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).
Properties
Section titled “Properties”aggregateFill?
Section titled “aggregateFill?”
optionalaggregateFill?:string
Defined in: network/network.ts:148
Aggregate-glyph fill (any CSS color). Default = nodeFill.
aggregateOutline?
Section titled “aggregateOutline?”
optionalaggregateOutline?: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.
color?
Section titled “color?”
optionalcolor?:string
optionalgap?:number
width?
Section titled “width?”
optionalwidth?:number
coarsen?
Section titled “coarsen?”
optionalcoarsen?:CoarsenOptions
Defined in: network/network.ts:201
Coarsening granularity for the LOD tree (depth / minimum aggregate size).
crossFade?
Section titled “crossFade?”
optionalcrossFade?: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.
crossLevelEdges?
Section titled “crossLevelEdges?”
optionalcrossLevelEdges?: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.
declutter?
Section titled “declutter?”
optionaldeclutter?: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.
declutterSpacing?
Section titled “declutterSpacing?”
optionaldeclutterSpacing?:number
Defined in: network/network.ts:162
Spacing multiplier for declutter (>1 sparser, <1 denser). Default 1.
expandPx?
Section titled “expandPx?”
optionalexpandPx?: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.
maxAggregateRadius?
Section titled “maxAggregateRadius?”
optionalmaxAggregateRadius?: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.
modules?
Section titled “modules?”
optionalmodules?: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.
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.
spatial?
Section titled “spatial?”
optionalspatial?: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.
superEdges?
Section titled “superEdges?”
optionalsuperEdges?: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.