Converters#

Converters from various data structures to hiveplotlib-ready structures.

hiveplotlib.converters.networkx_to_nodes_edges(graph: Graph, unique_id_name: str = 'unique_id', check_uniqueness: bool = True) tuple[NodeCollection, Edges]#

Take a networkx graph and return hiveplotlib-friendly data structures.

Specifically, returns a NodeCollection instance of node data and an Edges instance of edge data. These outputs can be fed directly into HivePlot().

Parameters:
  • graphnetworkx graph.

  • unique_id_name – name to use for unique IDs.

  • check_uniqueness – whether or not to check that provided Node instances have unique IDs.

Returns:

list of Node instances, (n, 2) np.ndarray of edges.