/** * Streaming tree pipeline shared by treemap and sunburst. Rows arrive * incrementally; each chunk inserts its rows directly into the SOA * tree. Per-leaf tooltip columns are fetched lazily on pin via the * chart's `_lazyRows`; the tree only retains `leafRowIdx` per leaf * (small, O(leaves)) as the handle back to the source view row. * After a chunk is processed, `finalizeTree` recomputes `value` * bottom-up. * * Color mode: * - `"numeric"` — `readColor` reads the row's numeric value; the * render path maps it through the continuous gradient. * - `"series"` — `readColor` reads the row's string value from the * color column's dictionary, and `seedColorLabels` pre-populates * `_uniqueColorLabels` in dictionary-index order. Render picks * `palette[dictIdx % paletteSize]`. * - `"empty"` — no color column; every leaf gets `palette[0]`. * * When `_splitBy` is populated, every row is duplicated — one insertion * per split prefix, with that prefix pushed as the top-level path * segment so the top-level children of the synthetic root become * facet roots. The per-prefix `size` / `color` columns (named * `${prefix}|${base}`) feed the facet's values. `seedColorLabels` * runs once per split so every split's dictionary contributes to the * shared legend. */ import type { ColumnDataMap } from "../../data/view-reader"; import type { TreeChartBase } from "./tree-chart"; /** * Reset the shared tree state. Called on the first chunk * (`startRow === 0`) of each dataset load. */ export declare function resetTreeState(chart: TreeChartBase): void; /** * Process one incoming chunk: grow row-data buffers, walk every row, * capture column values, and insert into the tree. */ export declare function processTreeChunk(chart: TreeChartBase, columns: ColumnDataMap): void; /** * Post-chunk finalization. * 1. Recompute `value` bottom-up from `size` via an iterative * post-order walk. * 2. Re-resolve `_currentRootId` from the breadcrumb name-path so * drill state survives incremental chunk arrivals. * * `colorLabel` is set at insert time (`readColor`) and needs no * post-pass: in `"series"` mode it comes from the color column's * dictionary, and in `"numeric"` / `"empty"` modes it's unused. */ export declare function finalizeTree(chart: TreeChartBase): void; /** * Rebuild `chart._breadcrumbIds` by walking up from `nodeId`. */ export declare function rebuildBreadcrumbs(chart: TreeChartBase, nodeId: number): void;