Skip to content

NetworkLayoutOptions

Defined in: network/network.ts:189

How node positions are produced. Applies to plain graphs (Network.layout) and, since #182, state networks (Network.stateNetwork) — there every backend lays out the physical graph and the state/both views’ rosette is derived from it.

optional backend?: "positions" | "gpu" | "force" | "worker"

Defined in: network/network.ts:193

"positions" uses caller-supplied coordinates; "force" runs the in-library force layout on the main thread; "worker" runs it off-thread with progressive streaming; "gpu" runs a WebGL2 Barnes-Hut solve (falling back to "worker" when unavailable).


optional fit?: boolean

Defined in: network/network.ts:217

For the streaming backends ("worker" / "gpu"), keep the camera framed on the layout as it converges: the view is fit to the layout’s live bounds each streamed frame (centroid → view centre, extent → ~85% of the view) and released to normal zoom/pan once it settles or the user interacts. Without it a streaming layout converges wherever the solver centres it — the GPU solve centres the centroid at the origin, so it would otherwise render at the top-left corner until it settles. Default false. Ignored for "positions" / "force" (already final on the first paint). The per-frame fit reads the layout’s aggregate bounds (O(top-level modules), not O(nodes)) when LOD geometry exists; with LOD off it fits once from the initial extent and holds.


optional force?: Partial<ForceParams>

Defined in: network/network.ts:199

Force parameters for backend: "force".


optional iterations?: number

Defined in: network/network.ts:197

Iterations for backend: "force" (default 300, per level when multilevel).


optional multilevel?: boolean

Defined in: network/network.ts:206

For backend: "force" and backend: "worker", seed the layout via multilevel coarsening (heavy-edge matching) for faster convergence and fewer tangles on clustered graphs. Default true; set false for a plain cold-start force run. Tiny / edgeless graphs skip coarsening automatically.


optional positions?: Float32Array<ArrayBufferLike>

Defined in: network/network.ts:195

Interleaved [x, y, …] world coordinates for backend: "positions".