@wick-charts/vue 0.6.2 → 0.6.4
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 +2 -2
- package/dist/BandSeries.vue.js +50 -0
- package/dist/BandSeries.vue2.js +4 -0
- package/dist/ChartContainer.vue.js +45 -39
- package/dist/composables.js +39 -26
- package/dist/core/dist/animation/config.js +92 -75
- package/dist/core/dist/axis/dom-labels.js +56 -43
- 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/options.js +5 -5
- package/dist/core/dist/chart/scale-guards.js +26 -0
- package/dist/core/dist/chart/y-target.js +46 -19
- package/dist/core/dist/chart.js +670 -518
- package/dist/core/dist/components/crosshair.js +8 -8
- package/dist/core/dist/components/grid.js +26 -17
- package/dist/core/dist/components/marker.js +28 -28
- package/dist/core/dist/components/reference-line.js +16 -16
- package/dist/core/dist/data/decimation.js +58 -39
- package/dist/core/dist/interactions/handler.js +3 -2
- package/dist/core/dist/interactions/zoom.js +6 -5
- package/dist/core/dist/navigator/controller.js +47 -44
- package/dist/core/dist/perf/perf-hud.js +3 -3
- package/dist/core/dist/scales/log-scale.js +76 -0
- package/dist/core/dist/scales/y-scale.js +134 -35
- package/dist/core/dist/series/band.js +670 -0
- package/dist/core/dist/series/bar-intro.js +11 -11
- package/dist/core/dist/series/bar.js +301 -251
- package/dist/core/dist/series/base-multi-layer.js +100 -76
- package/dist/core/dist/series/candlestick.js +238 -235
- package/dist/core/dist/series/heatmap.js +5 -5
- package/dist/core/dist/series/line-intro.js +50 -40
- package/dist/core/dist/series/line.js +561 -483
- 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/series/scale-stack.js +25 -0
- package/dist/core/dist/snapshots.js +36 -35
- package/dist/core/dist/tooltip-position.js +5 -5
- package/dist/core/dist/utils/point.js +10 -0
- package/dist/index.d.ts +501 -128
- package/dist/index.js +195 -189
- package/dist/ui/Crosshair.vue.js +14 -14
- package/dist/ui/HeatmapTooltip.vue.js +6 -6
- package/dist/ui/InfoBar.vue.js +100 -81
- package/dist/ui/PieTooltip.vue.js +4 -4
- package/dist/ui/TimeAxis.vue.js +23 -22
- package/dist/ui/Tooltip.vue.js +140 -111
- package/dist/ui/YAxis.vue.js +25 -24
- package/dist/ui/YLabel.vue.js +63 -70
- package/package.json +2 -2
- package/src/BandSeries.vue +87 -0
- package/src/ChartContainer.vue +20 -8
- package/src/composables.ts +35 -1
- package/src/index.ts +13 -0
- package/src/ui/Crosshair.vue +2 -2
- package/src/ui/InfoBar.vue +20 -1
- package/src/ui/TimeAxis.vue +7 -4
- package/src/ui/Tooltip.vue +40 -3
- package/src/ui/YAxis.vue +5 -3
- package/src/ui/YLabel.vue +5 -16
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ 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;
|
|
@@ -26,35 +26,41 @@ 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
|
|
|
46
|
-
declare const __VLS_component_6: DefineComponent<
|
|
46
|
+
declare const __VLS_component_6: DefineComponent<__VLS_Props_19, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_19> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
47
47
|
|
|
48
|
-
declare const __VLS_component_7: DefineComponent<
|
|
48
|
+
declare const __VLS_component_7: DefineComponent<__VLS_Props_20, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_20> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
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`.
|
|
60
|
+
*/
|
|
61
|
+
data: BandData;
|
|
62
|
+
/** Visual options override — fill, edge stroke, curve, entrance / intro / smoothing. */
|
|
63
|
+
options?: Partial<BandSeriesOptions>;
|
|
58
64
|
/** Stable series ID — same value across remounts. */
|
|
59
65
|
id?: string;
|
|
60
66
|
/** Show/hide the series without unmounting it — excludes it from the Y-range fit and tooltip/legend. Default `true`. Live. */
|
|
@@ -62,6 +68,15 @@ declare type __VLS_Props = {
|
|
|
62
68
|
};
|
|
63
69
|
|
|
64
70
|
declare type __VLS_Props_10 = {
|
|
71
|
+
items?: LegendItemOverride[];
|
|
72
|
+
position?: 'bottom' | 'right';
|
|
73
|
+
/** `'isolate'` shows only the clicked item; `'solo'` is a @deprecated alias. */
|
|
74
|
+
mode?: LegendMode;
|
|
75
|
+
/** Fired after a click changes series visibility — via the built-in UI or a custom slot calling `item.toggle()`/`isolate()` directly. */
|
|
76
|
+
onToggle?: (info: LegendToggleInfo) => void;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
declare type __VLS_Props_11 = {
|
|
65
80
|
/** X anchor — epoch ms or a `Date`. */
|
|
66
81
|
time: TimeValue;
|
|
67
82
|
/** Y anchor as a data value. Omit and set `seriesId` to snap to that series' value at `time`. */
|
|
@@ -78,13 +93,13 @@ declare type __VLS_Props_10 = {
|
|
|
78
93
|
color?: string;
|
|
79
94
|
};
|
|
80
95
|
|
|
81
|
-
declare type
|
|
96
|
+
declare type __VLS_Props_12 = {
|
|
82
97
|
data: NavigatorData;
|
|
83
98
|
/** Strip height in CSS pixels. Defaults to `theme.navigator.height` (60). */
|
|
84
99
|
height?: number;
|
|
85
100
|
};
|
|
86
101
|
|
|
87
|
-
declare type
|
|
102
|
+
declare type __VLS_Props_13 = {
|
|
88
103
|
value: number;
|
|
89
104
|
/**
|
|
90
105
|
* Value-to-string formatter. Defaults to the current locale's
|
|
@@ -96,7 +111,7 @@ declare type __VLS_Props_12 = {
|
|
|
96
111
|
spinDuration?: number;
|
|
97
112
|
};
|
|
98
113
|
|
|
99
|
-
declare type
|
|
114
|
+
declare type __VLS_Props_14 = {
|
|
100
115
|
/**
|
|
101
116
|
* Owning series id. **Optional** — when omitted, the first visible pie
|
|
102
117
|
* series is picked.
|
|
@@ -110,7 +125,7 @@ declare type __VLS_Props_13 = {
|
|
|
110
125
|
position?: PieLegendPosition;
|
|
111
126
|
};
|
|
112
127
|
|
|
113
|
-
declare type
|
|
128
|
+
declare type __VLS_Props_15 = {
|
|
114
129
|
/**
|
|
115
130
|
* Owning series id. **Optional** — when omitted, the first visible pie
|
|
116
131
|
* series is picked.
|
|
@@ -120,7 +135,7 @@ declare type __VLS_Props_14 = {
|
|
|
120
135
|
format?: ValueFormatter;
|
|
121
136
|
};
|
|
122
137
|
|
|
123
|
-
declare type
|
|
138
|
+
declare type __VLS_Props_16 = {
|
|
124
139
|
/** Horizontal line at this Y data value. Mutually exclusive with `time`. */
|
|
125
140
|
value?: number;
|
|
126
141
|
/** Vertical line at this `time` (epoch ms or `Date`). Mutually exclusive with `value`. */
|
|
@@ -135,14 +150,14 @@ declare type __VLS_Props_15 = {
|
|
|
135
150
|
width?: number;
|
|
136
151
|
};
|
|
137
152
|
|
|
138
|
-
declare type
|
|
153
|
+
declare type __VLS_Props_17 = {
|
|
139
154
|
/** Desired number of labels (≥ 2). Overrides chart-level `axis.x.labelCount`. */
|
|
140
155
|
labelCount?: number;
|
|
141
156
|
/** Minimum pixel gap between adjacent labels (hard floor). Overrides chart-level. */
|
|
142
157
|
minLabelSpacing?: number;
|
|
143
158
|
};
|
|
144
159
|
|
|
145
|
-
declare type
|
|
160
|
+
declare type __VLS_Props_18 = {
|
|
146
161
|
/** Left edge — epoch ms or a `Date`. */
|
|
147
162
|
from: TimeValue;
|
|
148
163
|
/** Right edge — epoch ms or a `Date`. Omit (or pass `'now'`) for an open-ended band to the right edge. */
|
|
@@ -155,7 +170,7 @@ declare type __VLS_Props_17 = {
|
|
|
155
170
|
color?: string;
|
|
156
171
|
};
|
|
157
172
|
|
|
158
|
-
declare type
|
|
173
|
+
declare type __VLS_Props_19 = {
|
|
159
174
|
/**
|
|
160
175
|
* @deprecated Use the named `sub` slot instead — it accepts arbitrary
|
|
161
176
|
* inline markup (icons, badges, formatted text) to mirror React's
|
|
@@ -169,15 +184,10 @@ declare type __VLS_Props_18 = {
|
|
|
169
184
|
sub?: string;
|
|
170
185
|
};
|
|
171
186
|
|
|
172
|
-
declare type __VLS_Props_19 = {
|
|
173
|
-
sort?: SnapshotSort;
|
|
174
|
-
format?: TooltipFormatter;
|
|
175
|
-
};
|
|
176
|
-
|
|
177
187
|
declare type __VLS_Props_2 = {
|
|
178
|
-
/** Flat `
|
|
179
|
-
data:
|
|
180
|
-
options?: Partial<
|
|
188
|
+
/** Flat `TimePoint[]`, `TimePoint[][]`, or named `{ label, color?, data }` layers. Time accepts ms or `Date`. */
|
|
189
|
+
data: MultiLayerData;
|
|
190
|
+
options?: Partial<BarSeriesOptions>;
|
|
181
191
|
/** Stable series ID — same value across remounts. */
|
|
182
192
|
id?: string;
|
|
183
193
|
/** Show/hide the series without unmounting it — excludes it from the Y-range fit and tooltip/legend. Default `true`. Live. */
|
|
@@ -185,6 +195,11 @@ declare type __VLS_Props_2 = {
|
|
|
185
195
|
};
|
|
186
196
|
|
|
187
197
|
declare type __VLS_Props_20 = {
|
|
198
|
+
sort?: SnapshotSort;
|
|
199
|
+
format?: TooltipFormatter;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
declare type __VLS_Props_21 = {
|
|
188
203
|
/** Custom tick-label formatter. Overrides the built-in range-adaptive default. */
|
|
189
204
|
format?: ValueFormatter;
|
|
190
205
|
/**
|
|
@@ -196,7 +211,7 @@ declare type __VLS_Props_20 = {
|
|
|
196
211
|
minLabelSpacing?: number;
|
|
197
212
|
};
|
|
198
213
|
|
|
199
|
-
declare type
|
|
214
|
+
declare type __VLS_Props_22 = {
|
|
200
215
|
/**
|
|
201
216
|
* Owning series id. **Optional** — when omitted, the first visible
|
|
202
217
|
* single-layer time series is picked, falling back to the first visible
|
|
@@ -214,6 +229,16 @@ declare type __VLS_Props_21 = {
|
|
|
214
229
|
};
|
|
215
230
|
|
|
216
231
|
declare type __VLS_Props_3 = {
|
|
232
|
+
/** Flat `OHLCInput[]`, or `{ label, data }` to name the stream. */
|
|
233
|
+
data: CandlestickData;
|
|
234
|
+
options?: Partial<CandlestickSeriesOptions>;
|
|
235
|
+
/** Stable series ID — same value across remounts. */
|
|
236
|
+
id?: string;
|
|
237
|
+
/** Show/hide the series without unmounting it — excludes it from the Y-range fit and tooltip/legend. Default `true`. Live. */
|
|
238
|
+
visible?: boolean;
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
declare type __VLS_Props_4 = {
|
|
217
242
|
/** Visual theme. Live — changing this at runtime updates all themed elements. */
|
|
218
243
|
theme?: ChartTheme;
|
|
219
244
|
/** Grouped axis configuration (Y/X visibility, bounds, sizing). Live. */
|
|
@@ -268,7 +293,7 @@ declare type __VLS_Props_3 = {
|
|
|
268
293
|
* change, use `viewport.initialRange` instead.
|
|
269
294
|
*/
|
|
270
295
|
visibleRange?: VisibleRangeSpec;
|
|
271
|
-
/** Show the chart background gradient. Live. Defaults to
|
|
296
|
+
/** Show the chart background gradient. Live. Defaults to false. */
|
|
272
297
|
gradient?: boolean;
|
|
273
298
|
/**
|
|
274
299
|
* Enable zoom, pan, and crosshair interactions. Defaults to true.
|
|
@@ -285,16 +310,20 @@ declare type __VLS_Props_3 = {
|
|
|
285
310
|
* Soft fade-out at the top of the plot area, so series content dissolves
|
|
286
311
|
* under a floating `<Title>` / `<InfoBar>` instead of colliding with it.
|
|
287
312
|
* The mask erases canvas alpha rather than painting a cover color, so it
|
|
288
|
-
* stays correct over
|
|
313
|
+
* stays correct over a background gradient. Live.
|
|
289
314
|
*
|
|
290
315
|
* Two directions, independently controlled:
|
|
291
316
|
*
|
|
292
317
|
* **X (under the axis)** — panning content slides under the Y-axis
|
|
293
318
|
* column and dissolves instead of hard-clipping at the pane edge. **On
|
|
294
319
|
* by default** as a 60px ramp that finishes just inside the axis
|
|
295
|
-
* column, before the label glyphs
|
|
296
|
-
*
|
|
297
|
-
*
|
|
320
|
+
* column, before the label glyphs — on whichever side
|
|
321
|
+
* `axis.y.position` puts it (a left-axis ramp ends at the pane edge
|
|
322
|
+
* instead). The axis side's key (`{ right }` by default, `{ left }` for
|
|
323
|
+
* a left axis) overrides the total ramp width in CSS px (`0` disables);
|
|
324
|
+
* the other key adds a plain zone at the opposite pane edge (default
|
|
325
|
+
* off). A chart with only pie / heatmap series has no axis column, so
|
|
326
|
+
* both keys add plain zones there.
|
|
298
327
|
*
|
|
299
328
|
* **Top (under the header)** — opt-in. `true` enables the auto zone
|
|
300
329
|
* (measured header + 24px run-out, half the header fold-in released so
|
|
@@ -378,7 +407,7 @@ declare type __VLS_Props_3 = {
|
|
|
378
407
|
onCrosshairMove?: (position: CrosshairPosition | null) => void;
|
|
379
408
|
};
|
|
380
409
|
|
|
381
|
-
declare type
|
|
410
|
+
declare type __VLS_Props_5 = {
|
|
382
411
|
data: HeatmapCellData[];
|
|
383
412
|
options?: Partial<HeatmapSeriesOptions>;
|
|
384
413
|
/** Stable series ID — same value across remounts. */
|
|
@@ -387,7 +416,7 @@ declare type __VLS_Props_4 = {
|
|
|
387
416
|
visible?: boolean;
|
|
388
417
|
};
|
|
389
418
|
|
|
390
|
-
declare type
|
|
419
|
+
declare type __VLS_Props_6 = {
|
|
391
420
|
/** Flat `TimePoint[]`, `TimePoint[][]`, or named `{ label, color?, data }` layers. Time accepts ms or `Date`. */
|
|
392
421
|
data: MultiLayerData;
|
|
393
422
|
options?: Partial<LineSeriesOptions>;
|
|
@@ -397,7 +426,7 @@ declare type __VLS_Props_5 = {
|
|
|
397
426
|
visible?: boolean;
|
|
398
427
|
};
|
|
399
428
|
|
|
400
|
-
declare type
|
|
429
|
+
declare type __VLS_Props_7 = {
|
|
401
430
|
data: PieSliceData[];
|
|
402
431
|
options?: Partial<PieSeriesOptions>;
|
|
403
432
|
/** Stable series ID — same value across remounts. */
|
|
@@ -406,7 +435,7 @@ declare type __VLS_Props_6 = {
|
|
|
406
435
|
visible?: boolean;
|
|
407
436
|
};
|
|
408
437
|
|
|
409
|
-
declare type
|
|
438
|
+
declare type __VLS_Props_8 = {
|
|
410
439
|
/**
|
|
411
440
|
* Owning series id. **Optional** — when omitted, the first visible heatmap
|
|
412
441
|
* series is picked.
|
|
@@ -416,20 +445,11 @@ declare type __VLS_Props_7 = {
|
|
|
416
445
|
format?: ValueFormatter;
|
|
417
446
|
};
|
|
418
447
|
|
|
419
|
-
declare type
|
|
448
|
+
declare type __VLS_Props_9 = {
|
|
420
449
|
sort?: SnapshotSort;
|
|
421
450
|
format?: TooltipFormatter;
|
|
422
451
|
};
|
|
423
452
|
|
|
424
|
-
declare type __VLS_Props_9 = {
|
|
425
|
-
items?: LegendItemOverride[];
|
|
426
|
-
position?: 'bottom' | 'right';
|
|
427
|
-
/** `'isolate'` shows only the clicked item; `'solo'` is a @deprecated alias. */
|
|
428
|
-
mode?: LegendMode;
|
|
429
|
-
/** Fired after a click changes series visibility — via the built-in UI or a custom slot calling `item.toggle()`/`isolate()` directly. */
|
|
430
|
-
onToggle?: (info: LegendToggleInfo) => void;
|
|
431
|
-
};
|
|
432
|
-
|
|
433
453
|
declare function __VLS_template(): {
|
|
434
454
|
attrs: Partial<{}>;
|
|
435
455
|
slots: {
|
|
@@ -669,7 +689,7 @@ export declare const andromeda: ThemePreset;
|
|
|
669
689
|
* - `axis.ticks` — axis tick label cross-fade.
|
|
670
690
|
* - `toggle` — series visibility (alpha fade + Y re-fit, locked to one
|
|
671
691
|
* duration so they finish on the same frame).
|
|
672
|
-
* - `series.{line,candlestick,bar,pie,heatmap}` — per-series-type data tweens.
|
|
692
|
+
* - `series.{line,candlestick,bar,band,pie,heatmap}` — per-series-type data tweens.
|
|
673
693
|
*
|
|
674
694
|
* Top-level `false` disables every animation category. `axis: false`
|
|
675
695
|
* disables both axes and ticks. `axis.y: false` / `axis.x: false` disables
|
|
@@ -881,6 +901,34 @@ export declare interface AnimationsConfig {
|
|
|
881
901
|
*/
|
|
882
902
|
smooth?: AnimationTime;
|
|
883
903
|
};
|
|
904
|
+
/**
|
|
905
|
+
* Band-series tweens. `false` disables band entrance, intro and
|
|
906
|
+
* edge chase.
|
|
907
|
+
*/
|
|
908
|
+
band?: false | {
|
|
909
|
+
/**
|
|
910
|
+
* Per-point entrance duration. `false` disables the entrance
|
|
911
|
+
* (equivalent to `entryAnimation: 'none'`).
|
|
912
|
+
*
|
|
913
|
+
* @default {@link DEFAULT_BAND_ENTRY}
|
|
914
|
+
*/
|
|
915
|
+
entry?: AnimationTime;
|
|
916
|
+
/**
|
|
917
|
+
* Initial-load reveal on the first data seed. The value is the
|
|
918
|
+
* per-element wave duration; the full reveal lasts ~2×.
|
|
919
|
+
* `false` / `0` disables the intro.
|
|
920
|
+
*
|
|
921
|
+
* @default {@link DEFAULT_BAND_INTRO}
|
|
922
|
+
*/
|
|
923
|
+
intro?: AnimationTime;
|
|
924
|
+
/**
|
|
925
|
+
* Edge chase duration on `updateLastPoint`. `false` / `0`
|
|
926
|
+
* snaps to the target instantly.
|
|
927
|
+
*
|
|
928
|
+
* @default {@link DEFAULT_BAND_SMOOTH}
|
|
929
|
+
*/
|
|
930
|
+
smooth?: AnimationTime;
|
|
931
|
+
};
|
|
884
932
|
/**
|
|
885
933
|
* Pie segment entry/update tweens. `false` disables the slice
|
|
886
934
|
* entry sweep (`update` is still parse-only; wiring lands in a
|
|
@@ -1047,6 +1095,113 @@ export declare const ayuMirage: ThemePreset;
|
|
|
1047
1095
|
*/
|
|
1048
1096
|
export declare function backfillSweepIntro(): LineIntroFn;
|
|
1049
1097
|
|
|
1098
|
+
/**
|
|
1099
|
+
* `data` shape for a band series — the same omnivorous forms as
|
|
1100
|
+
* {@link MultiLayerData}, one band per layer: a flat `BandPointInput[]`, a
|
|
1101
|
+
* layered `BandPointInput[][]`, a named `SeriesLayer`, or an array mixing both.
|
|
1102
|
+
*/
|
|
1103
|
+
export declare type BandData = BandPointInput[] | SeriesLayer<BandPointInput> | Array<BandPointInput[] | SeriesLayer<BandPointInput>>;
|
|
1104
|
+
|
|
1105
|
+
/** Entrance styles for band points added via `appendData` — the same set as {@link LineEntryAnimation}. */
|
|
1106
|
+
export declare type BandEntryAnimation = LineEntryAnimation;
|
|
1107
|
+
|
|
1108
|
+
/**
|
|
1109
|
+
* A single band sample: the filled region between `low` and `high` at `time`.
|
|
1110
|
+
* Time is a timestamp in milliseconds. A `low` above `high` is drawn with the
|
|
1111
|
+
* edges swapped; a non-finite edge is a gap.
|
|
1112
|
+
*/
|
|
1113
|
+
export declare interface BandPoint {
|
|
1114
|
+
time: number;
|
|
1115
|
+
low: number;
|
|
1116
|
+
high: number;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
/** {@link BandPoint} that also accepts `Date` for the time field. */
|
|
1120
|
+
export declare type BandPointInput = Omit<BandPoint, 'time'> & {
|
|
1121
|
+
time: TimeValue;
|
|
1122
|
+
};
|
|
1123
|
+
|
|
1124
|
+
export declare const BandSeries: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
1125
|
+
visible: boolean;
|
|
1126
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
1127
|
+
|
|
1128
|
+
/** Series definition for `chart.addSeries` — keeps the chart renderer-agnostic. */
|
|
1129
|
+
export declare const BandSeriesDef: SeriesDefinition<BandSeriesOptions>;
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Visual options for a band series — the filled region between a `low` and a
|
|
1133
|
+
* `high` edge. Each layer is one band; layers draw in order with translucent
|
|
1134
|
+
* fills, so nested bands of one color read as a fan chart. There is no
|
|
1135
|
+
* stacking: a stack of ranges has no meaning.
|
|
1136
|
+
*/
|
|
1137
|
+
export declare interface BandSeriesOptions {
|
|
1138
|
+
/**
|
|
1139
|
+
* Fill between the edges: a flat color, or a `[top, bottom]` pair painted
|
|
1140
|
+
* as a vertical gradient over each band's visible extent. Applies to every
|
|
1141
|
+
* layer. Default: a gradient of the layer color from 40% opacity at the top
|
|
1142
|
+
* to 4% at the bottom.
|
|
1143
|
+
*/
|
|
1144
|
+
fill?: string | [string, string];
|
|
1145
|
+
/** Edge strokes, in the layer color at 60% opacity. Default: `{ visible: true, width: 1 }`. */
|
|
1146
|
+
stroke?: {
|
|
1147
|
+
/** Whether the `low` and `high` edges are stroked. Default: `true`. */
|
|
1148
|
+
visible?: boolean;
|
|
1149
|
+
/** Stroke width in CSS pixels. Default: `1`. */
|
|
1150
|
+
width?: number;
|
|
1151
|
+
/** Stroke color for every layer. Default: the layer color at 60% opacity. */
|
|
1152
|
+
color?: string;
|
|
1153
|
+
};
|
|
1154
|
+
/**
|
|
1155
|
+
* Edge smoothing, with the same builders as the line series. Default:
|
|
1156
|
+
* `'straight'`. `'smooth'` is monotone, so an edge never overshoots its own
|
|
1157
|
+
* samples.
|
|
1158
|
+
*/
|
|
1159
|
+
curve?: 'straight' | 'smooth' | 'stepped';
|
|
1160
|
+
/**
|
|
1161
|
+
* Entrance style for appended points. Default: `'grow'` — the trailing
|
|
1162
|
+
* segment of both edges unfurls from the previous point.
|
|
1163
|
+
*
|
|
1164
|
+
* @see entryMs — cross-linked duration for this animation.
|
|
1165
|
+
*/
|
|
1166
|
+
entryAnimation?: BandEntryAnimation;
|
|
1167
|
+
/**
|
|
1168
|
+
* Per-point entrance duration in milliseconds. Default: `250`. `false` or
|
|
1169
|
+
* `0` disables the entrance. A chart-level `animations.series.band: false`
|
|
1170
|
+
* wins over this field.
|
|
1171
|
+
*/
|
|
1172
|
+
entryMs?: number | false;
|
|
1173
|
+
/**
|
|
1174
|
+
* Initial-load reveal duration in milliseconds; the full reveal lasts ~2×.
|
|
1175
|
+
* Default: `500`. `false` or `0` disables it. Bulk re-seeds of a non-empty
|
|
1176
|
+
* series never replay it. Skipped under `prefers-reduced-motion`.
|
|
1177
|
+
*/
|
|
1178
|
+
introMs?: number | false;
|
|
1179
|
+
/**
|
|
1180
|
+
* Initial-load reveal choreography — the line series' `LineIntroFn`
|
|
1181
|
+
* contract. The frame's `layerData` / `layerMean` / `primaryPath` describe
|
|
1182
|
+
* each band's center, and a `value` transform applies to both edges.
|
|
1183
|
+
* `heads` are ignored. Default: `unfoldIntro()` — the band opens out of its
|
|
1184
|
+
* mean.
|
|
1185
|
+
*
|
|
1186
|
+
* @see introMs — cross-linked duration for this animation.
|
|
1187
|
+
*/
|
|
1188
|
+
introAnimation?: LineIntroFn;
|
|
1189
|
+
/**
|
|
1190
|
+
* History-prepend reveal for older points loaded at the front. Default:
|
|
1191
|
+
* `backfillSweepIntro()`. `'none'` makes prepended points appear at once.
|
|
1192
|
+
*
|
|
1193
|
+
* @see historyRevealMs — cross-linked duration for this animation.
|
|
1194
|
+
*/
|
|
1195
|
+
historyReveal?: LineIntroFn | 'none';
|
|
1196
|
+
/** History-prepend reveal duration in milliseconds. Default: `400`. `false` or `0` disables it. */
|
|
1197
|
+
historyRevealMs?: number | false;
|
|
1198
|
+
/**
|
|
1199
|
+
* How long both displayed edges take to catch up on every
|
|
1200
|
+
* `updateLastPoint`. Default: `250` ms. `0` or `false` snaps.
|
|
1201
|
+
*/
|
|
1202
|
+
smoothMs?: number | false;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1050
1205
|
/** Declarative per-bar transform — translation and opacity only; growth is
|
|
1051
1206
|
* expressed through {@link BarIntroDirectives.value} instead so stacked
|
|
1052
1207
|
* columns rise as one attached unit. */
|
|
@@ -1080,8 +1235,9 @@ export declare interface BarIntroDirectives {
|
|
|
1080
1235
|
fromX?: number;
|
|
1081
1236
|
toX?: number;
|
|
1082
1237
|
};
|
|
1083
|
-
/** Per-value transform applied before geometry
|
|
1084
|
-
*
|
|
1238
|
+
/** Per-value transform applied before geometry. Moving the value from
|
|
1239
|
+
* `frame.baseline` grows the bar on every render path. A stack applies it
|
|
1240
|
+
* to each segment before stacking, or to each drawn edge on a non-linear axis. */
|
|
1085
1241
|
value?: (args: BarIntroValueArgs) => number;
|
|
1086
1242
|
/** Per-bar transform applied after the geometry is resolved. */
|
|
1087
1243
|
element?: (el: BarIntroElement) => BarElementTransform;
|
|
@@ -1109,6 +1265,14 @@ export declare type BarIntroFn = (frame: BarIntroFrame) => BarIntroDirectives;
|
|
|
1109
1265
|
export declare interface BarIntroFrame extends WaveIntroFrame {
|
|
1110
1266
|
/** Time → bitmap X through the live time scale. */
|
|
1111
1267
|
timeToX(time: number): number;
|
|
1268
|
+
/** The value bars grow from: `0`, or the plot floor's value on a scale with no place for 0 (log). */
|
|
1269
|
+
baseline: number;
|
|
1270
|
+
/**
|
|
1271
|
+
* The value `t` of the way from `from` to `to` on the Y axis — a plain lerp
|
|
1272
|
+
* on a linear axis, a geometric one on log. Grow bars through this: a bare
|
|
1273
|
+
* `value * t` stays below a log axis's floor for most of the intro.
|
|
1274
|
+
*/
|
|
1275
|
+
lerpValue(from: number, to: number, t: number): number;
|
|
1112
1276
|
}
|
|
1113
1277
|
|
|
1114
1278
|
/** Arguments handed to {@link BarIntroDirectives.value} for every rendered value. */
|
|
@@ -1148,7 +1312,7 @@ export declare interface BarPaintArgs {
|
|
|
1148
1312
|
/** Paints one bar / stacked segment. Owns its fill — it calls `ctx.fill()`. */
|
|
1149
1313
|
export declare type BarPainter = (env: PaintEnv, args: BarPaintArgs) => void;
|
|
1150
1314
|
|
|
1151
|
-
export declare const BarSeries: DefineComponent<
|
|
1315
|
+
export declare const BarSeries: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{}>, {
|
|
1152
1316
|
visible: boolean;
|
|
1153
1317
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
1154
1318
|
|
|
@@ -1377,7 +1541,7 @@ export declare interface BaseSeriesRenderer {
|
|
|
1377
1541
|
/** Last data value for the series, or null if empty. Optional. */
|
|
1378
1542
|
getLastValue?(): number | null;
|
|
1379
1543
|
/** Nearest data point to a given time, or null. Optional. */
|
|
1380
|
-
getDataAtTime?(time: number, interval: number): TimePoint | OHLCData | null;
|
|
1544
|
+
getDataAtTime?(time: number, interval: number): TimePoint | OHLCData | BandPoint | null;
|
|
1381
1545
|
/**
|
|
1382
1546
|
* For multi-layer renderers: nearest data point per visible layer at `time`.
|
|
1383
1547
|
* Each entry carries the owning `layerIndex` (so filtered hidden layers
|
|
@@ -1386,12 +1550,7 @@ export declare interface BaseSeriesRenderer {
|
|
|
1386
1550
|
* tooltips/legends.
|
|
1387
1551
|
* Returns null for single-layer renderers or when no visible layer has data.
|
|
1388
1552
|
*/
|
|
1389
|
-
getLayerSnapshots?(time: number, interval: number):
|
|
1390
|
-
layerIndex: number;
|
|
1391
|
-
time: number;
|
|
1392
|
-
value: number;
|
|
1393
|
-
color: string;
|
|
1394
|
-
}[] | null;
|
|
1553
|
+
getLayerSnapshots?(time: number, interval: number): LayerSnapshot[] | null;
|
|
1395
1554
|
/**
|
|
1396
1555
|
* Stacked last value — cumulative top of the rendered stack for multi-layer
|
|
1397
1556
|
* renderers. Falls back to `getLastValue()` behavior for single-layer
|
|
@@ -1417,12 +1576,7 @@ export declare interface BaseSeriesRenderer {
|
|
|
1417
1576
|
* primary layer's time.
|
|
1418
1577
|
* Returns null for single-layer renderers or when no visible layer has data.
|
|
1419
1578
|
*/
|
|
1420
|
-
getLayerLastSnapshots?():
|
|
1421
|
-
layerIndex: number;
|
|
1422
|
-
time: number;
|
|
1423
|
-
value: number;
|
|
1424
|
-
color: string;
|
|
1425
|
-
}[] | null;
|
|
1579
|
+
getLayerLastSnapshots?(): LayerSnapshot[] | null;
|
|
1426
1580
|
/** Total data points across all owned stores. Used by Chart for batch-load detection. */
|
|
1427
1581
|
getTotalLength?(): number;
|
|
1428
1582
|
/**
|
|
@@ -1670,7 +1824,7 @@ declare interface CandlestickDirectionColors {
|
|
|
1670
1824
|
*/
|
|
1671
1825
|
export declare type CandlestickEntryAnimation = 'none' | 'fade' | 'unfold' | 'slide' | 'fade-unfold';
|
|
1672
1826
|
|
|
1673
|
-
export declare const CandlestickSeries: DefineComponent<
|
|
1827
|
+
export declare const CandlestickSeries: DefineComponent<__VLS_Props_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_3> & Readonly<{}>, {
|
|
1674
1828
|
visible: boolean;
|
|
1675
1829
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
1676
1830
|
|
|
@@ -1873,7 +2027,20 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
1873
2027
|
readonly timeScale: XScale;
|
|
1874
2028
|
/** Maps price/value to vertical pixel coordinates. */
|
|
1875
2029
|
readonly yScale: YScale;
|
|
2030
|
+
/** CSS px of the Y-axis column. The default collapses to `0` on a spatial-only chart. */
|
|
1876
2031
|
get yAxisWidth(): number;
|
|
2032
|
+
/** Side of the plot area the Y-axis column sits on. */
|
|
2033
|
+
get yAxisPosition(): YAxisPosition;
|
|
2034
|
+
/**
|
|
2035
|
+
* Left edge of the plot area in container CSS px — the Y-axis width when
|
|
2036
|
+
* the axis sits on the left, `0` otherwise. Scales map into the plot area,
|
|
2037
|
+
* so add this to `timeScale.timeToX()` to get a container coordinate.
|
|
2038
|
+
*/
|
|
2039
|
+
get plotLeft(): number;
|
|
2040
|
+
/** CSS px height of the floating Title / InfoBar header, `0` without one. A left
|
|
2041
|
+
* axis shares its column with it, so tick labels fade out underneath. */
|
|
2042
|
+
get headerHeight(): number;
|
|
2043
|
+
/** CSS px of the time-axis row. The default collapses to `0` on a spatial-only chart. */
|
|
1877
2044
|
get xAxisHeight(): number;
|
|
1878
2045
|
constructor(container: HTMLElement, options?: ChartOptions);
|
|
1879
2046
|
/**
|
|
@@ -1903,6 +2070,12 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
1903
2070
|
label?: string;
|
|
1904
2071
|
labels?: (string | undefined)[];
|
|
1905
2072
|
}>): string;
|
|
2073
|
+
addSeries(type: 'band', options?: Partial<BandSeriesOptions & {
|
|
2074
|
+
layers?: number;
|
|
2075
|
+
id?: string;
|
|
2076
|
+
label?: string;
|
|
2077
|
+
labels?: (string | undefined)[];
|
|
2078
|
+
}>): string;
|
|
1906
2079
|
addSeries(type: 'pie', options?: Partial<PieSeriesOptions & {
|
|
1907
2080
|
id?: string;
|
|
1908
2081
|
label?: string;
|
|
@@ -1996,7 +2169,7 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
1996
2169
|
*/
|
|
1997
2170
|
setSeriesData(id: string, data: unknown, layerIndex?: number): void;
|
|
1998
2171
|
/** Append a new data point to the end of a series (real-time tick). */
|
|
1999
|
-
appendData(id: string, point: OHLCInput | TimePointInput, layerIndex?: number): void;
|
|
2172
|
+
appendData(id: string, point: OHLCInput | TimePointInput | BandPointInput, layerIndex?: number): void;
|
|
2000
2173
|
/**
|
|
2001
2174
|
* Prepend older points to the front of a series — the "load more history on
|
|
2002
2175
|
* scroll" path. Unlike {@link setSeriesData}, this deliberately does NOT set
|
|
@@ -2010,9 +2183,9 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2010
2183
|
* first point; the sync reconciler guarantees this before calling here.
|
|
2011
2184
|
* No-op if the renderer doesn't support prepend.
|
|
2012
2185
|
*/
|
|
2013
|
-
prependData(id: string, points: (OHLCInput | TimePointInput)[], layerIndex?: number): void;
|
|
2186
|
+
prependData(id: string, points: (OHLCInput | TimePointInput | BandPointInput)[], layerIndex?: number): void;
|
|
2014
2187
|
/** Update the last data point of a series in place (e.g. live candle update). */
|
|
2015
|
-
updateData(id: string, point: OHLCInput | TimePointInput, layerIndex?: number): void;
|
|
2188
|
+
updateData(id: string, point: OHLCInput | TimePointInput | BandPointInput, layerIndex?: number): void;
|
|
2016
2189
|
/**
|
|
2017
2190
|
* Keep only the most recent `count` points of a series — drop the oldest
|
|
2018
2191
|
* tail when the series exceeds the cap. Smooth Y-range chase (no snap):
|
|
@@ -2028,7 +2201,7 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2028
2201
|
*/
|
|
2029
2202
|
keepLast(id: string, count: number, layerIndex?: number): void;
|
|
2030
2203
|
/** Update visual options (color, width, etc.) for an existing series. */
|
|
2031
|
-
updateSeriesOptions(id: string, options: Partial<CandlestickSeriesOptions> | Partial<LineSeriesOptions> | Partial<BarSeriesOptions> | Partial<PieSeriesOptions> | Partial<HeatmapSeriesOptions>): void;
|
|
2204
|
+
updateSeriesOptions(id: string, options: Partial<CandlestickSeriesOptions> | Partial<LineSeriesOptions> | Partial<BarSeriesOptions> | Partial<BandSeriesOptions> | Partial<PieSeriesOptions> | Partial<HeatmapSeriesOptions>): void;
|
|
2032
2205
|
/**
|
|
2033
2206
|
* Batch multiple updates: suppress recomputes until `fn` returns. Exceptions
|
|
2034
2207
|
* inside `fn` still flush the batch so counters don't leak across calls.
|
|
@@ -2145,21 +2318,16 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2145
2318
|
} | null;
|
|
2146
2319
|
/** Get the second-to-last value, useful for computing change. */
|
|
2147
2320
|
getPreviousClose(seriesId: string): number | null;
|
|
2148
|
-
getLastData(seriesId: string): OHLCData | TimePoint | null;
|
|
2321
|
+
getLastData(seriesId: string): OHLCData | TimePoint | BandPoint | null;
|
|
2149
2322
|
/** Find the data point closest to the given timestamp within one data interval. */
|
|
2150
|
-
getDataAtTime(seriesId: string, time: number): OHLCData | TimePoint | null;
|
|
2323
|
+
getDataAtTime(seriesId: string, time: number): OHLCData | TimePoint | BandPoint | null;
|
|
2151
2324
|
/**
|
|
2152
2325
|
* Get all layers' data at a given time for multi-layer series (Bar/Line
|
|
2153
2326
|
* with stacking). Each entry carries the owning `layerIndex` and the
|
|
2154
2327
|
* snapped sample time — callers must not derive layer identity from the
|
|
2155
2328
|
* array index, because hidden layers are filtered out.
|
|
2156
2329
|
*/
|
|
2157
|
-
getLayerSnapshots(seriesId: string, time: number):
|
|
2158
|
-
layerIndex: number;
|
|
2159
|
-
time: number;
|
|
2160
|
-
value: number;
|
|
2161
|
-
color: string;
|
|
2162
|
-
}[] | null;
|
|
2330
|
+
getLayerSnapshots(seriesId: string, time: number): LayerSnapshot[] | null;
|
|
2163
2331
|
getSeriesIds(): string[];
|
|
2164
2332
|
/**
|
|
2165
2333
|
* Whether pan/zoom gestures currently apply — true when any visible series
|
|
@@ -2207,12 +2375,7 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2207
2375
|
* overlay components that must display every layer in last-mode even
|
|
2208
2376
|
* when layers advance at different rates (ragged streams).
|
|
2209
2377
|
*/
|
|
2210
|
-
getLayerLastSnapshots(seriesId: string):
|
|
2211
|
-
layerIndex: number;
|
|
2212
|
-
time: number;
|
|
2213
|
-
value: number;
|
|
2214
|
-
color: string;
|
|
2215
|
-
}[] | null;
|
|
2378
|
+
getLayerLastSnapshots(seriesId: string): LayerSnapshot[] | null;
|
|
2216
2379
|
/** Get the primary display color for a series. */
|
|
2217
2380
|
getSeriesColor(seriesId: string): string | null;
|
|
2218
2381
|
/** The series' primary name (first layer). Used for single-layer overlays. */
|
|
@@ -2293,6 +2456,9 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2293
2456
|
* the next render frame.
|
|
2294
2457
|
*/
|
|
2295
2458
|
setFade(fade: ChartOptions['fade']): void;
|
|
2459
|
+
/** Report the floating header's height (see {@link headerHeight}). The
|
|
2460
|
+
* framework wrappers keep it in sync with the measured Title / InfoBar. */
|
|
2461
|
+
setHeaderHeight(height: number): void;
|
|
2296
2462
|
/**
|
|
2297
2463
|
* Set the visual state for one side of the chart. Typically called in
|
|
2298
2464
|
* response to the `onEdgeReached` callback:
|
|
@@ -2368,8 +2534,10 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2368
2534
|
|
|
2369
2535
|
/** Layout metrics describing the chart area, Y axis, and time axis sizes. */
|
|
2370
2536
|
export declare interface ChartLayout {
|
|
2537
|
+
/** Plot area in container CSS px — `x` is the Y-axis width when the axis sits on the left. */
|
|
2371
2538
|
chartArea: Rect;
|
|
2372
2539
|
yAxisWidth: number;
|
|
2540
|
+
yAxisPosition: YAxisPosition;
|
|
2373
2541
|
xAxisHeight: number;
|
|
2374
2542
|
}
|
|
2375
2543
|
|
|
@@ -2437,11 +2605,11 @@ export declare interface ChartOptions {
|
|
|
2437
2605
|
* Soft alpha fade applied at the edges of the plot area. Anything the main
|
|
2438
2606
|
* layer draws inside a zone (series, grid, time-region bands) dissolves to
|
|
2439
2607
|
* transparent as it approaches the edge: horizontally sliding under the
|
|
2440
|
-
* Y-axis labels
|
|
2441
|
-
*
|
|
2442
|
-
*
|
|
2608
|
+
* Y-axis labels (the axis side, **on by default**), toward a floating
|
|
2609
|
+
* Title / InfoBar at the top (`top`), or out the edge opposite the axis.
|
|
2610
|
+
* The mask *erases* pixels rather than painting a cover color,
|
|
2443
2611
|
* so it stays correct over any container background — including the
|
|
2444
|
-
*
|
|
2612
|
+
* optional CSS gradient. Live — `chart.setFade()` updates it after
|
|
2445
2613
|
* construction.
|
|
2446
2614
|
*/
|
|
2447
2615
|
fade?: FadeConfig;
|
|
@@ -2771,7 +2939,7 @@ export declare interface CustomSpatialSeriesRenderer extends BaseSeriesRenderer
|
|
|
2771
2939
|
*/
|
|
2772
2940
|
export declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
2773
2941
|
|
|
2774
|
-
declare const _default: DefineComponent<
|
|
2942
|
+
declare const _default: DefineComponent<__VLS_Props_17, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_17> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
2775
2943
|
containerRef: HTMLDivElement;
|
|
2776
2944
|
}, HTMLDivElement>;
|
|
2777
2945
|
export { _default as TimeAxis }
|
|
@@ -2818,18 +2986,30 @@ declare interface FadeConfig {
|
|
|
2818
2986
|
* area. `0` / omitted disables the mask. */
|
|
2819
2987
|
top?: number;
|
|
2820
2988
|
/**
|
|
2821
|
-
*
|
|
2822
|
-
*
|
|
2823
|
-
*
|
|
2824
|
-
*
|
|
2825
|
-
*
|
|
2826
|
-
*
|
|
2989
|
+
* Width in CSS pixels of the horizontal dissolve at the right edge.
|
|
2990
|
+
*
|
|
2991
|
+
* On the Y-axis side (the default `axis.y.position`) this is the total
|
|
2992
|
+
* width of a ramp that finishes just inside the axis column — 12px past
|
|
2993
|
+
* the pane edge, before the label glyphs start — so content melts on
|
|
2994
|
+
* approach (pan / tail-scroll exit) and is fully gone before it can cross
|
|
2995
|
+
* any axis text; the rest of the width runs backward into the pane as a
|
|
2996
|
+
* soft lead-in. **Defaults to a 60px ramp** there — on out of the box;
|
|
2827
2997
|
* `0` disables. A no-op while the Y axis is hidden.
|
|
2998
|
+
*
|
|
2999
|
+
* On the side opposite the axis it's a plain zone at the pane edge —
|
|
3000
|
+
* content leaving the plot dissolves instead of hard-clipping at the
|
|
3001
|
+
* canvas boundary. Off by default.
|
|
3002
|
+
*
|
|
3003
|
+
* A chart whose series are all spatial (pie, heatmap) has no axis column,
|
|
3004
|
+
* so both sides take the plain zone, off by default.
|
|
2828
3005
|
*/
|
|
2829
3006
|
right?: number;
|
|
2830
|
-
/**
|
|
2831
|
-
*
|
|
2832
|
-
*
|
|
3007
|
+
/**
|
|
3008
|
+
* Width in CSS pixels of the horizontal dissolve at the left edge. Same
|
|
3009
|
+
* rules as {@link right}, except that with `axis.y.position: 'left'` the
|
|
3010
|
+
* ramp (60px by default) finishes at the pane edge rather than under the
|
|
3011
|
+
* column: data scrolls out through the left edge and isn't drawn past it.
|
|
3012
|
+
*/
|
|
2833
3013
|
left?: number;
|
|
2834
3014
|
}
|
|
2835
3015
|
|
|
@@ -2917,7 +3097,7 @@ export declare interface HeatmapCellLabelsOptions {
|
|
|
2917
3097
|
format?: (value: number) => string;
|
|
2918
3098
|
}
|
|
2919
3099
|
|
|
2920
|
-
export declare const HeatmapSeries: DefineComponent<
|
|
3100
|
+
export declare const HeatmapSeries: DefineComponent<__VLS_Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{}>, {
|
|
2921
3101
|
visible: boolean;
|
|
2922
3102
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
2923
3103
|
|
|
@@ -2968,7 +3148,7 @@ export declare interface HeatmapSeriesRenderer extends BaseSeriesRenderer {
|
|
|
2968
3148
|
readonly kind: 'heatmap';
|
|
2969
3149
|
}
|
|
2970
3150
|
|
|
2971
|
-
export declare const HeatmapTooltip: DefineComponent<
|
|
3151
|
+
export declare const HeatmapTooltip: DefineComponent<__VLS_Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_8> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
2972
3152
|
|
|
2973
3153
|
/**
|
|
2974
3154
|
* Velocity-matched cubic Hermite Y transition. Direction-aware: per-call
|
|
@@ -3012,6 +3192,21 @@ export declare function isTimeSeriesRenderer(renderer: SeriesRenderer): renderer
|
|
|
3012
3192
|
|
|
3013
3193
|
export declare const lavenderMist: ThemePreset;
|
|
3014
3194
|
|
|
3195
|
+
/**
|
|
3196
|
+
* One layer's sample in a multi-layer query ({@link BaseSeriesRenderer.getLayerSnapshots}).
|
|
3197
|
+
* `time` is the resolved sample time, not the query time. A band layer also
|
|
3198
|
+
* carries its `low` / `high` edges; its `value` is then their midpoint, kept
|
|
3199
|
+
* only for sorting and anchoring — display the edges instead.
|
|
3200
|
+
*/
|
|
3201
|
+
export declare interface LayerSnapshot {
|
|
3202
|
+
layerIndex: number;
|
|
3203
|
+
time: number;
|
|
3204
|
+
value: number;
|
|
3205
|
+
color: string;
|
|
3206
|
+
low?: number;
|
|
3207
|
+
high?: number;
|
|
3208
|
+
}
|
|
3209
|
+
|
|
3015
3210
|
export declare const Legend: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
3016
3211
|
|
|
3017
3212
|
/**
|
|
@@ -3146,11 +3341,21 @@ export declare interface LineIntroFrame {
|
|
|
3146
3341
|
xToTime(x: number): number;
|
|
3147
3342
|
/** Value → bitmap Y through the live Y scale. */
|
|
3148
3343
|
valueToY(value: number): number;
|
|
3344
|
+
/**
|
|
3345
|
+
* The value `t` of the way from `from` to `to` on the Y axis — a plain lerp
|
|
3346
|
+
* on a linear axis, a geometric one on log. Move values through this, or a
|
|
3347
|
+
* log axis bunches the motion at one end and overshoots past 0.
|
|
3348
|
+
*/
|
|
3349
|
+
lerpValue(from: number, to: number, t: number): number;
|
|
3149
3350
|
/** Number of layers in the series. */
|
|
3150
3351
|
layerCount: number;
|
|
3151
3352
|
/** Visible data of one layer (memoized per frame). */
|
|
3152
3353
|
layerData(layerIndex: number): readonly TimePoint[];
|
|
3153
|
-
/**
|
|
3354
|
+
/**
|
|
3355
|
+
* Mean of the layer's visible plottable values, taken on the Y axis (the
|
|
3356
|
+
* geometric mean on log), or `null` for an empty/poisoned layer (memoized per frame).
|
|
3357
|
+
* On a percent stack, the layer's mean share of its column, in percent.
|
|
3358
|
+
*/
|
|
3154
3359
|
layerMean(layerIndex: number): number | null;
|
|
3155
3360
|
/**
|
|
3156
3361
|
* Bitmap-space polyline of the first visible layer (finite values only,
|
|
@@ -3167,7 +3372,10 @@ export declare interface LineIntroFrame {
|
|
|
3167
3372
|
export declare interface LineIntroValueArgs {
|
|
3168
3373
|
layerIndex: number;
|
|
3169
3374
|
time: number;
|
|
3170
|
-
/**
|
|
3375
|
+
/**
|
|
3376
|
+
* The value the renderer would draw without the intro (live smoothing included).
|
|
3377
|
+
* On a percent stack, the layer's share of its column, in percent.
|
|
3378
|
+
*/
|
|
3171
3379
|
value: number;
|
|
3172
3380
|
/** Normalized x-position of `time` across the visible range, clamped to `[0, 1]`. */
|
|
3173
3381
|
position: number;
|
|
@@ -3212,7 +3420,7 @@ declare interface LinePoint {
|
|
|
3212
3420
|
y: number;
|
|
3213
3421
|
}
|
|
3214
3422
|
|
|
3215
|
-
export declare const LineSeries: DefineComponent<
|
|
3423
|
+
export declare const LineSeries: DefineComponent<__VLS_Props_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_6> & Readonly<{}>, {
|
|
3216
3424
|
visible: boolean;
|
|
3217
3425
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
3218
3426
|
|
|
@@ -3487,7 +3695,25 @@ export declare interface LoadingIndicatorArgs {
|
|
|
3487
3695
|
/** Pure function contract for a pluggable loading indicator. */
|
|
3488
3696
|
export declare type LoadingIndicatorFn = (args: LoadingIndicatorArgs) => void;
|
|
3489
3697
|
|
|
3490
|
-
|
|
3698
|
+
/**
|
|
3699
|
+
* Logarithmic Y scale for `axis.y.scale`: each power of the base gets the same
|
|
3700
|
+
* height. Ticks sit on powers of the base, thinned when they crowd and — for
|
|
3701
|
+
* base 10 — with 2× / 5× steps when a decade has room; a range too narrow to
|
|
3702
|
+
* catch a power falls back to linear ticks. Values ≤ 0 have no position.
|
|
3703
|
+
*
|
|
3704
|
+
* Tree-shakeable: charts that never call it don't ship the log code.
|
|
3705
|
+
*/
|
|
3706
|
+
export declare function logScale(options?: LogScaleOptions): YScaleTransform;
|
|
3707
|
+
|
|
3708
|
+
export declare interface LogScaleOptions {
|
|
3709
|
+
/**
|
|
3710
|
+
* Base whose powers carry the ticks. The mapping itself is the same for
|
|
3711
|
+
* every base — only tick placement changes. Default: 10.
|
|
3712
|
+
*/
|
|
3713
|
+
base?: number;
|
|
3714
|
+
}
|
|
3715
|
+
|
|
3716
|
+
export declare const Marker: DefineComponent<__VLS_Props_11, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_11> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
3491
3717
|
|
|
3492
3718
|
/**
|
|
3493
3719
|
* A point annotation pinned to a `time` (X) and a `value` (Y) — "anomaly opened
|
|
@@ -3599,7 +3825,7 @@ declare interface MorphPlaceholder {
|
|
|
3599
3825
|
*/
|
|
3600
3826
|
export declare type MultiLayerData = TimePointInput[] | SeriesLayer<TimePointInput> | Array<TimePointInput[] | SeriesLayer<TimePointInput>>;
|
|
3601
3827
|
|
|
3602
|
-
declare const Navigator_2: DefineComponent<
|
|
3828
|
+
declare const Navigator_2: DefineComponent<__VLS_Props_12, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_12> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
3603
3829
|
stripRef: HTMLDivElement;
|
|
3604
3830
|
}, any>;
|
|
3605
3831
|
export { Navigator_2 as Navigator }
|
|
@@ -3621,8 +3847,9 @@ export declare interface NavigatorCandlePoint {
|
|
|
3621
3847
|
* left handle, right handle. The overlay is purely visual; pointer input is
|
|
3622
3848
|
* captured on the canvas and hit-tested against the current window geometry.
|
|
3623
3849
|
*
|
|
3624
|
-
* Both layers reserve `chart.yAxisWidth` on the
|
|
3625
|
-
* active zone aligns with the main chart's plot area (matches
|
|
3850
|
+
* Both layers reserve `chart.yAxisWidth` on the Y-axis side so the
|
|
3851
|
+
* navigator's active zone aligns with the main chart's plot area (matches
|
|
3852
|
+
* the TimeAxis).
|
|
3626
3853
|
*
|
|
3627
3854
|
* Event topology — navigator is a pure listener on the chart side, never emits:
|
|
3628
3855
|
* chart.viewportChange → reposition window DOM on next frame (canvas untouched)
|
|
@@ -3691,7 +3918,7 @@ export declare const nightOwl: ThemePreset;
|
|
|
3691
3918
|
/** Convert a {@link TimeValue} (number ms or Date) to a millisecond timestamp. */
|
|
3692
3919
|
export declare function normalizeTime(t: TimeValue): number;
|
|
3693
3920
|
|
|
3694
|
-
export declare const NumberFlow: DefineComponent<
|
|
3921
|
+
export declare const NumberFlow: DefineComponent<__VLS_Props_13, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_13> & Readonly<{}>, {
|
|
3695
3922
|
locale: string;
|
|
3696
3923
|
spinDuration: number;
|
|
3697
3924
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
@@ -3779,6 +4006,12 @@ declare interface PanZoomTarget {
|
|
|
3779
4006
|
* chart keeps working. Targets that omit the hook are always pan/zoomable.
|
|
3780
4007
|
*/
|
|
3781
4008
|
canPanZoom?(): boolean;
|
|
4009
|
+
/**
|
|
4010
|
+
* Left edge of the plot area in canvas CSS px — nonzero when the Y axis
|
|
4011
|
+
* sits on the left. Pointer offsets subtract it before mapping through the
|
|
4012
|
+
* time scale. Omitted means `0`.
|
|
4013
|
+
*/
|
|
4014
|
+
readonly plotLeft?: number;
|
|
3782
4015
|
}
|
|
3783
4016
|
|
|
3784
4017
|
/**
|
|
@@ -4003,7 +4236,7 @@ declare interface PieOtherOptions {
|
|
|
4003
4236
|
color?: string;
|
|
4004
4237
|
}
|
|
4005
4238
|
|
|
4006
|
-
export declare const PieSeries: DefineComponent<
|
|
4239
|
+
export declare const PieSeries: DefineComponent<__VLS_Props_7, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_7> & Readonly<{}>, {
|
|
4007
4240
|
visible: boolean;
|
|
4008
4241
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
4009
4242
|
|
|
@@ -4184,7 +4417,7 @@ declare interface Rect {
|
|
|
4184
4417
|
height: number;
|
|
4185
4418
|
}
|
|
4186
4419
|
|
|
4187
|
-
export declare const ReferenceLine: DefineComponent<
|
|
4420
|
+
export declare const ReferenceLine: DefineComponent<__VLS_Props_16, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_16> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
4188
4421
|
|
|
4189
4422
|
/**
|
|
4190
4423
|
* A straight reference line across the plot — a horizontal threshold / baseline
|
|
@@ -4226,7 +4459,7 @@ declare interface RegionEntry {
|
|
|
4226
4459
|
}
|
|
4227
4460
|
|
|
4228
4461
|
/**
|
|
4229
|
-
* Register the
|
|
4462
|
+
* Register the six built-in series so the string form
|
|
4230
4463
|
* `chart.addSeries('line', …)` resolves. Call it once at startup.
|
|
4231
4464
|
*
|
|
4232
4465
|
* Importing this helper pulls every renderer into the bundle — hosts that
|
|
@@ -4355,6 +4588,24 @@ export declare function sampleRamp(stops: readonly string[], t: number): string;
|
|
|
4355
4588
|
|
|
4356
4589
|
export declare const sandDune: ThemePreset;
|
|
4357
4590
|
|
|
4591
|
+
/** What a {@link YScaleTransform.ticks} generator is asked to fill. */
|
|
4592
|
+
export declare interface ScaleTickArgs {
|
|
4593
|
+
/** Visible value range. Both bounds are plottable on the scale. */
|
|
4594
|
+
min: number;
|
|
4595
|
+
max: number;
|
|
4596
|
+
/** Plot height in CSS pixels. */
|
|
4597
|
+
height: number;
|
|
4598
|
+
/** Minimum pixel gap between adjacent labels. */
|
|
4599
|
+
minSpacing: number;
|
|
4600
|
+
/** Desired label count from `<YAxis labelCount>`, or `null`. */
|
|
4601
|
+
labelCount: number | null;
|
|
4602
|
+
/**
|
|
4603
|
+
* Linear {1,2,5}×10^k ticks already spaced for this mapping (with the axis's
|
|
4604
|
+
* anti-flicker hold). Return this array itself to keep them.
|
|
4605
|
+
*/
|
|
4606
|
+
linear: readonly number[];
|
|
4607
|
+
}
|
|
4608
|
+
|
|
4358
4609
|
/** Environment the chart hands a {@link SeriesDefinition} when constructing its renderer. */
|
|
4359
4610
|
export declare interface SeriesCreateEnv {
|
|
4360
4611
|
/** Active chart theme — definitions read their default colours from it. */
|
|
@@ -4390,7 +4641,7 @@ export declare interface SeriesHoverInfo {
|
|
|
4390
4641
|
* series (see {@link CustomSpatialSeriesRenderer} / {@link TimeSeriesRenderer})
|
|
4391
4642
|
* picks any string that isn't one of the built-ins.
|
|
4392
4643
|
*/
|
|
4393
|
-
export declare type SeriesKind = 'candlestick' | 'line' | 'bar' | 'pie' | 'heatmap' | (string & {});
|
|
4644
|
+
export declare type SeriesKind = 'candlestick' | 'line' | 'bar' | 'band' | 'pie' | 'heatmap' | (string & {});
|
|
4394
4645
|
|
|
4395
4646
|
/**
|
|
4396
4647
|
* A single named (and optionally colored) layer. Carries the layer's display
|
|
@@ -4451,19 +4702,21 @@ export declare type SeriesRenderer = TimeSeriesRenderer | PieSeriesRenderer | He
|
|
|
4451
4702
|
* grouping (e.g. `snapshots.filter(s => s.seriesId === 'btc')`).
|
|
4452
4703
|
*
|
|
4453
4704
|
* `data` is a shallow clone, frozen along with the snapshot itself — a slot
|
|
4454
|
-
* consumer cannot accidentally mutate the chart's internal store.
|
|
4705
|
+
* consumer cannot accidentally mutate the chart's internal store. Its shape
|
|
4706
|
+
* follows the series: `OHLCData` for a candlestick, `TimePoint` for a line or
|
|
4707
|
+
* bar, `BandPoint` (`{ time, low, high }`) for a band.
|
|
4455
4708
|
*/
|
|
4456
4709
|
export declare interface SeriesSnapshot {
|
|
4457
4710
|
readonly id: string;
|
|
4458
4711
|
readonly seriesId: string;
|
|
4459
4712
|
readonly layerIndex?: number;
|
|
4460
4713
|
readonly label?: string;
|
|
4461
|
-
readonly data: Readonly<OHLCData> | Readonly<TimePoint>;
|
|
4714
|
+
readonly data: Readonly<OHLCData> | Readonly<TimePoint> | Readonly<BandPoint>;
|
|
4462
4715
|
readonly color: string;
|
|
4463
4716
|
}
|
|
4464
4717
|
|
|
4465
4718
|
/** Primary series types. Open-ended — a custom {@link SeriesDefinition} picks any string that isn't a built-in. */
|
|
4466
|
-
export declare type SeriesType = 'candlestick' | 'line' | 'bar' | 'pie' | 'heatmap' | (string & {});
|
|
4719
|
+
export declare type SeriesType = 'candlestick' | 'line' | 'bar' | 'band' | 'pie' | 'heatmap' | (string & {});
|
|
4467
4720
|
|
|
4468
4721
|
/** Width and height pair. */
|
|
4469
4722
|
declare interface Size {
|
|
@@ -4684,7 +4937,7 @@ export declare type TimePointInput = Omit<TimePoint, 'time'> & {
|
|
|
4684
4937
|
time: TimeValue;
|
|
4685
4938
|
};
|
|
4686
4939
|
|
|
4687
|
-
export declare const TimeRegion: DefineComponent<
|
|
4940
|
+
export declare const TimeRegion: DefineComponent<__VLS_Props_18, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_18> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
4688
4941
|
|
|
4689
4942
|
/**
|
|
4690
4943
|
* A translucent vertical band shading the interval `[from, to]` — Grafana's
|
|
@@ -4724,25 +4977,32 @@ export declare type TimeRegionEnd = TimeValue | 'now';
|
|
|
4724
4977
|
* pinned to layer 0 (see {@link BaseMultiLayerSeries}).
|
|
4725
4978
|
*/
|
|
4726
4979
|
export declare interface TimeSeriesRenderer extends BaseSeriesRenderer {
|
|
4727
|
-
readonly kind: 'candlestick' | 'line' | 'bar' | (string & {});
|
|
4980
|
+
readonly kind: 'candlestick' | 'line' | 'bar' | 'band' | (string & {});
|
|
4728
4981
|
/** Earliest/latest sample time across all owned layers, or null when empty. */
|
|
4729
4982
|
getTimeBounds(): {
|
|
4730
4983
|
first: number;
|
|
4731
4984
|
last: number;
|
|
4732
4985
|
} | null;
|
|
4733
4986
|
/** Last data point (layer 0 for multi-layer), or null when empty. */
|
|
4734
|
-
getLastDataPoint(): OHLCData | TimePoint | null;
|
|
4987
|
+
getLastDataPoint(): OHLCData | TimePoint | BandPoint | null;
|
|
4735
4988
|
/** Second-to-last data point (layer 0 for multi-layer), or null. */
|
|
4736
|
-
getSecondLastDataPoint(): OHLCData | TimePoint | null;
|
|
4989
|
+
getSecondLastDataPoint(): OHLCData | TimePoint | BandPoint | null;
|
|
4737
4990
|
/** First `maxCount` sample times from the first populated layer — feeds interval detection. */
|
|
4738
4991
|
sampleTimes(maxCount: number): number[];
|
|
4739
4992
|
/** Visible points in `[from, to]` (layer 0 for multi-layer). */
|
|
4740
|
-
getVisibleDataPoints(from: number, to: number): readonly (OHLCData | TimePoint)[];
|
|
4741
|
-
/**
|
|
4742
|
-
|
|
4993
|
+
getVisibleDataPoints(from: number, to: number): readonly (OHLCData | TimePoint | BandPoint)[];
|
|
4994
|
+
/**
|
|
4995
|
+
* Effective min/max for auto-range (stacked totals for multi-layer; raw
|
|
4996
|
+
* min/max otherwise). With `opts.plottable` (a non-linear Y scale) values
|
|
4997
|
+
* it rejects are left out, so the range covers only what the scale can
|
|
4998
|
+
* place; `null` when nothing plottable is in view.
|
|
4999
|
+
*/
|
|
5000
|
+
getValueRange(from: number, to: number, opts?: ValueRangeOptions): {
|
|
4743
5001
|
min: number;
|
|
4744
5002
|
max: number;
|
|
4745
5003
|
} | null;
|
|
5004
|
+
/** Stacking mode of a multi-layer series — the chart rejects `'percent'` on a Y scale with no 0. */
|
|
5005
|
+
readonly stacking?: StackingMode;
|
|
4746
5006
|
}
|
|
4747
5007
|
|
|
4748
5008
|
/** Custom tick-value generator — replaces the built-in `niceTimeIntervals` tier resolution entirely when installed. */
|
|
@@ -4781,10 +5041,16 @@ export declare interface TooltipPosition {
|
|
|
4781
5041
|
* time-series, full media size for pie).
|
|
4782
5042
|
*/
|
|
4783
5043
|
export declare interface TooltipPositionArgs {
|
|
4784
|
-
/** Cursor or anchor x in CSS pixels, relative to the
|
|
5044
|
+
/** Cursor or anchor x in CSS pixels, relative to the overlay container. */
|
|
4785
5045
|
x: number;
|
|
4786
5046
|
/** Cursor or anchor y in CSS pixels, relative to the chart area origin. */
|
|
4787
5047
|
y: number;
|
|
5048
|
+
/**
|
|
5049
|
+
* Left edge of the plot area in the same space as `x` — `chart.plotLeft`
|
|
5050
|
+
* for a time-series tooltip, so it stays clear of a left-side Y axis.
|
|
5051
|
+
* The result is in that space too. Default `0`.
|
|
5052
|
+
*/
|
|
5053
|
+
chartLeft?: number;
|
|
4788
5054
|
/** Plot-area width in CSS pixels. */
|
|
4789
5055
|
chartWidth: number;
|
|
4790
5056
|
/** Plot-area height in CSS pixels. */
|
|
@@ -4946,6 +5212,12 @@ declare type ValueColor = string | ((value: number) => string);
|
|
|
4946
5212
|
/** Signature for a value-to-string formatter (YAxis, YLabel, Pie, Sparkline, NumberFlow). */
|
|
4947
5213
|
export declare type ValueFormatter = (value: number) => string;
|
|
4948
5214
|
|
|
5215
|
+
/** Options for {@link TimeSeriesRenderer.getValueRange}. */
|
|
5216
|
+
declare interface ValueRangeOptions {
|
|
5217
|
+
/** Whether a value has a position on the Y scale (e.g. `v > 0` on log); others are left out. */
|
|
5218
|
+
plottable?: (value: number) => boolean;
|
|
5219
|
+
}
|
|
5220
|
+
|
|
4949
5221
|
/** Custom tick-value generator — replaces the built-in {1,2,5}×10^k resolution entirely when installed. */
|
|
4950
5222
|
export declare type ValueTickGenerator = (range: YRange) => number[];
|
|
4951
5223
|
|
|
@@ -5036,7 +5308,7 @@ export declare function wipeIntro(): WaveIntroFn;
|
|
|
5036
5308
|
|
|
5037
5309
|
/** Configuration for the X (time) axis. */
|
|
5038
5310
|
export declare interface XAxisConfig {
|
|
5039
|
-
/** Height in CSS pixels. Default: 30. */
|
|
5311
|
+
/** Height in CSS pixels. Default: 30, or 0 when every series is spatial (pie, heatmap). */
|
|
5040
5312
|
height?: number;
|
|
5041
5313
|
/** Whether the axis is visible. Default: true. When false, height is treated as 0. */
|
|
5042
5314
|
visible?: boolean;
|
|
@@ -5143,14 +5415,32 @@ export declare class XScale {
|
|
|
5143
5415
|
private countTicks;
|
|
5144
5416
|
}
|
|
5145
5417
|
|
|
5146
|
-
export declare const YAxis: DefineComponent<
|
|
5418
|
+
export declare const YAxis: DefineComponent<__VLS_Props_21, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_21> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
5147
5419
|
containerRef: HTMLDivElement;
|
|
5148
5420
|
}, HTMLDivElement>;
|
|
5149
5421
|
|
|
5150
5422
|
/** Configuration for the Y axis. */
|
|
5151
5423
|
export declare interface YAxisConfig {
|
|
5152
|
-
/**
|
|
5424
|
+
/**
|
|
5425
|
+
* Side the axis column sits on — the plot area shifts right by the axis
|
|
5426
|
+
* width when it's `'left'`. The default edge fade follows the axis to
|
|
5427
|
+
* whichever side it's on. Default: 'right'.
|
|
5428
|
+
*/
|
|
5429
|
+
position?: YAxisPosition;
|
|
5430
|
+
/** Width in CSS pixels. Default: 55, or 0 when every series is spatial (pie, heatmap). */
|
|
5153
5431
|
width?: number;
|
|
5432
|
+
/**
|
|
5433
|
+
* Value mapping. Omitted: linear. `logScale()` gives each power of ten equal
|
|
5434
|
+
* height — for series spanning orders of magnitude; `logScale({ base: 2 })`
|
|
5435
|
+
* puts the ticks on powers of two. Any {@link YScaleTransform} works.
|
|
5436
|
+
*
|
|
5437
|
+
* Autoscale and Y animations run in the scale's space. Values the scale
|
|
5438
|
+
* can't place (≤ 0 on log) are skipped — a gap in a line, no bar or candle —
|
|
5439
|
+
* a fixed `min` / `max` it can't place falls back to `'auto'`, and area
|
|
5440
|
+
* fills close to the plot floor. Percent stacking is rejected when the
|
|
5441
|
+
* scale has no position for 0. Live — a different scale refits the Y range.
|
|
5442
|
+
*/
|
|
5443
|
+
scale?: YScaleTransform;
|
|
5154
5444
|
/** Minimum bound. Default: 'auto'. */
|
|
5155
5445
|
min?: AxisBound;
|
|
5156
5446
|
/** Maximum bound. Default: 'auto'. */
|
|
@@ -5159,6 +5449,9 @@ export declare interface YAxisConfig {
|
|
|
5159
5449
|
visible?: boolean;
|
|
5160
5450
|
}
|
|
5161
5451
|
|
|
5452
|
+
/** Side of the plot area the Y axis column sits on. */
|
|
5453
|
+
export declare type YAxisPosition = 'left' | 'right';
|
|
5454
|
+
|
|
5162
5455
|
export declare const YLabel: __VLS_WithTemplateSlots_8<typeof __VLS_component_8, __VLS_TemplateResult_8["slots"]>;
|
|
5163
5456
|
|
|
5164
5457
|
/**
|
|
@@ -5197,8 +5490,13 @@ export declare interface YRange {
|
|
|
5197
5490
|
export declare class YScale {
|
|
5198
5491
|
/** Shared fade state for Y ticks; see {@link TimeScale.tickTracker}. */
|
|
5199
5492
|
readonly tickTracker: AxisTickTracker;
|
|
5493
|
+
/** Non-linear value mapping (`axis.y.scale`); `null` is linear. */
|
|
5494
|
+
private transform;
|
|
5200
5495
|
private min;
|
|
5201
5496
|
private max;
|
|
5497
|
+
/** Domain bounds in scale space — `transform.forward` of `min` / `max`. */
|
|
5498
|
+
private lo;
|
|
5499
|
+
private hi;
|
|
5202
5500
|
private height;
|
|
5203
5501
|
private pixelRatio;
|
|
5204
5502
|
private labelCountHintValue;
|
|
@@ -5215,6 +5513,8 @@ export declare class YScale {
|
|
|
5215
5513
|
* the boundary doesn't instantly flip back.
|
|
5216
5514
|
*/
|
|
5217
5515
|
private lastRawInterval;
|
|
5516
|
+
/** The transform's own ticks (e.g. powers of ten); `null` while linear ticks are in use. */
|
|
5517
|
+
private ownTicks;
|
|
5218
5518
|
/** Custom formatter (driven by `<YAxis format=…>`). */
|
|
5219
5519
|
private customFormat;
|
|
5220
5520
|
/** Custom tick generator — bypasses {1,2,5}×10^k resolution in `niceTickValues` when set. */
|
|
@@ -5223,11 +5523,23 @@ export declare class YScale {
|
|
|
5223
5523
|
private get minLabelSpacing();
|
|
5224
5524
|
/** Recalculate the scale with a new Y range, chart height, and device pixel ratio. */
|
|
5225
5525
|
update(range: YRange, mediaHeight: number, pixelRatio: number): void;
|
|
5526
|
+
/** Install a non-linear value mapping, or `null` for linear. The range is kept as-is — the chart refits it. */
|
|
5527
|
+
setTransform(transform: YScaleTransform | null): void;
|
|
5528
|
+
getTransform(): YScaleTransform | null;
|
|
5529
|
+
/**
|
|
5530
|
+
* Whether `value` has a position on this scale: finite, and inside the
|
|
5531
|
+
* transform's domain (positive on log). Renderers skip values that fail —
|
|
5532
|
+
* {@link valueToY} still maps them (to the plot floor) so nothing
|
|
5533
|
+
* downstream sees NaN.
|
|
5534
|
+
*/
|
|
5535
|
+
isPlottable(value: number): boolean;
|
|
5226
5536
|
/** Desired label count. Invalid values (NaN, <2, Infinity) clear the hint. */
|
|
5227
5537
|
setLabelCount(n: number | null | undefined): void;
|
|
5228
5538
|
/** Minimum pixel gap between adjacent labels. */
|
|
5229
5539
|
setMinSpacing(px: number | null | undefined): void;
|
|
5230
5540
|
private resetHysteresis;
|
|
5541
|
+
/** A transformed domain needs both bounds plottable; anything else collapses to a flat one. */
|
|
5542
|
+
private updateDomain;
|
|
5231
5543
|
/** Install (or clear) a custom formatter. */
|
|
5232
5544
|
setFormat(fn: ValueFormatter | null): void;
|
|
5233
5545
|
/** Read back the currently installed formatter — null when the built-in is active. */
|
|
@@ -5238,7 +5550,10 @@ export declare class YScale {
|
|
|
5238
5550
|
* with the current range.
|
|
5239
5551
|
*/
|
|
5240
5552
|
setTickGenerator(fn: ValueTickGenerator | null): void;
|
|
5241
|
-
/**
|
|
5553
|
+
/**
|
|
5554
|
+
* Convert a value to a Y position in CSS (media) pixels. A value the
|
|
5555
|
+
* transform can't place (≤ 0 on log) lands on the plot floor.
|
|
5556
|
+
*/
|
|
5242
5557
|
valueToY(value: number): number;
|
|
5243
5558
|
/** Convert a value to a Y position in physical (bitmap) pixels, snapped to
|
|
5244
5559
|
* the pixel grid — for axis-aligned edges that have to stay crisp. */
|
|
@@ -5255,13 +5570,23 @@ export declare class YScale {
|
|
|
5255
5570
|
* so text and gridline share one pixel grid.
|
|
5256
5571
|
*/
|
|
5257
5572
|
valueToSnappedY(value: number): number;
|
|
5258
|
-
/** Convert a Y position in CSS pixels back to a value. */
|
|
5573
|
+
/** Convert a Y position in CSS pixels back to a value — the exact inverse of {@link valueToY}. */
|
|
5259
5574
|
yToValue(y: number): number;
|
|
5575
|
+
/** The value bars and stacks grow from: `0`, or the plot floor's value on a scale with no place for 0 (log). */
|
|
5576
|
+
baselineValue(): number;
|
|
5577
|
+
/**
|
|
5578
|
+
* The value `t` of the way from `from` to `to` in pixels — a plain lerp on a
|
|
5579
|
+
* linear axis, a geometric one on log. `t` past `[0, 1]` overshoots along the
|
|
5580
|
+
* axis. An endpoint the transform can't place returns `to`, so a gap stays a gap.
|
|
5581
|
+
*/
|
|
5582
|
+
lerpValue(from: number, to: number, t: number): number;
|
|
5260
5583
|
/**
|
|
5261
5584
|
* Generate evenly spaced "nice" tick values for the current range and
|
|
5262
5585
|
* chart height. Pure read — resolution happens in `update()`.
|
|
5263
5586
|
*/
|
|
5264
5587
|
niceTickValues(): number[];
|
|
5588
|
+
/** {1,2,5}×10^k ticks at the resolved interval, limited to what the transform can place. */
|
|
5589
|
+
private linearTickValues;
|
|
5265
5590
|
getRange(): YRange;
|
|
5266
5591
|
getMediaHeight(): number;
|
|
5267
5592
|
/**
|
|
@@ -5272,9 +5597,18 @@ export declare class YScale {
|
|
|
5272
5597
|
* range happens to be < 1000.
|
|
5273
5598
|
*/
|
|
5274
5599
|
formatY(value: number): string;
|
|
5600
|
+
private resolveTicks;
|
|
5601
|
+
/**
|
|
5602
|
+
* Smallest linear interval whose ticks stay `minLabelSpacing` apart on the
|
|
5603
|
+
* transformed axis. A monotonic mapping squeezes its gaps hardest at one
|
|
5604
|
+
* end — the top for log (concave), the bottom for a convex one — so
|
|
5605
|
+
* checking both ends covers it.
|
|
5606
|
+
*/
|
|
5607
|
+
private transformedGapFloor;
|
|
5275
5608
|
/**
|
|
5276
5609
|
* Resolve the interval to a {1,2,5}×10^k tick size that satisfies the pixel
|
|
5277
|
-
* floor and (optionally) targets `labelCountHint` labels.
|
|
5610
|
+
* floor and (optionally) targets `labelCountHint` labels. `gapFloorValue` is
|
|
5611
|
+
* the smallest interval that clears `minLabelSpacing` anywhere on the axis.
|
|
5278
5612
|
*
|
|
5279
5613
|
* Hysteresis: the band [0.8×, 1.25×] is anchored to **rawInterval at last
|
|
5280
5614
|
* snap**, not to `lastInterval`. After an escalation (e.g. 100 → 200),
|
|
@@ -5287,4 +5621,43 @@ export declare class YScale {
|
|
|
5287
5621
|
private countTicks;
|
|
5288
5622
|
}
|
|
5289
5623
|
|
|
5624
|
+
/**
|
|
5625
|
+
* A non-linear value mapping for the Y axis — pass one as `axis.y.scale`.
|
|
5626
|
+
* `logScale()` is the built-in one; any monotonic mapping works, e.g. a
|
|
5627
|
+
* square-root axis:
|
|
5628
|
+
*
|
|
5629
|
+
* ```ts
|
|
5630
|
+
* const sqrtScale: YScaleTransform = {
|
|
5631
|
+
* forward: Math.sqrt,
|
|
5632
|
+
* inverse: (s) => s * s,
|
|
5633
|
+
* isPlottable: (v) => v >= 0,
|
|
5634
|
+
* };
|
|
5635
|
+
* ```
|
|
5636
|
+
*
|
|
5637
|
+
* Everything vertical runs in the transformed space: pixel positions,
|
|
5638
|
+
* autoscale padding and the Y animations. Keep the object stable — define it
|
|
5639
|
+
* outside a component, since a new object means a new scale and resets the
|
|
5640
|
+
* Y range.
|
|
5641
|
+
*/
|
|
5642
|
+
export declare interface YScaleTransform {
|
|
5643
|
+
/** Value → scale space. Must be strictly increasing over the plottable values. */
|
|
5644
|
+
forward(value: number): number;
|
|
5645
|
+
/** Scale space → value; the exact inverse of {@link forward}. */
|
|
5646
|
+
inverse(scaled: number): number;
|
|
5647
|
+
/**
|
|
5648
|
+
* Whether a finite value has a position on this scale — one contiguous
|
|
5649
|
+
* interval, e.g. `v > 0` for log. Values that fail are skipped: a gap in a
|
|
5650
|
+
* line, no bar or candle, left out of autoscale. Default: every finite value.
|
|
5651
|
+
*/
|
|
5652
|
+
isPlottable?(value: number): boolean;
|
|
5653
|
+
/**
|
|
5654
|
+
* The scale's own tick values (e.g. powers of ten), or `args.linear` to keep
|
|
5655
|
+
* the linear ticks — say, on a range too narrow for its own. Omitted: linear
|
|
5656
|
+
* ticks, spaced so the tightest gap on this mapping clears `minSpacing`.
|
|
5657
|
+
*/
|
|
5658
|
+
ticks?(args: ScaleTickArgs): readonly number[];
|
|
5659
|
+
/** Label format while the scale's own ticks are in use. Default: the linear formatter. */
|
|
5660
|
+
format?(value: number): string;
|
|
5661
|
+
}
|
|
5662
|
+
|
|
5290
5663
|
export { }
|