Skip to content

LODTree

Defined in: network/lod.ts:86

A retained coarsening tree, flattened to SoA typed arrays for cache-friendly traversal at scale.

Tree nodes are numbered by level: level 0 (the original graph) occupies global ids [0, leafCount) and is the leaves; each coarser level follows, and the coarsest level is the roots. Ids are stable for the life of the graph, so aggregates keep their identity across frames (no popping).

  • LODTopology

border: Float32Array

Defined in: network/lod.ts:115

Summed leaf flow-border metric (e.g. enter/exit flow) — the raw value a flow border encodes (#104 N6). Each leaf takes its provided value; each aggregate the sum of its descendants’, so a module’s border reflects its members’ total. Zero when no border metric is supplied. The draw scale (value → ring width) is applied at glyph-build time, not stored here.


childOffset: Uint32Array

Defined in: network/lod.ts:39

Children CSR: node g’s children are children[childOffset[g] .. childOffset[g+1]] (one level finer).

LODTopology.childOffset


children: Uint32Array

Defined in: network/lod.ts:40

LODTopology.children


color: Uint8Array

Defined in: network/lod.ts:122

Per-node fill colour as RGBA bytes, length 4 · size (#104 N6 rework). Each leaf takes its provided colour; each aggregate the (count-)averaged colour of its descendants — so a module drawn from a categorical palette keeps its colour when collapsed, and its leaves share it. Zero when no colours are supplied (the engine falls back to a single fill).


count: Uint32Array

Defined in: network/lod.ts:106

Number of leaf descendants.


cx: Float32Array

Defined in: network/lod.ts:89

Centroid x of each node’s leaf descendants.


cy: Float32Array

Defined in: network/lod.ts:91

Centroid y of each node’s leaf descendants.


edgeNeighbors: Uint32Array

Defined in: network/lod.ts:55

LODTopology.edgeNeighbors


edgeOffset: Uint32Array

Defined in: network/lod.ts:54

Same-level adjacency CSR for aggregates (super-edges): aggregate g’s same-level neighbours are edgeNeighbors[edgeOffset[g] .. edgeOffset[g+1]]. Built from the coarse levels only; leaf adjacency is the graph’s own CSR (a leaf’s global id equals its node id), so leaf entries are empty here. Symmetric.

LODTopology.edgeOffset


extent: Float32Array

Defined in: network/lod.ts:96

Spatial bounding radius (world units): an upper bound on the distance from the centroid to any descendant leaf. Drives viewport culling and the zoom-driven expand trigger.


leafCount: number

Defined in: network/lod.ts:33

Number of leaves (= graph.nodeCount = level-0 node count).

LODTopology.leafCount


levelCount: number

Defined in: network/lod.ts:35

Number of coarsening levels; 1 means no coarsening was possible (tiny / edge-less graph).

LODTopology.levelCount


levelOffset: Uint32Array

Defined in: network/lod.ts:37

Global-id start of each level; length levelCount + 1. Level k is [levelOffset[k], levelOffset[k+1]).

LODTopology.levelOffset


optional parent?: Int32Array<ArrayBufferLike>

Defined in: network/lod.ts:47

Per-node parent global id (one level coarser), length size; the root’s parent is -1. Lets the super-edge gather walk a node up to its nearest present ancestor for cross-level edges (#139). Present on provided-module trees (built with the parent map); absent on coarsening/spatial trees, which also carry no super-edge CSR — so the cross-level path never needs it there.

LODTopology.parent


radius: Float32Array

Defined in: network/lod.ts:104

Visual draw radius (world units): leaves take their resolved per-node radius (degree/strength/… encoded); each aggregate is √(Σ child radius²) — area-additive, so it’s agnostic to the node sizing and an aggregate’s ink ≈ its contents’ total ink — unless a RadiusAggregate is supplied, when an aggregate is sized by the leaf scale on its summed metric (flow-sized modules). Drives drawing and declutter occupancy.


size: number

Defined in: network/lod.ts:31

Total tree nodes across all levels.

LODTopology.size


optional superEdgeFlow?: Float32Array<ArrayBufferLike>

Defined in: network/lod.ts:66

LODTopology.superEdgeFlow


optional superEdgeInFlow?: Float32Array<ArrayBufferLike>

Defined in: network/lod.ts:76

LODTopology.superEdgeInFlow


optional superEdgeInOffset?: Uint32Array<ArrayBufferLike>

Defined in: network/lod.ts:74

The transpose of the super-edge CSR (in-adjacency, by target): node g’s incoming edges are [superEdgeInOffset[g] .. superEdgeInOffset[g+1]), coming from superEdgeInSource with the same summed superEdgeInFlow. Lets the gather keep a visible node’s edges to off-screen neighbours in both directions (incoming as well as outgoing) without scanning off-screen sources. Built and present together with the out-adjacency above.

buildSuperEdges

LODTopology.superEdgeInOffset


optional superEdgeInSource?: Uint32Array<ArrayBufferLike>

Defined in: network/lod.ts:75

LODTopology.superEdgeInSource


optional superEdgeOffset?: Uint32Array<ArrayBufferLike>

Defined in: network/lod.ts:64

Directed, flow-weighted super-edges (#104 N6c), built from a provided module hierarchy so a map’s inter-module links render as bent half-arrows. Out-adjacency CSR over all tree nodes: node g’s out-edges are [superEdgeOffset[g] .. superEdgeOffset[g+1]), going to superEdgeTarget with summed directed superEdgeFlow. A graph edge contributes at every level from the leaves up to its endpoints’ lowest common module, so leaf↔leaf and module↔module pairs both have an entry — whichever the cut makes visible. Absent for coarsening / spatial trees.

buildModuleLODTree

LODTopology.superEdgeOffset


optional superEdgeTarget?: Uint32Array<ArrayBufferLike>

Defined in: network/lod.ts:65

LODTopology.superEdgeTarget


weight: Float32Array

Defined in: network/lod.ts:108

Summed leaf importance (default: strength) — drives super-edge weight and declutter priority.