@wick-charts/vue 0.6.3 → 0.7.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/README.md +6 -6
- package/dist/BandSeries.vue.js +52 -0
- package/dist/BandSeries.vue2.js +4 -0
- package/dist/BarSeries.vue.js +15 -13
- package/dist/CandlestickSeries.vue.js +31 -29
- package/dist/ChartContainer.vue.js +75 -68
- package/dist/LineSeries.vue.js +19 -17
- package/dist/composables.js +46 -36
- package/dist/core/dist/animation/config.js +92 -75
- package/dist/core/dist/animation/viewport-engine.js +155 -96
- package/dist/core/dist/axis/dom-labels.js +56 -51
- package/dist/core/dist/chart/badge-animator.js +30 -22
- package/dist/core/dist/chart/edge-indicators.js +22 -21
- package/dist/core/dist/chart/last-value.js +33 -26
- package/dist/core/dist/chart/scale-guards.js +23 -5
- package/dist/core/dist/chart/x-guards.js +37 -0
- package/dist/core/dist/chart.js +1286 -842
- package/dist/core/dist/data/decimation.js +58 -39
- package/dist/core/dist/data/sync.js +37 -31
- package/dist/core/dist/navigator/controller.js +41 -41
- package/dist/core/dist/perf/perf-hud.js +3 -3
- package/dist/core/dist/scales/tick-tracker.js +2 -2
- package/dist/core/dist/scales/x-scale.js +167 -53
- package/dist/core/dist/scales/y-scale.js +36 -34
- package/dist/core/dist/series/band.js +723 -0
- package/dist/core/dist/series/bar.js +297 -291
- package/dist/core/dist/series/base-multi-layer.js +283 -237
- package/dist/core/dist/series/candlestick.js +32 -31
- package/dist/core/dist/series/heatmap.js +5 -5
- package/dist/core/dist/series/line-intro.js +47 -37
- package/dist/core/dist/series/line.js +489 -448
- package/dist/core/dist/series/painters/builtins.js +4 -4
- package/dist/core/dist/series/painters/canvas-path.js +64 -52
- package/dist/core/dist/series/register-builtins.js +9 -8
- package/dist/core/dist/snapshots.js +59 -46
- package/dist/core/dist/utils/point.js +10 -0
- package/dist/index.d.ts +552 -129
- package/dist/index.js +195 -191
- package/dist/ui/Crosshair.vue.js +51 -27
- package/dist/ui/InfoBar.vue.js +98 -79
- package/dist/ui/Marker.vue.js +14 -11
- package/dist/ui/Navigator.vue.js +23 -23
- package/dist/ui/ReferenceLine.vue.js +19 -16
- package/dist/ui/Tooltip.vue.js +116 -84
- package/dist/ui/XAxis.vue.js +48 -0
- package/dist/ui/XAxis.vue2.js +4 -0
- package/dist/ui/YAxis.vue.js +44 -28
- package/dist/ui/YLabel.vue.js +82 -85
- package/package.json +2 -2
- package/src/BandSeries.vue +92 -0
- package/src/BarSeries.vue +13 -6
- package/src/CandlestickSeries.vue +9 -5
- package/src/ChartContainer.vue +20 -0
- package/src/LineSeries.vue +13 -6
- package/src/composables.ts +23 -4
- package/src/index.ts +16 -1
- package/src/ui/Crosshair.vue +41 -1
- package/src/ui/InfoBar.vue +22 -2
- package/src/ui/Marker.vue +5 -1
- package/src/ui/Navigator.vue +2 -1
- package/src/ui/ReferenceLine.vue +5 -1
- package/src/ui/Tooltip.vue +43 -6
- package/src/ui/{TimeAxis.vue → XAxis.vue} +18 -5
- package/src/ui/YAxis.vue +66 -12
- package/src/ui/YLabel.vue +37 -18
- package/dist/ui/TimeAxis.vue.js +0 -44
- package/dist/ui/TimeAxis.vue2.js +0 -4
package/dist/index.d.ts
CHANGED
|
@@ -5,15 +5,15 @@ import { PublicProps } from 'vue';
|
|
|
5
5
|
import { Ref } from 'vue';
|
|
6
6
|
import { ShallowRef } from 'vue';
|
|
7
7
|
|
|
8
|
-
declare const __VLS_component: DefineComponent<
|
|
8
|
+
declare const __VLS_component: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{}>, {
|
|
9
9
|
fade: boolean | {
|
|
10
10
|
top?: number;
|
|
11
11
|
overlap?: number;
|
|
12
12
|
right?: number;
|
|
13
13
|
left?: number;
|
|
14
14
|
};
|
|
15
|
-
theme: ChartTheme;
|
|
16
15
|
gradient: boolean;
|
|
16
|
+
theme: ChartTheme;
|
|
17
17
|
interactive: boolean;
|
|
18
18
|
headerLayout: "overlay" | "inline";
|
|
19
19
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
@@ -26,20 +26,20 @@ legendAnchor: HTMLDivElement;
|
|
|
26
26
|
navigatorAnchor: HTMLDivElement;
|
|
27
27
|
}, HTMLDivElement>;
|
|
28
28
|
|
|
29
|
-
declare const __VLS_component_2: DefineComponent<
|
|
29
|
+
declare const __VLS_component_2: DefineComponent<__VLS_Props_9, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_9> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
30
30
|
|
|
31
|
-
declare const __VLS_component_3: DefineComponent<
|
|
31
|
+
declare const __VLS_component_3: DefineComponent<__VLS_Props_10, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_10> & Readonly<{}>, {
|
|
32
32
|
position: "bottom" | "right";
|
|
33
33
|
mode: LegendMode;
|
|
34
34
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
|
|
36
|
-
declare const __VLS_component_4: DefineComponent<
|
|
36
|
+
declare const __VLS_component_4: DefineComponent<__VLS_Props_14, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_14> & Readonly<{}>, {
|
|
37
37
|
position: PieLegendPosition;
|
|
38
38
|
format: ValueFormatter;
|
|
39
39
|
mode: PieLegendMode;
|
|
40
40
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
41
41
|
|
|
42
|
-
declare const __VLS_component_5: DefineComponent<
|
|
42
|
+
declare const __VLS_component_5: DefineComponent<__VLS_Props_15, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_15> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
43
43
|
containerRef: HTMLDivElement;
|
|
44
44
|
}, any>;
|
|
45
45
|
|
|
@@ -49,19 +49,37 @@ declare const __VLS_component_7: DefineComponent<__VLS_Props_19, {}, {}, {}, {},
|
|
|
49
49
|
containerRef: HTMLDivElement;
|
|
50
50
|
}, any>;
|
|
51
51
|
|
|
52
|
-
declare const __VLS_component_8: DefineComponent<
|
|
52
|
+
declare const __VLS_component_8: DefineComponent<__VLS_Props_22, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_22> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
53
53
|
|
|
54
54
|
declare type __VLS_Props = {
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Band data — one band per layer. A single band passes a flat
|
|
57
|
+
* `{ time, low, high }[]`; several bands pass `BandPoint[][]`. To name/color
|
|
58
|
+
* a band, pass `{ label, color?, data }` (or an array of them). Time accepts
|
|
59
|
+
* ms or `Date`. On a numeric or category X axis (`axis.x.type`) samples
|
|
60
|
+
* carry `x` in place of `time`: `{ x: 'EU', low, high }`.
|
|
61
|
+
*/
|
|
62
|
+
data: BandData;
|
|
63
|
+
/** Visual options override — fill, edge stroke, curve, entrance / intro / smoothing. */
|
|
64
|
+
options?: Partial<BandSeriesOptions>;
|
|
58
65
|
/** Stable series ID — same value across remounts. */
|
|
59
66
|
id?: string;
|
|
60
67
|
/** Show/hide the series without unmounting it — excludes it from the Y-range fit and tooltip/legend. Default `true`. Live. */
|
|
61
68
|
visible?: boolean;
|
|
69
|
+
/** Named Y scale from the container's `scales` — autoscales on its own, sharing the time axis. Default: the default scale. Live. */
|
|
70
|
+
scale?: string;
|
|
62
71
|
};
|
|
63
72
|
|
|
64
73
|
declare type __VLS_Props_10 = {
|
|
74
|
+
items?: LegendItemOverride[];
|
|
75
|
+
position?: 'bottom' | 'right';
|
|
76
|
+
/** `'isolate'` shows only the clicked item; `'solo'` is a @deprecated alias. */
|
|
77
|
+
mode?: LegendMode;
|
|
78
|
+
/** Fired after a click changes series visibility — via the built-in UI or a custom slot calling `item.toggle()`/`isolate()` directly. */
|
|
79
|
+
onToggle?: (info: LegendToggleInfo) => void;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
declare type __VLS_Props_11 = {
|
|
65
83
|
/** X anchor — epoch ms or a `Date`. */
|
|
66
84
|
time: TimeValue;
|
|
67
85
|
/** Y anchor as a data value. Omit and set `seriesId` to snap to that series' value at `time`. */
|
|
@@ -76,15 +94,17 @@ declare type __VLS_Props_10 = {
|
|
|
76
94
|
label?: string;
|
|
77
95
|
/** Color override. Falls back to the series color (when `seriesId` is set), then the theme line color. */
|
|
78
96
|
color?: string;
|
|
97
|
+
/** Named Y scale (`ChartContainer` `scales`) the `value` maps through. Default: the `seriesId` series' scale, else the default scale. */
|
|
98
|
+
scale?: string;
|
|
79
99
|
};
|
|
80
100
|
|
|
81
|
-
declare type
|
|
101
|
+
declare type __VLS_Props_12 = {
|
|
82
102
|
data: NavigatorData;
|
|
83
103
|
/** Strip height in CSS pixels. Defaults to `theme.navigator.height` (60). */
|
|
84
104
|
height?: number;
|
|
85
105
|
};
|
|
86
106
|
|
|
87
|
-
declare type
|
|
107
|
+
declare type __VLS_Props_13 = {
|
|
88
108
|
value: number;
|
|
89
109
|
/**
|
|
90
110
|
* Value-to-string formatter. Defaults to the current locale's
|
|
@@ -96,7 +116,7 @@ declare type __VLS_Props_12 = {
|
|
|
96
116
|
spinDuration?: number;
|
|
97
117
|
};
|
|
98
118
|
|
|
99
|
-
declare type
|
|
119
|
+
declare type __VLS_Props_14 = {
|
|
100
120
|
/**
|
|
101
121
|
* Owning series id. **Optional** — when omitted, the first visible pie
|
|
102
122
|
* series is picked.
|
|
@@ -110,7 +130,7 @@ declare type __VLS_Props_13 = {
|
|
|
110
130
|
position?: PieLegendPosition;
|
|
111
131
|
};
|
|
112
132
|
|
|
113
|
-
declare type
|
|
133
|
+
declare type __VLS_Props_15 = {
|
|
114
134
|
/**
|
|
115
135
|
* Owning series id. **Optional** — when omitted, the first visible pie
|
|
116
136
|
* series is picked.
|
|
@@ -120,7 +140,7 @@ declare type __VLS_Props_14 = {
|
|
|
120
140
|
format?: ValueFormatter;
|
|
121
141
|
};
|
|
122
142
|
|
|
123
|
-
declare type
|
|
143
|
+
declare type __VLS_Props_16 = {
|
|
124
144
|
/** Horizontal line at this Y data value. Mutually exclusive with `time`. */
|
|
125
145
|
value?: number;
|
|
126
146
|
/** Vertical line at this `time` (epoch ms or `Date`). Mutually exclusive with `value`. */
|
|
@@ -133,13 +153,8 @@ declare type __VLS_Props_15 = {
|
|
|
133
153
|
style?: ReferenceLineStyle;
|
|
134
154
|
/** Stroke width in CSS pixels. Default: `1`. */
|
|
135
155
|
width?: number;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
declare type __VLS_Props_16 = {
|
|
139
|
-
/** Desired number of labels (≥ 2). Overrides chart-level `axis.x.labelCount`. */
|
|
140
|
-
labelCount?: number;
|
|
141
|
-
/** Minimum pixel gap between adjacent labels (hard floor). Overrides chart-level. */
|
|
142
|
-
minLabelSpacing?: number;
|
|
156
|
+
/** Named Y scale (`ChartContainer` `scales`) the `value` maps through. Default: the default scale. */
|
|
157
|
+
scale?: string;
|
|
143
158
|
};
|
|
144
159
|
|
|
145
160
|
declare type __VLS_Props_17 = {
|
|
@@ -175,16 +190,34 @@ declare type __VLS_Props_19 = {
|
|
|
175
190
|
};
|
|
176
191
|
|
|
177
192
|
declare type __VLS_Props_2 = {
|
|
178
|
-
/**
|
|
179
|
-
|
|
180
|
-
|
|
193
|
+
/**
|
|
194
|
+
* Flat `TimePoint[]`, `TimePoint[][]`, or named `{ label, color?, data }` layers. Time accepts ms or `Date`.
|
|
195
|
+
* On a numeric or category X axis (`axis.x.type`) points carry `x` in place of `time`.
|
|
196
|
+
*/
|
|
197
|
+
data: MultiLayerData;
|
|
198
|
+
options?: Partial<BarSeriesOptions>;
|
|
181
199
|
/** Stable series ID — same value across remounts. */
|
|
182
200
|
id?: string;
|
|
183
201
|
/** Show/hide the series without unmounting it — excludes it from the Y-range fit and tooltip/legend. Default `true`. Live. */
|
|
184
202
|
visible?: boolean;
|
|
203
|
+
/** Named Y scale from the container's `scales` — autoscales on its own, sharing the time axis. Default: the default scale. Live. */
|
|
204
|
+
scale?: string;
|
|
185
205
|
};
|
|
186
206
|
|
|
187
207
|
declare type __VLS_Props_20 = {
|
|
208
|
+
/** Desired number of labels (≥ 2). Overrides chart-level `axis.x.labelCount`. */
|
|
209
|
+
labelCount?: number;
|
|
210
|
+
/** Minimum pixel gap between adjacent labels (hard floor). Overrides chart-level. */
|
|
211
|
+
minLabelSpacing?: number;
|
|
212
|
+
/**
|
|
213
|
+
* Custom label formatter. `x` is epoch ms on a time axis, the number on a
|
|
214
|
+
* numeric axis, the category name on a category axis; `step` is the tick
|
|
215
|
+
* spacing. Also formats the crosshair label and the tooltip / info-bar headers.
|
|
216
|
+
*/
|
|
217
|
+
format?: XAxisFormatter;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
declare type __VLS_Props_21 = {
|
|
188
221
|
/** Custom tick-label formatter. Overrides the built-in range-adaptive default. */
|
|
189
222
|
format?: ValueFormatter;
|
|
190
223
|
/**
|
|
@@ -194,9 +227,15 @@ declare type __VLS_Props_20 = {
|
|
|
194
227
|
labelCount?: number;
|
|
195
228
|
/** Minimum pixel gap between adjacent labels (hard floor). Overrides chart-level. */
|
|
196
229
|
minLabelSpacing?: number;
|
|
230
|
+
/**
|
|
231
|
+
* Named Y scale (`ChartContainer` `scales`) this axis labels. Default: the
|
|
232
|
+
* default scale. An overlay scale has no column, so only `format` and the
|
|
233
|
+
* label density apply.
|
|
234
|
+
*/
|
|
235
|
+
scale?: string;
|
|
197
236
|
};
|
|
198
237
|
|
|
199
|
-
declare type
|
|
238
|
+
declare type __VLS_Props_22 = {
|
|
200
239
|
/**
|
|
201
240
|
* Owning series id. **Optional** — when omitted, the first visible
|
|
202
241
|
* single-layer time series is picked, falling back to the first visible
|
|
@@ -204,20 +243,46 @@ declare type __VLS_Props_21 = {
|
|
|
204
243
|
*/
|
|
205
244
|
seriesId?: string;
|
|
206
245
|
color?: string;
|
|
207
|
-
/** Custom formatter; routed through NumberFlow's `formatter` so the digit animation still plays. */
|
|
246
|
+
/** Custom formatter; routed through NumberFlow's `formatter` so the digit animation still plays. Default: the scale's `<YAxis format>`, else a range-adaptive number. */
|
|
208
247
|
format?: ValueFormatter;
|
|
209
248
|
/**
|
|
210
249
|
* Badge motion. `true` (default) glides + counts up + fades in with the
|
|
211
250
|
* intro; `false` snaps with no easing; an object tunes individual parts.
|
|
212
251
|
*/
|
|
213
252
|
animate?: YLabelAnimate;
|
|
253
|
+
/**
|
|
254
|
+
* Named Y scale (`ChartContainer` `scales`) the value maps through. Default:
|
|
255
|
+
* the series' own scale. The badge sits on that scale's axis side — the
|
|
256
|
+
* default axis side for an overlay scale.
|
|
257
|
+
*/
|
|
258
|
+
scale?: string;
|
|
214
259
|
};
|
|
215
260
|
|
|
216
261
|
declare type __VLS_Props_3 = {
|
|
262
|
+
/** Flat `OHLCInput[]`, or `{ label, data }` to name the stream. */
|
|
263
|
+
data: CandlestickData;
|
|
264
|
+
options?: Partial<CandlestickSeriesOptions>;
|
|
265
|
+
/** Stable series ID — same value across remounts. */
|
|
266
|
+
id?: string;
|
|
267
|
+
/** Show/hide the series without unmounting it — excludes it from the Y-range fit and tooltip/legend. Default `true`. Live. */
|
|
268
|
+
visible?: boolean;
|
|
269
|
+
/** Named Y scale from the container's `scales` — autoscales on its own, sharing the time axis. Default: the default scale. Live. */
|
|
270
|
+
scale?: string;
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
declare type __VLS_Props_4 = {
|
|
217
274
|
/** Visual theme. Live — changing this at runtime updates all themed elements. */
|
|
218
275
|
theme?: ChartTheme;
|
|
219
276
|
/** Grouped axis configuration (Y/X visibility, bounds, sizing). Live. */
|
|
220
277
|
axis?: AxisConfig;
|
|
278
|
+
/**
|
|
279
|
+
* Named secondary Y scales, keyed by id — a series opts in with its `scale`
|
|
280
|
+
* prop and autoscales on its own, sharing the time axis. Same fields as
|
|
281
|
+
* `axis.y`; `position` defaults to the side opposite the default axis. One
|
|
282
|
+
* axis column fits on each side — render it with `<YAxis scale="id" />`.
|
|
283
|
+
* Live.
|
|
284
|
+
*/
|
|
285
|
+
scales?: Record<string, YAxisConfig>;
|
|
221
286
|
/**
|
|
222
287
|
* Viewport padding. `top`/`bottom` are in pixels. `left`/`right` accept either pixels (`50`)
|
|
223
288
|
* or data intervals (`{ intervals: 3 }`). Set to 0 for edge-to-edge sparklines. Updates are
|
|
@@ -382,7 +447,7 @@ declare type __VLS_Props_3 = {
|
|
|
382
447
|
onCrosshairMove?: (position: CrosshairPosition | null) => void;
|
|
383
448
|
};
|
|
384
449
|
|
|
385
|
-
declare type
|
|
450
|
+
declare type __VLS_Props_5 = {
|
|
386
451
|
data: HeatmapCellData[];
|
|
387
452
|
options?: Partial<HeatmapSeriesOptions>;
|
|
388
453
|
/** Stable series ID — same value across remounts. */
|
|
@@ -391,17 +456,22 @@ declare type __VLS_Props_4 = {
|
|
|
391
456
|
visible?: boolean;
|
|
392
457
|
};
|
|
393
458
|
|
|
394
|
-
declare type
|
|
395
|
-
/**
|
|
459
|
+
declare type __VLS_Props_6 = {
|
|
460
|
+
/**
|
|
461
|
+
* Flat `TimePoint[]`, `TimePoint[][]`, or named `{ label, color?, data }` layers. Time accepts ms or `Date`.
|
|
462
|
+
* On a numeric or category X axis (`axis.x.type`) points carry `x` in place of `time`.
|
|
463
|
+
*/
|
|
396
464
|
data: MultiLayerData;
|
|
397
465
|
options?: Partial<LineSeriesOptions>;
|
|
398
466
|
/** Stable series ID — same value across remounts. */
|
|
399
467
|
id?: string;
|
|
400
468
|
/** Show/hide the series without unmounting it — excludes it from the Y-range fit and tooltip/legend. Default `true`. Live. */
|
|
401
469
|
visible?: boolean;
|
|
470
|
+
/** Named Y scale from the container's `scales` — autoscales on its own, sharing the time axis. Default: the default scale. Live. */
|
|
471
|
+
scale?: string;
|
|
402
472
|
};
|
|
403
473
|
|
|
404
|
-
declare type
|
|
474
|
+
declare type __VLS_Props_7 = {
|
|
405
475
|
data: PieSliceData[];
|
|
406
476
|
options?: Partial<PieSeriesOptions>;
|
|
407
477
|
/** Stable series ID — same value across remounts. */
|
|
@@ -410,7 +480,7 @@ declare type __VLS_Props_6 = {
|
|
|
410
480
|
visible?: boolean;
|
|
411
481
|
};
|
|
412
482
|
|
|
413
|
-
declare type
|
|
483
|
+
declare type __VLS_Props_8 = {
|
|
414
484
|
/**
|
|
415
485
|
* Owning series id. **Optional** — when omitted, the first visible heatmap
|
|
416
486
|
* series is picked.
|
|
@@ -420,20 +490,11 @@ declare type __VLS_Props_7 = {
|
|
|
420
490
|
format?: ValueFormatter;
|
|
421
491
|
};
|
|
422
492
|
|
|
423
|
-
declare type
|
|
493
|
+
declare type __VLS_Props_9 = {
|
|
424
494
|
sort?: SnapshotSort;
|
|
425
495
|
format?: TooltipFormatter;
|
|
426
496
|
};
|
|
427
497
|
|
|
428
|
-
declare type __VLS_Props_9 = {
|
|
429
|
-
items?: LegendItemOverride[];
|
|
430
|
-
position?: 'bottom' | 'right';
|
|
431
|
-
/** `'isolate'` shows only the clicked item; `'solo'` is a @deprecated alias. */
|
|
432
|
-
mode?: LegendMode;
|
|
433
|
-
/** Fired after a click changes series visibility — via the built-in UI or a custom slot calling `item.toggle()`/`isolate()` directly. */
|
|
434
|
-
onToggle?: (info: LegendToggleInfo) => void;
|
|
435
|
-
};
|
|
436
|
-
|
|
437
498
|
declare function __VLS_template(): {
|
|
438
499
|
attrs: Partial<{}>;
|
|
439
500
|
slots: {
|
|
@@ -673,7 +734,7 @@ export declare const andromeda: ThemePreset;
|
|
|
673
734
|
* - `axis.ticks` — axis tick label cross-fade.
|
|
674
735
|
* - `toggle` — series visibility (alpha fade + Y re-fit, locked to one
|
|
675
736
|
* duration so they finish on the same frame).
|
|
676
|
-
* - `series.{line,candlestick,bar,pie,heatmap}` — per-series-type data tweens.
|
|
737
|
+
* - `series.{line,candlestick,bar,band,pie,heatmap}` — per-series-type data tweens.
|
|
677
738
|
*
|
|
678
739
|
* Top-level `false` disables every animation category. `axis: false`
|
|
679
740
|
* disables both axes and ticks. `axis.y: false` / `axis.x: false` disables
|
|
@@ -885,6 +946,34 @@ export declare interface AnimationsConfig {
|
|
|
885
946
|
*/
|
|
886
947
|
smooth?: AnimationTime;
|
|
887
948
|
};
|
|
949
|
+
/**
|
|
950
|
+
* Band-series tweens. `false` disables band entrance, intro and
|
|
951
|
+
* edge chase.
|
|
952
|
+
*/
|
|
953
|
+
band?: false | {
|
|
954
|
+
/**
|
|
955
|
+
* Per-point entrance duration. `false` disables the entrance
|
|
956
|
+
* (equivalent to `entryAnimation: 'none'`).
|
|
957
|
+
*
|
|
958
|
+
* @default {@link DEFAULT_BAND_ENTRY}
|
|
959
|
+
*/
|
|
960
|
+
entry?: AnimationTime;
|
|
961
|
+
/**
|
|
962
|
+
* Initial-load reveal on the first data seed. The value is the
|
|
963
|
+
* per-element wave duration; the full reveal lasts ~2×.
|
|
964
|
+
* `false` / `0` disables the intro.
|
|
965
|
+
*
|
|
966
|
+
* @default {@link DEFAULT_BAND_INTRO}
|
|
967
|
+
*/
|
|
968
|
+
intro?: AnimationTime;
|
|
969
|
+
/**
|
|
970
|
+
* Edge chase duration on `updateLastPoint`. `false` / `0`
|
|
971
|
+
* snaps to the target instantly.
|
|
972
|
+
*
|
|
973
|
+
* @default {@link DEFAULT_BAND_SMOOTH}
|
|
974
|
+
*/
|
|
975
|
+
smooth?: AnimationTime;
|
|
976
|
+
};
|
|
888
977
|
/**
|
|
889
978
|
* Pie segment entry/update tweens. `false` disables the slice
|
|
890
979
|
* entry sweep (`update` is still parse-only; wiring lands in a
|
|
@@ -990,7 +1079,7 @@ export declare type AxisBound = 'auto' | number | string | ((values: number[]) =
|
|
|
990
1079
|
export declare interface AxisConfig {
|
|
991
1080
|
/** Y-axis configuration — width, bounds, and visibility of the value axis. */
|
|
992
1081
|
y?: YAxisConfig;
|
|
993
|
-
/** X-axis configuration — height and visibility of the
|
|
1082
|
+
/** X-axis configuration — type, height and visibility of the X axis. */
|
|
994
1083
|
x?: XAxisConfig;
|
|
995
1084
|
}
|
|
996
1085
|
|
|
@@ -1051,6 +1140,119 @@ export declare const ayuMirage: ThemePreset;
|
|
|
1051
1140
|
*/
|
|
1052
1141
|
export declare function backfillSweepIntro(): LineIntroFn;
|
|
1053
1142
|
|
|
1143
|
+
/**
|
|
1144
|
+
* `data` shape for a band series — the same omnivorous forms as
|
|
1145
|
+
* {@link MultiLayerData}, one band per layer: a flat `BandPointInput[]`, a
|
|
1146
|
+
* layered `BandPointInput[][]`, a named `SeriesLayer`, or an array mixing both.
|
|
1147
|
+
* On a numeric or category X axis the samples are {@link XBandPointInput}s.
|
|
1148
|
+
*/
|
|
1149
|
+
export declare type BandData = BandSampleInput[] | SeriesLayer<BandSampleInput> | Array<BandSampleInput[] | SeriesLayer<BandSampleInput>>;
|
|
1150
|
+
|
|
1151
|
+
/** Entrance styles for band points added via `appendData` — the same set as {@link LineEntryAnimation}. */
|
|
1152
|
+
export declare type BandEntryAnimation = LineEntryAnimation;
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* A single band sample: the filled region between `low` and `high` at `time`.
|
|
1156
|
+
* Time is a timestamp in milliseconds. A `low` above `high` is drawn with the
|
|
1157
|
+
* edges swapped; a non-finite edge is a gap.
|
|
1158
|
+
*/
|
|
1159
|
+
export declare interface BandPoint {
|
|
1160
|
+
time: number;
|
|
1161
|
+
low: number;
|
|
1162
|
+
high: number;
|
|
1163
|
+
/** The sample's X on a numeric or category axis, as passed in; `time` is then the internal X coordinate. */
|
|
1164
|
+
x?: number | string;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
/** {@link BandPoint} that also accepts `Date` for the time field. */
|
|
1168
|
+
export declare type BandPointInput = Omit<BandPoint, 'time' | 'x'> & {
|
|
1169
|
+
time: TimeValue;
|
|
1170
|
+
};
|
|
1171
|
+
|
|
1172
|
+
/** A band input sample: keyed by `time` on a time axis, by `x` on a numeric or category axis. */
|
|
1173
|
+
export declare type BandSampleInput = BandPointInput | XBandPointInput;
|
|
1174
|
+
|
|
1175
|
+
export declare const BandSeries: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
1176
|
+
visible: boolean;
|
|
1177
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
1178
|
+
|
|
1179
|
+
/** Series definition for `chart.addSeries` — keeps the chart renderer-agnostic. */
|
|
1180
|
+
export declare const BandSeriesDef: SeriesDefinition<BandSeriesOptions>;
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* Visual options for a band series — the filled region between a `low` and a
|
|
1184
|
+
* `high` edge. Each layer is one band; layers draw in order with translucent
|
|
1185
|
+
* fills, so nested bands of one color read as a fan chart. There is no
|
|
1186
|
+
* stacking: a stack of ranges has no meaning.
|
|
1187
|
+
*/
|
|
1188
|
+
export declare interface BandSeriesOptions {
|
|
1189
|
+
/**
|
|
1190
|
+
* Fill between the edges: a flat color, or a `[top, bottom]` pair painted
|
|
1191
|
+
* as a vertical gradient over each band's visible extent. Applies to every
|
|
1192
|
+
* layer. Default: a gradient of the layer color from 40% opacity at the top
|
|
1193
|
+
* to 4% at the bottom.
|
|
1194
|
+
*/
|
|
1195
|
+
fill?: string | [string, string];
|
|
1196
|
+
/** Edge strokes, in the layer color at 60% opacity. Default: `{ visible: true, width: 1 }`. */
|
|
1197
|
+
stroke?: {
|
|
1198
|
+
/** Whether the `low` and `high` edges are stroked. Default: `true`. */
|
|
1199
|
+
visible?: boolean;
|
|
1200
|
+
/** Stroke width in CSS pixels. Default: `1`. */
|
|
1201
|
+
width?: number;
|
|
1202
|
+
/** Stroke color for every layer. Default: the layer color at 60% opacity. */
|
|
1203
|
+
color?: string;
|
|
1204
|
+
};
|
|
1205
|
+
/**
|
|
1206
|
+
* Edge smoothing, with the same builders as the line series. Default:
|
|
1207
|
+
* `'straight'`. `'smooth'` is monotone, so an edge never overshoots its own
|
|
1208
|
+
* samples.
|
|
1209
|
+
*/
|
|
1210
|
+
curve?: 'straight' | 'smooth' | 'stepped';
|
|
1211
|
+
/**
|
|
1212
|
+
* Entrance style for appended points. Default: `'grow'` — the trailing
|
|
1213
|
+
* segment of both edges unfurls from the previous point.
|
|
1214
|
+
*
|
|
1215
|
+
* @see entryMs — cross-linked duration for this animation.
|
|
1216
|
+
*/
|
|
1217
|
+
entryAnimation?: BandEntryAnimation;
|
|
1218
|
+
/**
|
|
1219
|
+
* Per-point entrance duration in milliseconds. Default: `250`. `false` or
|
|
1220
|
+
* `0` disables the entrance. A chart-level `animations.series.band: false`
|
|
1221
|
+
* wins over this field.
|
|
1222
|
+
*/
|
|
1223
|
+
entryMs?: number | false;
|
|
1224
|
+
/**
|
|
1225
|
+
* Initial-load reveal duration in milliseconds; the full reveal lasts ~2×.
|
|
1226
|
+
* Default: `500`. `false` or `0` disables it. Bulk re-seeds of a non-empty
|
|
1227
|
+
* series never replay it. Skipped under `prefers-reduced-motion`.
|
|
1228
|
+
*/
|
|
1229
|
+
introMs?: number | false;
|
|
1230
|
+
/**
|
|
1231
|
+
* Initial-load reveal choreography — the line series' `LineIntroFn`
|
|
1232
|
+
* contract. The frame's `layerData` / `layerMean` / `primaryPath` describe
|
|
1233
|
+
* each band's center, and a `value` transform applies to both edges.
|
|
1234
|
+
* `heads` are ignored. Default: `unfoldIntro()` — the band opens out of its
|
|
1235
|
+
* mean.
|
|
1236
|
+
*
|
|
1237
|
+
* @see introMs — cross-linked duration for this animation.
|
|
1238
|
+
*/
|
|
1239
|
+
introAnimation?: LineIntroFn;
|
|
1240
|
+
/**
|
|
1241
|
+
* History-prepend reveal for older points loaded at the front. Default:
|
|
1242
|
+
* `backfillSweepIntro()`. `'none'` makes prepended points appear at once.
|
|
1243
|
+
*
|
|
1244
|
+
* @see historyRevealMs — cross-linked duration for this animation.
|
|
1245
|
+
*/
|
|
1246
|
+
historyReveal?: LineIntroFn | 'none';
|
|
1247
|
+
/** History-prepend reveal duration in milliseconds. Default: `400`. `false` or `0` disables it. */
|
|
1248
|
+
historyRevealMs?: number | false;
|
|
1249
|
+
/**
|
|
1250
|
+
* How long both displayed edges take to catch up on every
|
|
1251
|
+
* `updateLastPoint`. Default: `250` ms. `0` or `false` snaps.
|
|
1252
|
+
*/
|
|
1253
|
+
smoothMs?: number | false;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1054
1256
|
/** Declarative per-bar transform — translation and opacity only; growth is
|
|
1055
1257
|
* expressed through {@link BarIntroDirectives.value} instead so stacked
|
|
1056
1258
|
* columns rise as one attached unit. */
|
|
@@ -1161,7 +1363,7 @@ export declare interface BarPaintArgs {
|
|
|
1161
1363
|
/** Paints one bar / stacked segment. Owns its fill — it calls `ctx.fill()`. */
|
|
1162
1364
|
export declare type BarPainter = (env: PaintEnv, args: BarPaintArgs) => void;
|
|
1163
1365
|
|
|
1164
|
-
export declare const BarSeries: DefineComponent<
|
|
1366
|
+
export declare const BarSeries: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{}>, {
|
|
1165
1367
|
visible: boolean;
|
|
1166
1368
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
1167
1369
|
|
|
@@ -1171,7 +1373,10 @@ export declare const BarSeriesDef: SeriesDefinition<BarSeriesOptions>;
|
|
|
1171
1373
|
|
|
1172
1374
|
/** Visual options for a bar series. */
|
|
1173
1375
|
export declare interface BarSeriesOptions {
|
|
1174
|
-
/**
|
|
1376
|
+
/**
|
|
1377
|
+
* Width of each bar as a fraction of the available bar slot (0–1). `1` = bars touch; `0.6` = roughly 60 % of the slot.
|
|
1378
|
+
* Applies on a time or numeric X axis only — on a category axis a bar fills its band (see `axis.x.padding`). Default: 0.7.
|
|
1379
|
+
*/
|
|
1175
1380
|
barWidthRatio: number;
|
|
1176
1381
|
/** Stacking mode. Default: 'off'. */
|
|
1177
1382
|
stacking: StackingMode;
|
|
@@ -1329,6 +1534,12 @@ export declare interface BaseSeriesRenderer {
|
|
|
1329
1534
|
* selects which internal store to target; defaults to 0.
|
|
1330
1535
|
*/
|
|
1331
1536
|
setData(data: unknown, layerIndex?: number): void;
|
|
1537
|
+
/**
|
|
1538
|
+
* Replace the data like {@link setData}, but ease each point that keeps its
|
|
1539
|
+
* `time` from the value on screen to its new one; a point with a new `time`
|
|
1540
|
+
* plays its entrance. Optional — the chart falls back to {@link setData}.
|
|
1541
|
+
*/
|
|
1542
|
+
morphData?(data: unknown, layerIndex?: number): void;
|
|
1332
1543
|
/** Append a single point (real-time tick). Optional — not all renderers support streaming. */
|
|
1333
1544
|
appendPoint?(point: unknown, layerIndex?: number): void;
|
|
1334
1545
|
/**
|
|
@@ -1390,7 +1601,7 @@ export declare interface BaseSeriesRenderer {
|
|
|
1390
1601
|
/** Last data value for the series, or null if empty. Optional. */
|
|
1391
1602
|
getLastValue?(): number | null;
|
|
1392
1603
|
/** Nearest data point to a given time, or null. Optional. */
|
|
1393
|
-
getDataAtTime?(time: number, interval: number): TimePoint | OHLCData | null;
|
|
1604
|
+
getDataAtTime?(time: number, interval: number): TimePoint | OHLCData | BandPoint | null;
|
|
1394
1605
|
/**
|
|
1395
1606
|
* For multi-layer renderers: nearest data point per visible layer at `time`.
|
|
1396
1607
|
* Each entry carries the owning `layerIndex` (so filtered hidden layers
|
|
@@ -1399,12 +1610,7 @@ export declare interface BaseSeriesRenderer {
|
|
|
1399
1610
|
* tooltips/legends.
|
|
1400
1611
|
* Returns null for single-layer renderers or when no visible layer has data.
|
|
1401
1612
|
*/
|
|
1402
|
-
getLayerSnapshots?(time: number, interval: number):
|
|
1403
|
-
layerIndex: number;
|
|
1404
|
-
time: number;
|
|
1405
|
-
value: number;
|
|
1406
|
-
color: string;
|
|
1407
|
-
}[] | null;
|
|
1613
|
+
getLayerSnapshots?(time: number, interval: number): LayerSnapshot[] | null;
|
|
1408
1614
|
/**
|
|
1409
1615
|
* Stacked last value — cumulative top of the rendered stack for multi-layer
|
|
1410
1616
|
* renderers. Falls back to `getLastValue()` behavior for single-layer
|
|
@@ -1430,12 +1636,7 @@ export declare interface BaseSeriesRenderer {
|
|
|
1430
1636
|
* primary layer's time.
|
|
1431
1637
|
* Returns null for single-layer renderers or when no visible layer has data.
|
|
1432
1638
|
*/
|
|
1433
|
-
getLayerLastSnapshots?():
|
|
1434
|
-
layerIndex: number;
|
|
1435
|
-
time: number;
|
|
1436
|
-
value: number;
|
|
1437
|
-
color: string;
|
|
1438
|
-
}[] | null;
|
|
1639
|
+
getLayerLastSnapshots?(): LayerSnapshot[] | null;
|
|
1439
1640
|
/** Total data points across all owned stores. Used by Chart for batch-load detection. */
|
|
1440
1641
|
getTotalLength?(): number;
|
|
1441
1642
|
/**
|
|
@@ -1683,7 +1884,7 @@ declare interface CandlestickDirectionColors {
|
|
|
1683
1884
|
*/
|
|
1684
1885
|
export declare type CandlestickEntryAnimation = 'none' | 'fade' | 'unfold' | 'slide' | 'fade-unfold';
|
|
1685
1886
|
|
|
1686
|
-
export declare const CandlestickSeries: DefineComponent<
|
|
1887
|
+
export declare const CandlestickSeries: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{}>, {
|
|
1687
1888
|
visible: boolean;
|
|
1688
1889
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
1689
1890
|
|
|
@@ -1884,18 +2085,25 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
1884
2085
|
#private;
|
|
1885
2086
|
/** Maps time values to horizontal pixel coordinates. */
|
|
1886
2087
|
readonly timeScale: XScale;
|
|
1887
|
-
/** Maps price/value to vertical pixel coordinates. */
|
|
2088
|
+
/** Maps price/value to vertical pixel coordinates — the default Y scale. */
|
|
1888
2089
|
readonly yScale: YScale;
|
|
1889
|
-
/** CSS px of the Y-axis column. The default collapses to `0` on a spatial-only chart. */
|
|
2090
|
+
/** CSS px of the default Y-axis column. The default collapses to `0` on a spatial-only chart. */
|
|
1890
2091
|
get yAxisWidth(): number;
|
|
1891
|
-
/** Side of the plot area the Y-axis column sits on. */
|
|
2092
|
+
/** Side of the plot area the default Y-axis column sits on. */
|
|
1892
2093
|
get yAxisPosition(): YAxisPosition;
|
|
1893
2094
|
/**
|
|
1894
|
-
* Left edge of the plot area in container CSS px — the Y-axis
|
|
1895
|
-
*
|
|
1896
|
-
*
|
|
2095
|
+
* Left edge of the plot area in container CSS px — the width of the Y-axis
|
|
2096
|
+
* column on the left, `0` without one. Scales map into the plot area, so
|
|
2097
|
+
* add this to `timeScale.timeToX()` to get a container coordinate.
|
|
1897
2098
|
*/
|
|
1898
2099
|
get plotLeft(): number;
|
|
2100
|
+
/**
|
|
2101
|
+
* CSS px of the Y-axis column on `side` — the default axis's or the named
|
|
2102
|
+
* scale's that owns that side — `0` when no column sits there.
|
|
2103
|
+
*/
|
|
2104
|
+
getAxisColumnWidth(side: YAxisPosition): number;
|
|
2105
|
+
/** The named scale whose axis column sits on `side`, `null` when the default axis's does or none. */
|
|
2106
|
+
getAxisColumnScale(side: YAxisPosition): string | null;
|
|
1899
2107
|
/** CSS px height of the floating Title / InfoBar header, `0` without one. A left
|
|
1900
2108
|
* axis shares its column with it, so tick labels fade out underneath. */
|
|
1901
2109
|
get headerHeight(): number;
|
|
@@ -1916,18 +2124,28 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
1916
2124
|
addSeries(type: 'candlestick', options?: Partial<CandlestickSeriesOptions & {
|
|
1917
2125
|
id?: string;
|
|
1918
2126
|
label?: string;
|
|
2127
|
+
scale?: string;
|
|
1919
2128
|
}>): string;
|
|
1920
2129
|
addSeries(type: 'line', options?: Partial<LineSeriesOptions & {
|
|
1921
2130
|
layers?: number;
|
|
1922
2131
|
id?: string;
|
|
1923
2132
|
label?: string;
|
|
1924
2133
|
labels?: (string | undefined)[];
|
|
2134
|
+
scale?: string;
|
|
1925
2135
|
}>): string;
|
|
1926
2136
|
addSeries(type: 'bar', options?: Partial<BarSeriesOptions & {
|
|
1927
2137
|
layers?: number;
|
|
1928
2138
|
id?: string;
|
|
1929
2139
|
label?: string;
|
|
1930
2140
|
labels?: (string | undefined)[];
|
|
2141
|
+
scale?: string;
|
|
2142
|
+
}>): string;
|
|
2143
|
+
addSeries(type: 'band', options?: Partial<BandSeriesOptions & {
|
|
2144
|
+
layers?: number;
|
|
2145
|
+
id?: string;
|
|
2146
|
+
label?: string;
|
|
2147
|
+
labels?: (string | undefined)[];
|
|
2148
|
+
scale?: string;
|
|
1931
2149
|
}>): string;
|
|
1932
2150
|
addSeries(type: 'pie', options?: Partial<PieSeriesOptions & {
|
|
1933
2151
|
id?: string;
|
|
@@ -1942,6 +2160,7 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
1942
2160
|
id?: string;
|
|
1943
2161
|
label?: string;
|
|
1944
2162
|
labels?: (string | undefined)[];
|
|
2163
|
+
scale?: string;
|
|
1945
2164
|
}): string;
|
|
1946
2165
|
/** Remove a series by ID and clean up its resources. */
|
|
1947
2166
|
removeSeries(id: string): void;
|
|
@@ -2019,10 +2238,13 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2019
2238
|
*
|
|
2020
2239
|
* For line/bar accepts `TimePointInput[]` (time may be `Date`); for candlestick accepts `OHLCInput[]`;
|
|
2021
2240
|
* for pie accepts `PieSliceData[]`. Time fields are normalized internally.
|
|
2241
|
+
*
|
|
2242
|
+
* On a category axis a replace is how a bar other than the last changes value,
|
|
2243
|
+
* so it eases like a stream: points that keep their band ease to their new values.
|
|
2022
2244
|
*/
|
|
2023
2245
|
setSeriesData(id: string, data: unknown, layerIndex?: number): void;
|
|
2024
2246
|
/** Append a new data point to the end of a series (real-time tick). */
|
|
2025
|
-
appendData(id: string, point:
|
|
2247
|
+
appendData(id: string, point: SeriesPointInput, layerIndex?: number): void;
|
|
2026
2248
|
/**
|
|
2027
2249
|
* Prepend older points to the front of a series — the "load more history on
|
|
2028
2250
|
* scroll" path. Unlike {@link setSeriesData}, this deliberately does NOT set
|
|
@@ -2036,9 +2258,9 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2036
2258
|
* first point; the sync reconciler guarantees this before calling here.
|
|
2037
2259
|
* No-op if the renderer doesn't support prepend.
|
|
2038
2260
|
*/
|
|
2039
|
-
prependData(id: string, points:
|
|
2261
|
+
prependData(id: string, points: SeriesPointInput[], layerIndex?: number): void;
|
|
2040
2262
|
/** Update the last data point of a series in place (e.g. live candle update). */
|
|
2041
|
-
updateData(id: string, point:
|
|
2263
|
+
updateData(id: string, point: SeriesPointInput, layerIndex?: number): void;
|
|
2042
2264
|
/**
|
|
2043
2265
|
* Keep only the most recent `count` points of a series — drop the oldest
|
|
2044
2266
|
* tail when the series exceeds the cap. Smooth Y-range chase (no snap):
|
|
@@ -2053,8 +2275,13 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2053
2275
|
* ```
|
|
2054
2276
|
*/
|
|
2055
2277
|
keepLast(id: string, count: number, layerIndex?: number): void;
|
|
2056
|
-
/**
|
|
2057
|
-
|
|
2278
|
+
/**
|
|
2279
|
+
* Update visual options (color, width, etc.) for an existing series. `scale`
|
|
2280
|
+
* (time series) moves it onto a named Y scale, `undefined` back to the default.
|
|
2281
|
+
*/
|
|
2282
|
+
updateSeriesOptions(id: string, options: (Partial<CandlestickSeriesOptions> | Partial<LineSeriesOptions> | Partial<BarSeriesOptions> | Partial<BandSeriesOptions> | Partial<PieSeriesOptions> | Partial<HeatmapSeriesOptions>) & {
|
|
2283
|
+
scale?: string;
|
|
2284
|
+
}): void;
|
|
2058
2285
|
/**
|
|
2059
2286
|
* Batch multiple updates: suppress recomputes until `fn` returns. Exceptions
|
|
2060
2287
|
* inside `fn` still flush the batch so counters don't leak across calls.
|
|
@@ -2171,27 +2398,22 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2171
2398
|
} | null;
|
|
2172
2399
|
/** Get the second-to-last value, useful for computing change. */
|
|
2173
2400
|
getPreviousClose(seriesId: string): number | null;
|
|
2174
|
-
getLastData(seriesId: string): OHLCData | TimePoint | null;
|
|
2401
|
+
getLastData(seriesId: string): OHLCData | TimePoint | BandPoint | null;
|
|
2175
2402
|
/** Find the data point closest to the given timestamp within one data interval. */
|
|
2176
|
-
getDataAtTime(seriesId: string, time: number): OHLCData | TimePoint | null;
|
|
2403
|
+
getDataAtTime(seriesId: string, time: number): OHLCData | TimePoint | BandPoint | null;
|
|
2177
2404
|
/**
|
|
2178
2405
|
* Get all layers' data at a given time for multi-layer series (Bar/Line
|
|
2179
2406
|
* with stacking). Each entry carries the owning `layerIndex` and the
|
|
2180
2407
|
* snapped sample time — callers must not derive layer identity from the
|
|
2181
2408
|
* array index, because hidden layers are filtered out.
|
|
2182
2409
|
*/
|
|
2183
|
-
getLayerSnapshots(seriesId: string, time: number):
|
|
2184
|
-
layerIndex: number;
|
|
2185
|
-
time: number;
|
|
2186
|
-
value: number;
|
|
2187
|
-
color: string;
|
|
2188
|
-
}[] | null;
|
|
2410
|
+
getLayerSnapshots(seriesId: string, time: number): LayerSnapshot[] | null;
|
|
2189
2411
|
getSeriesIds(): string[];
|
|
2190
2412
|
/**
|
|
2191
2413
|
* Whether pan/zoom gestures currently apply — true when any visible series
|
|
2192
|
-
* has a time axis. Part of the
|
|
2193
|
-
*
|
|
2194
|
-
* wheel and touch events, so the page scrolls normally under the cursor.
|
|
2414
|
+
* has a time axis and `axis.x.panZoom` allows it. Part of the
|
|
2415
|
+
* {@link PanZoomTarget} surface: otherwise the interaction layer stops
|
|
2416
|
+
* capturing wheel and touch events, so the page scrolls normally under the cursor.
|
|
2195
2417
|
*/
|
|
2196
2418
|
canPanZoom(): boolean;
|
|
2197
2419
|
/**
|
|
@@ -2233,12 +2455,7 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2233
2455
|
* overlay components that must display every layer in last-mode even
|
|
2234
2456
|
* when layers advance at different rates (ragged streams).
|
|
2235
2457
|
*/
|
|
2236
|
-
getLayerLastSnapshots(seriesId: string):
|
|
2237
|
-
layerIndex: number;
|
|
2238
|
-
time: number;
|
|
2239
|
-
value: number;
|
|
2240
|
-
color: string;
|
|
2241
|
-
}[] | null;
|
|
2458
|
+
getLayerLastSnapshots(seriesId: string): LayerSnapshot[] | null;
|
|
2242
2459
|
/** Get the primary display color for a series. */
|
|
2243
2460
|
getSeriesColor(seriesId: string): string | null;
|
|
2244
2461
|
/** The series' primary name (first layer). Used for single-layer overlays. */
|
|
@@ -2279,17 +2496,54 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2279
2496
|
getTimeZone(): string | undefined;
|
|
2280
2497
|
/** Update axis configuration and re-render. */
|
|
2281
2498
|
setAxis(config: AxisConfig): void;
|
|
2499
|
+
/**
|
|
2500
|
+
* Replace the named Y scales (see {@link ChartOptions.scales}). Added,
|
|
2501
|
+
* removed and edited scales apply in place: a changed transform resets that
|
|
2502
|
+
* scale's ticks, and every scale refits. A deep-equal replay is a no-op.
|
|
2503
|
+
*/
|
|
2504
|
+
setScales(scales: Readonly<Record<string, YAxisConfig>> | undefined): void;
|
|
2505
|
+
/** Ids of the named Y scales, in declaration order. */
|
|
2506
|
+
getYScaleIds(): string[];
|
|
2507
|
+
/** The Y scale named `scaleId`; the default scale for `undefined` or an id `scales` doesn't define. */
|
|
2508
|
+
getYScale(scaleId?: string): YScale;
|
|
2509
|
+
/**
|
|
2510
|
+
* The column a scale's axis sits in — always the default axis's for
|
|
2511
|
+
* `undefined`; `null` for an overlay scale or an unknown id.
|
|
2512
|
+
*/
|
|
2513
|
+
getYScaleColumn(scaleId?: string): {
|
|
2514
|
+
position: YAxisPosition;
|
|
2515
|
+
width: number;
|
|
2516
|
+
} | null;
|
|
2517
|
+
/** The named scale a series maps through, `undefined` for the default scale. */
|
|
2518
|
+
getSeriesScale(seriesId: string): string | undefined;
|
|
2519
|
+
/**
|
|
2520
|
+
* Install (or clear, with `null`) the value formatter `<YAxis format>` puts
|
|
2521
|
+
* on a scale — its axis labels, crosshair label and `YLabel` read it. `scale`
|
|
2522
|
+
* picks a named scale; an id `scales` doesn't define is a no-op.
|
|
2523
|
+
*/
|
|
2524
|
+
setYAxisFormat(params: {
|
|
2525
|
+
format: ValueFormatter | null;
|
|
2526
|
+
scale?: string;
|
|
2527
|
+
}): void;
|
|
2282
2528
|
/**
|
|
2283
2529
|
* Apply label-density knobs driven by `<YAxis labelCount=… minLabelSpacing=…>`
|
|
2284
2530
|
* — kept separate from {@link setAxis} so component props don't force a
|
|
2285
|
-
* Y-animation reset.
|
|
2286
|
-
*
|
|
2531
|
+
* Y-animation reset. `scale` picks a named scale's axis — an id `scales`
|
|
2532
|
+
* doesn't define is a no-op. Triggers a viewportChange + repaint so static
|
|
2533
|
+
* charts react without waiting for pan/zoom.
|
|
2287
2534
|
*/
|
|
2288
2535
|
setYAxisLabelDensity(params: {
|
|
2289
2536
|
labelCount?: number | null;
|
|
2290
2537
|
minLabelSpacing?: number | null;
|
|
2538
|
+
scale?: string;
|
|
2291
2539
|
}): void;
|
|
2292
|
-
/**
|
|
2540
|
+
/**
|
|
2541
|
+
* Install (or clear, with `null`) the X label formatter `<XAxis format>`
|
|
2542
|
+
* puts on the axis — its tick labels, the crosshair label, the tooltip and
|
|
2543
|
+
* info-bar headers read it.
|
|
2544
|
+
*/
|
|
2545
|
+
setXAxisFormat(format: XAxisFormatter | null): void;
|
|
2546
|
+
/** Label-density knobs for the X axis — mirror of {@link setYAxisLabelDensity}. */
|
|
2293
2547
|
setTimeAxisLabelDensity(params: {
|
|
2294
2548
|
labelCount?: number | null;
|
|
2295
2549
|
minLabelSpacing?: number | null;
|
|
@@ -2408,6 +2662,16 @@ export declare interface ChartLayout {
|
|
|
2408
2662
|
export declare interface ChartOptions {
|
|
2409
2663
|
theme?: ChartTheme;
|
|
2410
2664
|
axis?: AxisConfig;
|
|
2665
|
+
/**
|
|
2666
|
+
* Named secondary Y scales, keyed by id — a time series opts in with its
|
|
2667
|
+
* `scale` option. Each one autoscales from its own series and animates
|
|
2668
|
+
* like the default scale; X stays shared. Same fields as `axis.y`, except
|
|
2669
|
+
* `position` defaults to the side opposite the default axis. One axis
|
|
2670
|
+
* column fits on each side: a visible scale whose side is taken renders
|
|
2671
|
+
* as an overlay (no column), as does `visible: false`. Grid lines follow
|
|
2672
|
+
* the default scale. Live — `chart.setScales()` updates it after construction.
|
|
2673
|
+
*/
|
|
2674
|
+
scales?: Record<string, YAxisConfig>;
|
|
2411
2675
|
/**
|
|
2412
2676
|
* Viewport padding. `top`/`bottom` are in pixels. `left`/`right` accept either pixels (`50`)
|
|
2413
2677
|
* or data intervals (`{ intervals: 3 }`). Defaults: `{ top: 20, bottom: 20, right: { intervals: 3 }, left: { intervals: 0 } }`.
|
|
@@ -2773,8 +3037,13 @@ export declare interface CrosshairPosition {
|
|
|
2773
3037
|
mediaX: number;
|
|
2774
3038
|
/** Y position in CSS pixels relative to the chart container. */
|
|
2775
3039
|
mediaY: number;
|
|
2776
|
-
/**
|
|
3040
|
+
/**
|
|
3041
|
+
* Internal X coordinate under the crosshair — the timestamp in milliseconds
|
|
3042
|
+
* on a time axis, the number on a numeric axis, the band index on a category axis.
|
|
3043
|
+
*/
|
|
2777
3044
|
time: number;
|
|
3045
|
+
/** X in the axis domain: epoch ms on a time axis, the number on a numeric axis, the category name on a category axis. */
|
|
3046
|
+
x: number | string;
|
|
2778
3047
|
/** Y (value) under the crosshair. */
|
|
2779
3048
|
y: number;
|
|
2780
3049
|
}
|
|
@@ -2802,7 +3071,7 @@ export declare interface CustomSpatialSeriesRenderer extends BaseSeriesRenderer
|
|
|
2802
3071
|
*/
|
|
2803
3072
|
export declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
2804
3073
|
|
|
2805
|
-
declare const _default: DefineComponent<
|
|
3074
|
+
declare const _default: DefineComponent<__VLS_Props_20, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_20> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
2806
3075
|
containerRef: HTMLDivElement;
|
|
2807
3076
|
}, HTMLDivElement>;
|
|
2808
3077
|
export { _default as TimeAxis }
|
|
@@ -2960,7 +3229,7 @@ export declare interface HeatmapCellLabelsOptions {
|
|
|
2960
3229
|
format?: (value: number) => string;
|
|
2961
3230
|
}
|
|
2962
3231
|
|
|
2963
|
-
export declare const HeatmapSeries: DefineComponent<
|
|
3232
|
+
export declare const HeatmapSeries: DefineComponent<__VLS_Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{}>, {
|
|
2964
3233
|
visible: boolean;
|
|
2965
3234
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
2966
3235
|
|
|
@@ -3011,7 +3280,7 @@ export declare interface HeatmapSeriesRenderer extends BaseSeriesRenderer {
|
|
|
3011
3280
|
readonly kind: 'heatmap';
|
|
3012
3281
|
}
|
|
3013
3282
|
|
|
3014
|
-
export declare const HeatmapTooltip: DefineComponent<
|
|
3283
|
+
export declare const HeatmapTooltip: DefineComponent<__VLS_Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_8> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
3015
3284
|
|
|
3016
3285
|
/**
|
|
3017
3286
|
* Velocity-matched cubic Hermite Y transition. Direction-aware: per-call
|
|
@@ -3055,6 +3324,23 @@ export declare function isTimeSeriesRenderer(renderer: SeriesRenderer): renderer
|
|
|
3055
3324
|
|
|
3056
3325
|
export declare const lavenderMist: ThemePreset;
|
|
3057
3326
|
|
|
3327
|
+
/**
|
|
3328
|
+
* One layer's sample in a multi-layer query ({@link BaseSeriesRenderer.getLayerSnapshots}).
|
|
3329
|
+
* `time` is the resolved sample time, not the query time. A band layer also
|
|
3330
|
+
* carries its `low` / `high` edges; its `value` is then their midpoint, kept
|
|
3331
|
+
* only for sorting and anchoring — display the edges instead.
|
|
3332
|
+
*/
|
|
3333
|
+
export declare interface LayerSnapshot {
|
|
3334
|
+
layerIndex: number;
|
|
3335
|
+
time: number;
|
|
3336
|
+
value: number;
|
|
3337
|
+
color: string;
|
|
3338
|
+
low?: number;
|
|
3339
|
+
high?: number;
|
|
3340
|
+
/** The sample's own X on a numeric or category axis. */
|
|
3341
|
+
x?: number | string;
|
|
3342
|
+
}
|
|
3343
|
+
|
|
3058
3344
|
export declare const Legend: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
3059
3345
|
|
|
3060
3346
|
/**
|
|
@@ -3121,6 +3407,7 @@ declare interface LineEntry {
|
|
|
3121
3407
|
label?: string;
|
|
3122
3408
|
style: ReferenceLineStyle;
|
|
3123
3409
|
width: number;
|
|
3410
|
+
scale?: string;
|
|
3124
3411
|
}
|
|
3125
3412
|
|
|
3126
3413
|
/**
|
|
@@ -3202,6 +3489,7 @@ export declare interface LineIntroFrame {
|
|
|
3202
3489
|
/**
|
|
3203
3490
|
* Mean of the layer's visible plottable values, taken on the Y axis (the
|
|
3204
3491
|
* geometric mean on log), or `null` for an empty/poisoned layer (memoized per frame).
|
|
3492
|
+
* On a percent stack, the layer's mean share of its column, in percent.
|
|
3205
3493
|
*/
|
|
3206
3494
|
layerMean(layerIndex: number): number | null;
|
|
3207
3495
|
/**
|
|
@@ -3219,7 +3507,10 @@ export declare interface LineIntroFrame {
|
|
|
3219
3507
|
export declare interface LineIntroValueArgs {
|
|
3220
3508
|
layerIndex: number;
|
|
3221
3509
|
time: number;
|
|
3222
|
-
/**
|
|
3510
|
+
/**
|
|
3511
|
+
* The value the renderer would draw without the intro (live smoothing included).
|
|
3512
|
+
* On a percent stack, the layer's share of its column, in percent.
|
|
3513
|
+
*/
|
|
3223
3514
|
value: number;
|
|
3224
3515
|
/** Normalized x-position of `time` across the visible range, clamped to `[0, 1]`. */
|
|
3225
3516
|
position: number;
|
|
@@ -3264,7 +3555,10 @@ declare interface LinePoint {
|
|
|
3264
3555
|
y: number;
|
|
3265
3556
|
}
|
|
3266
3557
|
|
|
3267
|
-
|
|
3558
|
+
/** A line / bar input point: keyed by `time` on a time axis, by `x` on a numeric or category axis. */
|
|
3559
|
+
export declare type LinePointInput = TimePointInput | XPointInput;
|
|
3560
|
+
|
|
3561
|
+
export declare const LineSeries: DefineComponent<__VLS_Props_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_6> & Readonly<{}>, {
|
|
3268
3562
|
visible: boolean;
|
|
3269
3563
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
3270
3564
|
|
|
@@ -3557,7 +3851,7 @@ export declare interface LogScaleOptions {
|
|
|
3557
3851
|
base?: number;
|
|
3558
3852
|
}
|
|
3559
3853
|
|
|
3560
|
-
export declare const Marker: DefineComponent<
|
|
3854
|
+
export declare const Marker: DefineComponent<__VLS_Props_11, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_11> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
3561
3855
|
|
|
3562
3856
|
/**
|
|
3563
3857
|
* A point annotation pinned to a `time` (X) and a `value` (Y) — "anomaly opened
|
|
@@ -3588,6 +3882,8 @@ export declare interface MarkerConfig {
|
|
|
3588
3882
|
label?: string;
|
|
3589
3883
|
/** Color override. Falls back to the series color (when `seriesId` is set), then the theme line color. */
|
|
3590
3884
|
color?: string;
|
|
3885
|
+
/** Named Y scale (`ChartOptions.scales`) the value maps through. Default: the `seriesId` series' scale, else the default scale. */
|
|
3886
|
+
scale?: string;
|
|
3591
3887
|
}
|
|
3592
3888
|
|
|
3593
3889
|
/** Internal bookkeeping for a registered marker. `time` is normalized to epoch ms; `shape`/`pulse` carry resolved defaults. */
|
|
@@ -3600,6 +3896,7 @@ declare interface MarkerEntry {
|
|
|
3600
3896
|
pulse: boolean;
|
|
3601
3897
|
label?: string;
|
|
3602
3898
|
color?: string;
|
|
3899
|
+
scale?: string;
|
|
3603
3900
|
}
|
|
3604
3901
|
|
|
3605
3902
|
/**
|
|
@@ -3665,11 +3962,12 @@ declare interface MorphPlaceholder {
|
|
|
3665
3962
|
* - an array mixing raw `TimePointInput[]` layers and named `SeriesLayer`s.
|
|
3666
3963
|
*
|
|
3667
3964
|
* Everything normalizes to `SeriesLayer[]` internally (see `toLayers`). Time
|
|
3668
|
-
* accepts epoch milliseconds or a `Date` on every point.
|
|
3965
|
+
* accepts epoch milliseconds or a `Date` on every point. On a numeric or
|
|
3966
|
+
* category X axis the points are {@link XPointInput}s instead.
|
|
3669
3967
|
*/
|
|
3670
|
-
export declare type MultiLayerData =
|
|
3968
|
+
export declare type MultiLayerData = LinePointInput[] | SeriesLayer<LinePointInput> | Array<LinePointInput[] | SeriesLayer<LinePointInput>>;
|
|
3671
3969
|
|
|
3672
|
-
declare const Navigator_2: DefineComponent<
|
|
3970
|
+
declare const Navigator_2: DefineComponent<__VLS_Props_12, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_12> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
3673
3971
|
stripRef: HTMLDivElement;
|
|
3674
3972
|
}, any>;
|
|
3675
3973
|
export { Navigator_2 as Navigator }
|
|
@@ -3691,9 +3989,8 @@ export declare interface NavigatorCandlePoint {
|
|
|
3691
3989
|
* left handle, right handle. The overlay is purely visual; pointer input is
|
|
3692
3990
|
* captured on the canvas and hit-tested against the current window geometry.
|
|
3693
3991
|
*
|
|
3694
|
-
* Both layers reserve
|
|
3695
|
-
*
|
|
3696
|
-
* the TimeAxis).
|
|
3992
|
+
* Both layers reserve the main chart's Y-axis columns so the navigator's
|
|
3993
|
+
* active zone aligns with its plot area (matches the TimeAxis).
|
|
3697
3994
|
*
|
|
3698
3995
|
* Event topology — navigator is a pure listener on the chart side, never emits:
|
|
3699
3996
|
* chart.viewportChange → reposition window DOM on next frame (canvas untouched)
|
|
@@ -3762,7 +4059,7 @@ export declare const nightOwl: ThemePreset;
|
|
|
3762
4059
|
/** Convert a {@link TimeValue} (number ms or Date) to a millisecond timestamp. */
|
|
3763
4060
|
export declare function normalizeTime(t: TimeValue): number;
|
|
3764
4061
|
|
|
3765
|
-
export declare const NumberFlow: DefineComponent<
|
|
4062
|
+
export declare const NumberFlow: DefineComponent<__VLS_Props_13, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_13> & Readonly<{}>, {
|
|
3766
4063
|
locale: string;
|
|
3767
4064
|
spinDuration: number;
|
|
3768
4065
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
@@ -4080,7 +4377,7 @@ declare interface PieOtherOptions {
|
|
|
4080
4377
|
color?: string;
|
|
4081
4378
|
}
|
|
4082
4379
|
|
|
4083
|
-
export declare const PieSeries: DefineComponent<
|
|
4380
|
+
export declare const PieSeries: DefineComponent<__VLS_Props_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_7> & Readonly<{}>, {
|
|
4084
4381
|
visible: boolean;
|
|
4085
4382
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
4086
4383
|
|
|
@@ -4243,7 +4540,10 @@ export declare function plotterIntro(): LineIntroFn;
|
|
|
4243
4540
|
export declare interface PointClickInfo {
|
|
4244
4541
|
mediaX: number;
|
|
4245
4542
|
mediaY: number;
|
|
4543
|
+
/** Internal X coordinate — epoch ms on a time axis, the number on a numeric axis, the band index on a category axis. */
|
|
4246
4544
|
time: number;
|
|
4545
|
+
/** X in the axis domain: epoch ms on a time axis, the number on a numeric axis, the category name on a category axis. */
|
|
4546
|
+
x: number | string;
|
|
4247
4547
|
y: number;
|
|
4248
4548
|
spatialHit: {
|
|
4249
4549
|
seriesId: string;
|
|
@@ -4261,7 +4561,7 @@ declare interface Rect {
|
|
|
4261
4561
|
height: number;
|
|
4262
4562
|
}
|
|
4263
4563
|
|
|
4264
|
-
export declare const ReferenceLine: DefineComponent<
|
|
4564
|
+
export declare const ReferenceLine: DefineComponent<__VLS_Props_16, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_16> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
4265
4565
|
|
|
4266
4566
|
/**
|
|
4267
4567
|
* A straight reference line across the plot — a horizontal threshold / baseline
|
|
@@ -4284,6 +4584,8 @@ export declare interface ReferenceLineConfig {
|
|
|
4284
4584
|
style?: ReferenceLineStyle;
|
|
4285
4585
|
/** Stroke width in CSS pixels. Default: `1`. */
|
|
4286
4586
|
width?: number;
|
|
4587
|
+
/** Named Y scale (`ChartOptions.scales`) a horizontal line's `value` maps through. Default: the default scale. */
|
|
4588
|
+
scale?: string;
|
|
4287
4589
|
}
|
|
4288
4590
|
|
|
4289
4591
|
/** Orientation of a resolved reference line. */
|
|
@@ -4303,7 +4605,7 @@ declare interface RegionEntry {
|
|
|
4303
4605
|
}
|
|
4304
4606
|
|
|
4305
4607
|
/**
|
|
4306
|
-
* Register the
|
|
4608
|
+
* Register the six built-in series so the string form
|
|
4307
4609
|
* `chart.addSeries('line', …)` resolves. Call it once at startup.
|
|
4308
4610
|
*
|
|
4309
4611
|
* Importing this helper pulls every renderer into the bundle — hosts that
|
|
@@ -4469,6 +4771,11 @@ export declare interface SeriesCreateEnv {
|
|
|
4469
4771
|
export declare interface SeriesDefinition<O = Record<string, unknown>> {
|
|
4470
4772
|
/** Discriminator for animation defaults and string-form lookup. */
|
|
4471
4773
|
readonly type: SeriesType;
|
|
4774
|
+
/**
|
|
4775
|
+
* X axis types the series can plot on. Default: `['time']`. Not read for a
|
|
4776
|
+
* spatial series (pie, heatmap), which has no X axis.
|
|
4777
|
+
*/
|
|
4778
|
+
readonly xTypes?: readonly XAxisType[];
|
|
4472
4779
|
/** Construct the renderer. `options` arrives with the chart's animation defaults/overrides already merged. */
|
|
4473
4780
|
create(env: SeriesCreateEnv, options: Partial<O>): SeriesRenderer;
|
|
4474
4781
|
}
|
|
@@ -4485,7 +4792,7 @@ export declare interface SeriesHoverInfo {
|
|
|
4485
4792
|
* series (see {@link CustomSpatialSeriesRenderer} / {@link TimeSeriesRenderer})
|
|
4486
4793
|
* picks any string that isn't one of the built-ins.
|
|
4487
4794
|
*/
|
|
4488
|
-
export declare type SeriesKind = 'candlestick' | 'line' | 'bar' | 'pie' | 'heatmap' | (string & {});
|
|
4795
|
+
export declare type SeriesKind = 'candlestick' | 'line' | 'bar' | 'band' | 'pie' | 'heatmap' | (string & {});
|
|
4489
4796
|
|
|
4490
4797
|
/**
|
|
4491
4798
|
* A single named (and optionally colored) layer. Carries the layer's display
|
|
@@ -4502,6 +4809,9 @@ declare interface SeriesLayer<T> {
|
|
|
4502
4809
|
data: T[];
|
|
4503
4810
|
}
|
|
4504
4811
|
|
|
4812
|
+
/** Any point `appendData` / `prependData` / `updateData` take. */
|
|
4813
|
+
declare type SeriesPointInput = OHLCInput | TimePointInput | BandPointInput | XPointInput | XBandPointInput;
|
|
4814
|
+
|
|
4505
4815
|
export declare interface SeriesRenderContext {
|
|
4506
4816
|
scope: BitmapCoordinateSpace;
|
|
4507
4817
|
timeScale: XScale;
|
|
@@ -4546,19 +4856,21 @@ export declare type SeriesRenderer = TimeSeriesRenderer | PieSeriesRenderer | He
|
|
|
4546
4856
|
* grouping (e.g. `snapshots.filter(s => s.seriesId === 'btc')`).
|
|
4547
4857
|
*
|
|
4548
4858
|
* `data` is a shallow clone, frozen along with the snapshot itself — a slot
|
|
4549
|
-
* consumer cannot accidentally mutate the chart's internal store.
|
|
4859
|
+
* consumer cannot accidentally mutate the chart's internal store. Its shape
|
|
4860
|
+
* follows the series: `OHLCData` for a candlestick, `TimePoint` for a line or
|
|
4861
|
+
* bar, `BandPoint` (`{ time, low, high }`) for a band.
|
|
4550
4862
|
*/
|
|
4551
4863
|
export declare interface SeriesSnapshot {
|
|
4552
4864
|
readonly id: string;
|
|
4553
4865
|
readonly seriesId: string;
|
|
4554
4866
|
readonly layerIndex?: number;
|
|
4555
4867
|
readonly label?: string;
|
|
4556
|
-
readonly data: Readonly<OHLCData> | Readonly<TimePoint>;
|
|
4868
|
+
readonly data: Readonly<OHLCData> | Readonly<TimePoint> | Readonly<BandPoint>;
|
|
4557
4869
|
readonly color: string;
|
|
4558
4870
|
}
|
|
4559
4871
|
|
|
4560
4872
|
/** Primary series types. Open-ended — a custom {@link SeriesDefinition} picks any string that isn't a built-in. */
|
|
4561
|
-
export declare type SeriesType = 'candlestick' | 'line' | 'bar' | 'pie' | 'heatmap' | (string & {});
|
|
4873
|
+
export declare type SeriesType = 'candlestick' | 'line' | 'bar' | 'band' | 'pie' | 'heatmap' | (string & {});
|
|
4562
4874
|
|
|
4563
4875
|
/** Width and height pair. */
|
|
4564
4876
|
declare interface Size {
|
|
@@ -4768,14 +5080,20 @@ export declare interface TimeFormatOptions {
|
|
|
4768
5080
|
/** Custom time-tick formatter, mirroring {@link YScale}'s `ValueFormatter` contract. */
|
|
4769
5081
|
export declare type TimeFormatter = (timestamp: number, interval: number) => string;
|
|
4770
5082
|
|
|
4771
|
-
/**
|
|
5083
|
+
/**
|
|
5084
|
+
* A single time-value data point for line and bar series. Time is a timestamp in milliseconds.
|
|
5085
|
+
* On a numeric or category X axis `time` is the internal X coordinate (the number, or the
|
|
5086
|
+
* category's index) and `x` is the point's own X.
|
|
5087
|
+
*/
|
|
4772
5088
|
export declare interface TimePoint {
|
|
4773
5089
|
time: number;
|
|
4774
5090
|
value: number;
|
|
5091
|
+
/** The point's X on a numeric or category axis, as passed in. */
|
|
5092
|
+
x?: number | string;
|
|
4775
5093
|
}
|
|
4776
5094
|
|
|
4777
5095
|
/** {@link TimePoint} that also accepts `Date` for the time field. */
|
|
4778
|
-
export declare type TimePointInput = Omit<TimePoint, 'time'> & {
|
|
5096
|
+
export declare type TimePointInput = Omit<TimePoint, 'time' | 'x'> & {
|
|
4779
5097
|
time: TimeValue;
|
|
4780
5098
|
};
|
|
4781
5099
|
|
|
@@ -4819,20 +5137,20 @@ export declare type TimeRegionEnd = TimeValue | 'now';
|
|
|
4819
5137
|
* pinned to layer 0 (see {@link BaseMultiLayerSeries}).
|
|
4820
5138
|
*/
|
|
4821
5139
|
export declare interface TimeSeriesRenderer extends BaseSeriesRenderer {
|
|
4822
|
-
readonly kind: 'candlestick' | 'line' | 'bar' | (string & {});
|
|
5140
|
+
readonly kind: 'candlestick' | 'line' | 'bar' | 'band' | (string & {});
|
|
4823
5141
|
/** Earliest/latest sample time across all owned layers, or null when empty. */
|
|
4824
5142
|
getTimeBounds(): {
|
|
4825
5143
|
first: number;
|
|
4826
5144
|
last: number;
|
|
4827
5145
|
} | null;
|
|
4828
5146
|
/** Last data point (layer 0 for multi-layer), or null when empty. */
|
|
4829
|
-
getLastDataPoint(): OHLCData | TimePoint | null;
|
|
5147
|
+
getLastDataPoint(): OHLCData | TimePoint | BandPoint | null;
|
|
4830
5148
|
/** Second-to-last data point (layer 0 for multi-layer), or null. */
|
|
4831
|
-
getSecondLastDataPoint(): OHLCData | TimePoint | null;
|
|
5149
|
+
getSecondLastDataPoint(): OHLCData | TimePoint | BandPoint | null;
|
|
4832
5150
|
/** First `maxCount` sample times from the first populated layer — feeds interval detection. */
|
|
4833
5151
|
sampleTimes(maxCount: number): number[];
|
|
4834
5152
|
/** Visible points in `[from, to]` (layer 0 for multi-layer). */
|
|
4835
|
-
getVisibleDataPoints(from: number, to: number): readonly (OHLCData | TimePoint)[];
|
|
5153
|
+
getVisibleDataPoints(from: number, to: number): readonly (OHLCData | TimePoint | BandPoint)[];
|
|
4836
5154
|
/**
|
|
4837
5155
|
* Effective min/max for auto-range (stacked totals for multi-layer; raw
|
|
4838
5156
|
* min/max otherwise). With `opts.plottable` (a non-linear Y scale) values
|
|
@@ -5148,14 +5466,69 @@ export declare function wickBodyIntro(): CandleIntroFn;
|
|
|
5148
5466
|
*/
|
|
5149
5467
|
export declare function wipeIntro(): WaveIntroFn;
|
|
5150
5468
|
|
|
5151
|
-
/** Configuration for the X
|
|
5469
|
+
/** Configuration for the X axis. */
|
|
5152
5470
|
export declare interface XAxisConfig {
|
|
5471
|
+
/**
|
|
5472
|
+
* What the axis maps. Default: `'time'`. Read once at construction — a later
|
|
5473
|
+
* change is ignored with a dev warning; remount the chart (a React `key`) to
|
|
5474
|
+
* switch. Line, bar and band series work on every type, candlestick on
|
|
5475
|
+
* `'time'` only. Navigator, EdgeLoader / `onEdgeReached` and TimeRegion are
|
|
5476
|
+
* time-only.
|
|
5477
|
+
*/
|
|
5478
|
+
type?: XAxisType;
|
|
5479
|
+
/** Band spacing on a category axis. Ignored on other types. Live. */
|
|
5480
|
+
padding?: XAxisPadding;
|
|
5481
|
+
/**
|
|
5482
|
+
* Whether drag and wheel move the X range. The crosshair works either way.
|
|
5483
|
+
* Default: `true`, or `false` on a category axis. Live.
|
|
5484
|
+
*/
|
|
5485
|
+
panZoom?: boolean;
|
|
5153
5486
|
/** Height in CSS pixels. Default: 30, or 0 when every series is spatial (pie, heatmap). */
|
|
5154
5487
|
height?: number;
|
|
5155
5488
|
/** Whether the axis is visible. Default: true. When false, height is treated as 0. */
|
|
5156
5489
|
visible?: boolean;
|
|
5157
5490
|
}
|
|
5158
5491
|
|
|
5492
|
+
/**
|
|
5493
|
+
* X label formatter for any axis type (`<XAxis format>`): `x` is epoch ms on a
|
|
5494
|
+
* time axis, the number on a numeric axis, the category name on a category
|
|
5495
|
+
* axis; `step` is the tick spacing in the internal coordinate.
|
|
5496
|
+
*/
|
|
5497
|
+
export declare type XAxisFormatter = (x: number | string, step: number) => string;
|
|
5498
|
+
|
|
5499
|
+
/** Band spacing on a category axis, in fractions of one category step. */
|
|
5500
|
+
export declare interface XAxisPadding {
|
|
5501
|
+
/** Gap between adjacent bands. Default: `0.3`. */
|
|
5502
|
+
inner?: number;
|
|
5503
|
+
/** Space before the first band and after the last one. Default: `0.2`. */
|
|
5504
|
+
outer?: number;
|
|
5505
|
+
}
|
|
5506
|
+
|
|
5507
|
+
/**
|
|
5508
|
+
* What the X axis maps:
|
|
5509
|
+
* - `'time'` — epoch-ms timestamps, points keyed by `time` (default);
|
|
5510
|
+
* - `'numeric'` — plain numbers, points keyed by `x: number`, linear spacing;
|
|
5511
|
+
* - `'category'` — names, points keyed by `x: string`, one band per category in
|
|
5512
|
+
* first-seen order across the series.
|
|
5513
|
+
*/
|
|
5514
|
+
export declare type XAxisType = 'time' | 'numeric' | 'category';
|
|
5515
|
+
|
|
5516
|
+
/** A band sample on a numeric or category X axis — {@link XPointInput} with edges in place of a value. */
|
|
5517
|
+
export declare interface XBandPointInput {
|
|
5518
|
+
x: number | string;
|
|
5519
|
+
low: number;
|
|
5520
|
+
high: number;
|
|
5521
|
+
}
|
|
5522
|
+
|
|
5523
|
+
/**
|
|
5524
|
+
* A line / bar point on a numeric or category X axis (`axis.x.type`): `x` is a
|
|
5525
|
+
* number on a numeric axis and a category name on a category axis.
|
|
5526
|
+
*/
|
|
5527
|
+
export declare interface XPointInput {
|
|
5528
|
+
x: number | string;
|
|
5529
|
+
value: number;
|
|
5530
|
+
}
|
|
5531
|
+
|
|
5159
5532
|
/** Time range (timestamps in milliseconds) of the currently visible portion of the chart. */
|
|
5160
5533
|
declare interface XRange {
|
|
5161
5534
|
from: number;
|
|
@@ -5169,6 +5542,10 @@ export declare class XScale {
|
|
|
5169
5542
|
* identical on both surfaces.
|
|
5170
5543
|
*/
|
|
5171
5544
|
readonly tickTracker: AxisTickTracker;
|
|
5545
|
+
private type;
|
|
5546
|
+
/** Category names in band order — category `i` is centred on coordinate `i`. */
|
|
5547
|
+
private categories;
|
|
5548
|
+
private bandPadding;
|
|
5172
5549
|
private from;
|
|
5173
5550
|
private to;
|
|
5174
5551
|
private width;
|
|
@@ -5176,7 +5553,7 @@ export declare class XScale {
|
|
|
5176
5553
|
private dataInterval;
|
|
5177
5554
|
private labelCountHintValue;
|
|
5178
5555
|
private minSpacingValue;
|
|
5179
|
-
/** Custom formatter
|
|
5556
|
+
/** Custom formatter, installed by `<XAxis format=…>`. */
|
|
5180
5557
|
private customFormat;
|
|
5181
5558
|
/** Custom tick generator — bypasses tier resolution in `niceTickValues` when set. */
|
|
5182
5559
|
private customTickGenerator;
|
|
@@ -5198,10 +5575,41 @@ export declare class XScale {
|
|
|
5198
5575
|
update(range: XRange, mediaWidth: number, pixelRatio: number, dataInterval?: number): void;
|
|
5199
5576
|
setLabelCount(n: number | null | undefined): void;
|
|
5200
5577
|
setMinSpacing(px: number | null | undefined): void;
|
|
5201
|
-
/**
|
|
5202
|
-
|
|
5578
|
+
/**
|
|
5579
|
+
* Install (or clear) a custom tick-label formatter. A {@link TimeFormatter}
|
|
5580
|
+
* fits a time axis, where every `x` is a timestamp.
|
|
5581
|
+
*/
|
|
5582
|
+
setFormat(fn: XAxisFormatter | null): void;
|
|
5583
|
+
setFormat(fn: TimeFormatter): void;
|
|
5203
5584
|
/** Read back the currently installed formatter — null when the built-in is active. */
|
|
5204
|
-
getFormat():
|
|
5585
|
+
getFormat(): XAxisFormatter | null;
|
|
5586
|
+
/** What the axis maps. Set once by the chart at construction. */
|
|
5587
|
+
setType(type: XAxisType): void;
|
|
5588
|
+
getType(): XAxisType;
|
|
5589
|
+
/** Category names in band order (category axis). */
|
|
5590
|
+
setCategories(names: readonly string[]): void;
|
|
5591
|
+
getCategories(): readonly string[];
|
|
5592
|
+
/** Band spacing on a category axis; an omitted or invalid side takes its default. */
|
|
5593
|
+
setBandPadding(padding: XAxisPadding | undefined): void;
|
|
5594
|
+
getBandPadding(): Required<XAxisPadding>;
|
|
5595
|
+
/**
|
|
5596
|
+
* The coordinate range that fits every band with its outer padding, or
|
|
5597
|
+
* `null` without categories. Band `i` spans `i ± (1 - inner) / 2`.
|
|
5598
|
+
*/
|
|
5599
|
+
bandRange(): XRange | null;
|
|
5600
|
+
/** Width of one category band in physical pixels — what a bar on a category axis fills. */
|
|
5601
|
+
bandWidthBitmap(): number;
|
|
5602
|
+
/**
|
|
5603
|
+
* The internal coordinate the pointer resolves to: the nearest band's index
|
|
5604
|
+
* on a category axis, `coord` itself elsewhere.
|
|
5605
|
+
*/
|
|
5606
|
+
snapToBand(coord: number): number;
|
|
5607
|
+
/**
|
|
5608
|
+
* An internal coordinate in the axis domain: the category name at that
|
|
5609
|
+
* band on a category axis (`''` without categories), the number itself on
|
|
5610
|
+
* time and numeric axes.
|
|
5611
|
+
*/
|
|
5612
|
+
domainValue(coord: number): number | string;
|
|
5205
5613
|
/**
|
|
5206
5614
|
* Install (or clear) a custom tick-value generator. When set, it replaces
|
|
5207
5615
|
* `niceTimeIntervals` tier resolution entirely — `niceTickValues` calls it
|
|
@@ -5215,11 +5623,19 @@ export declare class XScale {
|
|
|
5215
5623
|
setTimeZone(timeZone: string | undefined): void;
|
|
5216
5624
|
getTimeZone(): string | undefined;
|
|
5217
5625
|
/**
|
|
5218
|
-
* Format
|
|
5219
|
-
* {@link setFormat})
|
|
5220
|
-
*
|
|
5626
|
+
* Format an internal X coordinate for display — a tick, the crosshair, a
|
|
5627
|
+
* tooltip header. A custom formatter (via {@link setFormat}) gets the
|
|
5628
|
+
* domain value; otherwise a time axis formats the timestamp with the
|
|
5629
|
+
* installed locale/timezone, a numeric axis prints a locale number, and a
|
|
5630
|
+
* category axis prints the name.
|
|
5631
|
+
*/
|
|
5632
|
+
formatX(coord: number, interval: number): string;
|
|
5633
|
+
/**
|
|
5634
|
+
* Format a data point's X for a tooltip or info-bar header. Like
|
|
5635
|
+
* {@link formatX}, except a numeric axis prints the value with its own
|
|
5636
|
+
* decimals — `1.25` stays `1.25` where the step would round it.
|
|
5221
5637
|
*/
|
|
5222
|
-
|
|
5638
|
+
formatPointX(coord: number, interval: number): string;
|
|
5223
5639
|
private resetHysteresis;
|
|
5224
5640
|
timeToX(time: number): number;
|
|
5225
5641
|
/** X in physical (bitmap) pixels, snapped to the pixel grid — for
|
|
@@ -5246,6 +5662,8 @@ export declare class XScale {
|
|
|
5246
5662
|
ticks: number[];
|
|
5247
5663
|
tickInterval: number;
|
|
5248
5664
|
};
|
|
5665
|
+
/** One tick per category whose band centre is in view. */
|
|
5666
|
+
private bandTicks;
|
|
5249
5667
|
getRange(): XRange;
|
|
5250
5668
|
getMediaWidth(): number;
|
|
5251
5669
|
/**
|
|
@@ -5254,12 +5672,17 @@ export declare class XScale {
|
|
|
5254
5672
|
* tier inside a ratio band so micro pan/zoom doesn't flip label density.
|
|
5255
5673
|
*/
|
|
5256
5674
|
private resolveInterval;
|
|
5675
|
+
/**
|
|
5676
|
+
* Numeric counterpart of the time-tier walk: the {1,2,5}×10^k step that
|
|
5677
|
+
* clears `minLabelSpacing` and targets `labelCount`, with the same hysteresis band.
|
|
5678
|
+
*/
|
|
5679
|
+
private resolveNumericInterval;
|
|
5257
5680
|
private countTicks;
|
|
5258
5681
|
}
|
|
5259
5682
|
|
|
5260
|
-
export declare const YAxis: DefineComponent<
|
|
5683
|
+
export declare const YAxis: DefineComponent<__VLS_Props_21, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_21> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
5261
5684
|
containerRef: HTMLDivElement;
|
|
5262
|
-
},
|
|
5685
|
+
}, any>;
|
|
5263
5686
|
|
|
5264
5687
|
/** Configuration for the Y axis. */
|
|
5265
5688
|
export declare interface YAxisConfig {
|