Node placement and sizing for the layout engine.
Handles placing nodes on the grid, computing column widths and row heights based on label content, and normalizing sizes within layers.
Summary
Functions
Compute column widths and row heights based on node content.
Normalize node dimensions within the same layer, capped at a maximum.
Place nodes on the grid based on layer assignments.
Functions
@spec compute_sizes( Boxart.Layout.t(), Boxart.Graph.t(), integer(), integer(), integer(), keyword() ) :: Boxart.Layout.t()
Compute column widths and row heights based on node content.
@spec normalize_sizes(Boxart.Layout.t(), Boxart.Graph.t()) :: Boxart.Layout.t()
Normalize node dimensions within the same layer, capped at a maximum.
Nodes at the same flow level are normalized to the same perpendicular dimension so side-by-side nodes look consistent.
@spec place_nodes(Boxart.Layout.t(), Boxart.Graph.t(), [[String.t()]], atom(), %{ required(non_neg_integer()) => non_neg_integer() }) :: Boxart.Layout.t()
Place nodes on the grid based on layer assignments.
gap_expansions maps gap index to the number of extra grid cells to
insert between that gap's adjacent layers, giving the pathfinder more
room to route crossing edges without overlap.