graphvix v0.3.0 Graphvix.Node

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

delete(node_id)
delete(pos_integer) :: :ok

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> Node.delete(1)
find(node_id)
find(pos_integer) :: map | nil

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`
new(attrs \\ [])
new(Keyword.t | nil) :: map

Create a new node with the given attrs and attach it to the active graph.

Returns the map of the node with a unique id.

iex> Node.new(label: "Start")
%{ id: 1, attrs: [label: "Start"] }
update(node_id, attrs)
update(pos_integer, Keyword.t) :: :ok

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)