plot_graph
samplomatic.visualization.plot_graph(graph: PyDiGraph[T, S], cols: int = 2, subgraph_idxs: None | int | Sequence[int] = None, layout_method: Literal['auto', 'spring', 'graphviz', 'graphviz_curved', 'graphviz_line'] | LayoutMethod[T, S] = 'auto', ranker: NodeRanker[T] | None = None) → Figure
Visualize the disconnected subgraphs of a graph.
This function identifies all disconnected subgraphs within the given graph using the weakly_connected_components() method. Then, it plots all of the subgraphs corresponding to the indices specified in subgraph_idxs, with each selected subgraph displayed in its own subplot.
Parameters
- graph – The graph to visualize.
- cols – The number of columns in the returned figure.
- subgraph_idxs – The indices of the connected subgraphs to include in the plot, or
Noneto include all of the available subgraphs. - layout_method – A predefined layout method by name, or a callable implementing a layout.
- ranker – Specifies a node ranking that can be used by layout methods that group nodes topologically.
Returns
A Plotly graph.
Was this page helpful?
Report a bug, typo, or request content on GitHub.