@perspective-dev/viewer-charts 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/LICENSE.md +193 -0
  2. package/dist/cdn/perspective-viewer-charts.js +3 -0
  3. package/dist/cdn/perspective-viewer-charts.js.map +7 -0
  4. package/dist/esm/axis/axis-primitives.d.ts +24 -0
  5. package/dist/esm/axis/bar-axis.d.ts +51 -0
  6. package/dist/esm/axis/canvas.d.ts +24 -0
  7. package/dist/esm/axis/categorical-axis-core.d.ts +42 -0
  8. package/dist/esm/axis/categorical-axis.d.ts +27 -0
  9. package/dist/esm/axis/facet-chrome.d.ts +13 -0
  10. package/dist/esm/axis/label-geometry.d.ts +41 -0
  11. package/dist/esm/axis/legend.d.ts +44 -0
  12. package/dist/esm/axis/numeric-axis.d.ts +20 -0
  13. package/dist/esm/charts/candlestick/candlestick-build.d.ts +129 -0
  14. package/dist/esm/charts/candlestick/candlestick-interact.d.ts +10 -0
  15. package/dist/esm/charts/candlestick/candlestick-render.d.ts +24 -0
  16. package/dist/esm/charts/candlestick/candlestick.d.ts +144 -0
  17. package/dist/esm/charts/candlestick/glyphs/draw-candlesticks.d.ts +36 -0
  18. package/dist/esm/charts/candlestick/glyphs/draw-ohlc.d.ts +33 -0
  19. package/dist/esm/charts/canvas-types.d.ts +15 -0
  20. package/dist/esm/charts/cartesian/cartesian-build.d.ts +14 -0
  21. package/dist/esm/charts/cartesian/cartesian-interact.d.ts +20 -0
  22. package/dist/esm/charts/cartesian/cartesian-render.d.ts +26 -0
  23. package/dist/esm/charts/cartesian/cartesian.d.ts +239 -0
  24. package/dist/esm/charts/cartesian/glyph.d.ts +53 -0
  25. package/dist/esm/charts/cartesian/glyphs/density.d.ts +142 -0
  26. package/dist/esm/charts/cartesian/glyphs/lines.d.ts +23 -0
  27. package/dist/esm/charts/cartesian/glyphs/points.d.ts +24 -0
  28. package/dist/esm/charts/cartesian/label-interner.d.ts +21 -0
  29. package/dist/esm/charts/cartesian/tooltip-lines.d.ts +11 -0
  30. package/dist/esm/charts/chart-base.d.ts +402 -0
  31. package/dist/esm/charts/chart.d.ts +338 -0
  32. package/dist/esm/charts/common/band-layout.d.ts +32 -0
  33. package/dist/esm/charts/common/categorical-y-chart.d.ts +53 -0
  34. package/dist/esm/charts/common/category-axis-resolver.d.ts +90 -0
  35. package/dist/esm/charts/common/chrome-cache.d.ts +18 -0
  36. package/dist/esm/charts/common/draw-tooltip-box.d.ts +9 -0
  37. package/dist/esm/charts/common/leaf-color.d.ts +33 -0
  38. package/dist/esm/charts/common/node-store.d.ts +81 -0
  39. package/dist/esm/charts/common/tree-chart.d.ts +48 -0
  40. package/dist/esm/charts/common/tree-chrome.d.ts +31 -0
  41. package/dist/esm/charts/common/tree-data.d.ts +54 -0
  42. package/dist/esm/charts/common/visible-extent.d.ts +51 -0
  43. package/dist/esm/charts/heatmap/heatmap-build.d.ts +86 -0
  44. package/dist/esm/charts/heatmap/heatmap-interact.d.ts +19 -0
  45. package/dist/esm/charts/heatmap/heatmap-render.d.ts +19 -0
  46. package/dist/esm/charts/heatmap/heatmap-y-axis.d.ts +46 -0
  47. package/dist/esm/charts/heatmap/heatmap.d.ts +117 -0
  48. package/dist/esm/charts/map/map.d.ts +67 -0
  49. package/dist/esm/charts/registry.d.ts +14 -0
  50. package/dist/esm/charts/series/glyphs/draw-areas.d.ts +30 -0
  51. package/dist/esm/charts/series/glyphs/draw-bars.d.ts +15 -0
  52. package/dist/esm/charts/series/glyphs/draw-lines.d.ts +34 -0
  53. package/dist/esm/charts/series/glyphs/draw-scatter.d.ts +33 -0
  54. package/dist/esm/charts/series/series-build.d.ts +228 -0
  55. package/dist/esm/charts/series/series-interact.d.ts +35 -0
  56. package/dist/esm/charts/series/series-render.d.ts +41 -0
  57. package/dist/esm/charts/series/series-type.d.ts +49 -0
  58. package/dist/esm/charts/series/series.d.ts +317 -0
  59. package/dist/esm/charts/sunburst/sunburst-interact.d.ts +7 -0
  60. package/dist/esm/charts/sunburst/sunburst-layout.d.ts +33 -0
  61. package/dist/esm/charts/sunburst/sunburst-render.d.ts +22 -0
  62. package/dist/esm/charts/sunburst/sunburst.d.ts +85 -0
  63. package/dist/esm/charts/treemap/treemap-interact.d.ts +12 -0
  64. package/dist/esm/charts/treemap/treemap-layout.d.ts +28 -0
  65. package/dist/esm/charts/treemap/treemap-render.d.ts +18 -0
  66. package/dist/esm/charts/treemap/treemap.d.ts +74 -0
  67. package/dist/esm/config.d.ts +27 -0
  68. package/dist/esm/data/lazy-row.d.ts +32 -0
  69. package/dist/esm/data/split-groups.d.ts +20 -0
  70. package/dist/esm/data/view-reader.d.ts +35 -0
  71. package/dist/esm/event-detail.d.ts +28 -0
  72. package/dist/esm/index.d.ts +3 -0
  73. package/dist/esm/interaction/hit-test.d.ts +30 -0
  74. package/dist/esm/interaction/host-sink-dom.d.ts +19 -0
  75. package/dist/esm/interaction/host-sink-message.d.ts +46 -0
  76. package/dist/esm/interaction/lazy-tooltip.d.ts +61 -0
  77. package/dist/esm/interaction/raw-event-forwarder.d.ts +27 -0
  78. package/dist/esm/interaction/spatial-grid.d.ts +15 -0
  79. package/dist/esm/interaction/tooltip-controller.d.ts +193 -0
  80. package/dist/esm/interaction/zoom-controller.d.ts +106 -0
  81. package/dist/esm/interaction/zoom-router.d.ts +48 -0
  82. package/dist/esm/layout/facet-grid.d.ts +126 -0
  83. package/dist/esm/layout/plot-layout.d.ts +104 -0
  84. package/dist/esm/layout/ticks.d.ts +17 -0
  85. package/dist/esm/map/mercator.d.ts +102 -0
  86. package/dist/esm/map/tile-cache.d.ts +38 -0
  87. package/dist/esm/map/tile-layer.d.ts +66 -0
  88. package/dist/esm/map/tile-loader.d.ts +52 -0
  89. package/dist/esm/map/tile-source.d.ts +66 -0
  90. package/dist/esm/perspective-viewer-charts.js +3 -0
  91. package/dist/esm/perspective-viewer-charts.js.map +7 -0
  92. package/dist/esm/plugin/charts.d.ts +40 -0
  93. package/dist/esm/plugin/plugin.d.ts +95 -0
  94. package/dist/esm/render/scheduler.d.ts +41 -0
  95. package/dist/esm/theme/gradient.d.ts +48 -0
  96. package/dist/esm/theme/palette.d.ts +13 -0
  97. package/dist/esm/theme/theme-snapshot.d.ts +7 -0
  98. package/dist/esm/theme/theme.d.ts +53 -0
  99. package/dist/esm/transport/protocol.d.ts +430 -0
  100. package/dist/esm/transport/renderer-transport.d.ts +201 -0
  101. package/dist/esm/utils/css.d.ts +1 -0
  102. package/dist/esm/utils/font-snapshot.d.ts +50 -0
  103. package/dist/esm/webgl/buffer-pool.d.ts +62 -0
  104. package/dist/esm/webgl/context-manager.d.ts +184 -0
  105. package/dist/esm/webgl/gradient-texture.d.ts +17 -0
  106. package/dist/esm/webgl/instanced-attrs.d.ts +44 -0
  107. package/dist/esm/webgl/plot-frame.d.ts +39 -0
  108. package/dist/esm/webgl/program-cache.d.ts +13 -0
  109. package/dist/esm/webgl/shader-manifest.d.ts +53 -0
  110. package/dist/esm/webgl/shader-registry.d.ts +22 -0
  111. package/dist/esm/worker/boot.d.ts +0 -0
  112. package/dist/esm/worker/dispatch.d.ts +9 -0
  113. package/dist/esm/worker/font-loader.d.ts +2 -0
  114. package/dist/esm/worker/renderer.worker.d.ts +115 -0
  115. package/dist/esm/worker/session-host.d.ts +26 -0
  116. package/package.json +47 -0
  117. package/src/css/perspective-viewer-charts.css +95 -0
  118. package/src/ts/axis/axis-primitives.ts +125 -0
  119. package/src/ts/axis/bar-axis.ts +345 -0
  120. package/src/ts/axis/canvas.ts +64 -0
  121. package/src/ts/axis/categorical-axis-core.ts +125 -0
  122. package/src/ts/axis/categorical-axis.ts +716 -0
  123. package/src/ts/axis/facet-chrome.ts +42 -0
  124. package/src/ts/axis/label-geometry.ts +188 -0
  125. package/src/ts/axis/legend.ts +218 -0
  126. package/src/ts/axis/numeric-axis.ts +353 -0
  127. package/src/ts/charts/candlestick/candlestick-build.ts +516 -0
  128. package/src/ts/charts/candlestick/candlestick-interact.ts +256 -0
  129. package/src/ts/charts/candlestick/candlestick-render.ts +387 -0
  130. package/src/ts/charts/candlestick/candlestick.ts +367 -0
  131. package/src/ts/charts/candlestick/glyphs/draw-candlesticks.ts +432 -0
  132. package/src/ts/charts/candlestick/glyphs/draw-ohlc.ts +317 -0
  133. package/src/ts/charts/canvas-types.ts +30 -0
  134. package/src/ts/charts/cartesian/cartesian-build.ts +616 -0
  135. package/src/ts/charts/cartesian/cartesian-interact.ts +355 -0
  136. package/src/ts/charts/cartesian/cartesian-render.ts +948 -0
  137. package/src/ts/charts/cartesian/cartesian.ts +469 -0
  138. package/src/ts/charts/cartesian/glyph.ts +81 -0
  139. package/src/ts/charts/cartesian/glyphs/density.ts +1263 -0
  140. package/src/ts/charts/cartesian/glyphs/lines.ts +320 -0
  141. package/src/ts/charts/cartesian/glyphs/points.ts +239 -0
  142. package/src/ts/charts/cartesian/label-interner.ts +56 -0
  143. package/src/ts/charts/cartesian/tooltip-lines.ts +80 -0
  144. package/src/ts/charts/chart-base.ts +840 -0
  145. package/src/ts/charts/chart.ts +427 -0
  146. package/src/ts/charts/common/band-layout.ts +63 -0
  147. package/src/ts/charts/common/categorical-y-chart.ts +81 -0
  148. package/src/ts/charts/common/category-axis-resolver.ts +314 -0
  149. package/src/ts/charts/common/chrome-cache.ts +79 -0
  150. package/src/ts/charts/common/draw-tooltip-box.ts +84 -0
  151. package/src/ts/charts/common/leaf-color.ts +92 -0
  152. package/src/ts/charts/common/node-store.ts +235 -0
  153. package/src/ts/charts/common/tree-chart.ts +76 -0
  154. package/src/ts/charts/common/tree-chrome.ts +123 -0
  155. package/src/ts/charts/common/tree-data.ts +623 -0
  156. package/src/ts/charts/common/visible-extent.ts +112 -0
  157. package/src/ts/charts/heatmap/heatmap-build.ts +426 -0
  158. package/src/ts/charts/heatmap/heatmap-interact.ts +274 -0
  159. package/src/ts/charts/heatmap/heatmap-render.ts +815 -0
  160. package/src/ts/charts/heatmap/heatmap-y-axis.ts +351 -0
  161. package/src/ts/charts/heatmap/heatmap.ts +368 -0
  162. package/src/ts/charts/map/map.ts +201 -0
  163. package/src/ts/charts/registry.ts +65 -0
  164. package/src/ts/charts/series/glyphs/draw-areas.ts +331 -0
  165. package/src/ts/charts/series/glyphs/draw-bars.ts +113 -0
  166. package/src/ts/charts/series/glyphs/draw-lines.ts +320 -0
  167. package/src/ts/charts/series/glyphs/draw-scatter.ts +328 -0
  168. package/src/ts/charts/series/series-build.ts +848 -0
  169. package/src/ts/charts/series/series-interact.ts +604 -0
  170. package/src/ts/charts/series/series-render.ts +1109 -0
  171. package/src/ts/charts/series/series-type.ts +99 -0
  172. package/src/ts/charts/series/series.ts +794 -0
  173. package/src/ts/charts/sunburst/sunburst-interact.ts +460 -0
  174. package/src/ts/charts/sunburst/sunburst-layout.ts +238 -0
  175. package/src/ts/charts/sunburst/sunburst-render.ts +887 -0
  176. package/src/ts/charts/sunburst/sunburst.ts +248 -0
  177. package/src/ts/charts/treemap/treemap-interact.ts +445 -0
  178. package/src/ts/charts/treemap/treemap-layout.ts +328 -0
  179. package/src/ts/charts/treemap/treemap-render.ts +886 -0
  180. package/src/ts/charts/treemap/treemap.ts +247 -0
  181. package/src/ts/config.ts +41 -0
  182. package/src/ts/data/lazy-row.ts +140 -0
  183. package/src/ts/data/split-groups.ts +97 -0
  184. package/src/ts/data/view-reader.ts +107 -0
  185. package/src/ts/event-detail.ts +44 -0
  186. package/src/ts/index.ts +53 -0
  187. package/src/ts/interaction/hit-test.ts +106 -0
  188. package/src/ts/interaction/host-sink-dom.ts +85 -0
  189. package/src/ts/interaction/host-sink-message.ts +75 -0
  190. package/src/ts/interaction/lazy-tooltip.ts +102 -0
  191. package/src/ts/interaction/raw-event-forwarder.ts +175 -0
  192. package/src/ts/interaction/spatial-grid.ts +100 -0
  193. package/src/ts/interaction/tooltip-controller.ts +407 -0
  194. package/src/ts/interaction/zoom-controller.ts +468 -0
  195. package/src/ts/interaction/zoom-router.ts +230 -0
  196. package/src/ts/layout/facet-grid.ts +346 -0
  197. package/src/ts/layout/plot-layout.ts +277 -0
  198. package/src/ts/layout/ticks.ts +168 -0
  199. package/src/ts/map/mercator.ts +204 -0
  200. package/src/ts/map/tile-cache.ts +96 -0
  201. package/src/ts/map/tile-layer.ts +382 -0
  202. package/src/ts/map/tile-loader.ts +143 -0
  203. package/src/ts/map/tile-source.ts +156 -0
  204. package/src/ts/plugin/charts.ts +286 -0
  205. package/src/ts/plugin/plugin.ts +668 -0
  206. package/src/ts/render/scheduler.ts +339 -0
  207. package/src/ts/shaders/area.frag.glsl +20 -0
  208. package/src/ts/shaders/area.vert.glsl +19 -0
  209. package/src/ts/shaders/bar.frag.glsl +25 -0
  210. package/src/ts/shaders/bar.vert.glsl +60 -0
  211. package/src/ts/shaders/candlestick-body.frag.glsl +19 -0
  212. package/src/ts/shaders/candlestick-body.vert.glsl +34 -0
  213. package/src/ts/shaders/density-extreme.frag.glsl +30 -0
  214. package/src/ts/shaders/density-mrt.frag.glsl +44 -0
  215. package/src/ts/shaders/density-mrt.vert.glsl +48 -0
  216. package/src/ts/shaders/density-resolve.frag.glsl +89 -0
  217. package/src/ts/shaders/density-resolve.vert.glsl +23 -0
  218. package/src/ts/shaders/density-splat.frag.glsl +34 -0
  219. package/src/ts/shaders/density-splat.vert.glsl +52 -0
  220. package/src/ts/shaders/gridline.frag.glsl +18 -0
  221. package/src/ts/shaders/gridline.vert.glsl +18 -0
  222. package/src/ts/shaders/heatmap.frag.glsl +23 -0
  223. package/src/ts/shaders/heatmap.vert.glsl +42 -0
  224. package/src/ts/shaders/line-uniform.frag.glsl +26 -0
  225. package/src/ts/shaders/line-uniform.vert.glsl +54 -0
  226. package/src/ts/shaders/line.frag.glsl +28 -0
  227. package/src/ts/shaders/line.vert.glsl +87 -0
  228. package/src/ts/shaders/scatter.frag.glsl +39 -0
  229. package/src/ts/shaders/scatter.vert.glsl +67 -0
  230. package/src/ts/shaders/sunburst-arc.frag.glsl +19 -0
  231. package/src/ts/shaders/sunburst-arc.vert.glsl +79 -0
  232. package/src/ts/shaders/tile.frag.glsl +27 -0
  233. package/src/ts/shaders/tile.vert.glsl +35 -0
  234. package/src/ts/shaders/treemap.frag.glsl +19 -0
  235. package/src/ts/shaders/treemap.vert.glsl +25 -0
  236. package/src/ts/shaders/y-scatter.frag.glsl +30 -0
  237. package/src/ts/shaders/y-scatter.vert.glsl +31 -0
  238. package/src/ts/theme/gradient.ts +312 -0
  239. package/src/ts/theme/palette.ts +64 -0
  240. package/src/ts/theme/theme-snapshot.ts +66 -0
  241. package/src/ts/theme/theme.ts +166 -0
  242. package/src/ts/transport/protocol.ts +497 -0
  243. package/src/ts/transport/renderer-transport.ts +788 -0
  244. package/src/ts/utils/css.ts +36 -0
  245. package/src/ts/utils/font-snapshot.ts +159 -0
  246. package/src/ts/webgl/buffer-pool.ts +163 -0
  247. package/src/ts/webgl/context-manager.ts +414 -0
  248. package/src/ts/webgl/gradient-texture.ts +84 -0
  249. package/src/ts/webgl/instanced-attrs.ts +139 -0
  250. package/src/ts/webgl/plot-frame.ts +91 -0
  251. package/src/ts/webgl/program-cache.ts +46 -0
  252. package/src/ts/webgl/shader-manifest.ts +148 -0
  253. package/src/ts/webgl/shader-registry.ts +97 -0
  254. package/src/ts/worker/boot.ts +22 -0
  255. package/src/ts/worker/dispatch.ts +99 -0
  256. package/src/ts/worker/font-loader.ts +89 -0
  257. package/src/ts/worker/renderer.worker.ts +734 -0
  258. package/src/ts/worker/session-host.ts +118 -0
