Skip to main content

grapher.to_networkx()

Convert a dependency, sheet, or series graph to a NetworkX DiGraph.

Usage

Source

grapher.to_networkx(
    graph, *, include_formula_on_nodes=True, max_formula_length=120
)

Accepts DependencyGraph, any graph-like object with node iteration, dependency lookup, and edge attributes (for example ProjectionResult), a SheetGraph from to_sheet_graph, or a SeriesGraph from to_series_graph. Statement graphs and series drilldowns are converted with excel_grapher.exporter.statement_graph_to_networkx and SeriesDrilldown.to_networkx.

NetworkX is an optional dependency. If not installed, raises ImportError with a helpful message.