Layout

object Layout

Lays out a Vista and returns a copy with Position populated on every view and Waypoints on every edge.

General flat graphs use a bounded deterministic grid. A layered algorithm represents each long edge with one dummy node per crossed layer; dense control-flow graphs can therefore expand tens of thousands of retained edges into millions of temporary nodes. The grid keeps memory proportional to the original Vista while retaining every node and edge. Small summarized SVGs explicitly opt into layoutSvg, which restores ELK's layered, orthogonal activity-diagram layout. Nested compound graphs also use ELK because their parent/child boxes require hierarchy-aware placement.

Direction defaults to DOWN (top-down) — the convention for the generated SVG/control-flow diagrams. The caller can pass another Direction to override. Flat edges use direct boundary-to-boundary polylines; nested edges use ELK's polyline router.

Functions

Link copied to clipboard
fun layout(graph: Vista, layout: DiagramLayout, nested: Boolean = false): Vista

Lay out using a DiagramLayout direction — LEFT_RIGHT for the SUMMARIZED level, TOP_DOWN for everything else. Lets the gradle layer pick a direction without depending on ELK's Direction enum.

fun layout(graph: Vista, direction: Direction = Direction.DOWN, nested: Boolean = false): Vista
Link copied to clipboard
fun layoutSvg(graph: Vista, layout: DiagramLayout): Vista

High-quality static layout for the small summarized graph embedded in an SVG. This intentionally uses the more expensive layered algorithm and orthogonal routing; full interactive graphs must continue to use their bounded preset/swimlane layouts.

Generated with STIG