pivotick / LayoutOptions / StructuredLayoutOptions
Interface: StructuredLayoutOptions
Defined in: interfaces/LayoutOptions.ts:127
Lays a small graph out the way a person would draw it, and pins it there. Computed once per change rather than simulated, so the same graph always gives the same picture.
- Each connected component is laid out on its own, and the components are packed side by side to fit the canvas at the largest zoom.
- Leaves of one type hanging off the same one or two nodes line up as a block, beside the nodes they hang from.
- Everything else is placed so its distances follow the edges: a hub's neighbours come out on a ring, a chain on a line.
- Nodes with no edge at all go in a tray beside the rest.
Meant for graphs of up to a few hundred nodes.
Extends
Properties
direction?
optionaldirection:"auto"|"row"|"column"
Defined in: interfaces/LayoutOptions.ts:140
How a block lines up. 'auto' stands it across the line to the nodes it hangs from; 'row' and 'column' force one way.
Default
'auto'gap?
optionalgap:number
Defined in: interfaces/LayoutOptions.ts:146
Clear space between two nodes, in graph units. An edge is drawn twice this long, and components and the tray sit three times this apart.
Default
30groupMin?
optionalgroupMin:number
Defined in: interfaces/LayoutOptions.ts:134
The fewest leaves sharing a type and their neighbours that line up as a block; fewer are placed one by one. A leaf has two neighbours at most.
Default
3labelSides?
optionallabelSides:boolean
Defined in: interfaces/LayoutOptions.ts:158
Move each floated label (see textVerticalShift) to the side of its node that its edges leave free; a block's members all take the side away from the nodes they hang from. The style still decides how far out the label sits.
Default
truetrayPosition?
optionaltrayPosition:"bottom"|"right"
Defined in: interfaces/LayoutOptions.ts:151
Where the nodes with no edge go: under the rest, or to their right.
Default
'bottom'type
type:
"structured"
Defined in: interfaces/LayoutOptions.ts:128
Default
'force'