Import it from @grafloria/engine.
Also has every member of LayoutOptions, LayoutRunOptions, listed on their own entries.
The one options schema. Adapter-specific knobs still ride in options, but
everything that is common to all layouts is named here so callers do not have
to learn five different vocabularies.
tsinterface UnifiedLayoutOptions extends Partial<LayoutOptions>, LayoutRunOptions
Properties
| Name | Type | Default | Description |
|---|---|---|---|
seed? | number | Seed for any algorithm that uses randomness (force, spectral, community). Defaults to a FIXED constant — so an author who never thinks about seeds still gets the same picture every time. Randomness is opt-in. | |
direction? | FlowDirection | Primary flow direction, normalised across engines: dagre calls it rankdir, ELK calls it elk.direction, and the two disagree about spelling. Callers say direction and the registry translates. | |
nodeSpacing? | number | Space between nodes in the same rank/row. | |
rankSpacing? | number | Space between ranks/layers. | |
nested? | boolean | Lay groups out as CONTAINERS: each group's contents are arranged recursively (deepest first), the container is auto-sized to fit them, and the parent level then arranges containers as COMPOUND NODES — with edges that cross a container boundary induced onto the compound nodes so the containers land next to the things they actually connect to. | |
containerPadding? | number | Fallback inner padding for containers that carry no padding of their own. | |
groupSpacing? | number | Gap between compound units when a level falls back to the built-in grid. | |
componentSpacing? | number | Gap between packed disconnected components. Defaults to nodeSpacing. See component-packing.ts — this applies to EVERY layout, not just the new ones, because "lay out a forest and the trees land on top of each other" is an adapter-agnostic bug. | |
aspectRatio? | number | Target width/height of the packed result. 1.6 ≈ a landscape screen. | |
removeOverlaps? | boolean | Push nodes apart if the algorithm left them overlapping. Default true. | |
columns? | number | grid: number of columns. Defaults to ceil(sqrt(n)). | |
rootId? | string | tree/radial: the node to root the tree / centre the rings on. | |
branchDirections? | Record<string, FlowDirection> | tree: per-branch direction. The subtree rooted at each listed node flows its own way instead of the tree's direction — a mind map is { 'left-branch': 'RL', 'right-branch': 'LR' }. |
Was this page helpful?