spine.vis.network

Draw graph connectivity on top of clustered point clouds.

Functions

network_schematic(clusts, edge_index, ...[, ...])

Network 2D schematic representation.

network_topology(points, clusts, edge_index)

Network 3D topological representation in Euclidean space.

spine.vis.network.network_topology(points: np.ndarray, clusts: list[np.ndarray], edge_index: np.ndarray, clust_labels: np.ndarray | None = None, edge_labels: np.ndarray | None = None, mode: str = 'scatter', color: str | np.ndarray | None = None, line: dict[str, Any] | None = None, linewidth: float = 2, name: str | None = None, **kwargs: Any) list[go.Scatter3d] | list[go.Scatter3d | go.Mesh3d][source]

Network 3D topological representation in Euclidean space.

Parameters:
  • points (np.ndarray) – (N, 3) array of N points of (…, x, y, z,…) coordinate information

  • clusts (List[np.ndarray]) –

    1. List of cluster indexes

  • edge_index (np.ndarray) – (E, 2) List of connections between clusters

  • clust_labels (np.ndarray, optional) –

    1. List of cluster labels

  • edge_labels (np.ndarray, optional) –

    1. List of edge labels

  • mode (str, default 'scatter') – Drawing mode; one of ‘circle’, ‘scatter’, ‘ellipsoid’, ‘cone’ or ‘hull’

  • color (Union[str, np.ndarray], optional) – Color of clusters or (C) list of color of clusters

  • line (dict, optional) – Line property dictionary

  • linewidth (float, default 2) – Width of the edge lines

  • name (str, optional) – Name of the network

  • **kwargs (dict, optional) – List of additional arguments to pass to plotly

Returns:

Node and edge traces in the same list

Return type:

List[Union[plotly.graph_objs.Scatter3d, plotly.graph_objs.Mesh3d]]

spine.vis.network.network_schematic(clusts: list[ndarray], edge_index: ndarray, clust_labels: ndarray, edge_labels: ndarray | None = None, color: str | ndarray | None = None, name: str | None = None, linewidth: float = 2, **kwargs: Any) list[plotly.graph_objs.Scatter][source]

Network 2D schematic representation.

This is to be used exclusevely with bipartite graphs where the nodes are either classified as primary or secondaries under clust_labels and connections only exist between primaries and secondaries.

Parameters:
  • clusts (List[np.ndarray]) –

    1. List of cluster indexes

  • edge_index (np.ndarray) – (E, 2) List of connections between clusters

  • clust_labels (np.ndarray) –

    1. Whether a cluster is a primary or a secondary

  • edge_labels (np.ndarray, optional) –

    1. List of edge labels

  • linewidth (float, default 2) – Width of the edge lines

  • color (Union[str, np.ndarray], optional) – Color of clusters or (C) list of color of clusters

  • name (str, optional) – Name of the network

  • linewidth – Width of the edge lines

  • **kwargs (dict, optional) – List of additional arguments to pass to plotly

Returns:

Node and edge traces in the same list

Return type:

List[plotly.graph_objs.Scatter]