grapher.to_sheet_graph()
Collapse a cell graph to one node per sheet with consolidated edges.
Usage
grapher.to_sheet_graph(
graph,
*,
include_self_loops=False,
)Sheets that appear as graph nodes are included even when they have no cross-sheet edges. Dangling edge endpoints that do not resolve to a graph node are skipped, matching to_graphviz.
Parameters
graph: GraphReadView-
Cell-level dependency graph or read view.
include_self_loops: bool = False-
If
True, keep intra-sheet cell edges as a single self-loop per sheet. IfFalse(default), drop them.
Returns
SheetGraph-
Immutable sheet graph. Node order follows
graph.sheet_orderwhenpresent; otherwise names sort lexicographically. Edges follow the
same sheet order on(source, target).