Boxart.Layout.Subgraphs (Boxart v0.3.1)

Copy Markdown View Source

Subgraph layout handling for the layout engine.

Manages gap expansion for subgraph borders and labels, and computes subgraph bounding boxes after node placement.

Summary

Functions

Compute bounding boxes for all subgraphs after node placement.

Expand gap cells to accommodate subgraph borders, labels, and nesting.

Functions

compute_subgraph_bounds(layout, graph)

@spec compute_subgraph_bounds(Boxart.Layout.t(), Boxart.Graph.t()) ::
  Boxart.Layout.t()

Compute bounding boxes for all subgraphs after node placement.

Recursively processes nested subgraphs from innermost to outermost, computing bounds that encompass all contained nodes and child subgraph bounds.

expand_gaps_for_subgraphs(layout, graph, direction)

@spec expand_gaps_for_subgraphs(Boxart.Layout.t(), Boxart.Graph.t(), atom()) ::
  Boxart.Layout.t()

Expand gap cells to accommodate subgraph borders, labels, and nesting.

Analyzes nesting depth changes between adjacent layers and sibling subgraph transitions in both flow and cross directions, inserting extra space as needed.