@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.
- package/LICENSE.md +193 -0
- package/dist/cdn/perspective-viewer-charts.js +3 -0
- package/dist/cdn/perspective-viewer-charts.js.map +7 -0
- package/dist/esm/axis/axis-primitives.d.ts +24 -0
- package/dist/esm/axis/bar-axis.d.ts +51 -0
- package/dist/esm/axis/canvas.d.ts +24 -0
- package/dist/esm/axis/categorical-axis-core.d.ts +42 -0
- package/dist/esm/axis/categorical-axis.d.ts +27 -0
- package/dist/esm/axis/facet-chrome.d.ts +13 -0
- package/dist/esm/axis/label-geometry.d.ts +41 -0
- package/dist/esm/axis/legend.d.ts +44 -0
- package/dist/esm/axis/numeric-axis.d.ts +20 -0
- package/dist/esm/charts/candlestick/candlestick-build.d.ts +129 -0
- package/dist/esm/charts/candlestick/candlestick-interact.d.ts +10 -0
- package/dist/esm/charts/candlestick/candlestick-render.d.ts +24 -0
- package/dist/esm/charts/candlestick/candlestick.d.ts +144 -0
- package/dist/esm/charts/candlestick/glyphs/draw-candlesticks.d.ts +36 -0
- package/dist/esm/charts/candlestick/glyphs/draw-ohlc.d.ts +33 -0
- package/dist/esm/charts/canvas-types.d.ts +15 -0
- package/dist/esm/charts/cartesian/cartesian-build.d.ts +14 -0
- package/dist/esm/charts/cartesian/cartesian-interact.d.ts +20 -0
- package/dist/esm/charts/cartesian/cartesian-render.d.ts +26 -0
- package/dist/esm/charts/cartesian/cartesian.d.ts +239 -0
- package/dist/esm/charts/cartesian/glyph.d.ts +53 -0
- package/dist/esm/charts/cartesian/glyphs/density.d.ts +142 -0
- package/dist/esm/charts/cartesian/glyphs/lines.d.ts +23 -0
- package/dist/esm/charts/cartesian/glyphs/points.d.ts +24 -0
- package/dist/esm/charts/cartesian/label-interner.d.ts +21 -0
- package/dist/esm/charts/cartesian/tooltip-lines.d.ts +11 -0
- package/dist/esm/charts/chart-base.d.ts +402 -0
- package/dist/esm/charts/chart.d.ts +338 -0
- package/dist/esm/charts/common/band-layout.d.ts +32 -0
- package/dist/esm/charts/common/categorical-y-chart.d.ts +53 -0
- package/dist/esm/charts/common/category-axis-resolver.d.ts +90 -0
- package/dist/esm/charts/common/chrome-cache.d.ts +18 -0
- package/dist/esm/charts/common/draw-tooltip-box.d.ts +9 -0
- package/dist/esm/charts/common/leaf-color.d.ts +33 -0
- package/dist/esm/charts/common/node-store.d.ts +81 -0
- package/dist/esm/charts/common/tree-chart.d.ts +48 -0
- package/dist/esm/charts/common/tree-chrome.d.ts +31 -0
- package/dist/esm/charts/common/tree-data.d.ts +54 -0
- package/dist/esm/charts/common/visible-extent.d.ts +51 -0
- package/dist/esm/charts/heatmap/heatmap-build.d.ts +86 -0
- package/dist/esm/charts/heatmap/heatmap-interact.d.ts +19 -0
- package/dist/esm/charts/heatmap/heatmap-render.d.ts +19 -0
- package/dist/esm/charts/heatmap/heatmap-y-axis.d.ts +46 -0
- package/dist/esm/charts/heatmap/heatmap.d.ts +117 -0
- package/dist/esm/charts/map/map.d.ts +67 -0
- package/dist/esm/charts/registry.d.ts +14 -0
- package/dist/esm/charts/series/glyphs/draw-areas.d.ts +30 -0
- package/dist/esm/charts/series/glyphs/draw-bars.d.ts +15 -0
- package/dist/esm/charts/series/glyphs/draw-lines.d.ts +34 -0
- package/dist/esm/charts/series/glyphs/draw-scatter.d.ts +33 -0
- package/dist/esm/charts/series/series-build.d.ts +228 -0
- package/dist/esm/charts/series/series-interact.d.ts +35 -0
- package/dist/esm/charts/series/series-render.d.ts +41 -0
- package/dist/esm/charts/series/series-type.d.ts +49 -0
- package/dist/esm/charts/series/series.d.ts +317 -0
- package/dist/esm/charts/sunburst/sunburst-interact.d.ts +7 -0
- package/dist/esm/charts/sunburst/sunburst-layout.d.ts +33 -0
- package/dist/esm/charts/sunburst/sunburst-render.d.ts +22 -0
- package/dist/esm/charts/sunburst/sunburst.d.ts +85 -0
- package/dist/esm/charts/treemap/treemap-interact.d.ts +12 -0
- package/dist/esm/charts/treemap/treemap-layout.d.ts +28 -0
- package/dist/esm/charts/treemap/treemap-render.d.ts +18 -0
- package/dist/esm/charts/treemap/treemap.d.ts +74 -0
- package/dist/esm/config.d.ts +27 -0
- package/dist/esm/data/lazy-row.d.ts +32 -0
- package/dist/esm/data/split-groups.d.ts +20 -0
- package/dist/esm/data/view-reader.d.ts +35 -0
- package/dist/esm/event-detail.d.ts +28 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/interaction/hit-test.d.ts +30 -0
- package/dist/esm/interaction/host-sink-dom.d.ts +19 -0
- package/dist/esm/interaction/host-sink-message.d.ts +46 -0
- package/dist/esm/interaction/lazy-tooltip.d.ts +61 -0
- package/dist/esm/interaction/raw-event-forwarder.d.ts +27 -0
- package/dist/esm/interaction/spatial-grid.d.ts +15 -0
- package/dist/esm/interaction/tooltip-controller.d.ts +193 -0
- package/dist/esm/interaction/zoom-controller.d.ts +106 -0
- package/dist/esm/interaction/zoom-router.d.ts +48 -0
- package/dist/esm/layout/facet-grid.d.ts +126 -0
- package/dist/esm/layout/plot-layout.d.ts +104 -0
- package/dist/esm/layout/ticks.d.ts +17 -0
- package/dist/esm/map/mercator.d.ts +102 -0
- package/dist/esm/map/tile-cache.d.ts +38 -0
- package/dist/esm/map/tile-layer.d.ts +66 -0
- package/dist/esm/map/tile-loader.d.ts +52 -0
- package/dist/esm/map/tile-source.d.ts +66 -0
- package/dist/esm/perspective-viewer-charts.js +3 -0
- package/dist/esm/perspective-viewer-charts.js.map +7 -0
- package/dist/esm/plugin/charts.d.ts +40 -0
- package/dist/esm/plugin/plugin.d.ts +95 -0
- package/dist/esm/render/scheduler.d.ts +41 -0
- package/dist/esm/theme/gradient.d.ts +48 -0
- package/dist/esm/theme/palette.d.ts +13 -0
- package/dist/esm/theme/theme-snapshot.d.ts +7 -0
- package/dist/esm/theme/theme.d.ts +53 -0
- package/dist/esm/transport/protocol.d.ts +430 -0
- package/dist/esm/transport/renderer-transport.d.ts +201 -0
- package/dist/esm/utils/css.d.ts +1 -0
- package/dist/esm/utils/font-snapshot.d.ts +50 -0
- package/dist/esm/webgl/buffer-pool.d.ts +62 -0
- package/dist/esm/webgl/context-manager.d.ts +184 -0
- package/dist/esm/webgl/gradient-texture.d.ts +17 -0
- package/dist/esm/webgl/instanced-attrs.d.ts +44 -0
- package/dist/esm/webgl/plot-frame.d.ts +39 -0
- package/dist/esm/webgl/program-cache.d.ts +13 -0
- package/dist/esm/webgl/shader-manifest.d.ts +53 -0
- package/dist/esm/webgl/shader-registry.d.ts +22 -0
- package/dist/esm/worker/boot.d.ts +0 -0
- package/dist/esm/worker/dispatch.d.ts +9 -0
- package/dist/esm/worker/font-loader.d.ts +2 -0
- package/dist/esm/worker/renderer.worker.d.ts +115 -0
- package/dist/esm/worker/session-host.d.ts +26 -0
- package/package.json +47 -0
- package/src/css/perspective-viewer-charts.css +95 -0
- package/src/ts/axis/axis-primitives.ts +125 -0
- package/src/ts/axis/bar-axis.ts +345 -0
- package/src/ts/axis/canvas.ts +64 -0
- package/src/ts/axis/categorical-axis-core.ts +125 -0
- package/src/ts/axis/categorical-axis.ts +716 -0
- package/src/ts/axis/facet-chrome.ts +42 -0
- package/src/ts/axis/label-geometry.ts +188 -0
- package/src/ts/axis/legend.ts +218 -0
- package/src/ts/axis/numeric-axis.ts +353 -0
- package/src/ts/charts/candlestick/candlestick-build.ts +516 -0
- package/src/ts/charts/candlestick/candlestick-interact.ts +256 -0
- package/src/ts/charts/candlestick/candlestick-render.ts +387 -0
- package/src/ts/charts/candlestick/candlestick.ts +367 -0
- package/src/ts/charts/candlestick/glyphs/draw-candlesticks.ts +432 -0
- package/src/ts/charts/candlestick/glyphs/draw-ohlc.ts +317 -0
- package/src/ts/charts/canvas-types.ts +30 -0
- package/src/ts/charts/cartesian/cartesian-build.ts +616 -0
- package/src/ts/charts/cartesian/cartesian-interact.ts +355 -0
- package/src/ts/charts/cartesian/cartesian-render.ts +948 -0
- package/src/ts/charts/cartesian/cartesian.ts +469 -0
- package/src/ts/charts/cartesian/glyph.ts +81 -0
- package/src/ts/charts/cartesian/glyphs/density.ts +1263 -0
- package/src/ts/charts/cartesian/glyphs/lines.ts +320 -0
- package/src/ts/charts/cartesian/glyphs/points.ts +239 -0
- package/src/ts/charts/cartesian/label-interner.ts +56 -0
- package/src/ts/charts/cartesian/tooltip-lines.ts +80 -0
- package/src/ts/charts/chart-base.ts +840 -0
- package/src/ts/charts/chart.ts +427 -0
- package/src/ts/charts/common/band-layout.ts +63 -0
- package/src/ts/charts/common/categorical-y-chart.ts +81 -0
- package/src/ts/charts/common/category-axis-resolver.ts +314 -0
- package/src/ts/charts/common/chrome-cache.ts +79 -0
- package/src/ts/charts/common/draw-tooltip-box.ts +84 -0
- package/src/ts/charts/common/leaf-color.ts +92 -0
- package/src/ts/charts/common/node-store.ts +235 -0
- package/src/ts/charts/common/tree-chart.ts +76 -0
- package/src/ts/charts/common/tree-chrome.ts +123 -0
- package/src/ts/charts/common/tree-data.ts +623 -0
- package/src/ts/charts/common/visible-extent.ts +112 -0
- package/src/ts/charts/heatmap/heatmap-build.ts +426 -0
- package/src/ts/charts/heatmap/heatmap-interact.ts +274 -0
- package/src/ts/charts/heatmap/heatmap-render.ts +815 -0
- package/src/ts/charts/heatmap/heatmap-y-axis.ts +351 -0
- package/src/ts/charts/heatmap/heatmap.ts +368 -0
- package/src/ts/charts/map/map.ts +201 -0
- package/src/ts/charts/registry.ts +65 -0
- package/src/ts/charts/series/glyphs/draw-areas.ts +331 -0
- package/src/ts/charts/series/glyphs/draw-bars.ts +113 -0
- package/src/ts/charts/series/glyphs/draw-lines.ts +320 -0
- package/src/ts/charts/series/glyphs/draw-scatter.ts +328 -0
- package/src/ts/charts/series/series-build.ts +848 -0
- package/src/ts/charts/series/series-interact.ts +604 -0
- package/src/ts/charts/series/series-render.ts +1109 -0
- package/src/ts/charts/series/series-type.ts +99 -0
- package/src/ts/charts/series/series.ts +794 -0
- package/src/ts/charts/sunburst/sunburst-interact.ts +460 -0
- package/src/ts/charts/sunburst/sunburst-layout.ts +238 -0
- package/src/ts/charts/sunburst/sunburst-render.ts +887 -0
- package/src/ts/charts/sunburst/sunburst.ts +248 -0
- package/src/ts/charts/treemap/treemap-interact.ts +445 -0
- package/src/ts/charts/treemap/treemap-layout.ts +328 -0
- package/src/ts/charts/treemap/treemap-render.ts +886 -0
- package/src/ts/charts/treemap/treemap.ts +247 -0
- package/src/ts/config.ts +41 -0
- package/src/ts/data/lazy-row.ts +140 -0
- package/src/ts/data/split-groups.ts +97 -0
- package/src/ts/data/view-reader.ts +107 -0
- package/src/ts/event-detail.ts +44 -0
- package/src/ts/index.ts +53 -0
- package/src/ts/interaction/hit-test.ts +106 -0
- package/src/ts/interaction/host-sink-dom.ts +85 -0
- package/src/ts/interaction/host-sink-message.ts +75 -0
- package/src/ts/interaction/lazy-tooltip.ts +102 -0
- package/src/ts/interaction/raw-event-forwarder.ts +175 -0
- package/src/ts/interaction/spatial-grid.ts +100 -0
- package/src/ts/interaction/tooltip-controller.ts +407 -0
- package/src/ts/interaction/zoom-controller.ts +468 -0
- package/src/ts/interaction/zoom-router.ts +230 -0
- package/src/ts/layout/facet-grid.ts +346 -0
- package/src/ts/layout/plot-layout.ts +277 -0
- package/src/ts/layout/ticks.ts +168 -0
- package/src/ts/map/mercator.ts +204 -0
- package/src/ts/map/tile-cache.ts +96 -0
- package/src/ts/map/tile-layer.ts +382 -0
- package/src/ts/map/tile-loader.ts +143 -0
- package/src/ts/map/tile-source.ts +156 -0
- package/src/ts/plugin/charts.ts +286 -0
- package/src/ts/plugin/plugin.ts +668 -0
- package/src/ts/render/scheduler.ts +339 -0
- package/src/ts/shaders/area.frag.glsl +20 -0
- package/src/ts/shaders/area.vert.glsl +19 -0
- package/src/ts/shaders/bar.frag.glsl +25 -0
- package/src/ts/shaders/bar.vert.glsl +60 -0
- package/src/ts/shaders/candlestick-body.frag.glsl +19 -0
- package/src/ts/shaders/candlestick-body.vert.glsl +34 -0
- package/src/ts/shaders/density-extreme.frag.glsl +30 -0
- package/src/ts/shaders/density-mrt.frag.glsl +44 -0
- package/src/ts/shaders/density-mrt.vert.glsl +48 -0
- package/src/ts/shaders/density-resolve.frag.glsl +89 -0
- package/src/ts/shaders/density-resolve.vert.glsl +23 -0
- package/src/ts/shaders/density-splat.frag.glsl +34 -0
- package/src/ts/shaders/density-splat.vert.glsl +52 -0
- package/src/ts/shaders/gridline.frag.glsl +18 -0
- package/src/ts/shaders/gridline.vert.glsl +18 -0
- package/src/ts/shaders/heatmap.frag.glsl +23 -0
- package/src/ts/shaders/heatmap.vert.glsl +42 -0
- package/src/ts/shaders/line-uniform.frag.glsl +26 -0
- package/src/ts/shaders/line-uniform.vert.glsl +54 -0
- package/src/ts/shaders/line.frag.glsl +28 -0
- package/src/ts/shaders/line.vert.glsl +87 -0
- package/src/ts/shaders/scatter.frag.glsl +39 -0
- package/src/ts/shaders/scatter.vert.glsl +67 -0
- package/src/ts/shaders/sunburst-arc.frag.glsl +19 -0
- package/src/ts/shaders/sunburst-arc.vert.glsl +79 -0
- package/src/ts/shaders/tile.frag.glsl +27 -0
- package/src/ts/shaders/tile.vert.glsl +35 -0
- package/src/ts/shaders/treemap.frag.glsl +19 -0
- package/src/ts/shaders/treemap.vert.glsl +25 -0
- package/src/ts/shaders/y-scatter.frag.glsl +30 -0
- package/src/ts/shaders/y-scatter.vert.glsl +31 -0
- package/src/ts/theme/gradient.ts +312 -0
- package/src/ts/theme/palette.ts +64 -0
- package/src/ts/theme/theme-snapshot.ts +66 -0
- package/src/ts/theme/theme.ts +166 -0
- package/src/ts/transport/protocol.ts +497 -0
- package/src/ts/transport/renderer-transport.ts +788 -0
- package/src/ts/utils/css.ts +36 -0
- package/src/ts/utils/font-snapshot.ts +159 -0
- package/src/ts/webgl/buffer-pool.ts +163 -0
- package/src/ts/webgl/context-manager.ts +414 -0
- package/src/ts/webgl/gradient-texture.ts +84 -0
- package/src/ts/webgl/instanced-attrs.ts +139 -0
- package/src/ts/webgl/plot-frame.ts +91 -0
- package/src/ts/webgl/program-cache.ts +46 -0
- package/src/ts/webgl/shader-manifest.ts +148 -0
- package/src/ts/webgl/shader-registry.ts +97 -0
- package/src/ts/worker/boot.ts +22 -0
- package/src/ts/worker/dispatch.ts +99 -0
- package/src/ts/worker/font-loader.ts +89 -0
- package/src/ts/worker/renderer.worker.ts +734 -0
- package/src/ts/worker/session-host.ts +118 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { WebGLContextManager } from "../../../webgl/context-manager";
|
|
2
|
+
import type { CandlestickChart } from "../candlestick";
|
|
3
|
+
type GL = WebGL2RenderingContext | WebGLRenderingContext;
|
|
4
|
+
/**
|
|
5
|
+
* OHLC bar glyph. Owns the OHLC program + per-color persistent segment
|
|
6
|
+
* buffers built per data load. Co-tenanted with `BodyWickGlyph` on
|
|
7
|
+
* `CandlestickChart`; only one of the two is active per frame depending
|
|
8
|
+
* on `_defaultChartType`.
|
|
9
|
+
*/
|
|
10
|
+
export declare class OHLCGlyph {
|
|
11
|
+
private _program;
|
|
12
|
+
private _buffers;
|
|
13
|
+
private ensureProgram;
|
|
14
|
+
/**
|
|
15
|
+
* Drop persistent OHLC vertex buffers. Called from data-load (before
|
|
16
|
+
* `rebuildBuffers`) and from chart-destroy paths.
|
|
17
|
+
*/
|
|
18
|
+
invalidateBuffers(chart: CandlestickChart): void;
|
|
19
|
+
/**
|
|
20
|
+
* Pre-build the per-group OHLC instance buffers. Each candle emits 3
|
|
21
|
+
* line segments (H–L, open tick, close tick); layout per instance is
|
|
22
|
+
* `[start.x, start.y, end.x, end.y]`. Single GPU upload per group per
|
|
23
|
+
* data load.
|
|
24
|
+
*/
|
|
25
|
+
rebuildBuffers(chart: CandlestickChart, glManager: WebGLContextManager): void;
|
|
26
|
+
/**
|
|
27
|
+
* Bind the persistent up/down OHLC buffers and dispatch one instanced
|
|
28
|
+
* draw per color group.
|
|
29
|
+
*/
|
|
30
|
+
draw(chart: CandlestickChart, gl: GL, glManager: WebGLContextManager, projection: Float32Array): void;
|
|
31
|
+
destroy(chart: CandlestickChart): void;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Either flavor of 2D canvas the chart code may paint to. The chart's
|
|
3
|
+
* gridline and chrome canvases are `OffscreenCanvas` once the Host
|
|
4
|
+
* transfers rendering control to the Renderer (which it does in
|
|
5
|
+
* `LocalTransport` to validate that the chart code is DOM-free for
|
|
6
|
+
* worker mode). The GL canvas is also `HTMLCanvasElement | OffscreenCanvas`
|
|
7
|
+
* via WebGL's `gl.canvas`.
|
|
8
|
+
*/
|
|
9
|
+
export type Canvas2D = HTMLCanvasElement | OffscreenCanvas;
|
|
10
|
+
/**
|
|
11
|
+
* 2D rendering context for either canvas flavor. The `OffscreenCanvas`
|
|
12
|
+
* variant is missing only `getContextAttributes` and `drawFocusIfNeeded` —
|
|
13
|
+
* neither used by the chart render paths.
|
|
14
|
+
*/
|
|
15
|
+
export type Context2D = CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ColumnDataMap } from "../../data/view-reader";
|
|
2
|
+
import type { WebGLContextManager } from "../../webgl/context-manager";
|
|
3
|
+
import type { CartesianChart } from "./cartesian";
|
|
4
|
+
/**
|
|
5
|
+
* First-chunk init: compile the glyph program, reset data extents,
|
|
6
|
+
* resolve column roles and split groups, pre-allocate CPU + GPU buffers.
|
|
7
|
+
*/
|
|
8
|
+
export declare function initCartesianPipeline(chart: CartesianChart, glManager: WebGLContextManager, columns: ColumnDataMap, endRow: number): void;
|
|
9
|
+
/**
|
|
10
|
+
* Process one data chunk: extract positions + optional color/size per
|
|
11
|
+
* point, extend extents, write into per-series slots, capture tooltip
|
|
12
|
+
* data, and let the glyph upload its own GPU attribute buffers.
|
|
13
|
+
*/
|
|
14
|
+
export declare function processCartesianChunk(chart: CartesianChart, glManager: WebGLContextManager, columns: ColumnDataMap, startRow: number, chunkLength: number, endRow: number): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CartesianChart } from "./cartesian";
|
|
2
|
+
/**
|
|
3
|
+
* Update {@link CartesianChart._hoveredIndex} for the given mouse
|
|
4
|
+
* position. Triggers a chrome re-render if the hovered index changes.
|
|
5
|
+
*
|
|
6
|
+
* In faceted mode, the hit test first resolves which facet the mouse is
|
|
7
|
+
* over, then restricts the search to that facet's series slice. This
|
|
8
|
+
* makes hover local to a facet; coordinated ghost indicators in other
|
|
9
|
+
* facets are painted by the chrome overlay.
|
|
10
|
+
*/
|
|
11
|
+
export declare function handleCartesianHover(chart: CartesianChart, mx: number, my: number): void;
|
|
12
|
+
/**
|
|
13
|
+
* Show a sticky (pinned) tooltip at the given point, anchored to the
|
|
14
|
+
* GL canvas's parent via the tooltip controller.
|
|
15
|
+
*
|
|
16
|
+
* In faceted mode, resolves the source facet from `pointIdx` and uses
|
|
17
|
+
* that cell's layout so the tooltip anchors to the correct sub-plot.
|
|
18
|
+
*/
|
|
19
|
+
export declare function showCartesianPinnedTooltip(chart: CartesianChart, pointIdx: number): void;
|
|
20
|
+
export declare function dismissCartesianPinnedTooltip(chart: CartesianChart): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { WebGLContextManager } from "../../webgl/context-manager";
|
|
2
|
+
import type { CartesianChart } from "./cartesian";
|
|
3
|
+
/**
|
|
4
|
+
* Full-frame render: gridlines → glyph draw inside the plot-frame
|
|
5
|
+
* scissor → chrome overlay (axes + legend + tooltip).
|
|
6
|
+
*
|
|
7
|
+
* Branches on `_facetConfig.facet_mode`:
|
|
8
|
+
*
|
|
9
|
+
* - `"overlay"` (legacy): a single plot rect; all split series are
|
|
10
|
+
* drawn together, distinguished by color. This is the pre-facet
|
|
11
|
+
* behavior, preserved for manual opt-in via `plugin_config.facet_mode`.
|
|
12
|
+
* - `"grid"` (default): when splits are present, `_splitGroups` laid
|
|
13
|
+
* out as a grid of sub-plots by {@link buildFacetGrid}. When splits
|
|
14
|
+
* are absent, falls through to the single-plot path — identical to
|
|
15
|
+
* the `"overlay"` case with 0 splits, so the non-split render path
|
|
16
|
+
* is byte-for-byte unchanged from before this feature.
|
|
17
|
+
*/
|
|
18
|
+
export declare function renderCartesianFrame(chart: CartesianChart, glManager: WebGLContextManager): void;
|
|
19
|
+
/**
|
|
20
|
+
* Redraw the chrome canvas only. Used for lightweight hover updates.
|
|
21
|
+
*/
|
|
22
|
+
export declare function renderCartesianChromeOverlay(chart: CartesianChart): void;
|
|
23
|
+
/**
|
|
24
|
+
* Map a flat slotted index back to its series (facet) index.
|
|
25
|
+
*/
|
|
26
|
+
export declare function seriesFromIndex(chart: CartesianChart, flatIdx: number): number;
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import type { ColumnDataMap } from "../../data/view-reader";
|
|
2
|
+
import type { WebGLContextManager } from "../../webgl/context-manager";
|
|
3
|
+
import { AbstractChart } from "../chart-base";
|
|
4
|
+
import { SpatialHitTester } from "../../interaction/hit-test";
|
|
5
|
+
import { PlotLayout } from "../../layout/plot-layout";
|
|
6
|
+
import { type AxisDomain } from "../../axis/numeric-axis";
|
|
7
|
+
import type { GradientTextureCache } from "../../webgl/gradient-texture";
|
|
8
|
+
import type { Glyph } from "./glyph";
|
|
9
|
+
import type { LabelInterner } from "./label-interner";
|
|
10
|
+
import { LazyTooltip } from "../../interaction/lazy-tooltip";
|
|
11
|
+
export interface SplitGroup {
|
|
12
|
+
prefix: string;
|
|
13
|
+
xColName: string;
|
|
14
|
+
yColName: string;
|
|
15
|
+
colorColName: string;
|
|
16
|
+
sizeColName: string;
|
|
17
|
+
labelColName: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Unified continuous (numeric X/Y) chart. Glyphs plug in to render
|
|
21
|
+
* points, lines, or (future) areas over the shared data pipeline:
|
|
22
|
+
* streaming chunk upload, per-series slotted buffer layout, pan/zoom,
|
|
23
|
+
* spatial hit testing, chrome overlay, tooltip controller.
|
|
24
|
+
*
|
|
25
|
+
* Fields are package-internal (no `private`) so the split helper
|
|
26
|
+
* modules and glyphs can read/write them.
|
|
27
|
+
*/
|
|
28
|
+
export declare class CartesianChart extends AbstractChart {
|
|
29
|
+
readonly glyph: Glyph;
|
|
30
|
+
constructor(glyph: Glyph);
|
|
31
|
+
/**
|
|
32
|
+
* Rendering pipeline selector. `"cartesian"` is the default —
|
|
33
|
+
* draws axes, gridlines, and ticks via the chrome canvas.
|
|
34
|
+
* `"map"` (set by `MapChart` subclasses) suppresses cartesian
|
|
35
|
+
* chrome and inserts a raster tile layer underneath the glyph
|
|
36
|
+
* draw in `_fullRender`, so the same glyphs (point / line /
|
|
37
|
+
* density) render on top of a basemap.
|
|
38
|
+
*
|
|
39
|
+
* Read in `cartesian-render.ts` at three branch points; the
|
|
40
|
+
* `"cartesian"` path is byte-for-byte unchanged by the addition
|
|
41
|
+
* of this enum.
|
|
42
|
+
*/
|
|
43
|
+
_renderMode: "cartesian" | "map";
|
|
44
|
+
/**
|
|
45
|
+
* Per-point data-space projection hook. Default is identity; map
|
|
46
|
+
* subclasses override to map (lon, lat) → Mercator meters. Called
|
|
47
|
+
* from `processCartesianChunk` immediately after the NaN guard,
|
|
48
|
+
* before extent accumulation and the `_xData` / `_yData` slot
|
|
49
|
+
* writes — so every downstream consumer (axis domain, projection
|
|
50
|
+
* matrix, spatial hit-test, glyph buffers) sees projected space
|
|
51
|
+
* uniformly. Returning `[NaN, NaN]` from a subclass discards the
|
|
52
|
+
* row (e.g. Mercator's ±85° latitude clamp).
|
|
53
|
+
*/
|
|
54
|
+
projectPoint(x: number, y: number): [number, number];
|
|
55
|
+
/**
|
|
56
|
+
* Paint a per-frame background inside the plot-frame scissor,
|
|
57
|
+
* before the glyph draw. Map subclasses override to render the
|
|
58
|
+
* raster tile basemap; the default no-op leaves cartesian charts
|
|
59
|
+
* byte-for-byte unchanged.
|
|
60
|
+
*
|
|
61
|
+
* Called once per facet in faceted mode (each call's `projection`
|
|
62
|
+
* and `domain` are that cell's), wrapped in the cell's scissor —
|
|
63
|
+
* just like `glyph.drawSeries`.
|
|
64
|
+
*
|
|
65
|
+
* `xOrigin` / `yOrigin` are the rebase origins the projection
|
|
66
|
+
* matrix bakes in (see `buildProjectionMatrix`). Glyphs ship
|
|
67
|
+
* pre-rebased positions, so the background pass must subtract
|
|
68
|
+
* them from absolute-domain coords (e.g. tile Mercator extents)
|
|
69
|
+
* before uploading vertex positions; otherwise the matrix
|
|
70
|
+
* over-corrects and the background lands off-screen by
|
|
71
|
+
* `sx * xOrigin` clip units.
|
|
72
|
+
*/
|
|
73
|
+
renderBackground(_glManager: import("../../webgl/context-manager").WebGLContextManager, _layout: import("../../layout/plot-layout").PlotLayout, _projection: Float32Array, _domain: {
|
|
74
|
+
xMin: number;
|
|
75
|
+
xMax: number;
|
|
76
|
+
yMin: number;
|
|
77
|
+
yMax: number;
|
|
78
|
+
}, _xOrigin: number, _yOrigin: number): void;
|
|
79
|
+
/**
|
|
80
|
+
* Paint chrome (attribution, scale bar) for map mode on top of the
|
|
81
|
+
* chrome canvas, in place of the cartesian axes/gridlines/legend.
|
|
82
|
+
* Called only when `_renderMode === "map"`. Default no-op so
|
|
83
|
+
* cartesian charts still go through `renderAxesChrome`.
|
|
84
|
+
*/
|
|
85
|
+
renderMapChrome(_canvas: import("../canvas-types").Canvas2D | null, _layout: import("../../layout/plot-layout").PlotLayout, _theme: import("../../theme/theme").Theme, _dpr: number): void;
|
|
86
|
+
_gradientCache: GradientTextureCache | null;
|
|
87
|
+
_xName: string;
|
|
88
|
+
_yName: string;
|
|
89
|
+
_xLabel: string;
|
|
90
|
+
_yLabel: string;
|
|
91
|
+
_xIsRowIndex: boolean;
|
|
92
|
+
_colorName: string;
|
|
93
|
+
_sizeName: string;
|
|
94
|
+
_labelName: string;
|
|
95
|
+
_colorIsString: boolean;
|
|
96
|
+
_splitGroups: SplitGroup[];
|
|
97
|
+
_xMin: number;
|
|
98
|
+
_xMax: number;
|
|
99
|
+
_yMin: number;
|
|
100
|
+
_yMax: number;
|
|
101
|
+
/**
|
|
102
|
+
* Origin used to rebase x values before f32 narrowing. With datetime
|
|
103
|
+
* x columns the absolute timestamp is ~1.7e12, beyond f32 precision;
|
|
104
|
+
* storing `(x - _xOrigin)` keeps sub-millisecond fidelity in the
|
|
105
|
+
* `_xData` mirror, the GPU position attribute, and the projection
|
|
106
|
+
* matrix's `tx` term, avoiding the catastrophic cancellation that
|
|
107
|
+
* would otherwise push points outside the clip volume. NaN until
|
|
108
|
+
* the first valid x sample is observed.
|
|
109
|
+
*/
|
|
110
|
+
_xOrigin: number;
|
|
111
|
+
_yOrigin: number;
|
|
112
|
+
_colorMin: number;
|
|
113
|
+
_colorMax: number;
|
|
114
|
+
_sizeMin: number;
|
|
115
|
+
_sizeMax: number;
|
|
116
|
+
/**
|
|
117
|
+
* `domain_mode: "expand"` accumulators. The build pipeline seeds
|
|
118
|
+
* `_xMin/_xMax/_yMin/_yMax/_colorMin/_colorMax/_sizeMin/_sizeMax`
|
|
119
|
+
* from these instead of `±Infinity` when expand mode is active, so
|
|
120
|
+
* the per-row scan naturally unions new data into the running
|
|
121
|
+
* extent. Mirrored back from the live fields at the end of every
|
|
122
|
+
* `processCartesianChunk` so multi-chunk uploads accumulate into
|
|
123
|
+
* the same union. Cleared via `resetExpandedDomain` (called from
|
|
124
|
+
* the worker's `resetAllZooms` and the view-config setters on
|
|
125
|
+
* `AbstractChart`).
|
|
126
|
+
*/
|
|
127
|
+
_expandedXMin: number;
|
|
128
|
+
_expandedXMax: number;
|
|
129
|
+
_expandedYMin: number;
|
|
130
|
+
_expandedYMax: number;
|
|
131
|
+
_expandedColorMin: number;
|
|
132
|
+
_expandedColorMax: number;
|
|
133
|
+
_expandedSizeMin: number;
|
|
134
|
+
_expandedSizeMax: number;
|
|
135
|
+
_seriesCapacity: number;
|
|
136
|
+
_seriesUploadedCounts: number[];
|
|
137
|
+
_maxSeriesUploaded: number;
|
|
138
|
+
_xData: Float32Array | null;
|
|
139
|
+
_yData: Float32Array | null;
|
|
140
|
+
_colorData: Float32Array | null;
|
|
141
|
+
/**
|
|
142
|
+
* Source view row index for each slot in `_xData` / `_yData`,
|
|
143
|
+
* sized and laid out identically. Split expansion duplicates the
|
|
144
|
+
* same arrow source row across every series; this sidecar stores
|
|
145
|
+
* that source index so lazy tooltip fetches can retrieve the
|
|
146
|
+
* original row. Int32 for compactness — at 1M points this is
|
|
147
|
+
* ~4 MB, a small fraction of the ~70 MB that the prior eager
|
|
148
|
+
* row-data buffers cost.
|
|
149
|
+
*/
|
|
150
|
+
_rowIndexData: Int32Array | null;
|
|
151
|
+
/**
|
|
152
|
+
* Slot-indexed string store for the scatter "Label" column. `null`
|
|
153
|
+
* when no label column was wired. See {@link LabelInterner} — the
|
|
154
|
+
* three formerly-separate label fields (`_labelData`,
|
|
155
|
+
* `_labelDictionary`, `_labelDictMap`) live there as one unit, so
|
|
156
|
+
* future label-related state stays cohesive instead of accreting
|
|
157
|
+
* sibling fields on the chart.
|
|
158
|
+
*/
|
|
159
|
+
_labels: LabelInterner | null;
|
|
160
|
+
_dataCount: number;
|
|
161
|
+
_uniqueColorLabels: Map<string, number>;
|
|
162
|
+
/**
|
|
163
|
+
* Lazy-tooltip cache. `lines` is `null` until the async row fetch
|
|
164
|
+
* resolves — the chrome overlay skips the tooltip text box in
|
|
165
|
+
* that state but still paints the crosshair + highlight ring
|
|
166
|
+
* from geometry data so the hover cue is immediate. The
|
|
167
|
+
* controller owns the serial dance that drops stale resolves
|
|
168
|
+
* when the user moves before the fetch returns. Target type is
|
|
169
|
+
* the flat slot index of the hovered point.
|
|
170
|
+
*/
|
|
171
|
+
_lazyTooltip: LazyTooltip<number>;
|
|
172
|
+
_stagingPositions: Float32Array | null;
|
|
173
|
+
_stagingColors: Float32Array | null;
|
|
174
|
+
_stagingSizes: Float32Array | null;
|
|
175
|
+
_stagingChunkSize: number;
|
|
176
|
+
_hitTest: SpatialHitTester;
|
|
177
|
+
_lastLayout: PlotLayout | null;
|
|
178
|
+
_hoveredIndex: number;
|
|
179
|
+
_pinnedIndex: number;
|
|
180
|
+
/**
|
|
181
|
+
* Source facet for the current hover (`-1` when not over any facet).
|
|
182
|
+
* Drives coordinated hover indicator painting in other facets.
|
|
183
|
+
*/
|
|
184
|
+
_hoveredFacet: number;
|
|
185
|
+
_facetGrid: import("../../layout/facet-grid").FacetGrid | null;
|
|
186
|
+
_lastXDomain: AxisDomain | null;
|
|
187
|
+
_lastYDomain: AxisDomain | null;
|
|
188
|
+
_lastXTicks: number[] | null;
|
|
189
|
+
_lastYTicks: number[] | null;
|
|
190
|
+
_lastGradientStops: import("../../theme/gradient").GradientStop[] | null;
|
|
191
|
+
_lastHasColorCol: boolean;
|
|
192
|
+
_lastLutStops: import("../../theme/gradient").GradientStop[] | null;
|
|
193
|
+
_lastLutSeriesPalette: [number, number, number][] | null;
|
|
194
|
+
_lastLutLabelCount: number;
|
|
195
|
+
protected tooltipCallbacks(): {
|
|
196
|
+
onHover: (mx: number, my: number) => void;
|
|
197
|
+
onLeave: () => void;
|
|
198
|
+
onPin: (mx: number, my: number) => void;
|
|
199
|
+
onUnpin: () => void;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Resolve a clicked cartesian point into a `PerspectiveClickDetail`
|
|
203
|
+
* and emit both `perspective-click` and
|
|
204
|
+
* `perspective-global-filter selected:true`.
|
|
205
|
+
*
|
|
206
|
+
* Cartesian charts don't use `group_by` for positioning; X and Y
|
|
207
|
+
* come from explicit user-selected columns. The only filter clause
|
|
208
|
+
* we can build is the split-by prefix (when present). The source
|
|
209
|
+
* row index is the chart's per-point `_rowIndexData[flatIdx]`
|
|
210
|
+
* mirror — same lookup the lazy tooltip uses.
|
|
211
|
+
*/
|
|
212
|
+
private _emitCartesianClickSelect;
|
|
213
|
+
uploadAndRender(glManager: WebGLContextManager, columns: ColumnDataMap, startRow: number, endRow: number): Promise<void>;
|
|
214
|
+
resetExpandedDomain(): void;
|
|
215
|
+
_fullRender(glManager: WebGLContextManager): void;
|
|
216
|
+
protected destroyInternal(): void;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* X/Y Scatter — continuous chart with the point glyph.
|
|
220
|
+
*/
|
|
221
|
+
export declare class ScatterChart extends CartesianChart {
|
|
222
|
+
constructor();
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* X/Y Line — continuous chart with the line glyph.
|
|
226
|
+
*/
|
|
227
|
+
export declare class LineChart extends CartesianChart {
|
|
228
|
+
constructor();
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Density — continuous chart that rasterizes each row as an
|
|
232
|
+
* additive radial splat, producing a density field over the plot rect.
|
|
233
|
+
* Shares the cartesian pipeline (build, hit-test, zoom, facets,
|
|
234
|
+
* tooltips); the glyph swaps the per-point glyph for the heat
|
|
235
|
+
* accumulation + resolve pair.
|
|
236
|
+
*/
|
|
237
|
+
export declare class DensityChart extends CartesianChart {
|
|
238
|
+
constructor();
|
|
239
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { WebGLContextManager } from "../../webgl/context-manager";
|
|
2
|
+
import type { CartesianChart } from "./cartesian";
|
|
3
|
+
/**
|
|
4
|
+
* A Glyph is a pluggable renderer for a {@link CartesianChart}. The
|
|
5
|
+
* chart owns all data and shared pipeline (init, chunk processing, hover,
|
|
6
|
+
* chrome, tooltip plumbing); the glyph owns its shader program, draw
|
|
7
|
+
* call, and per-glyph tooltip lines.
|
|
8
|
+
*/
|
|
9
|
+
export interface Glyph {
|
|
10
|
+
/**
|
|
11
|
+
* `"point"` for scatter-style markers; `"line"` for polylines;
|
|
12
|
+
* `"density"` for the density-field shader glyph.
|
|
13
|
+
*/
|
|
14
|
+
readonly name: "point" | "line" | "density";
|
|
15
|
+
/**
|
|
16
|
+
* Compile the program + cache attrib/uniform locations on first
|
|
17
|
+
* frame. Subsequent frames are a no-op.
|
|
18
|
+
*/
|
|
19
|
+
ensureProgram(chart: CartesianChart, glManager: WebGLContextManager): void;
|
|
20
|
+
/**
|
|
21
|
+
* Issue the draw call(s) for this glyph's visible geometry.
|
|
22
|
+
*/
|
|
23
|
+
draw(chart: CartesianChart, glManager: WebGLContextManager, projection: Float32Array): void;
|
|
24
|
+
/**
|
|
25
|
+
* Issue draw calls for a single series' slice only. Used by
|
|
26
|
+
* faceted rendering: one facet per split, each facet's scissor
|
|
27
|
+
* clips to its plot rect and only that series rasterizes inside.
|
|
28
|
+
*
|
|
29
|
+
* Implementations should bind uniforms/buffers once (same as
|
|
30
|
+
* `draw`) and dispatch only the drawArrays call(s) for
|
|
31
|
+
* `seriesIdx`.
|
|
32
|
+
*/
|
|
33
|
+
drawSeries(chart: CartesianChart, glManager: WebGLContextManager, projection: Float32Array, seriesIdx: number): void;
|
|
34
|
+
/**
|
|
35
|
+
* Per-hover tooltip content for the point at `flatIdx`. Returns a
|
|
36
|
+
* Promise because some glyphs (notably `PointGlyph`) need to fetch
|
|
37
|
+
* the source row from the view on demand for extra-column lookups.
|
|
38
|
+
* Glyphs whose tooltip is geometry-only (e.g. `LineGlyph`) return
|
|
39
|
+
* a microtask-resolved promise.
|
|
40
|
+
*/
|
|
41
|
+
buildTooltipLines(chart: CartesianChart, flatIdx: number): Promise<string[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Hover-overlay options (crosshair, highlight radius).
|
|
44
|
+
*/
|
|
45
|
+
tooltipOptions(): {
|
|
46
|
+
crosshair: boolean;
|
|
47
|
+
highlightRadius: number;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Release GL resources created by `ensureProgram`.
|
|
51
|
+
*/
|
|
52
|
+
destroy(chart: CartesianChart): void;
|
|
53
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import type { WebGLContextManager } from "../../../webgl/context-manager";
|
|
2
|
+
import type { CartesianChart } from "../cartesian";
|
|
3
|
+
import type { Glyph } from "../glyph";
|
|
4
|
+
/**
|
|
5
|
+
* Density-field glyph. Each cartesian row is rasterized as an additive
|
|
6
|
+
* radial splat into an RGBA float FBO; a fullscreen pass resolves the
|
|
7
|
+
* accumulated density (and optional color-weighted average) through the
|
|
8
|
+
* chart's gradient LUT and composites the result inside the plot rect.
|
|
9
|
+
*
|
|
10
|
+
* The user-facing `gradient_color_mode` plugin field selects between:
|
|
11
|
+
*
|
|
12
|
+
* - `density` — alpha and hue from density alone.
|
|
13
|
+
* - `mean` — density-weighted average of color-t (default).
|
|
14
|
+
* - `extreme` — sign-aware MAX of per-point color deviation. Requires
|
|
15
|
+
* a second accumulation target; uses `OES_draw_buffers_indexed`
|
|
16
|
+
* MRT in one pass when available, otherwise falls back to two
|
|
17
|
+
* sequential splat passes.
|
|
18
|
+
* - `signed` — net positive vs. negative accumulation via the
|
|
19
|
+
* `G - 0.5·R` identity. Requires a float-capable framebuffer; on
|
|
20
|
+
* `UNSIGNED_BYTE` fallback the glyph silently degrades to `mean`
|
|
21
|
+
* with a one-line console warning.
|
|
22
|
+
*/
|
|
23
|
+
export declare class DensityGlyph implements Glyph {
|
|
24
|
+
readonly name: "density";
|
|
25
|
+
private _cache;
|
|
26
|
+
ensureProgram(chart: CartesianChart, glManager: WebGLContextManager): void;
|
|
27
|
+
draw(chart: CartesianChart, glManager: WebGLContextManager, projection: Float32Array): void;
|
|
28
|
+
drawSeries(chart: CartesianChart, glManager: WebGLContextManager, projection: Float32Array, seriesIdx: number): void;
|
|
29
|
+
buildTooltipLines(chart: CartesianChart, flatIdx: number): Promise<string[]>;
|
|
30
|
+
tooltipOptions(): {
|
|
31
|
+
crosshair: boolean;
|
|
32
|
+
highlightRadius: number;
|
|
33
|
+
};
|
|
34
|
+
destroy(chart: CartesianChart): void;
|
|
35
|
+
/**
|
|
36
|
+
* Resize the heat (and, when allocated, extreme + MRT) targets to
|
|
37
|
+
* the current canvas bitmap size. The canvas backing store changes
|
|
38
|
+
* on DPR or layout updates, so we compare cached dimensions and
|
|
39
|
+
* re-allocate when stale.
|
|
40
|
+
*/
|
|
41
|
+
private ensureHeatTarget;
|
|
42
|
+
/**
|
|
43
|
+
* Re-allocate the storage for one accumulation texture using the
|
|
44
|
+
* cached format triple. Called both at first draw and on every
|
|
45
|
+
* canvas-size change.
|
|
46
|
+
*/
|
|
47
|
+
private allocAccumTexture;
|
|
48
|
+
/**
|
|
49
|
+
* Lazily allocate the extreme-mode accumulation texture + its
|
|
50
|
+
* framebuffers. Sized to match the heat target. Also probes
|
|
51
|
+
* `OES_draw_buffers_indexed` once per cache; if available, builds
|
|
52
|
+
* the MRT framebuffer with both textures attached.
|
|
53
|
+
*/
|
|
54
|
+
private ensureExtremeTarget;
|
|
55
|
+
/**
|
|
56
|
+
* Compile (and cache) the single-target extreme splat program — the
|
|
57
|
+
* fallback two-pass path's second pass. Reuses the splat vertex
|
|
58
|
+
* shader so `v_color_t` semantics match the heat pass.
|
|
59
|
+
*/
|
|
60
|
+
private ensureExtremeSplatProgram;
|
|
61
|
+
/**
|
|
62
|
+
* Compile (and cache) the MRT splat program. Only safe to call
|
|
63
|
+
* after `cache.indexedBlend` resolves truthy — the program's
|
|
64
|
+
* `#extension GL_EXT_draw_buffers : require` would fail to
|
|
65
|
+
* compile on contexts without multi-render-target support.
|
|
66
|
+
*/
|
|
67
|
+
private ensureMrtSplatProgram;
|
|
68
|
+
/**
|
|
69
|
+
* Resolve the active mode for this frame. Folds in the silent
|
|
70
|
+
* downgrades to `mean` with a one-shot console warning:
|
|
71
|
+
*
|
|
72
|
+
* - `signed` requires a float-capable framebuffer
|
|
73
|
+
* (`EXT_color_buffer_float` on WebGL2 in practice).
|
|
74
|
+
* - `extreme` requires `gl.MAX` blend and a second color
|
|
75
|
+
* attachment, both of which are WebGL2-only here. On WebGL1
|
|
76
|
+
* we could probe `EXT_blend_minmax` + `WEBGL_draw_buffers`
|
|
77
|
+
* but degrading is simpler and the context manager prefers
|
|
78
|
+
* WebGL2 already.
|
|
79
|
+
*/
|
|
80
|
+
private activeMode;
|
|
81
|
+
private warnDowngradeOnce;
|
|
82
|
+
/**
|
|
83
|
+
* Shared splat → resolve pipeline. `dispatchSplats(cb)` iterates
|
|
84
|
+
* the series ranges the caller wants drawn, invoking
|
|
85
|
+
* `cb(slotOffset, count)` per range — `drawSeries` passes a single
|
|
86
|
+
* range, `draw` iterates every series. Internally branches on the
|
|
87
|
+
* active color mode: density/mean/signed share the single-target
|
|
88
|
+
* heat-only pass, `extreme` runs either an MRT single-pass or two
|
|
89
|
+
* sequential passes depending on extension support.
|
|
90
|
+
*/
|
|
91
|
+
private runSplatAndResolve;
|
|
92
|
+
/**
|
|
93
|
+
* Single-target accumulation into the heat FBO. ADD blend; writes
|
|
94
|
+
* `(w, w·t, 0, 0)`. Used by every mode except `extreme` on the
|
|
95
|
+
* MRT path (which does this work and the extreme pass in one go).
|
|
96
|
+
*/
|
|
97
|
+
private runHeatPass;
|
|
98
|
+
/**
|
|
99
|
+
* Second pass of the two-pass extreme path. MAX blend; writes
|
|
100
|
+
* sign-split deviation magnitudes into the extreme FBO. Skipped
|
|
101
|
+
* entirely on the MRT fast path.
|
|
102
|
+
*/
|
|
103
|
+
private runExtremePass;
|
|
104
|
+
/**
|
|
105
|
+
* MRT fast path: one splat draw writes density (ADD) and extreme
|
|
106
|
+
* (MAX) in the same invocation by routing `gl_FragData[0]` /
|
|
107
|
+
* `gl_FragData[1]` to attachments 0 and 1 with per-attachment
|
|
108
|
+
* blend equations.
|
|
109
|
+
*/
|
|
110
|
+
private runMrtExtremePass;
|
|
111
|
+
/**
|
|
112
|
+
* Clear the currently bound framebuffer's color attachment(s) to
|
|
113
|
+
* fully transparent, bypassing scissor so leftovers from a prior
|
|
114
|
+
* facet's region don't bleed into this pass's full sample range.
|
|
115
|
+
* Restores the scissor state on exit.
|
|
116
|
+
*/
|
|
117
|
+
private clearTarget;
|
|
118
|
+
/**
|
|
119
|
+
* Upload the per-frame splat-program uniforms (projection, splat
|
|
120
|
+
* radius, intensity, color range). Shared by the heat-only pass,
|
|
121
|
+
* the extreme single-target pass, and the MRT pass since each
|
|
122
|
+
* program exposes the same uniform layout.
|
|
123
|
+
*/
|
|
124
|
+
private bindSplatProgram;
|
|
125
|
+
/**
|
|
126
|
+
* Bind the static unit-quad corner buffer (divisor 0) and per-
|
|
127
|
+
* instance position + color attributes (divisor 1), then iterate
|
|
128
|
+
* the caller's series ranges issuing one instanced draw each.
|
|
129
|
+
*/
|
|
130
|
+
private bindAndDispatchInstanced;
|
|
131
|
+
/**
|
|
132
|
+
* Reset the per-instance divisors so subsequent draws (in this or
|
|
133
|
+
* another chart) don't inherit the instanced bindings.
|
|
134
|
+
*/
|
|
135
|
+
private unbindSplatInstancing;
|
|
136
|
+
/**
|
|
137
|
+
* Resolve pass on the canvas FBO. Standard alpha composite. Reads
|
|
138
|
+
* the heat FBO (always) and, in `extreme` mode, the extreme FBO.
|
|
139
|
+
* Uploads the mode int that the resolve frag branches on.
|
|
140
|
+
*/
|
|
141
|
+
private runResolvePass;
|
|
142
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { WebGLContextManager } from "../../../webgl/context-manager";
|
|
2
|
+
import type { CartesianChart } from "../cartesian";
|
|
3
|
+
import type { Glyph } from "../glyph";
|
|
4
|
+
/**
|
|
5
|
+
* Polyline glyph — instanced triangle-strip segments between adjacent
|
|
6
|
+
* same-series points. Segments are scoped per-series via byte-offset
|
|
7
|
+
* rebinding (see `drawLineSeries`); the shader reads the endpoints'
|
|
8
|
+
* raw color values and samples the gradient LUT via the same sign-
|
|
9
|
+
* aware `(v - cmin) / (cmax - cmin)` mapping the scatter glyph uses.
|
|
10
|
+
*/
|
|
11
|
+
export declare class LineGlyph implements Glyph {
|
|
12
|
+
readonly name: "line";
|
|
13
|
+
private _cache;
|
|
14
|
+
ensureProgram(_chart: CartesianChart, glManager: WebGLContextManager): void;
|
|
15
|
+
draw(chart: CartesianChart, glManager: WebGLContextManager, projection: Float32Array): void;
|
|
16
|
+
drawSeries(chart: CartesianChart, glManager: WebGLContextManager, projection: Float32Array, seriesIdx: number): void;
|
|
17
|
+
buildTooltipLines(chart: CartesianChart, flatIdx: number): Promise<string[]>;
|
|
18
|
+
tooltipOptions(): {
|
|
19
|
+
crosshair: boolean;
|
|
20
|
+
highlightRadius: number;
|
|
21
|
+
};
|
|
22
|
+
destroy(chart: CartesianChart): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { WebGLContextManager } from "../../../webgl/context-manager";
|
|
2
|
+
import type { CartesianChart } from "../cartesian";
|
|
3
|
+
import type { Glyph } from "../glyph";
|
|
4
|
+
/**
|
|
5
|
+
* `gl.POINTS` glyph — one squared/antialiased point per data row. Color
|
|
6
|
+
* and size are driven by the shared `a_color_value` / `a_size_value`
|
|
7
|
+
* buffers; the vertex shader does sign-aware color-t mapping and samples
|
|
8
|
+
* the gradient LUT. One draw call per series (the slot layout leaves
|
|
9
|
+
* gaps at each series' tail that we can't safely include in a single
|
|
10
|
+
* draw — dispatching `count[s]` per series skips them).
|
|
11
|
+
*/
|
|
12
|
+
export declare class PointGlyph implements Glyph {
|
|
13
|
+
readonly name: "point";
|
|
14
|
+
private _cache;
|
|
15
|
+
ensureProgram(_chart: CartesianChart, glManager: WebGLContextManager): void;
|
|
16
|
+
draw(chart: CartesianChart, glManager: WebGLContextManager, projection: Float32Array): void;
|
|
17
|
+
drawSeries(chart: CartesianChart, glManager: WebGLContextManager, projection: Float32Array, seriesIdx: number): void;
|
|
18
|
+
buildTooltipLines(chart: CartesianChart, flatIdx: number): Promise<string[]>;
|
|
19
|
+
tooltipOptions(): {
|
|
20
|
+
crosshair: boolean;
|
|
21
|
+
highlightRadius: number;
|
|
22
|
+
};
|
|
23
|
+
destroy(_chart: CartesianChart): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slot-indexed string store for the scatter "Label" column. Strings
|
|
3
|
+
* are deduplicated across split-by facets so identical labels share a
|
|
4
|
+
* dictionary entry; the per-slot `Int32Array` then holds dictionary
|
|
5
|
+
* indices (`-1` means "no label for this slot").
|
|
6
|
+
*/
|
|
7
|
+
export declare class LabelInterner {
|
|
8
|
+
readonly data: Int32Array;
|
|
9
|
+
readonly dictionary: string[];
|
|
10
|
+
private readonly dictMap;
|
|
11
|
+
constructor(capacity: number);
|
|
12
|
+
/**
|
|
13
|
+
* Insert (or look up) `label` and write its dictionary index into
|
|
14
|
+
* the slot at `flatIdx`. Returns the assigned dictionary index.
|
|
15
|
+
*/
|
|
16
|
+
set(flatIdx: number, label: string): number;
|
|
17
|
+
/**
|
|
18
|
+
* Resolve a slot's label string, or `null` if unset.
|
|
19
|
+
*/
|
|
20
|
+
get(flatIdx: number): string | null;
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CartesianChart } from "./cartesian";
|
|
2
|
+
/**
|
|
3
|
+
* Build the per-row tooltip for a point-style glyph (scatter, gradient
|
|
4
|
+
* heatmap). Resolves the source arrow row via the chart's lazy row
|
|
5
|
+
* fetcher, then surfaces every non-null column under the (split-aware)
|
|
6
|
+
* prefix filter formatted by column type.
|
|
7
|
+
*
|
|
8
|
+
* Returns `[]` when the chart has no row-index mirror or no fetcher;
|
|
9
|
+
* callers should fall back to a geometry-only tooltip in that case.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildPointRowTooltipLines(chart: CartesianChart, flatIdx: number): Promise<string[]>;
|