graphvix v0.4.0 Graphvix.Node
Graphvix.Node provides functions for adding, updating, and deleting nodes in a graph.
Summary
Functions
Deletes the node with the provided node_id
Find the node in the graph that has the provided node_id
Create a new node with the given attrs and attach it to the active graph
Update the attributes of the node with the provided node_id
Functions
Deletes the node with the provided node_id.
This will also remove any edges attached to the node, and remove it from any clusters it belongs to.
iex> {n_id, n} = Node.new(label: "Start")
iex> Node.delete(n_id)
Find the node in the graph that has the provided node_id.
Returns the node, or nil if it is not found.
iex> n = Node.new(label: "Start")
iex> Node.find(n.id) #=> returns `n`
Create a new node with the given attrs and attach it to the active graph.
Returns a tuple containing the new node’s id and its map representation.
iex> Node.new(label: "Start")
{1, %{ attrs: [label: "Start"] }}
Update the attributes of the node with the provided node_id.
If nil is passed as a value in the attrs keyword list, it will remove
the key entirely from the node’s attributes.
iex> n = Node.new(label: "Start")
iex> Node.update(n.id, color: "blue", label: nil)