/** * Struct-of-arrays storage for a hierarchical tree (treemap + sunburst). * A node is a numeric `id` into parallel typed arrays; hot numeric * fields live in `Float32Array` / `Int32Array` so iteration is * cache-linear and heap pressure stays flat. * * Children are a singly-linked list per parent (`firstChild` / * `nextSibling`, with `lastChild` for O(1) append). The `NULL_NODE = -1` * sentinel marks "no node" for `parent`, end-of-list for `nextSibling`, * and "leaf" for `firstChild`. * * Layout fields come in two flavors: * - `x0 / y0 / x1 / y1` — rectangular coords (treemap, future bar * hierarchies) * - `a0 / a1 / r0 / r1` — polar coords (sunburst) * Each chart populates only its own flavor; the other set wastes ~16 B * per node (32 MB at 2M nodes) — a small price for keeping a single * unified store across hierarchical chart types. * * At typical tree shapes the SOA + linked-list representation is ~10× * cheaper on heap and ~4× faster to build than per-node `Object` + * `Array` (which allocates ~300 B / node and is O(N²) for naive * child-name lookup). At 2M nodes the former OOMs the tab; the latter * stays under 100 MB. */ export declare const NULL_NODE = -1; export declare class NodeStore { size: Float32Array; value: Float32Array; colorValue: Float32Array; /** * Sign of the leaf's raw size column value: `-1` when the source row * was negative, `1` otherwise. `size` itself always stores the * magnitude so layout code continues to treat negatives as positive * area; render code uses `sizeSign` to apply a lower alpha on * negative leaves. Always `1` for branches. */ sizeSign: Int8Array; x0: Float32Array; y0: Float32Array; x1: Float32Array; y1: Float32Array; a0: Float32Array; a1: Float32Array; r0: Float32Array; r1: Float32Array; depth: Int32Array; parent: Int32Array; firstChild: Int32Array; nextSibling: Int32Array; lastChild: Int32Array; childCount: Int32Array; leafRowIdx: Int32Array; name: string[]; colorLabel: string[]; count: number; capacity: number; constructor(initialCapacity?: number); reset(): void; /** * Reserve a new node id. Caller must immediately initialize the * hot numeric fields and set `parent` / `depth`; topology fields * default to `NULL_NODE`. */ allocate(): number; /** * O(1) append `childId` as the last child of `parentId`. */ appendChild(parentId: number, childId: number): void; /** * `true` if the node has no children (branches set firstChild when they acquire one). */ isLeaf(id: number): boolean; private _allocate; } /** * Walk the ancestor chain back to (but not including) the synthetic * root, topmost first. Allocates a fresh string array — callers that * care about allocations should inline the walk. */ export declare function ancestorNames(store: NodeStore, id: number): string[];