@perspective-dev/viewer-charts 5.0.0 → 5.1.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.
@@ -23,9 +23,14 @@ export declare class AreaGlyph {
23
23
  /**
24
24
  * Bind persistent strip buffers and dispatch one TRIANGLE_STRIP per
25
25
  * series-run. Skips hidden series. `splitFilter` (faceted frames)
26
- * draws only the series whose `splitIdx` matches.
26
+ * draws only the series whose `splitIdx` matches; `aggRange` (mixed
27
+ * glyph-run frames) only those whose `aggIdx` lies in the inclusive
28
+ * run span.
27
29
  */
28
- draw(chart: SeriesChart, gl: GL, _glManager: WebGLContextManager, projLeft: Float32Array, projRight: Float32Array, opacity: number, splitFilter?: number): void;
30
+ draw(chart: SeriesChart, gl: GL, _glManager: WebGLContextManager, projLeft: Float32Array, projRight: Float32Array, opacity: number, splitFilter?: number, aggRange?: {
31
+ start: number;
32
+ end: number;
33
+ }): void;
29
34
  destroy(chart: SeriesChart): void;
30
35
  }
31
36
  export {};
@@ -34,9 +34,14 @@ export declare class LineGlyph {
34
34
  * per series. Skips hidden series via `_hiddenSeries`. Gap /
35
35
  * transparency rendering is governed by `u_interp_alpha`, set per
36
36
  * series. `splitFilter` (faceted frames) draws only the series
37
- * whose `splitIdx` matches — one call per facet.
37
+ * whose `splitIdx` matches — one call per facet. `aggRange` (mixed
38
+ * glyph-run frames) draws only the series whose `aggIdx` lies in
39
+ * the inclusive run span.
38
40
  */
39
- draw(chart: SeriesChart, gl: GL, glManager: WebGLContextManager, projLeft: Float32Array, projRight: Float32Array, splitFilter?: number): void;
41
+ draw(chart: SeriesChart, gl: GL, glManager: WebGLContextManager, projLeft: Float32Array, projRight: Float32Array, splitFilter?: number, aggRange?: {
42
+ start: number;
43
+ end: number;
44
+ }): void;
40
45
  destroy(chart: SeriesChart): void;
41
46
  }
42
47
  export {};
@@ -26,11 +26,14 @@ export declare class ScatterGlyph {
26
26
  /**
27
27
  * Bind the persistent left/right buffers and issue up to two draw
28
28
  * calls. No per-frame allocations or buffer uploads. `splitFilter`
29
- * (faceted frames) instead draws each matching series' contiguous
30
- * bucket sub-range — one `drawArrays(POINTS, first, count)` per
31
- * series of the facet.
29
+ * (faceted frames) and/or `aggRange` (mixed glyph-run frames)
30
+ * instead draw each matching series' contiguous bucket sub-range —
31
+ * one `drawArrays(POINTS, first, count)` per matching series.
32
32
  */
33
- draw(chart: SeriesChart, gl: GL, glManager: WebGLContextManager, projLeft: Float32Array, projRight: Float32Array, splitFilter?: number): void;
33
+ draw(chart: SeriesChart, gl: GL, glManager: WebGLContextManager, projLeft: Float32Array, projRight: Float32Array, splitFilter?: number, aggRange?: {
34
+ start: number;
35
+ end: number;
36
+ }): void;
34
37
  destroy(chart: SeriesChart): void;
35
38
  }
36
39
  export {};
@@ -8,8 +8,9 @@ import { type SeriesChartRecord } from "./series-build";
8
8
  */
9
9
  export declare function getHoveredBar(chart: SeriesChart): SeriesChartRecord | null;
10
10
  /**
11
- * Handle mouse-move across all glyph types. Tests (in reverse paint order
12
- * so top glyphs win): scatter points → line points → bars → areas.
11
+ * Handle mouse-move across all glyph types. Tests glyph runs in reverse
12
+ * paint order so top glyphs win — paint order is the `columns`
13
+ * declaration order (see `_glyphRuns` / `drawGlyphRuns`).
13
14
  * Updates `_hoveredBarIdx` or `_hoveredSample` and re-renders on change.
14
15
  *
15
16
  * Faceted frames first resolve the cell under the cursor: that cell's
@@ -26,6 +26,15 @@ export interface SeriesAutoFitCache {
26
26
  rightMax: number;
27
27
  hasRight: boolean;
28
28
  }
29
+ /**
30
+ * One paint pass: the contiguous span of aggregates (`columns` indices,
31
+ * inclusive) sharing a glyph type. See {@link SeriesChart._glyphRuns}.
32
+ */
33
+ export interface GlyphRun {
34
+ chartType: SeriesInfo["chartType"];
35
+ aggStart: number;
36
+ aggEnd: number;
37
+ }
29
38
  export interface CachedLocations {
30
39
  u_proj_left: WebGLUniformLocation | null;
31
40
  u_proj_right: WebGLUniformLocation | null;
@@ -98,6 +107,35 @@ export declare class SeriesChart extends CategoricalYChart {
98
107
  start: number;
99
108
  count: number;
100
109
  }[] | null;
110
+ /**
111
+ * Paint order of the current build: consecutive aggregates sharing
112
+ * a glyph type, merged into runs, in `columns` declaration order
113
+ * (`aggIdx` ascending — later columns paint on top). The frame
114
+ * draws one pass per run; a homogeneous chart is a single run and
115
+ * degenerates to the legacy one-pass-per-type path. `aggEnd` is
116
+ * inclusive.
117
+ */
118
+ _glyphRuns: GlyphRun[];
119
+ /**
120
+ * Per-aggregate contiguous instance ranges in the uploaded bar
121
+ * buffers, indexed by `aggIdx` — the overlay-mode counterpart of
122
+ * `_facetBarRanges`, populated by `uploadBarInstances`' aggregate
123
+ * counting sort. `null` until first upload.
124
+ */
125
+ _barAggRanges: {
126
+ start: number;
127
+ count: number;
128
+ }[] | null;
129
+ /**
130
+ * Faceted per-(split, aggregate) instance ranges,
131
+ * `[splitIdx][aggIdx]` — instances are emitted split-major then
132
+ * aggregate-ordered, so a facet's glyph-run slice is contiguous.
133
+ * `null` in overlay mode.
134
+ */
135
+ _facetBarAggRanges: {
136
+ start: number;
137
+ count: number;
138
+ }[][] | null;
101
139
  /**
102
140
  * Columnar bar/area record storage. Indexed by bar slot in
103
141
  * `[0, _bars.count)`. Replaces the legacy `SeriesChartRecord[]` to
@@ -197,6 +235,19 @@ export declare class SeriesChart extends CategoricalYChart {
197
235
  min: number;
198
236
  max: number;
199
237
  } | null;
238
+ /**
239
+ * The axis partition (per-aggregate axis side) the expand
240
+ * accumulators were accumulated under. An accumulator is only
241
+ * meaningful for the partition that produced it: when an aggregate
242
+ * moves sides (`columns_config.alt_axis` pin via a config-only
243
+ * `update()`, or a data-driven `auto_alt_y_axis` flip), the side it
244
+ * LEFT would otherwise retain its extent forever — the departed
245
+ * column's range never leaves the primary axis. A signature
246
+ * mismatch resets BOTH accumulators before the union. Keyed per
247
+ * AGGREGATE (not per series) so split-group growth on a streaming
248
+ * update never spuriously resets.
249
+ */
250
+ _expandedAxisSig: string | null;
200
251
  /**
201
252
  * Numeric category-axis state. Populated only when `group_by` has
202
253
  * exactly one level and that level is `date | datetime | integer |