@@ -0,0 +1,48 @@
1
+ import { AbstractChart } from "../chart-base";
2
+ import { NodeStore } from "./node-store";
3
+ import { LazyTooltip } from "../../interaction/lazy-tooltip";
4
+ /**
5
+ * Shared state for hierarchical charts (treemap, sunburst). Holds the
6
+ * tree store + streaming-insert scaffolding + per-row tooltip data
7
+ * buffers. Concrete chart classes extend this and add their own
8
+ * layout / render / interact state.
9
+ *
10
+ * Fields are `public` so the `tree-data.ts` helpers and per-chart
11
+ * layout modules can read/write them without friction.
12
+ */
13
+ export declare abstract class TreeChartBase extends AbstractChart {
14
+ _sizeName: string;
15
+ _colorName: string;
16
+ /**
17
+ * Color-slot semantics.
18
+ * - `"empty"`: no Color slot → single palette[0], legend suppressed.
19
+ * - `"numeric"`: Color column is float / integer / date / datetime →
20
+ * continuous gradient via `colorValueToT`.
21
+ * - `"series"`: Color column is any other type → discrete series
22
+ * palette keyed by the composite of group_by level values.
23
+ */
24
+ _colorMode: "empty" | "numeric" | "series";
25
+ _nodeStore: NodeStore;
26
+ _rootId: number;
27
+ _currentRootId: number;
28
+ _breadcrumbIds: number[];
29
+ /**
30
+ * Per-parent `Map<childName, childId>` for O(1) find-or-create
31
+ * during streaming tree insertion. Rebuilt on each dataset reset.
32
+ */
33
+ _childLookup: Map<number, Map<string, number>>;
34
+ _rowCount: number;
35
+ _colorMin: number;
36
+ _colorMax: number;
37
+ _uniqueColorLabels: Map<string, number>;
38
+ _visibleNodeIds: Int32Array | null;
39
+ _visibleNodeCount: number;
40
+ /**
41
+ * Lazy-tooltip cache. `lines` is `null` until the async row fetch
42
+ * resolves; the controller's serial dance drops stale results so
43
+ * rapid mouse motion doesn't paint out-of-date text. The render
44
+ * path consults `hoveredTarget` to verify cached lines belong to
45
+ * the currently hovered node before painting.
46
+ */
47
+ _lazyTooltip: LazyTooltip<number>;
48
+ }
@@ -0,0 +1,31 @@
1
+ import type { Context2D } from "../canvas-types";
2
+ import type { TreeChartBase } from "./tree-chart";
3
+ /**
4
+ * Click target for one breadcrumb segment. Tree-chart hit-testing
5
+ * checks `_breadcrumbRegions` first so a click on the trail re-roots
6
+ * the view to that ancestor.
7
+ */
8
+ export interface BreadcrumbRegion {
9
+ nodeId: number;
10
+ x0: number;
11
+ y0: number;
12
+ x1: number;
13
+ y1: number;
14
+ }
15
+ /**
16
+ * Paint the ancestor-path strip across the top of a tree chart and
17
+ * record per-crumb hit regions on `chart._breadcrumbRegions`. Mirrors
18
+ * the structure used by both treemap and sunburst — they only differ
19
+ * in their hover-highlight geometry, so this strip is shared verbatim.
20
+ */
21
+ export declare function renderBreadcrumbs(chart: TreeChartBase & {
22
+ _breadcrumbRegions: BreadcrumbRegion[];
23
+ }, ctx: Context2D, cssWidth: number, fontFamily: string, textColor: string): void;
24
+ /**
25
+ * Paint the lazy-tooltip box for a tree-chart node, anchored at
26
+ * `(cx, cy)`. Returns early when no lines are cached for `nodeId`
27
+ * (the lazy lookup hasn't resolved yet, or `nodeId` doesn't match the
28
+ * currently-hovered target). Both treemap (rect-center) and sunburst
29
+ * (arc-mid) charts only differ in how they compute the anchor.
30
+ */
31
+ export declare function renderTreeTooltip(chart: TreeChartBase, ctx: Context2D, nodeId: number, cx: number, cy: number, cssWidth: number, cssHeight: number, fontFamily: string): void;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Streaming tree pipeline shared by treemap and sunburst. Rows arrive
3
+ * incrementally; each chunk inserts its rows directly into the SOA
4
+ * tree. Per-leaf tooltip columns are fetched lazily on pin via the
5
+ * chart's `_lazyRows`; the tree only retains `leafRowIdx` per leaf
6
+ * (small, O(leaves)) as the handle back to the source view row.
7
+ * After a chunk is processed, `finalizeTree` recomputes `value`
8
+ * bottom-up.
9
+ *
10
+ * Color mode:
11
+ * - `"numeric"` — `readColor` reads the row's numeric value; the
12
+ * render path maps it through the continuous gradient.
13
+ * - `"series"` — `readColor` reads the row's string value from the
14
+ * color column's dictionary, and `seedColorLabels` pre-populates
15
+ * `_uniqueColorLabels` in dictionary-index order. Render picks
16
+ * `palette[dictIdx % paletteSize]`.
17
+ * - `"empty"` — no color column; every leaf gets `palette[0]`.
18
+ *
19
+ * When `_splitBy` is populated, every row is duplicated — one insertion
20
+ * per split prefix, with that prefix pushed as the top-level path
21
+ * segment so the top-level children of the synthetic root become
22
+ * facet roots. The per-prefix `size` / `color` columns (named
23
+ * `${prefix}|${base}`) feed the facet's values. `seedColorLabels`
24
+ * runs once per split so every split's dictionary contributes to the
25
+ * shared legend.
26
+ */
27
+ import type { ColumnDataMap } from "../../data/view-reader";
28
+ import type { TreeChartBase } from "./tree-chart";
29
+ /**
30
+ * Reset the shared tree state. Called on the first chunk
31
+ * (`startRow === 0`) of each dataset load.
32
+ */
33
+ export declare function resetTreeState(chart: TreeChartBase): void;
34
+ /**
35
+ * Process one incoming chunk: grow row-data buffers, walk every row,
36
+ * capture column values, and insert into the tree.
37
+ */
38
+ export declare function processTreeChunk(chart: TreeChartBase, columns: ColumnDataMap): void;
39
+ /**
40
+ * Post-chunk finalization.
41
+ * 1. Recompute `value` bottom-up from `size` via an iterative
42
+ * post-order walk.
43
+ * 2. Re-resolve `_currentRootId` from the breadcrumb name-path so
44
+ * drill state survives incremental chunk arrivals.
45
+ *
46
+ * `colorLabel` is set at insert time (`readColor`) and needs no
47
+ * post-pass: in `"series"` mode it comes from the color column's
48
+ * dictionary, and in `"numeric"` / `"empty"` modes it's unused.
49
+ */
50
+ export declare function finalizeTree(chart: TreeChartBase): void;
51
+ /**
52
+ * Rebuild `chart._breadcrumbIds` by walking up from `nodeId`.
53
+ */
54
+ export declare function rebuildBreadcrumbs(chart: TreeChartBase, nodeId: number): void;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Generic "find the value-axis extent among records whose category
3
+ * position falls inside a visible window" helper. Used by Y Bar,
4
+ * X Bar, Candlestick, and any future categorical-axis chart that
5
+ * wants an auto-fit value axis on zoom.
6
+ *
7
+ * Takes a pre-extracted numeric tuple per record via the `extract`
8
+ * callback instead of reading fields directly, so the same code path
9
+ * handles both Bar's `{ catIdx, y0, y1, axis, seriesId }` shape and
10
+ * Candlestick's `{ xCenter, low, high }` shape.
11
+ *
12
+ * TODO(perf): linear scan. Callers that order records by category
13
+ * index could pre-sort once and binary-search the slice to reduce
14
+ * this to O(log N + K_visible). Deferred until profiling shows the
15
+ * scan in the hot path.
16
+ */
17
+ export interface VisibleExtent {
18
+ min: number;
19
+ max: number;
20
+ hasFit: boolean;
21
+ }
22
+ export interface VisibleExtentRecord {
23
+ /**
24
+ * Position on the categorical axis — compared to the visible window.
25
+ */
26
+ cat: number;
27
+ /**
28
+ * Low bound of the value-axis extent for this record.
29
+ */
30
+ lo: number;
31
+ /**
32
+ * High bound of the value-axis extent for this record.
33
+ */
34
+ hi: number;
35
+ /**
36
+ * True to skip this record (hidden series / wrong axis / etc.).
37
+ */
38
+ skip: boolean;
39
+ }
40
+ /**
41
+ * Walk `items`, filter by `visCatMin <= cat <= visCatMax` (and the
42
+ * caller-supplied `skip` flag), and return min/max over `lo`/`hi`.
43
+ *
44
+ * Returns `hasFit: false` when the window matches no records, so
45
+ * callers can fall back to the base domain.
46
+ *
47
+ * Zero-range guard: if every visible record shares a single value
48
+ * (flat run), pad by `±|value|` so the axis doesn't collapse to a
49
+ * single pixel.
50
+ */
51
+ export declare function computeVisibleExtent<T>(items: readonly T[], visCatMin: number, visCatMax: number, extract: (item: T, out: VisibleExtentRecord) => void, out: VisibleExtent): VisibleExtent;
@@ -0,0 +1,86 @@
1
+ import type { ColumnDataMap } from "../../data/view-reader";
2
+ import type { CategoricalLevel } from "../../axis/categorical-axis";
3
+ import { type AxisMode, type NumericCategoryDomain } from "../common/category-axis-resolver";
4
+ export interface HeatmapCell {
5
+ xIdx: number;
6
+ yIdx: number;
7
+ value: number;
8
+ }
9
+ export interface HeatmapPipelineInput {
10
+ columns: ColumnDataMap;
11
+ numRows: number;
12
+ groupBy: string[];
13
+ splitBy: string[];
14
+ /**
15
+ * Source-column types keyed by column name (table.schema() merged
16
+ * with view.expression_schema()). Drives both the X-axis level-type
17
+ * lookup (for non-string row-paths) and the Y-axis numeric-mode
18
+ * decision when there's a single split_by.
19
+ */
20
+ groupByTypes: Record<string, string>;
21
+ }
22
+ export interface HeatmapPipelineResult {
23
+ /**
24
+ * Hierarchical row_path levels driving the X axis (outermost-first).
25
+ */
26
+ xLevels: CategoricalLevel[];
27
+ /**
28
+ * Arrow column names in iteration order; `yIdx === index in this list`.
29
+ */
30
+ yColumnNames: string[];
31
+ /**
32
+ * Hierarchical Y levels derived by splitting each name on `|`.
33
+ */
34
+ yLevels: CategoricalLevel[];
35
+ numX: number;
36
+ numY: number;
37
+ rowOffset: number;
38
+ cells: HeatmapCell[];
39
+ /**
40
+ * O(1) lookup by `yIdx * numX + xIdx`; `null` means no-data.
41
+ */
42
+ cells2D: (HeatmapCell | null)[];
43
+ colorMin: number;
44
+ colorMax: number;
45
+ /**
46
+ * X-axis mode. `numeric` fires when the single group_by is
47
+ * date/datetime/integer/float; positions live in `xPositions`
48
+ * and the domain in `xNumericDomain`.
49
+ */
50
+ xAxisMode: AxisMode;
51
+ yAxisMode: AxisMode;
52
+ xPositions: Float64Array | null;
53
+ yPositions: Float64Array | null;
54
+ xNumericDomain: NumericCategoryDomain | null;
55
+ yNumericDomain: NumericCategoryDomain | null;
56
+ }
57
+ /**
58
+ * Pure heatmap pipeline. Y indexing maps 1:1 to the arrow column iteration
59
+ * order — `yIdx` is the position of a value column in the ordered
60
+ * `ColumnDataMap` (after skipping `__ROW_PATH_N__` metadata). No
61
+ * aggregate/split reconstruction; the column name *is* the Y label.
62
+ *
63
+ * Externally enforced: only one entry sits in the `Color` slot, so every
64
+ * non-metadata column is a splitwise expansion of that single aggregate.
65
+ *
66
+ * Numeric-axis mode (matching bar/candlestick): when there's exactly one
67
+ * non-string group_by, the X axis switches to a real numeric/date axis
68
+ * with `xPositions[xIdx]` carrying the data-space center. Y mirrors this
69
+ * for a single non-string split_by, parsed best-effort out of the column
70
+ * name leaf segment; on parse failure it falls back to category mode.
71
+ */
72
+ export declare function buildHeatmapPipeline(input: HeatmapPipelineInput): HeatmapPipelineResult;
73
+ /**
74
+ * Partition a `ColumnDataMap` into one sub-map per user column. Every
75
+ * arrow value column is assigned to the partition whose user column name
76
+ * matches its terminal segment (everything after the last `|`, which
77
+ * equals the whole name when there's no `split_by`). `__ROW_PATH_N__`
78
+ * and `__GROUPING_ID__` metadata columns are copied into every partition
79
+ * since they describe the shared X axis.
80
+ *
81
+ * Used to render one heatmap per user column in a facet grid.
82
+ */
83
+ export declare function partitionColumnsPerFacet(columns: ColumnDataMap, userColumns: string[]): Array<{
84
+ label: string;
85
+ columns: ColumnDataMap;
86
+ }>;
@@ -0,0 +1,19 @@
1
+ import type { HeatmapChart } from "./heatmap";
2
+ import type { CategoricalLevel } from "../../axis/categorical-axis";
3
+ /**
4
+ * Find the heatmap cell under `(mx, my)`. O(1) via the prebuilt `cells2D`
5
+ * index. Sets `chart._hoveredCell` and schedules a re-render when the
6
+ * hovered cell changes.
7
+ *
8
+ * In multi-facet mode, iterates facets to find the one whose plot rect
9
+ * contains the cursor, then hit-tests against that facet's pipeline.
10
+ */
11
+ export declare function handleHeatmapHover(chart: HeatmapChart, mx: number, my: number): void;
12
+ /**
13
+ * Format a hierarchical path from a precomputed-label `CategoricalLevel` array.
14
+ */
15
+ export declare function formatHierarchicalPath(levels: CategoricalLevel[], idx: number): string;
16
+ /**
17
+ * Render a tooltip for the currently hovered cell.
18
+ */
19
+ export declare function renderHeatmapTooltip(chart: HeatmapChart): void;
@@ -0,0 +1,19 @@
1
+ import type { WebGLContextManager } from "../../webgl/context-manager";
2
+ import type { HeatmapChart } from "./heatmap";
3
+ export interface HeatmapLocations {
4
+ u_projection: WebGLUniformLocation | null;
5
+ u_cell_inset: WebGLUniformLocation | null;
6
+ u_cell_size: WebGLUniformLocation | null;
7
+ u_gradient_lut: WebGLUniformLocation | null;
8
+ a_corner: number;
9
+ a_cell: number;
10
+ a_color_t: number;
11
+ }
12
+ /**
13
+ * Full-frame render: WebGL cells → chrome overlay.
14
+ */
15
+ export declare function renderHeatmapFrame(chart: HeatmapChart, glManager: WebGLContextManager): void;
16
+ /**
17
+ * Chrome overlay: X axis + Y axis + color legend + (optional) tooltip.
18
+ */
19
+ export declare function renderHeatmapChromeOverlay(chart: HeatmapChart): void;
@@ -0,0 +1,46 @@
1
+ import type { Context2D } from "../canvas-types";
2
+ import { PlotLayout } from "../../layout/plot-layout";
3
+ import type { Theme } from "../../theme/theme";
4
+ import type { CategoricalDomain } from "../../axis/categorical-axis";
5
+ interface LevelTickLayout {
6
+ size: number;
7
+ }
8
+ export interface CategoricalYAxisOptions {
9
+ /**
10
+ * Drop the innermost level of the domain before rendering, promoting
11
+ * the second-to-last level into the leaf position. Used by the
12
+ * heatmap, whose column names encode `split…|aggregate` — with a
13
+ * single aggregate the leaf level is a redundant constant column,
14
+ * and showing the last split as the leaf reads more naturally.
15
+ *
16
+ * No-op when `levels.length <= 1` (there's nothing left to promote);
17
+ * the axis renders nothing in that case.
18
+ */
19
+ skipLeafLevel?: boolean;
20
+ }
21
+ /**
22
+ * Map a Y category index to a pixel y-coordinate. Matches the convention
23
+ * chosen for the heatmap plot: yIdx=0 sits at the *bottom* (math Y-up),
24
+ * so a higher yIdx maps to a lower pixel value via `dataToPixel`'s
25
+ * standard (1 - t) flip.
26
+ */
27
+ export declare function categoryIndexToPixelY(layout: PlotLayout, index: number): number;
28
+ /**
29
+ * Per-level widths for a vertical categorical axis. Leaf width is
30
+ * derived from the longest label in that level's dictionary; outer
31
+ * levels get a fixed narrow column for the bracket + short text.
32
+ */
33
+ export declare function measureCategoricalYLevels(domain: CategoricalDomain, opts?: CategoricalYAxisOptions): LevelTickLayout[];
34
+ /**
35
+ * Total CSS-pixel width required for the categorical tick band (levels),
36
+ * NOT including the per-axis-label allowance. Caller feeds this to
37
+ * `PlotLayout` as `leftExtra`; the axis label is added via `hasYLabel`.
38
+ */
39
+ export declare function measureCategoricalAxisWidth(domain: CategoricalDomain, opts?: CategoricalYAxisOptions): number;
40
+ /**
41
+ * Render hierarchical Y-axis tick marks, leaf labels, and outer-level
42
+ * bracket labels on the chrome canvas. The axis line is drawn by the
43
+ * caller alongside the X axis.
44
+ */
45
+ export declare function renderCategoricalYTicks(ctx: Context2D, layout: PlotLayout, domain: CategoricalDomain, theme: Theme, opts?: CategoricalYAxisOptions): void;
46
+ export {};
@@ -0,0 +1,117 @@
1
+ import type { ColumnDataMap } from "../../data/view-reader";
2
+ import type { WebGLContextManager } from "../../webgl/context-manager";
3
+ import { AbstractChart } from "../chart-base";
4
+ import { PlotLayout } from "../../layout/plot-layout";
5
+ import type { CategoricalLevel } from "../../axis/categorical-axis";
6
+ import type { FacetGrid } from "../../layout/facet-grid";
7
+ import type { AxisMode, NumericCategoryDomain } from "../common/category-axis-resolver";
8
+ import { type HeatmapCell, type HeatmapPipelineResult } from "./heatmap-build";
9
+ import { type HeatmapLocations } from "./heatmap-render";
10
+ /**
11
+ * One heatmap in a facet-grid layout. Each facet corresponds to one
12
+ * user-selected column in the `Color` slot; its `pipeline` holds the
13
+ * cell data, and `layout` is the cell's `PlotLayout` from `buildFacetGrid`.
14
+ * `instanceStart`/`instanceCount` give the range of the packed
15
+ * cell/colorT buffers that belong to this facet.
16
+ */
17
+ export interface HeatmapFacet {
18
+ label: string;
19
+ pipeline: HeatmapPipelineResult;
20
+ layout: PlotLayout;
21
+ instanceStart: number;
22
+ instanceCount: number;
23
+ /**
24
+ * Origins used to rebase cell positions before f32 narrowing —
25
+ * matches the per-axis convention in `SeriesChart._categoryOrigin`.
26
+ * `0` for non-numeric axes; for numeric (especially datetime) axes
27
+ * pinned to `xNumericDomain.min` / `yNumericDomain.min` so the
28
+ * shader's projection matrix can be built in rebased space.
29
+ */
30
+ xOrigin: number;
31
+ yOrigin: number;
32
+ }
33
+ /**
34
+ * Heatmap chart. `yIdx` maps 1:1 to the arrow column iteration order
35
+ * (after skipping `__ROW_PATH_N__` metadata). `xIdx` is the row index
36
+ * post-`rowOffset`.
37
+ *
38
+ * With one user column in the `Color` slot the chart renders a single
39
+ * heatmap filling the canvas. With more than one, each column becomes
40
+ * its own heatmap in a facet grid; all facets share a common color
41
+ * scale and a single legend.
42
+ */
43
+ export declare class HeatmapChart extends AbstractChart {
44
+ _program: WebGLProgram | null;
45
+ _locations: HeatmapLocations | null;
46
+ _cornerBuffer: WebGLBuffer | null;
47
+ _gradientCache: import("../../webgl/gradient-texture").GradientTextureCache | null;
48
+ _xLevels: CategoricalLevel[];
49
+ _yLevels: CategoricalLevel[];
50
+ _yColumnNames: string[];
51
+ _numX: number;
52
+ _numY: number;
53
+ _rowOffset: number;
54
+ _xAxisMode: AxisMode;
55
+ _yAxisMode: AxisMode;
56
+ _xPositions: Float64Array | null;
57
+ _yPositions: Float64Array | null;
58
+ _xNumericDomain: NumericCategoryDomain | null;
59
+ _yNumericDomain: NumericCategoryDomain | null;
60
+ /**
61
+ * Single-plot rebase origins. Datetime numeric axes carry ~1.7e12
62
+ * timestamps which the f32 GPU pipeline cannot resolve below
63
+ * ~256ms; the cell upload subtracts these and the projection
64
+ * matrix is built with the same values so its `tx`/`ty` terms stay
65
+ * small enough for f32 cancellation in the shader. `0` for
66
+ * categorical or numeric-non-date axes.
67
+ */
68
+ _xOrigin: number;
69
+ _yOrigin: number;
70
+ _cells: HeatmapCell[];
71
+ _cells2D: (HeatmapCell | null)[];
72
+ _uploadedCells: number;
73
+ _colorMin: number;
74
+ _colorMax: number;
75
+ _aggName: string;
76
+ _hoveredCell: HeatmapCell | null;
77
+ _lastLayout: PlotLayout | null;
78
+ /**
79
+ * Last cursor position (canvas-CSS pixels) recorded by
80
+ * `handleHeatmapHover`. Used as the tooltip anchor instead of the
81
+ * cell center so the hover label tracks the mouse — necessary
82
+ * because heatmap cells can be many pixels wide and a center-anchored
83
+ * tooltip drifts away from the cursor.
84
+ */
85
+ _hoveredMouseX: number;
86
+ _hoveredMouseY: number;
87
+ _facets: HeatmapFacet[];
88
+ _facetGrid: FacetGrid | null;
89
+ _hoveredFacetIdx: number;
90
+ /**
91
+ * Bound accessor so the interact module can trigger a chrome redraw.
92
+ */
93
+ _renderChromeOverlay: () => void;
94
+ protected tooltipCallbacks(): {
95
+ onHover: (mx: number, my: number) => void;
96
+ onLeave: () => void;
97
+ onPin: (mx: number, my: number) => void;
98
+ onUnpin: () => void;
99
+ };
100
+ /**
101
+ * Resolve a clicked heatmap cell into a `PerspectiveClickDetail`
102
+ * and emit both `perspective-click` and
103
+ * `perspective-global-filter selected:true`. `xIdx` indexes the
104
+ * outer (group-by) hierarchy; `yIdx` indexes the column-side
105
+ * hierarchy (split-by + value-column splits). Each level is read
106
+ * directly from the pre-resolved `_xLevels` / `_yLevels` labels.
107
+ *
108
+ * Representative source row: `xIdx + _rowOffset` — the row in the
109
+ * pivoted view that owns this category. Sufficient for the
110
+ * `row.{col}` lookups consumers typically do; not authoritative for
111
+ * cells that aggregate across many source rows.
112
+ */
113
+ private _emitHeatmapClickSelect;
114
+ uploadAndRender(glManager: WebGLContextManager, columns: ColumnDataMap, startRow: number, endRow: number): Promise<void>;
115
+ _fullRender(glManager: WebGLContextManager): void;
116
+ protected destroyInternal(): void;
117
+ }
@@ -0,0 +1,67 @@
1
+ import { CartesianChart } from "../cartesian/cartesian";
2
+ import type { Glyph } from "../cartesian/glyph";
3
+ import type { WebGLContextManager } from "../../webgl/context-manager";
4
+ import type { PlotLayout } from "../../layout/plot-layout";
5
+ import type { Theme } from "../../theme/theme";
6
+ import type { Canvas2D } from "../canvas-types";
7
+ import type { ZoomConfig } from "../../interaction/zoom-controller";
8
+ import type { PluginConfig } from "../chart";
9
+ /**
10
+ * Map-mode base for cartesian charts. Reuses the entire cartesian
11
+ * pipeline (build, hit-test, zoom controller, lazy tooltips, faceting,
12
+ * theme, gradient texture) and swaps three behaviors:
13
+ *
14
+ * - `projectPoint(lon, lat)` Mercator-projects incoming columns so
15
+ * the rest of the pipeline operates in meter-space (linear
16
+ * projection matrix, screen-space splat radius, hit-test grid all
17
+ * "just work").
18
+ * - `_renderMode = "map"` flips the render-frame branches to skip
19
+ * cartesian gridlines and axes, insert a basemap layer before the
20
+ * glyph draw, and use the map-specific chrome (attribution).
21
+ * - `getZoomConfig()` returns `lockAspect: true` so wheel zoom keeps
22
+ * `dataPerPixel` uniform on both axes (required: Mercator
23
+ * preserves angle, glyphs distort otherwise).
24
+ *
25
+ * Concrete map plugin tags (`map-scatter`, `map-line`, `map-density`)
26
+ * pin a glyph in their nullary constructor exactly like the cartesian
27
+ * convenience subclasses.
28
+ */
29
+ export declare class MapChart extends CartesianChart {
30
+ _renderMode: "map";
31
+ private _tileLayer;
32
+ constructor(glyph: Glyph);
33
+ projectPoint(lon: number, lat: number): [number, number];
34
+ protected getZoomConfig(): ZoomConfig;
35
+ setPluginConfig(cfg: PluginConfig): void;
36
+ renderBackground(glManager: WebGLContextManager, layout: PlotLayout, projection: Float32Array, domain: {
37
+ xMin: number;
38
+ xMax: number;
39
+ yMin: number;
40
+ yMax: number;
41
+ }, xOrigin: number, yOrigin: number): void;
42
+ renderMapChrome(canvas: Canvas2D | null, layout: PlotLayout, theme: Theme, dpr: number): void;
43
+ protected destroyInternal(): void;
44
+ }
45
+ /**
46
+ * Map Scatter — Mercator scatter on a raster basemap. Same glyph as
47
+ * `X/Y Scatter`; only projection and chrome differ.
48
+ */
49
+ export declare class MapScatterChart extends MapChart {
50
+ constructor();
51
+ }
52
+ /**
53
+ * Map Line — Mercator polyline on a raster basemap. Same glyph as
54
+ * `X/Y Line`.
55
+ */
56
+ export declare class MapLineChart extends MapChart {
57
+ constructor();
58
+ }
59
+ /**
60
+ * Map Density — Mercator KDE on a raster basemap. Same glyph as
61
+ * `Density`; the four `gradient_color_mode` variants
62
+ * (density/mean/extreme/signed) are all available on the map too
63
+ * because the glyph reads `_pluginConfig` directly.
64
+ */
65
+ export declare class MapDensityChart extends MapChart {
66
+ constructor();
67
+ }
@@ -0,0 +1,14 @@
1
+ import type { ChartImplementation } from "./chart";
2
+ type ChartImplCtor = new () => ChartImplementation;
3
+ /**
4
+ * Map from `ChartTypeConfig.tag` to a factory returning the chart-impl
5
+ * class. Consumed by `renderer.worker.ts` which `await`s the factory
6
+ * before constructing the impl.
7
+ *
8
+ * Eager chart types resolve immediately — `Promise.resolve(Class)` is
9
+ * a microtask, no I/O. Map plugins resolve via dynamic `import()` so
10
+ * the bundler emits the tile-rendering subsystem and the map-mode
11
+ * subclasses as a separate chunk; non-map users never fetch it.
12
+ */
13
+ export declare const CHART_IMPLS: Record<string, () => Promise<ChartImplCtor>>;
14
+ export {};
@@ -0,0 +1,30 @@
1
+ import type { WebGLContextManager } from "../../../webgl/context-manager";
2
+ import type { SeriesChart } from "../series";
3
+ type GL = WebGL2RenderingContext | WebGLRenderingContext;
4
+ /**
5
+ * Area glyph for {@link SeriesChart}. Owns its program + per-series
6
+ * strip buffers privately.
7
+ */
8
+ export declare class AreaGlyph {
9
+ private _program;
10
+ private _buffers;
11
+ private ensureProgram;
12
+ /**
13
+ * Drop persistent area buffers. Subsequent draws no-op until rebuild.
14
+ */
15
+ invalidateBuffers(chart: SeriesChart): void;
16
+ /**
17
+ * Build per-series strip buffers for area glyphs. Reads stacked
18
+ * y0/y1 from `chart._areaBarIndex` (cached at data load) and
19
+ * unstacked values from `_samples`. Single GPU upload per series;
20
+ * subsequent frames just rebind.
21
+ */
22
+ rebuildBuffers(chart: SeriesChart, glManager: WebGLContextManager): void;
23
+ /**
24
+ * Bind persistent strip buffers and dispatch one TRIANGLE_STRIP per
25
+ * series-run. Skips hidden series.
26
+ */
27
+ draw(chart: SeriesChart, gl: GL, _glManager: WebGLContextManager, projLeft: Float32Array, projRight: Float32Array, opacity: number): void;
28
+ destroy(chart: SeriesChart): void;
29
+ }
30
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { WebGLContextManager } from "../../../webgl/context-manager";
2
+ import type { SeriesChart } from "../series";
3
+ /**
4
+ * Re-export of the bar discriminator value so `series-render.ts` can
5
+ * filter the `_bars` columnar storage without pulling the full
6
+ * `series-build` types into its import surface.
7
+ */
8
+ export declare const BAR_TYPE_BAR_VAL = 0;
9
+ type GL = WebGL2RenderingContext | WebGLRenderingContext;
10
+ /**
11
+ * Draw the bar-typed subset of `chart._bars` as instanced quads. Assumes
12
+ * the caller has already `useProgram`'d the bar shader and set uniforms.
13
+ */
14
+ export declare function drawBars(chart: SeriesChart, gl: GL, glManager: WebGLContextManager): void;
15
+ export {};
@@ -0,0 +1,34 @@
1
+ import type { WebGLContextManager } from "../../../webgl/context-manager";
2
+ import type { SeriesChart } from "../series";
3
+ type GL = WebGL2RenderingContext | WebGLRenderingContext;
4
+ /**
5
+ * Line glyph for {@link SeriesChart}. Owns its program + per-series
6
+ * GPU buffers privately; chart routes lifecycle through
7
+ * `_glyphs.lines`.
8
+ */
9
+ export declare class LineGlyph {
10
+ private _program;
11
+ private _buffers;
12
+ private ensureProgram;
13
+ /**
14
+ * Drop persistent line buffers. Subsequent draws will no-op until
15
+ * the next `rebuildBuffers` call.
16
+ */
17
+ invalidateBuffers(chart: SeriesChart): void;
18
+ /**
19
+ * Rebuild the per-series GPU buffers for line glyphs. Called once
20
+ * per data load (and once after `restyle()` because palette colors
21
+ * are captured on the {@link LineSeriesEntry}). The buffer contents
22
+ * encode `[x,y]` points in run-major order; one `bufferData` per
23
+ * series. After this, every `draw` call rebinds + dispatches with
24
+ * no further uploads until the next data load.
25
+ */
26
+ rebuildBuffers(chart: SeriesChart, glManager: WebGLContextManager): void;
27
+ /**
28
+ * Bind the persistent vertex buffers and dispatch one instanced draw
29
+ * per (series, run). Skips hidden series via `_hiddenSeries`.
30
+ */
31
+ draw(chart: SeriesChart, gl: GL, glManager: WebGLContextManager, projLeft: Float32Array, projRight: Float32Array): void;
32
+ destroy(chart: SeriesChart): void;
33
+ }
34
+ export {};