Skip to content

NetworkLODOptions

Defined in: network/network.ts:129

Level-of-detail (#103): an adaptive hierarchy cut so a large network draws only what’s visible. Each pan/zoom re-cuts a retained coarsening tree — dense regions collapse to aggregate glyphs and expand into their members as you zoom in — bounding per-frame work to the visible frontier. Opt-in via Network.lod; off by default (every node/link drawn). The tree’s geometry updates as the layout converges (so LOD helps during the solve, not only after), and the zoom-time path re-cuts only the visible frontier. Best paired with style({ sizeMode: "screen" }).

On the WebGL lane the cut re-runs live every pan/zoom frame. On the Canvas/SVG (retained) backends the same frontier draws as Scene layers — so toSVG() exports a level-of-detail map (#138) — but the retained Scene can’t re-tessellate per frame, so there the frontier is static during a gesture and re-cuts on release (the redraw-on-zoom-end model; force one with Network.syncScreenGeometry).

optional aggregateFill?: string

Defined in: network/network.ts:148

Aggregate-glyph fill (any CSS color). Default = nodeFill.


optional aggregateOutline?: object

Defined in: network/network.ts:169

Mark aggregate glyphs (collapsed modules/subtrees, not leaves) with a thin outline ring set a gap px outside the glyph, so it reads as expandable — distinguishing a collapsed module from an individual node at intermediate zoom. width/gap in px (default 1.5 / 2.5), color any CSS colour (default a dark neutral). Omit to disable.

optional color?: string

optional gap?: number

optional width?: number


optional coarsen?: CoarsenOptions

Defined in: network/network.ts:201

Coarsening granularity for the LOD tree (depth / minimum aggregate size).


optional crossFade?: number

Defined in: network/network.ts:199

Cross-fade level transitions (#133): the half-width, as a fraction of expandPx, of the zoom band around the expand threshold over which an aggregate and its children are drawn together — the aggregate easing out (opacity 1→0) as its children ease in (0→1, smoothstep) — so a split/merge reads smoothly instead of popping. e.g. 0.3 fades over [expandPx·0.7, expandPx·1.3]. Applies to the frontier glyphs, their borders/halos, and the super-edges (which fade with their endpoints).

Off by default and zero added cost when off (0/omitted ⇒ the hard threshold): only the transitioning band of the frontier is doubled, and the per-node alpha pass runs only when set.


optional crossLevelEdges?: boolean

Defined in: network/network.ts:188

Also draw super-edges between mixed-level visible nodes — a visible leaf (or finer aggregate) and a visible coarser aggregate at a different cut level (the collapsed↔expanded mismatch). By default such an edge is dropped: when you zoom into one region, its leaves lose their links to the still-collapsed regions until both sides are at the same level again. With this on, the off-frontier on-screen endpoint is projected to its nearest present ancestor and the edge is drawn there (flows deduped), so aggregates keep their context across a mixed frontier (#139).

Off by default and zero added cost when off — the projection (an O(depth) ancestor walk per off-frontier on-screen edge + a dedup map) runs only when enabled; the same-level gather is unchanged. Needs the directed super-edge CSR (a provided modules hierarchy); ignored otherwise.


optional declutter?: boolean

Defined in: network/network.ts:160

Thin overlapping frontier glyphs in screen space, keeping the most important (by strength) and dropping those covered by a kept glyph — so dense regions stay readable instead of a solid mass. Zoom-dependent (more resolve as you zoom in). Default true.


optional declutterSpacing?: number

Defined in: network/network.ts:162

Spacing multiplier for declutter (>1 sparser, <1 denser). Default 1.


optional expandPx?: number

Defined in: network/network.ts:146

Expand threshold (px): an aggregate whose on-screen footprint (2·extent·k) reaches this expands into its children; below it it draws as a single glyph. Larger → coarser (fewer, bigger aggregates). Default 48.


optional maxAggregateRadius?: number

Defined in: network/network.ts:154

Cap on an aggregate glyph’s draw radius (in the active sizeMode’s units). The tree’s area-additive radius grows with subtree size — fine in world units, but set this (e.g. ~24) in screen mode so large aggregates stay readable rather than ballooning to hundreds of pixels.


optional modules?: ArrayLike<ModuleNode>

Defined in: network/network.ts:140

A provided module hierarchy (N6 / #104): the LOD tree’s source, taking priority over structural coarsening. Pass Infomap’s JSON nodes array directly — each record’s id is the dense node index (aligned with buildGraph) and path its 1-based module chain. Modules then expand → sub-modules → leaves on zoom through the same adaptive cut as coarsening. Records must cover every node.

buildModuleLODTree

On the worker backend the tree is built on the main thread (the worker supplies only positions); the off-thread module-tree path is a later refinement.


optional spatial?: SpatialLODOptions

Defined in: network/network.ts:206

Quadtree options for the edge-less path (#103): a graph with no edges can’t be coarsened, so the LOD tree is built spatially over the node positions instead. No effect on edge-bearing graphs.


optional superEdges?: boolean

Defined in: network/network.ts:175

Draw super-edges: links between both-visible frontier nodes (leaf↔leaf, module↔module, or aggregate↔aggregate — whatever the cut exposes), sized + coloured by their accumulated flow and rendered in the active linkStyle. Default true.

superEdges