Skip to content

NestedLayoutOptions

Defined in: network/nested-layout.ts:84

optional initial?: ArrayLike<number>

Defined in: network/nested-layout.ts:125

Warm start (#328): the current leaf positions, interleaved [x, y, …] (length 2 · leafCount), e.g. the layout before a re-clustering. Each module’s children are seeded at their current leaf centroids — relative to the module’s own, scaled into its disc — instead of the golden spiral, and the solve starts cooler, so it refines the current arrangement rather than replacing it. The result keeps the map where it is: its leaves get the same centroid as initial and, unless radius is given, the same RMS spread around it (so a warm start from a nested layout neither drifts nor shrinks over repeated re-clusters). Non-finite entries count as unknown. A module whose children’s offsets are unknown or all coincide is seeded cold, so an all-coincident initial (e.g. the zeros of a graph never laid out) gives exactly the cold layout.


optional iterations?: number

Defined in: network/nested-layout.ts:93

Force ticks per module solve. Default 100.


optional onDepth?: (depth, positions, bounds) => void

Defined in: network/nested-layout.ts:113

Called after every depth is final, with the leaf positions so far — leaves below the finished depth sit at their deepest placed ancestor’s centre. Lets a caller stream the layout top-down. Not called on a warm start (initial) placed by its result (the default placeBy): its placement is final only once every depth is, and collapsing leaves onto their module centres is what a warm start exists to avoid. A warm start placed by its seed streams instead (#454): first depth 0, the whole seed, then each depth, with the leaves below it where their seeded modules put them.

bounds is a box the final layout lies in, known already (#427): the placed leaves, and the disc of each unplaced leaf’s deepest placed ancestor. Every child disc lies inside its parent’s, so it only shrinks depth by depth — the first depth’s lies inside the root disc (nestedRootBounds), the bound known before any depth — and once every leaf is placed it is their exact box: what a streaming fit frames a cold nested layout by.

number

Float32Array

FitBox

void


optional packing?: number

Defined in: network/nested-layout.ts:98

Fraction of a parent disc’s area its children’s discs cover (before collision padding). Lower leaves more room between siblings for their links. Default 0.45.


optional placeBy?: "result" | "seed"

Defined in: network/nested-layout.ts:136

How a warm start keeps the map where it is (#454): "result" (default) places the solved layout over initial — exactly its centroid and spread, known only once every depth is solved; "seed" places the root disc so that the seed — every module’s children at their warm seed, mapped into their discs as the solve maps its result — has initial’s centroid and spread (the spread unless radius is given). Known before any module is solved, so every depth’s frame is placed alike and a warm start can stream (onDepth). The solve then keeps the root disc, so the result’s centroid and spread are the seed’s moved by the solve (from a nested map of the same modules the seed is that map, and they barely move). Costs one extra O(tree size) seed pass. Ignored on a cold start.


optional radius?: number

Defined in: network/nested-layout.ts:91

Radius of the root disc, in world units. Default 10·√leafCount.


optional size?: ArrayLike<number>

Defined in: network/nested-layout.ts:89

Per-leaf size metric (length leafCount, e.g. node flow). A disc’s area is its subtree’s summed metric relative to its siblings’. Default: 1 per leaf (discs sized by leaf count).