graphvix v0.3.0 Graphvix.Cluster

Summary

Functions

Adds a node or nodes to an existing cluster identified by cluster_id

Deletes the cluster with the provided cluster_id

Find the cluster in the graph that has the provided cluster_id

Create a new cluster

Removes a node or nodes from an existing cluster identified by cluster_id

Types

node_or_nodes()
node_or_nodes :: pos_integer | [pos_integer]

Functions

add(cluster_id, nodes)
add(pos_integer, node_or_nodes) :: map

Adds a node or nodes to an existing cluster identified by cluster_id

iex> c = Cluster.new
iex> n = Node.new
iex> Cluster.add(c.id, n)
delete(cluster_id)
delete(pos_integer) :: :ok

Deletes the cluster with the provided cluster_id.

iex> Cluster.delete(1)
find(cluster_id)
find(pos_integer) :: map | nil

Find the cluster in the graph that has the provided cluster_id.

Returns the cluster, or nil if it is not found.

iex> c = Cluster.new
iex> Cluster.find(c.id) #=> returns `c`
new(nodes \\ [])
new(node_or_nodes | nil) :: map

Create a new cluster.

The cluster is empty by default, but can be provided with nodes already part of it.

iex> n = Node.new
iex> n2 = Node.new
iex> Cluster.new # or
iex> Cluster.new(n) # or
iex> Cluster.new([n, n2])
remove(cluster_id, nodes)
remove(pos_integer, node_or_nodes) :: map

Removes a node or nodes from an existing cluster identified by cluster_id

iex> n = Node.new
iex> c = Cluster.new(n)
iex> Cluster.remove(c.id, n)