blazeplot 0.1.12 → 0.2.1
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/README.md +43 -62
- package/dist/core/DataCursor.d.ts.map +1 -1
- package/dist/core/OhlcDataset.d.ts +51 -0
- package/dist/core/OhlcDataset.d.ts.map +1 -0
- package/dist/core/RingBuffer.d.ts +7 -1
- package/dist/core/RingBuffer.d.ts.map +1 -1
- package/dist/core/SeriesStore.d.ts +21 -6
- package/dist/core/SeriesStore.d.ts.map +1 -1
- package/dist/core/StaticDataset.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/search.d.ts +3 -0
- package/dist/core/search.d.ts.map +1 -0
- package/dist/core/types.d.ts +49 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +827 -341
- package/dist/index.js.map +1 -1
- package/dist/plugins/interactions.d.ts +1 -1
- package/dist/plugins/interactions.d.ts.map +1 -1
- package/dist/plugins/interactions.js +44 -41
- package/dist/plugins/interactions.js.map +1 -1
- package/dist/plugins/tooltip.js +31 -20
- package/dist/plugins/tooltip.js.map +1 -1
- package/dist/render/Renderer.d.ts +9 -3
- package/dist/render/Renderer.d.ts.map +1 -1
- package/dist/ui/AxisOverlay.d.ts +3 -1
- package/dist/ui/AxisOverlay.d.ts.map +1 -1
- package/dist/ui/Chart.d.ts +42 -16
- package/dist/ui/Chart.d.ts.map +1 -1
- package/dist/ui/ChartLayout.d.ts +6 -0
- package/dist/ui/ChartLayout.d.ts.map +1 -1
- package/dist/ui/Interactions.d.ts +2 -1
- package/dist/ui/Interactions.d.ts.map +1 -1
- package/dist/ui/Tooltip.d.ts +4 -1
- package/dist/ui/Tooltip.d.ts.map +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.d.ts.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
[](https://www.npmjs.com/package/blazeplot)
|
|
6
6
|
[](https://www.npmjs.com/package/blazeplot)
|
|
7
7
|
[](LICENSE)
|
|
8
|
-
[](https://github.com/Federicocervelli/blazeplot/actions)
|
|
9
8
|
|
|
10
9
|
Fast WebGL2 plotting engine for the browser 🔥
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
Built for people who have hit the performance ceiling of Chart.js, Plotly, and similar browser charting libraries. BlazePlot keeps the hot path GPU-native and the DOM minimal, so large streaming datasets stay interactive instead of turning into a slideshow.
|
|
12
|
+
|
|
13
|
+
Built on WebGL2 + [regl](https://github.com/regl-project/regl).
|
|
13
14
|
|
|
14
15
|
## Installation
|
|
15
16
|
|
|
@@ -21,35 +22,21 @@ bun install blazeplot
|
|
|
21
22
|
|
|
22
23
|
```html
|
|
23
24
|
<div id="chart" style="width:100%;height:400px"></div>
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
```js
|
|
27
|
-
import { Chart } from "blazeplot";
|
|
28
|
-
|
|
29
|
-
const container = document.getElementById("chart");
|
|
30
|
-
const chart = new Chart(container);
|
|
31
25
|
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
{ color: [0.3, 0.6, 1.0, 1.0] },
|
|
35
|
-
);
|
|
26
|
+
<script type="module">
|
|
27
|
+
import { Chart } from "blazeplot";
|
|
36
28
|
|
|
37
|
-
chart
|
|
38
|
-
chart.
|
|
29
|
+
const chart = new Chart(document.getElementById("chart"));
|
|
30
|
+
const wave = chart.addLine({ capacity: 10_000, downsample: "minmax" });
|
|
39
31
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
wave.append(
|
|
33
|
+
Float64Array.from({ length: 1000 }, (_, i) => i),
|
|
34
|
+
Float32Array.from({ length: 1000 }, (_, i) => Math.sin(i * 0.02)),
|
|
35
|
+
);
|
|
43
36
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
ys[i] = Math.sin(t * 0.01) * 0.5 + Math.random() * 0.01;
|
|
48
|
-
}
|
|
49
|
-
series.append(xs, ys);
|
|
50
|
-
requestAnimationFrame(push);
|
|
51
|
-
}
|
|
52
|
-
push();
|
|
37
|
+
chart.setViewport({ xMin: 0, xMax: 1000, yMin: -1.5, yMax: 1.5 });
|
|
38
|
+
chart.start();
|
|
39
|
+
</script>
|
|
53
40
|
```
|
|
54
41
|
|
|
55
42
|
## Features
|
|
@@ -75,12 +62,13 @@ push();
|
|
|
75
62
|
|---|---|
|
|
76
63
|
| `new Chart(container, options?)` | Create a chart inside an HTML container element. The chart owns the plot canvas and axis layout. |
|
|
77
64
|
| `chart.addSeries(config, style?)` | Add a data series. Returns `SeriesStore`. |
|
|
78
|
-
| `chart.addLine(config, style?)` / `addArea` / `addScatter` / `addBar` | Typed helpers that set the series mode for you. |
|
|
65
|
+
| `chart.addLine(config, style?)` / `addArea` / `addScatter` / `addBar` / `addOhlc` / `addCandlestick` | Typed helpers that set the series mode for you. `config.yAxis: "right"` maps a series to the secondary Y axis. |
|
|
79
66
|
| `chart.removeSeries(series)` | Remove a previously added series. |
|
|
80
|
-
| `chart.setViewport({ xMin, xMax, yMin, yMax })` | Set the visible data range. |
|
|
81
|
-
| `chart.
|
|
67
|
+
| `chart.setViewport({ xMin, xMax, yMin, yMax })` | Set the visible data range on both Y axes and the shared X range. |
|
|
68
|
+
| `chart.setYViewport("left" | "right", { yMin, yMax })` | Set one Y-axis viewport while preserving the shared X range. |
|
|
69
|
+
| `chart.getViewport(yAxis?)` | Return the current visible data range for `"left"` or `"right"` Y axis. |
|
|
82
70
|
| `chart.pan(intent)` / `chart.zoom(intent)` | Plugin-facing camera interaction helpers. |
|
|
83
|
-
| `chart.clientToData(clientX, clientY)` / `chart.dataToPlot(x, y)` | Convert between client/plot coordinates and data coordinates. |
|
|
71
|
+
| `chart.clientToData(clientX, clientY, yAxis?)` / `chart.dataToPlot(x, y, yAxis?)` | Convert between client/plot coordinates and data coordinates for the selected Y axis. |
|
|
84
72
|
| `chart.resize(dpr?)` | Resize the internal plot canvas to match its CSS size × DPR. |
|
|
85
73
|
| `chart.start()` | Start the render loop (rAF). |
|
|
86
74
|
| `chart.stop()` | Stop the render loop. |
|
|
@@ -90,7 +78,7 @@ push();
|
|
|
90
78
|
| `chart.getFrameStats(target?)` | Copy per-frame benchmark counters into a reusable object. |
|
|
91
79
|
| `chart.getSeriesState()` | Return public series metadata/state for plugins or custom UI. |
|
|
92
80
|
| `chart.setSeriesVisible(series, visible)` | Toggle visibility and notify series-state subscribers. |
|
|
93
|
-
| `chart.pick(clientX, clientY, options?)` | Raw-data hit test. Supports `"nearest-x"
|
|
81
|
+
| `chart.pick(clientX, clientY, options?)` | Raw-data hit test. Supports `mode: "nearest-x" | "nearest-point"`, `group: "x" | "none"`, and `maxDistancePx`; returned items include actual sample X/Y and plot/client coordinates for highlights. |
|
|
94
82
|
| `chart.subscribe("hover", cb)` / `chart.subscribe("serieschange", cb)` | Subscribe to hover or series state changes. Returns an unsubscribe function. |
|
|
95
83
|
| `await chart.screenshot(options?)` | Export the full chart as an image `Blob`, including the WebGL plot and built-in DOM text overlays. |
|
|
96
84
|
| `chart.dispose()` | Dispose GPU resources, observers, input handlers, and owned DOM layout. |
|
|
@@ -100,12 +88,12 @@ push();
|
|
|
100
88
|
| Property | Default | Description |
|
|
101
89
|
|---|---|---|
|
|
102
90
|
| `viewportPolicy?` | — | Optional `beforeRender` viewport hook. Pass the same policy to `interactionsPlugin({ viewportPolicy })` for pan/zoom hooks. |
|
|
103
|
-
| `hover?` | `{ mode: "nearest-x" }` | Default hover picking behavior. `mode` can be `"nearest-x"` or `"nearest-point"
|
|
91
|
+
| `hover?` | `{ mode: "nearest-x", group: "x" }` | Default hover picking behavior. `mode` can be `"nearest-x"` or `"nearest-point"`; `group: "x"` reports one item per visible series at the selected X, while `group: "none"` reports only the selected point. |
|
|
104
92
|
| `plugins?` | `[]` | Optional `ChartPlugin` instances, e.g. `legendPlugin()` and `tooltipPlugin()`. |
|
|
105
93
|
| `theme?` | built-in dark theme | Override chart, axis, palette, legend, and tooltip colors/fonts. |
|
|
106
94
|
| `grid?` | `true` | Show grid lines. |
|
|
107
95
|
| `gridStyle?` | `{ color: theme.gridColor }` | Grid line color and width; overrides the theme grid color. |
|
|
108
|
-
| `axes?` | `true` | Show axis tick labels. `true`/`false`, or per-axis `{ x?: boolean \| AxisConfig, y?: boolean \| AxisConfig }`. |
|
|
96
|
+
| `axes?` | `true` | Show axis tick labels. `true`/`false`, or per-axis `{ x?: boolean \| AxisConfig, y?: boolean \| AxisConfig, y2?: boolean \| AxisConfig }`. `y2` is the right-side secondary Y axis and is hidden by default. |
|
|
109
97
|
|
|
110
98
|
### `ChartTheme`
|
|
111
99
|
|
|
@@ -142,10 +130,14 @@ WebGL-facing colors (`backgroundColor`, `gridColor`, `seriesColors`) accept eith
|
|
|
142
130
|
| `position?` | `"inside"` | `"inside"` draws labels over the plot; `"outside"` reserves a real DOM gutter and shrinks the plot canvas. |
|
|
143
131
|
|
|
144
132
|
```ts
|
|
145
|
-
// X labels outside (bottom gutter), Y
|
|
146
|
-
new Chart(canvas, {
|
|
147
|
-
axes: { x: { position: "outside" }, y: true }
|
|
133
|
+
// X labels outside (bottom gutter), left Y inside, right Y outside.
|
|
134
|
+
const chart = new Chart(canvas, {
|
|
135
|
+
axes: { x: { position: "outside" }, y: true, y2: { position: "outside" } }
|
|
148
136
|
});
|
|
137
|
+
|
|
138
|
+
chart.addLine({ capacity: 10_000, yAxis: "left" });
|
|
139
|
+
chart.addLine({ capacity: 10_000, yAxis: "right" });
|
|
140
|
+
chart.setYViewport("right", { yMin: 0, yMax: 100 });
|
|
149
141
|
```
|
|
150
142
|
|
|
151
143
|
### `ChartFrameStats`
|
|
@@ -168,16 +160,16 @@ import { legendPlugin } from "blazeplot/plugins/legend";
|
|
|
168
160
|
import { tooltipPlugin } from "blazeplot/plugins/tooltip";
|
|
169
161
|
|
|
170
162
|
const chart = new Chart(container, {
|
|
171
|
-
hover: { mode: "nearest-x" },
|
|
163
|
+
hover: { mode: "nearest-x", group: "x" },
|
|
172
164
|
plugins: [
|
|
173
165
|
interactionsPlugin({ axis: "xy" }),
|
|
174
166
|
legendPlugin(),
|
|
175
|
-
tooltipPlugin({ mode: "nearest-point" }),
|
|
167
|
+
tooltipPlugin({ mode: "nearest-point", group: "none", maxDistancePx: 24 }),
|
|
176
168
|
],
|
|
177
169
|
});
|
|
178
170
|
```
|
|
179
171
|
|
|
180
|
-
Built-in plugins are optional. `interactionsPlugin()` provides plain-drag box zoom, Shift+drag plot pan, wheel zoom, double-click reset, and `axis: "x" | "y" | "xy"`. When outside axes are visible, scrolling an axis zooms that axis and dragging an axis pans that axis; the plugin also applies a subtle axis hover color/filter configurable with `axisHover`, `axisHoverColor`, and `axisHoverFilter`. Legend/tooltip consume public APIs (`getSeriesState`, `setSeriesVisible`, `pick`, and `subscribe`) so custom UI can use the same contract. The default tooltip updates while the cursor is still on live charts and highlights the raw sample(s) it is reporting.
|
|
172
|
+
Built-in plugins are optional. `interactionsPlugin()` provides plain-drag box zoom, Shift+drag plot pan, wheel zoom, double-click reset, and `axis: "x" | "y" | "xy"`. When outside axes are visible, scrolling an axis zooms that axis and dragging an axis pans that axis; the plugin also applies a subtle axis hover color/filter configurable with `axisHover`, `axisHoverColor`, and `axisHoverFilter`. Legend/tooltip consume public APIs (`getSeriesState`, `setSeriesVisible`, `pick`, and `subscribe`) so custom UI can use the same contract. The default tooltip updates while the cursor is still on live charts and highlights the raw sample(s) it is reporting. For shared time-series tooltips, use `group: "x"`; for scatter/true point hover, use `group: "none"`.
|
|
181
173
|
|
|
182
174
|
### `SeriesStore`
|
|
183
175
|
|
|
@@ -193,9 +185,10 @@ Built-in plugins are optional. `interactionsPlugin()` provides plain-drag box zo
|
|
|
193
185
|
|
|
194
186
|
| Property | Description |
|
|
195
187
|
|---|---|
|
|
196
|
-
| `mode` | `"line"` / `"area"` / `"scatter"` / `"bar"` / `"envelope"` (envelope roadmap-only). |
|
|
188
|
+
| `mode` | `"line"` / `"area"` / `"scatter"` / `"bar"` / `"ohlc"` / `"candlestick"` / `"envelope"` (envelope roadmap-only). |
|
|
197
189
|
| `capacity` | Ring buffer capacity (samples). |
|
|
198
190
|
| `id?` / `name?` | Optional metadata exposed to plugins, legend, and tooltip rows. |
|
|
191
|
+
| `yAxis?` | `"left"` or `"right"`; selects the primary or secondary Y viewport/axis for this series. |
|
|
199
192
|
| `downsample` | `"minmax"` or `"none"`. Min/max LOD applies to line and bar rendering; area/scatter skip LOD. |
|
|
200
193
|
|
|
201
194
|
### `SeriesStyle`
|
|
@@ -208,6 +201,15 @@ Built-in plugins are optional. `interactionsPlugin()` provides plain-drag box zo
|
|
|
208
201
|
| `barWidth` | `0.8` | Bar width in data-space X units. |
|
|
209
202
|
| `baseline` | `0` | Area/bar baseline in data-space Y units. |
|
|
210
203
|
| `fillColor` | line color with 25% alpha | Area fill RGBA color. |
|
|
204
|
+
| `tickWidth` | `barWidth` or `0.8` | OHLC open/close tick width in data-space X units. |
|
|
205
|
+
| `upColor` / `downColor` | series color / translucent fill | Candlestick body colors. |
|
|
206
|
+
| `wickColor` | series color | Candlestick wick color. |
|
|
207
|
+
|
|
208
|
+
### High-performance dataset capabilities
|
|
209
|
+
|
|
210
|
+
`Dataset` only requires `getX/getY` and X binary search. For maximum performance with huge, procedural, remote, or memory-mapped data, implement `AcceleratedDataset`.
|
|
211
|
+
|
|
212
|
+
`AcceleratedDataset` is the convenience contract for all fast paths: range min/max, exact range copying, stable viewport sampling, and renderer-ready min/max buckets. BlazePlot still exports the smaller capability interfaces (`RangeMinMaxDataset`, `RangeSampleCopyDataset`, `VisibleSampleCopyDataset`, `MinMaxSegmentCopyDataset`) for advanced partial acceleration, but most high-performance custom datasets should target `AcceleratedDataset`.
|
|
211
213
|
|
|
212
214
|
### `ViewportPolicy`
|
|
213
215
|
|
|
@@ -241,27 +243,6 @@ src/
|
|
|
241
243
|
bun install
|
|
242
244
|
bun run dev # Vite dev server → preview/
|
|
243
245
|
bun run build # Package build (JS + declarations)
|
|
244
|
-
bun run build:js # JS-only build
|
|
245
246
|
bun test # Tests
|
|
246
247
|
bun run typecheck # TypeScript strict check
|
|
247
248
|
```
|
|
248
|
-
|
|
249
|
-
## Package build
|
|
250
|
-
|
|
251
|
-
```bash
|
|
252
|
-
bun run build
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
Output:
|
|
256
|
-
|
|
257
|
-
```
|
|
258
|
-
dist/index.js ES module
|
|
259
|
-
dist/index.d.ts TypeScript declarations
|
|
260
|
-
dist/plugins/interactions.js Optional interactions plugin
|
|
261
|
-
dist/plugins/legend.js Optional legend plugin
|
|
262
|
-
dist/plugins/tooltip.js Optional tooltip plugin
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
## Why WebGL2?
|
|
266
|
-
|
|
267
|
-
Canvas2D and SVG are CPU-bound — every point becomes a draw call or a DOM node. BlazePlot keeps plot data on the GPU and streams only visible vertices; DOM is limited to chart layout and labels. For dense line plots (millions of points), interactive scatter, or real-time streaming, the difference is orders of magnitude.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataCursor.d.ts","sourceRoot":"","sources":["../../src/core/DataCursor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataCursor.d.ts","sourceRoot":"","sources":["../../src/core/DataCursor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,OAAO,CAAwB;IAEvC,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAK3B,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;CAMjC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { BufferOverflowStrategy, OhlcDataset, TimeRange } from './types.js';
|
|
2
|
+
export declare class StaticOhlcDataset implements OhlcDataset {
|
|
3
|
+
readonly length: number;
|
|
4
|
+
private readonly xs;
|
|
5
|
+
private readonly opens;
|
|
6
|
+
private readonly highs;
|
|
7
|
+
private readonly lows;
|
|
8
|
+
private readonly closes;
|
|
9
|
+
constructor(x: ArrayLike<number>, open: ArrayLike<number>, high: ArrayLike<number>, low: ArrayLike<number>, close: ArrayLike<number>);
|
|
10
|
+
get range(): TimeRange | null;
|
|
11
|
+
getX(index: number): number;
|
|
12
|
+
getY(index: number): number;
|
|
13
|
+
getOpen(index: number): number;
|
|
14
|
+
getHigh(index: number): number;
|
|
15
|
+
getLow(index: number): number;
|
|
16
|
+
getClose(index: number): number;
|
|
17
|
+
lowerBoundX(x: number): number;
|
|
18
|
+
upperBoundX(x: number): number;
|
|
19
|
+
private assertValidIndex;
|
|
20
|
+
}
|
|
21
|
+
export interface OhlcRingBufferOptions {
|
|
22
|
+
readonly overflow?: BufferOverflowStrategy;
|
|
23
|
+
}
|
|
24
|
+
export declare class OhlcRingBuffer implements OhlcDataset {
|
|
25
|
+
readonly capacity: number;
|
|
26
|
+
private readonly overflow;
|
|
27
|
+
private readonly xData;
|
|
28
|
+
private readonly openData;
|
|
29
|
+
private readonly highData;
|
|
30
|
+
private readonly lowData;
|
|
31
|
+
private readonly closeData;
|
|
32
|
+
private _length;
|
|
33
|
+
private _head;
|
|
34
|
+
constructor(capacity: number, options?: OhlcRingBufferOptions);
|
|
35
|
+
get length(): number;
|
|
36
|
+
get range(): TimeRange | null;
|
|
37
|
+
push(x: number, open: number, high: number, low: number, close: number): void;
|
|
38
|
+
append(x: ArrayLike<number>, open: ArrayLike<number>, high: ArrayLike<number>, low: ArrayLike<number>, close: ArrayLike<number>): void;
|
|
39
|
+
clear(): void;
|
|
40
|
+
getX(index: number): number;
|
|
41
|
+
getY(index: number): number;
|
|
42
|
+
getOpen(index: number): number;
|
|
43
|
+
getHigh(index: number): number;
|
|
44
|
+
getLow(index: number): number;
|
|
45
|
+
getClose(index: number): number;
|
|
46
|
+
lowerBoundX(x: number): number;
|
|
47
|
+
upperBoundX(x: number): number;
|
|
48
|
+
private logicalToPhysical;
|
|
49
|
+
private assertValidIndex;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=OhlcDataset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OhlcDataset.d.ts","sourceRoot":"","sources":["../../src/core/OhlcDataset.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjF,qBAAa,iBAAkB,YAAW,WAAW;IACnD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoB;IACvC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;IAC1C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;IAC1C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;gBAGzC,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,EACpB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EACvB,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,EACvB,GAAG,EAAE,SAAS,CAAC,MAAM,CAAC,EACtB,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC;IAU1B,IAAI,KAAK,IAAI,SAAS,GAAG,IAAI,CAG5B;IAED,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK3B,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI3B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK9B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK9B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK7B,QAAQ,CAAC,KAAK,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AM;IAK3B,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI3B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK9B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK9B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK7B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK/B,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAI9B,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAI9B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,gBAAgB;CAKzB"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { TimeRange } from './types.js';
|
|
2
|
+
export type RingBufferOverflow = "wrap" | "drop-new" | "error";
|
|
3
|
+
export interface RingBufferOptions {
|
|
4
|
+
readonly overflow?: RingBufferOverflow;
|
|
5
|
+
}
|
|
2
6
|
export declare class RingBuffer {
|
|
3
7
|
readonly capacity: number;
|
|
4
8
|
private _length;
|
|
@@ -8,7 +12,8 @@ export declare class RingBuffer {
|
|
|
8
12
|
private readonly treeBase;
|
|
9
13
|
private readonly minTree;
|
|
10
14
|
private readonly maxTree;
|
|
11
|
-
|
|
15
|
+
private readonly overflow;
|
|
16
|
+
constructor(capacity: number, options?: RingBufferOptions);
|
|
12
17
|
get length(): number;
|
|
13
18
|
get range(): TimeRange | null;
|
|
14
19
|
push(x: number, y: number): void;
|
|
@@ -26,6 +31,7 @@ export declare class RingBuffer {
|
|
|
26
31
|
maxY: number;
|
|
27
32
|
} | null;
|
|
28
33
|
clear(): void;
|
|
34
|
+
private appendNoWrap;
|
|
29
35
|
private copyIntoPhysical;
|
|
30
36
|
private setTreeLeaf;
|
|
31
37
|
private recomputeTreeRange;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RingBuffer.d.ts","sourceRoot":"","sources":["../../src/core/RingBuffer.ts"],"names":[],"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AM;IAK3B,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAI9B,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAI9B,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAqB/E,KAAK,IAAI,IAAI;IAOb,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,gBAAgB;IAmBxB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,kBAAkB;IAa1B,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,mBAAmB;IA6B3B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,MAAM,CAAC,cAAc;CAG9B"}
|
|
@@ -23,13 +23,28 @@ export declare class SeriesStore {
|
|
|
23
23
|
visibleSampleCount(viewport: Viewport): number;
|
|
24
24
|
sampleAt(index: number): SeriesSample | null;
|
|
25
25
|
nearestSampleByX(x: number, viewport?: Viewport): SeriesSample | null;
|
|
26
|
-
nearestSampleByPoint(x: number, y: number, viewport: Viewport, plotWidth: number, plotHeight: number): SeriesSample | null;
|
|
27
|
-
copyRawVisible(viewport: Viewport, target: Float32Array, maxPoints: number): number;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
nearestSampleByPoint(x: number, y: number, viewport: Viewport, plotWidth: number, plotHeight: number, maxDistancePx?: number): SeriesSample | null;
|
|
27
|
+
copyRawVisible(viewport: Viewport, target: Float32Array, maxPoints: number, xOrigin?: number): number;
|
|
28
|
+
copyRawVisibleClipped(viewport: Viewport, target: Float32Array, maxPoints: number, xOrigin?: number): number;
|
|
29
|
+
copyRawVisibleClipSpace(viewport: Viewport, target: Float32Array, maxPoints: number): number;
|
|
30
|
+
copyRawRange(start: number, end: number, target: Float32Array, maxPoints: number, xOrigin?: number): number;
|
|
31
|
+
copyAreaVisible(viewport: Viewport, target: Float32Array, maxPoints: number, baseline?: number, xOrigin?: number): number;
|
|
32
|
+
copyAreaRange(start: number, end: number, target: Float32Array, maxPoints: number, baseline?: number, xOrigin?: number): number;
|
|
33
|
+
copyMinMaxVisible(viewport: Viewport, target: Float32Array, maxSegments: number, xOrigin?: number): number;
|
|
34
|
+
copyMinMaxInstanced(viewport: Viewport, target: Float32Array, maxSegments: number, xOrigin?: number): number;
|
|
35
|
+
copyOhlcRange(start: number, end: number, target: Float32Array, maxCandles: number, tickWidth: number, xOrigin?: number): number;
|
|
36
|
+
copyOhlcTuplesRange(start: number, end: number, target: Float32Array, maxCandles: number, xOrigin?: number): number;
|
|
37
|
+
visibleIndexRange(viewport: Viewport | undefined, outerPadding?: number): {
|
|
38
|
+
start: number;
|
|
39
|
+
end: number;
|
|
40
|
+
};
|
|
41
|
+
private pointXDistanceSq;
|
|
42
|
+
private pointIntervalDistanceSq;
|
|
43
|
+
private hasPointIntervalBounds;
|
|
44
|
+
private pointIntervalMinMaxY;
|
|
45
|
+
private copyClippedVisibleLine;
|
|
32
46
|
private copyVisibleSamples;
|
|
47
|
+
private copySampleRange;
|
|
33
48
|
private copyMinMaxSegments;
|
|
34
49
|
private minMaxForRange;
|
|
35
50
|
private queryRangeMinMax;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeriesStore.d.ts","sourceRoot":"","sources":["../../src/core/SeriesStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"SeriesStore.d.ts","sourceRoot":"","sources":["../../src/core/SeriesStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAkI,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAqCtO,qBAAa,WAAW;IACtB,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9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,MAAM;IAgCnI,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,MAAU,GAAG,MAAM;IAmBtH,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAAE,YAAY,GAAE,MAAU,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;IAS3G,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,uBAAuB;IAqB/B,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,oBAAoB;IAM5B,OAAO,CAAC,sBAAsB;IA0D9B,OAAO,CAAC,kBAAkB;IA0C1B,OAAO,CAAC,eAAe;IAuCvB,OAAO,CAAC,kBAAkB;IAkD1B,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,gBAAgB;IA6BxB,OAAO,CAAC,iBAAiB;CAgB1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StaticDataset.d.ts","sourceRoot":"","sources":["../../src/core/StaticDataset.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StaticDataset.d.ts","sourceRoot":"","sources":["../../src/core/StaticDataset.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAErD,qBAAa,aAAc,YAAW,OAAO;IAEzC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBADL,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,EACxB,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC;IAG3C,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,KAAK,IAAI,SAAS,GAAG,IAAI,CAG5B;IAED,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK3B,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAK3B,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAI9B,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAI9B,OAAO,CAAC,gBAAgB;CAKzB"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Viewport, LODBucket, LODView, TimeRange, SeriesStyle, SeriesMode, SeriesConfig, LODStrategy, Dataset, AppendableDataset } from './types.js';
|
|
1
|
+
export type { Viewport, LODBucket, LODView, TimeRange, SeriesStyle, SeriesMode, SeriesYAxis, SeriesConfig, LODStrategy, Dataset, AcceleratedDataset, AppendableDataset, RangeMinMaxDataset, RangeSampleCopyDataset, VisibleSampleCopyDataset, MinMaxSegmentCopyDataset, SampleCopyLayout, MinMaxSegmentLayout } from './types.js';
|
|
2
2
|
export { RingBuffer } from './RingBuffer.js';
|
|
3
3
|
export { StaticDataset } from './StaticDataset.js';
|
|
4
4
|
export { MinMaxPyramid } from './MinMaxPyramid.js';
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAElU,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/core/search.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CASpG;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CASpG"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -27,8 +27,13 @@ export interface SeriesStyle {
|
|
|
27
27
|
readonly barWidth?: number;
|
|
28
28
|
readonly baseline?: number;
|
|
29
29
|
readonly fillColor?: readonly [number, number, number, number];
|
|
30
|
+
readonly tickWidth?: number;
|
|
31
|
+
readonly upColor?: readonly [number, number, number, number];
|
|
32
|
+
readonly downColor?: readonly [number, number, number, number];
|
|
33
|
+
readonly wickColor?: readonly [number, number, number, number];
|
|
30
34
|
}
|
|
31
|
-
export type SeriesMode = "line" | "area" | "envelope" | "scatter" | "bar";
|
|
35
|
+
export type SeriesMode = "line" | "area" | "envelope" | "scatter" | "bar" | "ohlc" | "candlestick";
|
|
36
|
+
export type SeriesYAxis = "left" | "right";
|
|
32
37
|
export interface Dataset {
|
|
33
38
|
readonly length: number;
|
|
34
39
|
readonly range: TimeRange | null;
|
|
@@ -43,12 +48,53 @@ export interface RangeMinMaxDataset extends Dataset {
|
|
|
43
48
|
maxY: number;
|
|
44
49
|
} | null;
|
|
45
50
|
}
|
|
51
|
+
export type SampleCopyLayout = "points" | "area";
|
|
52
|
+
export type MinMaxSegmentLayout = "line-list" | "instanced";
|
|
53
|
+
/**
|
|
54
|
+
* Optional high-performance extraction capability for datasets that can copy raw
|
|
55
|
+
* samples without going through repeated getX/getY calls. Implement this for
|
|
56
|
+
* very large datasets, implicit-X datasets, or remote/memory-mapped sources.
|
|
57
|
+
*/
|
|
58
|
+
export interface RangeSampleCopyDataset extends Dataset {
|
|
59
|
+
copySamplesRange(start: number, end: number, target: Float32Array, maxPoints: number, layout: SampleCopyLayout, baseline: number, xOrigin: number): number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Optional high-performance stable visible sampling capability. Unlike
|
|
63
|
+
* copySamplesRange, this method may stride/downsample, but should choose samples
|
|
64
|
+
* anchored to data coordinates so streamed appends do not make existing sampled
|
|
65
|
+
* points jitter.
|
|
66
|
+
*/
|
|
67
|
+
export interface VisibleSampleCopyDataset extends Dataset {
|
|
68
|
+
copyVisibleSamples(viewport: Viewport, target: Float32Array, maxPoints: number, layout: SampleCopyLayout, baseline: number, xOrigin: number): number;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Optional high-performance min/max extraction capability for dense rendering.
|
|
72
|
+
* Implementations can use pyramids, segment trees, database aggregates, or
|
|
73
|
+
* analytic/procedural envelopes to emit renderer-ready min/max buckets.
|
|
74
|
+
*/
|
|
75
|
+
export interface MinMaxSegmentCopyDataset extends Dataset {
|
|
76
|
+
copyMinMaxSegments(viewport: Viewport, target: Float32Array, maxSegments: number, layout: MinMaxSegmentLayout, xOrigin: number): number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Convenience contract for maximum-performance custom datasets. Implement this
|
|
80
|
+
* when a dataset can provide fast exact sample copies, stable viewport sampling,
|
|
81
|
+
* range min/max queries, and renderer-ready min/max buckets.
|
|
82
|
+
*/
|
|
83
|
+
export interface AcceleratedDataset extends Dataset, RangeMinMaxDataset, RangeSampleCopyDataset, VisibleSampleCopyDataset, MinMaxSegmentCopyDataset {
|
|
84
|
+
}
|
|
85
|
+
export interface OhlcDataset extends Dataset {
|
|
86
|
+
getOpen(index: number): number;
|
|
87
|
+
getHigh(index: number): number;
|
|
88
|
+
getLow(index: number): number;
|
|
89
|
+
getClose(index: number): number;
|
|
90
|
+
}
|
|
46
91
|
export interface AppendableDataset extends Dataset {
|
|
47
92
|
push(x: number, y: number): void;
|
|
48
93
|
append(x: ArrayLike<number>, y: ArrayLike<number>): void;
|
|
49
94
|
clear(): void;
|
|
50
95
|
}
|
|
51
96
|
export type LODStrategy = "minmax" | "none";
|
|
97
|
+
export type BufferOverflowStrategy = "wrap" | "drop-new" | "error";
|
|
52
98
|
export interface SeriesSample {
|
|
53
99
|
readonly index: number;
|
|
54
100
|
readonly x: number;
|
|
@@ -59,7 +105,9 @@ export interface SeriesConfig {
|
|
|
59
105
|
readonly mode: SeriesMode;
|
|
60
106
|
readonly capacity: number;
|
|
61
107
|
readonly downsample?: LODStrategy;
|
|
108
|
+
readonly overflow?: BufferOverflowStrategy;
|
|
62
109
|
readonly dataset?: Dataset;
|
|
110
|
+
readonly yAxis?: SeriesYAxis;
|
|
63
111
|
readonly id?: string;
|
|
64
112
|
readonly name?: string;
|
|
65
113
|
}
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AA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AAU,GAAG,OAAO,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
export { Chart } from './ui/Chart.js';
|
|
2
|
-
export type { ChartFrameStats, ChartOptions, ChartScreenshotOptions, AxisConfig, TypedSeriesConfig, ChartHoverState, ChartPickItem, ChartPickMode, ChartPickOptions, ChartPlugin, ChartPluginHandle, ChartSeriesState } from './ui/Chart.js';
|
|
2
|
+
export type { ChartFrameStats, ChartOptions, ChartScreenshotOptions, AxisConfig, TypedSeriesConfig, ChartHoverState, ChartPickGroup, ChartPickItem, ChartPickMode, ChartPickOptions, ChartPlugin, ChartPluginHandle, ChartSeriesState } from './ui/Chart.js';
|
|
3
3
|
export { DEFAULT_CHART_THEME } from './ui/theme.js';
|
|
4
4
|
export type { ChartTheme, ResolvedChartTheme, RgbaColor, CssColor, ThemeColor } from './ui/theme.js';
|
|
5
5
|
export type { AxisPosition } from './ui/ChartLayout.js';
|
|
6
6
|
export { SeriesStore } from './core/SeriesStore.js';
|
|
7
7
|
export { RingBuffer } from './core/RingBuffer.js';
|
|
8
|
+
export type { RingBufferOptions, RingBufferOverflow } from './core/RingBuffer.js';
|
|
8
9
|
export { StaticDataset } from './core/StaticDataset.js';
|
|
10
|
+
export { OhlcRingBuffer, StaticOhlcDataset } from './core/OhlcDataset.js';
|
|
11
|
+
export type { OhlcRingBufferOptions } from './core/OhlcDataset.js';
|
|
9
12
|
export { MinMaxPyramid } from './core/MinMaxPyramid.js';
|
|
10
13
|
export { Camera2D } from './interaction/Camera2D.js';
|
|
11
14
|
export { AxisController } from './interaction/AxisController.js';
|
|
12
|
-
export type { Viewport, LODBucket, LODView, TimeRange, SeriesStyle, SeriesMode, SeriesConfig, SeriesSample, LODStrategy, Dataset, RangeMinMaxDataset, AppendableDataset } from './core/types.js';
|
|
15
|
+
export type { Viewport, LODBucket, LODView, TimeRange, SeriesStyle, SeriesMode, SeriesYAxis, SeriesConfig, SeriesSample, LODStrategy, BufferOverflowStrategy, Dataset, AcceleratedDataset, OhlcDataset, RangeMinMaxDataset, RangeSampleCopyDataset, VisibleSampleCopyDataset, MinMaxSegmentCopyDataset, SampleCopyLayout, MinMaxSegmentLayout, AppendableDataset } from './core/types.js';
|
|
13
16
|
export type { PanIntent, ZoomAxis, ZoomIntent, ViewportPolicy } from './interaction/types.js';
|
|
14
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,sBAAsB,EAAE,UAAU,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM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