@wick-charts/vue 0.6.4 → 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 +4 -4
- package/dist/BandSeries.vue.js +20 -18
- package/dist/BarSeries.vue.js +15 -13
- package/dist/CandlestickSeries.vue.js +31 -29
- package/dist/ChartContainer.vue.js +77 -70
- package/dist/LineSeries.vue.js +19 -17
- package/dist/composables.js +46 -36
- 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/scale-guards.js +23 -5
- package/dist/core/dist/chart/x-guards.js +37 -0
- package/dist/core/dist/chart.js +1286 -843
- package/dist/core/dist/data/sync.js +37 -31
- package/dist/core/dist/navigator/controller.js +37 -37
- 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 +266 -213
- 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 +1 -0
- package/dist/core/dist/series/line.js +21 -20
- package/dist/core/dist/snapshots.js +55 -43
- package/dist/index.d.ts +323 -58
- package/dist/index.js +9 -9
- package/dist/ui/Crosshair.vue.js +51 -27
- package/dist/ui/InfoBar.vue.js +37 -37
- 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 +91 -86
- 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 +78 -74
- package/package.json +2 -2
- package/src/BandSeries.vue +11 -6
- 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 +8 -1
- package/src/ui/Crosshair.vue +41 -1
- package/src/ui/InfoBar.vue +2 -1
- 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 +7 -4
- package/src/ui/{TimeAxis.vue → XAxis.vue} +18 -5
- package/src/ui/YAxis.vue +66 -12
- package/src/ui/YLabel.vue +35 -5
- package/dist/ui/TimeAxis.vue.js +0 -44
- package/dist/ui/TimeAxis.vue2.js +0 -4
package/dist/index.d.ts
CHANGED
|
@@ -12,8 +12,8 @@ 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, {
|
|
@@ -43,9 +43,9 @@ declare const __VLS_component_5: DefineComponent<__VLS_Props_15, {}, {}, {}, {},
|
|
|
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_18, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_18> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
47
47
|
|
|
48
|
-
declare const __VLS_component_7: DefineComponent<
|
|
48
|
+
declare const __VLS_component_7: DefineComponent<__VLS_Props_19, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_19> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
49
49
|
containerRef: HTMLDivElement;
|
|
50
50
|
}, any>;
|
|
51
51
|
|
|
@@ -56,7 +56,8 @@ declare type __VLS_Props = {
|
|
|
56
56
|
* Band data — one band per layer. A single band passes a flat
|
|
57
57
|
* `{ time, low, high }[]`; several bands pass `BandPoint[][]`. To name/color
|
|
58
58
|
* a band, pass `{ label, color?, data }` (or an array of them). Time accepts
|
|
59
|
-
* ms or `Date`.
|
|
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 }`.
|
|
60
61
|
*/
|
|
61
62
|
data: BandData;
|
|
62
63
|
/** Visual options override — fill, edge stroke, curve, entrance / intro / smoothing. */
|
|
@@ -65,6 +66,8 @@ declare type __VLS_Props = {
|
|
|
65
66
|
id?: string;
|
|
66
67
|
/** Show/hide the series without unmounting it — excludes it from the Y-range fit and tooltip/legend. Default `true`. Live. */
|
|
67
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;
|
|
68
71
|
};
|
|
69
72
|
|
|
70
73
|
declare type __VLS_Props_10 = {
|
|
@@ -91,6 +94,8 @@ declare type __VLS_Props_11 = {
|
|
|
91
94
|
label?: string;
|
|
92
95
|
/** Color override. Falls back to the series color (when `seriesId` is set), then the theme line color. */
|
|
93
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;
|
|
94
99
|
};
|
|
95
100
|
|
|
96
101
|
declare type __VLS_Props_12 = {
|
|
@@ -148,16 +153,11 @@ declare type __VLS_Props_16 = {
|
|
|
148
153
|
style?: ReferenceLineStyle;
|
|
149
154
|
/** Stroke width in CSS pixels. Default: `1`. */
|
|
150
155
|
width?: number;
|
|
156
|
+
/** Named Y scale (`ChartContainer` `scales`) the `value` maps through. Default: the default scale. */
|
|
157
|
+
scale?: string;
|
|
151
158
|
};
|
|
152
159
|
|
|
153
160
|
declare type __VLS_Props_17 = {
|
|
154
|
-
/** Desired number of labels (≥ 2). Overrides chart-level `axis.x.labelCount`. */
|
|
155
|
-
labelCount?: number;
|
|
156
|
-
/** Minimum pixel gap between adjacent labels (hard floor). Overrides chart-level. */
|
|
157
|
-
minLabelSpacing?: number;
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
declare type __VLS_Props_18 = {
|
|
161
161
|
/** Left edge — epoch ms or a `Date`. */
|
|
162
162
|
from: TimeValue;
|
|
163
163
|
/** Right edge — epoch ms or a `Date`. Omit (or pass `'now'`) for an open-ended band to the right edge. */
|
|
@@ -170,7 +170,7 @@ declare type __VLS_Props_18 = {
|
|
|
170
170
|
color?: string;
|
|
171
171
|
};
|
|
172
172
|
|
|
173
|
-
declare type
|
|
173
|
+
declare type __VLS_Props_18 = {
|
|
174
174
|
/**
|
|
175
175
|
* @deprecated Use the named `sub` slot instead — it accepts arbitrary
|
|
176
176
|
* inline markup (icons, badges, formatted text) to mirror React's
|
|
@@ -184,19 +184,37 @@ declare type __VLS_Props_19 = {
|
|
|
184
184
|
sub?: string;
|
|
185
185
|
};
|
|
186
186
|
|
|
187
|
+
declare type __VLS_Props_19 = {
|
|
188
|
+
sort?: SnapshotSort;
|
|
189
|
+
format?: TooltipFormatter;
|
|
190
|
+
};
|
|
191
|
+
|
|
187
192
|
declare type __VLS_Props_2 = {
|
|
188
|
-
/**
|
|
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
|
+
*/
|
|
189
197
|
data: MultiLayerData;
|
|
190
198
|
options?: Partial<BarSeriesOptions>;
|
|
191
199
|
/** Stable series ID — same value across remounts. */
|
|
192
200
|
id?: string;
|
|
193
201
|
/** Show/hide the series without unmounting it — excludes it from the Y-range fit and tooltip/legend. Default `true`. Live. */
|
|
194
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;
|
|
195
205
|
};
|
|
196
206
|
|
|
197
207
|
declare type __VLS_Props_20 = {
|
|
198
|
-
|
|
199
|
-
|
|
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;
|
|
200
218
|
};
|
|
201
219
|
|
|
202
220
|
declare type __VLS_Props_21 = {
|
|
@@ -209,6 +227,12 @@ declare type __VLS_Props_21 = {
|
|
|
209
227
|
labelCount?: number;
|
|
210
228
|
/** Minimum pixel gap between adjacent labels (hard floor). Overrides chart-level. */
|
|
211
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;
|
|
212
236
|
};
|
|
213
237
|
|
|
214
238
|
declare type __VLS_Props_22 = {
|
|
@@ -219,13 +243,19 @@ declare type __VLS_Props_22 = {
|
|
|
219
243
|
*/
|
|
220
244
|
seriesId?: string;
|
|
221
245
|
color?: string;
|
|
222
|
-
/** 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. */
|
|
223
247
|
format?: ValueFormatter;
|
|
224
248
|
/**
|
|
225
249
|
* Badge motion. `true` (default) glides + counts up + fades in with the
|
|
226
250
|
* intro; `false` snaps with no easing; an object tunes individual parts.
|
|
227
251
|
*/
|
|
228
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;
|
|
229
259
|
};
|
|
230
260
|
|
|
231
261
|
declare type __VLS_Props_3 = {
|
|
@@ -236,6 +266,8 @@ declare type __VLS_Props_3 = {
|
|
|
236
266
|
id?: string;
|
|
237
267
|
/** Show/hide the series without unmounting it — excludes it from the Y-range fit and tooltip/legend. Default `true`. Live. */
|
|
238
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;
|
|
239
271
|
};
|
|
240
272
|
|
|
241
273
|
declare type __VLS_Props_4 = {
|
|
@@ -243,6 +275,14 @@ declare type __VLS_Props_4 = {
|
|
|
243
275
|
theme?: ChartTheme;
|
|
244
276
|
/** Grouped axis configuration (Y/X visibility, bounds, sizing). Live. */
|
|
245
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>;
|
|
246
286
|
/**
|
|
247
287
|
* Viewport padding. `top`/`bottom` are in pixels. `left`/`right` accept either pixels (`50`)
|
|
248
288
|
* or data intervals (`{ intervals: 3 }`). Set to 0 for edge-to-edge sparklines. Updates are
|
|
@@ -417,13 +457,18 @@ declare type __VLS_Props_5 = {
|
|
|
417
457
|
};
|
|
418
458
|
|
|
419
459
|
declare type __VLS_Props_6 = {
|
|
420
|
-
/**
|
|
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
|
+
*/
|
|
421
464
|
data: MultiLayerData;
|
|
422
465
|
options?: Partial<LineSeriesOptions>;
|
|
423
466
|
/** Stable series ID — same value across remounts. */
|
|
424
467
|
id?: string;
|
|
425
468
|
/** Show/hide the series without unmounting it — excludes it from the Y-range fit and tooltip/legend. Default `true`. Live. */
|
|
426
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;
|
|
427
472
|
};
|
|
428
473
|
|
|
429
474
|
declare type __VLS_Props_7 = {
|
|
@@ -1034,7 +1079,7 @@ export declare type AxisBound = 'auto' | number | string | ((values: number[]) =
|
|
|
1034
1079
|
export declare interface AxisConfig {
|
|
1035
1080
|
/** Y-axis configuration — width, bounds, and visibility of the value axis. */
|
|
1036
1081
|
y?: YAxisConfig;
|
|
1037
|
-
/** X-axis configuration — height and visibility of the
|
|
1082
|
+
/** X-axis configuration — type, height and visibility of the X axis. */
|
|
1038
1083
|
x?: XAxisConfig;
|
|
1039
1084
|
}
|
|
1040
1085
|
|
|
@@ -1099,8 +1144,9 @@ export declare function backfillSweepIntro(): LineIntroFn;
|
|
|
1099
1144
|
* `data` shape for a band series — the same omnivorous forms as
|
|
1100
1145
|
* {@link MultiLayerData}, one band per layer: a flat `BandPointInput[]`, a
|
|
1101
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.
|
|
1102
1148
|
*/
|
|
1103
|
-
export declare type BandData =
|
|
1149
|
+
export declare type BandData = BandSampleInput[] | SeriesLayer<BandSampleInput> | Array<BandSampleInput[] | SeriesLayer<BandSampleInput>>;
|
|
1104
1150
|
|
|
1105
1151
|
/** Entrance styles for band points added via `appendData` — the same set as {@link LineEntryAnimation}. */
|
|
1106
1152
|
export declare type BandEntryAnimation = LineEntryAnimation;
|
|
@@ -1114,13 +1160,18 @@ export declare interface BandPoint {
|
|
|
1114
1160
|
time: number;
|
|
1115
1161
|
low: number;
|
|
1116
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;
|
|
1117
1165
|
}
|
|
1118
1166
|
|
|
1119
1167
|
/** {@link BandPoint} that also accepts `Date` for the time field. */
|
|
1120
|
-
export declare type BandPointInput = Omit<BandPoint, 'time'> & {
|
|
1168
|
+
export declare type BandPointInput = Omit<BandPoint, 'time' | 'x'> & {
|
|
1121
1169
|
time: TimeValue;
|
|
1122
1170
|
};
|
|
1123
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
|
+
|
|
1124
1175
|
export declare const BandSeries: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
1125
1176
|
visible: boolean;
|
|
1126
1177
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
@@ -1322,7 +1373,10 @@ export declare const BarSeriesDef: SeriesDefinition<BarSeriesOptions>;
|
|
|
1322
1373
|
|
|
1323
1374
|
/** Visual options for a bar series. */
|
|
1324
1375
|
export declare interface BarSeriesOptions {
|
|
1325
|
-
/**
|
|
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
|
+
*/
|
|
1326
1380
|
barWidthRatio: number;
|
|
1327
1381
|
/** Stacking mode. Default: 'off'. */
|
|
1328
1382
|
stacking: StackingMode;
|
|
@@ -1480,6 +1534,12 @@ export declare interface BaseSeriesRenderer {
|
|
|
1480
1534
|
* selects which internal store to target; defaults to 0.
|
|
1481
1535
|
*/
|
|
1482
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;
|
|
1483
1543
|
/** Append a single point (real-time tick). Optional — not all renderers support streaming. */
|
|
1484
1544
|
appendPoint?(point: unknown, layerIndex?: number): void;
|
|
1485
1545
|
/**
|
|
@@ -2025,18 +2085,25 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2025
2085
|
#private;
|
|
2026
2086
|
/** Maps time values to horizontal pixel coordinates. */
|
|
2027
2087
|
readonly timeScale: XScale;
|
|
2028
|
-
/** Maps price/value to vertical pixel coordinates. */
|
|
2088
|
+
/** Maps price/value to vertical pixel coordinates — the default Y scale. */
|
|
2029
2089
|
readonly yScale: YScale;
|
|
2030
|
-
/** 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. */
|
|
2031
2091
|
get yAxisWidth(): number;
|
|
2032
|
-
/** Side of the plot area the Y-axis column sits on. */
|
|
2092
|
+
/** Side of the plot area the default Y-axis column sits on. */
|
|
2033
2093
|
get yAxisPosition(): YAxisPosition;
|
|
2034
2094
|
/**
|
|
2035
|
-
* Left edge of the plot area in container CSS px — the Y-axis
|
|
2036
|
-
*
|
|
2037
|
-
*
|
|
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.
|
|
2038
2098
|
*/
|
|
2039
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;
|
|
2040
2107
|
/** CSS px height of the floating Title / InfoBar header, `0` without one. A left
|
|
2041
2108
|
* axis shares its column with it, so tick labels fade out underneath. */
|
|
2042
2109
|
get headerHeight(): number;
|
|
@@ -2057,24 +2124,28 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2057
2124
|
addSeries(type: 'candlestick', options?: Partial<CandlestickSeriesOptions & {
|
|
2058
2125
|
id?: string;
|
|
2059
2126
|
label?: string;
|
|
2127
|
+
scale?: string;
|
|
2060
2128
|
}>): string;
|
|
2061
2129
|
addSeries(type: 'line', options?: Partial<LineSeriesOptions & {
|
|
2062
2130
|
layers?: number;
|
|
2063
2131
|
id?: string;
|
|
2064
2132
|
label?: string;
|
|
2065
2133
|
labels?: (string | undefined)[];
|
|
2134
|
+
scale?: string;
|
|
2066
2135
|
}>): string;
|
|
2067
2136
|
addSeries(type: 'bar', options?: Partial<BarSeriesOptions & {
|
|
2068
2137
|
layers?: number;
|
|
2069
2138
|
id?: string;
|
|
2070
2139
|
label?: string;
|
|
2071
2140
|
labels?: (string | undefined)[];
|
|
2141
|
+
scale?: string;
|
|
2072
2142
|
}>): string;
|
|
2073
2143
|
addSeries(type: 'band', options?: Partial<BandSeriesOptions & {
|
|
2074
2144
|
layers?: number;
|
|
2075
2145
|
id?: string;
|
|
2076
2146
|
label?: string;
|
|
2077
2147
|
labels?: (string | undefined)[];
|
|
2148
|
+
scale?: string;
|
|
2078
2149
|
}>): string;
|
|
2079
2150
|
addSeries(type: 'pie', options?: Partial<PieSeriesOptions & {
|
|
2080
2151
|
id?: string;
|
|
@@ -2089,6 +2160,7 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2089
2160
|
id?: string;
|
|
2090
2161
|
label?: string;
|
|
2091
2162
|
labels?: (string | undefined)[];
|
|
2163
|
+
scale?: string;
|
|
2092
2164
|
}): string;
|
|
2093
2165
|
/** Remove a series by ID and clean up its resources. */
|
|
2094
2166
|
removeSeries(id: string): void;
|
|
@@ -2166,10 +2238,13 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2166
2238
|
*
|
|
2167
2239
|
* For line/bar accepts `TimePointInput[]` (time may be `Date`); for candlestick accepts `OHLCInput[]`;
|
|
2168
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.
|
|
2169
2244
|
*/
|
|
2170
2245
|
setSeriesData(id: string, data: unknown, layerIndex?: number): void;
|
|
2171
2246
|
/** Append a new data point to the end of a series (real-time tick). */
|
|
2172
|
-
appendData(id: string, point:
|
|
2247
|
+
appendData(id: string, point: SeriesPointInput, layerIndex?: number): void;
|
|
2173
2248
|
/**
|
|
2174
2249
|
* Prepend older points to the front of a series — the "load more history on
|
|
2175
2250
|
* scroll" path. Unlike {@link setSeriesData}, this deliberately does NOT set
|
|
@@ -2183,9 +2258,9 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2183
2258
|
* first point; the sync reconciler guarantees this before calling here.
|
|
2184
2259
|
* No-op if the renderer doesn't support prepend.
|
|
2185
2260
|
*/
|
|
2186
|
-
prependData(id: string, points:
|
|
2261
|
+
prependData(id: string, points: SeriesPointInput[], layerIndex?: number): void;
|
|
2187
2262
|
/** Update the last data point of a series in place (e.g. live candle update). */
|
|
2188
|
-
updateData(id: string, point:
|
|
2263
|
+
updateData(id: string, point: SeriesPointInput, layerIndex?: number): void;
|
|
2189
2264
|
/**
|
|
2190
2265
|
* Keep only the most recent `count` points of a series — drop the oldest
|
|
2191
2266
|
* tail when the series exceeds the cap. Smooth Y-range chase (no snap):
|
|
@@ -2200,8 +2275,13 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2200
2275
|
* ```
|
|
2201
2276
|
*/
|
|
2202
2277
|
keepLast(id: string, count: number, layerIndex?: number): void;
|
|
2203
|
-
/**
|
|
2204
|
-
|
|
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;
|
|
2205
2285
|
/**
|
|
2206
2286
|
* Batch multiple updates: suppress recomputes until `fn` returns. Exceptions
|
|
2207
2287
|
* inside `fn` still flush the batch so counters don't leak across calls.
|
|
@@ -2331,9 +2411,9 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2331
2411
|
getSeriesIds(): string[];
|
|
2332
2412
|
/**
|
|
2333
2413
|
* Whether pan/zoom gestures currently apply — true when any visible series
|
|
2334
|
-
* has a time axis. Part of the
|
|
2335
|
-
*
|
|
2336
|
-
* 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.
|
|
2337
2417
|
*/
|
|
2338
2418
|
canPanZoom(): boolean;
|
|
2339
2419
|
/**
|
|
@@ -2416,17 +2496,54 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
|
|
|
2416
2496
|
getTimeZone(): string | undefined;
|
|
2417
2497
|
/** Update axis configuration and re-render. */
|
|
2418
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;
|
|
2419
2528
|
/**
|
|
2420
2529
|
* Apply label-density knobs driven by `<YAxis labelCount=… minLabelSpacing=…>`
|
|
2421
2530
|
* — kept separate from {@link setAxis} so component props don't force a
|
|
2422
|
-
* Y-animation reset.
|
|
2423
|
-
*
|
|
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.
|
|
2424
2534
|
*/
|
|
2425
2535
|
setYAxisLabelDensity(params: {
|
|
2426
2536
|
labelCount?: number | null;
|
|
2427
2537
|
minLabelSpacing?: number | null;
|
|
2538
|
+
scale?: string;
|
|
2428
2539
|
}): void;
|
|
2429
|
-
/**
|
|
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}. */
|
|
2430
2547
|
setTimeAxisLabelDensity(params: {
|
|
2431
2548
|
labelCount?: number | null;
|
|
2432
2549
|
minLabelSpacing?: number | null;
|
|
@@ -2545,6 +2662,16 @@ export declare interface ChartLayout {
|
|
|
2545
2662
|
export declare interface ChartOptions {
|
|
2546
2663
|
theme?: ChartTheme;
|
|
2547
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>;
|
|
2548
2675
|
/**
|
|
2549
2676
|
* Viewport padding. `top`/`bottom` are in pixels. `left`/`right` accept either pixels (`50`)
|
|
2550
2677
|
* or data intervals (`{ intervals: 3 }`). Defaults: `{ top: 20, bottom: 20, right: { intervals: 3 }, left: { intervals: 0 } }`.
|
|
@@ -2910,8 +3037,13 @@ export declare interface CrosshairPosition {
|
|
|
2910
3037
|
mediaX: number;
|
|
2911
3038
|
/** Y position in CSS pixels relative to the chart container. */
|
|
2912
3039
|
mediaY: number;
|
|
2913
|
-
/**
|
|
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
|
+
*/
|
|
2914
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;
|
|
2915
3047
|
/** Y (value) under the crosshair. */
|
|
2916
3048
|
y: number;
|
|
2917
3049
|
}
|
|
@@ -2939,7 +3071,7 @@ export declare interface CustomSpatialSeriesRenderer extends BaseSeriesRenderer
|
|
|
2939
3071
|
*/
|
|
2940
3072
|
export declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
2941
3073
|
|
|
2942
|
-
declare const _default: DefineComponent<
|
|
3074
|
+
declare const _default: DefineComponent<__VLS_Props_20, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_20> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
2943
3075
|
containerRef: HTMLDivElement;
|
|
2944
3076
|
}, HTMLDivElement>;
|
|
2945
3077
|
export { _default as TimeAxis }
|
|
@@ -3205,6 +3337,8 @@ export declare interface LayerSnapshot {
|
|
|
3205
3337
|
color: string;
|
|
3206
3338
|
low?: number;
|
|
3207
3339
|
high?: number;
|
|
3340
|
+
/** The sample's own X on a numeric or category axis. */
|
|
3341
|
+
x?: number | string;
|
|
3208
3342
|
}
|
|
3209
3343
|
|
|
3210
3344
|
export declare const Legend: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
|
|
@@ -3273,6 +3407,7 @@ declare interface LineEntry {
|
|
|
3273
3407
|
label?: string;
|
|
3274
3408
|
style: ReferenceLineStyle;
|
|
3275
3409
|
width: number;
|
|
3410
|
+
scale?: string;
|
|
3276
3411
|
}
|
|
3277
3412
|
|
|
3278
3413
|
/**
|
|
@@ -3420,6 +3555,9 @@ declare interface LinePoint {
|
|
|
3420
3555
|
y: number;
|
|
3421
3556
|
}
|
|
3422
3557
|
|
|
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
|
+
|
|
3423
3561
|
export declare const LineSeries: DefineComponent<__VLS_Props_6, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_6> & Readonly<{}>, {
|
|
3424
3562
|
visible: boolean;
|
|
3425
3563
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
@@ -3744,6 +3882,8 @@ export declare interface MarkerConfig {
|
|
|
3744
3882
|
label?: string;
|
|
3745
3883
|
/** Color override. Falls back to the series color (when `seriesId` is set), then the theme line color. */
|
|
3746
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;
|
|
3747
3887
|
}
|
|
3748
3888
|
|
|
3749
3889
|
/** Internal bookkeeping for a registered marker. `time` is normalized to epoch ms; `shape`/`pulse` carry resolved defaults. */
|
|
@@ -3756,6 +3896,7 @@ declare interface MarkerEntry {
|
|
|
3756
3896
|
pulse: boolean;
|
|
3757
3897
|
label?: string;
|
|
3758
3898
|
color?: string;
|
|
3899
|
+
scale?: string;
|
|
3759
3900
|
}
|
|
3760
3901
|
|
|
3761
3902
|
/**
|
|
@@ -3821,9 +3962,10 @@ declare interface MorphPlaceholder {
|
|
|
3821
3962
|
* - an array mixing raw `TimePointInput[]` layers and named `SeriesLayer`s.
|
|
3822
3963
|
*
|
|
3823
3964
|
* Everything normalizes to `SeriesLayer[]` internally (see `toLayers`). Time
|
|
3824
|
-
* 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.
|
|
3825
3967
|
*/
|
|
3826
|
-
export declare type MultiLayerData =
|
|
3968
|
+
export declare type MultiLayerData = LinePointInput[] | SeriesLayer<LinePointInput> | Array<LinePointInput[] | SeriesLayer<LinePointInput>>;
|
|
3827
3969
|
|
|
3828
3970
|
declare const Navigator_2: DefineComponent<__VLS_Props_12, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_12> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
3829
3971
|
stripRef: HTMLDivElement;
|
|
@@ -3847,9 +3989,8 @@ export declare interface NavigatorCandlePoint {
|
|
|
3847
3989
|
* left handle, right handle. The overlay is purely visual; pointer input is
|
|
3848
3990
|
* captured on the canvas and hit-tested against the current window geometry.
|
|
3849
3991
|
*
|
|
3850
|
-
* Both layers reserve
|
|
3851
|
-
*
|
|
3852
|
-
* 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).
|
|
3853
3994
|
*
|
|
3854
3995
|
* Event topology — navigator is a pure listener on the chart side, never emits:
|
|
3855
3996
|
* chart.viewportChange → reposition window DOM on next frame (canvas untouched)
|
|
@@ -4399,7 +4540,10 @@ export declare function plotterIntro(): LineIntroFn;
|
|
|
4399
4540
|
export declare interface PointClickInfo {
|
|
4400
4541
|
mediaX: number;
|
|
4401
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. */
|
|
4402
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;
|
|
4403
4547
|
y: number;
|
|
4404
4548
|
spatialHit: {
|
|
4405
4549
|
seriesId: string;
|
|
@@ -4440,6 +4584,8 @@ export declare interface ReferenceLineConfig {
|
|
|
4440
4584
|
style?: ReferenceLineStyle;
|
|
4441
4585
|
/** Stroke width in CSS pixels. Default: `1`. */
|
|
4442
4586
|
width?: number;
|
|
4587
|
+
/** Named Y scale (`ChartOptions.scales`) a horizontal line's `value` maps through. Default: the default scale. */
|
|
4588
|
+
scale?: string;
|
|
4443
4589
|
}
|
|
4444
4590
|
|
|
4445
4591
|
/** Orientation of a resolved reference line. */
|
|
@@ -4625,6 +4771,11 @@ export declare interface SeriesCreateEnv {
|
|
|
4625
4771
|
export declare interface SeriesDefinition<O = Record<string, unknown>> {
|
|
4626
4772
|
/** Discriminator for animation defaults and string-form lookup. */
|
|
4627
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[];
|
|
4628
4779
|
/** Construct the renderer. `options` arrives with the chart's animation defaults/overrides already merged. */
|
|
4629
4780
|
create(env: SeriesCreateEnv, options: Partial<O>): SeriesRenderer;
|
|
4630
4781
|
}
|
|
@@ -4658,6 +4809,9 @@ declare interface SeriesLayer<T> {
|
|
|
4658
4809
|
data: T[];
|
|
4659
4810
|
}
|
|
4660
4811
|
|
|
4812
|
+
/** Any point `appendData` / `prependData` / `updateData` take. */
|
|
4813
|
+
declare type SeriesPointInput = OHLCInput | TimePointInput | BandPointInput | XPointInput | XBandPointInput;
|
|
4814
|
+
|
|
4661
4815
|
export declare interface SeriesRenderContext {
|
|
4662
4816
|
scope: BitmapCoordinateSpace;
|
|
4663
4817
|
timeScale: XScale;
|
|
@@ -4926,18 +5080,24 @@ export declare interface TimeFormatOptions {
|
|
|
4926
5080
|
/** Custom time-tick formatter, mirroring {@link YScale}'s `ValueFormatter` contract. */
|
|
4927
5081
|
export declare type TimeFormatter = (timestamp: number, interval: number) => string;
|
|
4928
5082
|
|
|
4929
|
-
/**
|
|
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
|
+
*/
|
|
4930
5088
|
export declare interface TimePoint {
|
|
4931
5089
|
time: number;
|
|
4932
5090
|
value: number;
|
|
5091
|
+
/** The point's X on a numeric or category axis, as passed in. */
|
|
5092
|
+
x?: number | string;
|
|
4933
5093
|
}
|
|
4934
5094
|
|
|
4935
5095
|
/** {@link TimePoint} that also accepts `Date` for the time field. */
|
|
4936
|
-
export declare type TimePointInput = Omit<TimePoint, 'time'> & {
|
|
5096
|
+
export declare type TimePointInput = Omit<TimePoint, 'time' | 'x'> & {
|
|
4937
5097
|
time: TimeValue;
|
|
4938
5098
|
};
|
|
4939
5099
|
|
|
4940
|
-
export declare const TimeRegion: DefineComponent<
|
|
5100
|
+
export declare const TimeRegion: DefineComponent<__VLS_Props_17, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_17> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
4941
5101
|
|
|
4942
5102
|
/**
|
|
4943
5103
|
* A translucent vertical band shading the interval `[from, to]` — Grafana's
|
|
@@ -5306,14 +5466,69 @@ export declare function wickBodyIntro(): CandleIntroFn;
|
|
|
5306
5466
|
*/
|
|
5307
5467
|
export declare function wipeIntro(): WaveIntroFn;
|
|
5308
5468
|
|
|
5309
|
-
/** Configuration for the X
|
|
5469
|
+
/** Configuration for the X axis. */
|
|
5310
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;
|
|
5311
5486
|
/** Height in CSS pixels. Default: 30, or 0 when every series is spatial (pie, heatmap). */
|
|
5312
5487
|
height?: number;
|
|
5313
5488
|
/** Whether the axis is visible. Default: true. When false, height is treated as 0. */
|
|
5314
5489
|
visible?: boolean;
|
|
5315
5490
|
}
|
|
5316
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
|
+
|
|
5317
5532
|
/** Time range (timestamps in milliseconds) of the currently visible portion of the chart. */
|
|
5318
5533
|
declare interface XRange {
|
|
5319
5534
|
from: number;
|
|
@@ -5327,6 +5542,10 @@ export declare class XScale {
|
|
|
5327
5542
|
* identical on both surfaces.
|
|
5328
5543
|
*/
|
|
5329
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;
|
|
5330
5549
|
private from;
|
|
5331
5550
|
private to;
|
|
5332
5551
|
private width;
|
|
@@ -5334,7 +5553,7 @@ export declare class XScale {
|
|
|
5334
5553
|
private dataInterval;
|
|
5335
5554
|
private labelCountHintValue;
|
|
5336
5555
|
private minSpacingValue;
|
|
5337
|
-
/** Custom formatter
|
|
5556
|
+
/** Custom formatter, installed by `<XAxis format=…>`. */
|
|
5338
5557
|
private customFormat;
|
|
5339
5558
|
/** Custom tick generator — bypasses tier resolution in `niceTickValues` when set. */
|
|
5340
5559
|
private customTickGenerator;
|
|
@@ -5356,10 +5575,41 @@ export declare class XScale {
|
|
|
5356
5575
|
update(range: XRange, mediaWidth: number, pixelRatio: number, dataInterval?: number): void;
|
|
5357
5576
|
setLabelCount(n: number | null | undefined): void;
|
|
5358
5577
|
setMinSpacing(px: number | null | undefined): void;
|
|
5359
|
-
/**
|
|
5360
|
-
|
|
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;
|
|
5361
5584
|
/** Read back the currently installed formatter — null when the built-in is active. */
|
|
5362
|
-
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;
|
|
5363
5613
|
/**
|
|
5364
5614
|
* Install (or clear) a custom tick-value generator. When set, it replaces
|
|
5365
5615
|
* `niceTimeIntervals` tier resolution entirely — `niceTickValues` calls it
|
|
@@ -5373,11 +5623,19 @@ export declare class XScale {
|
|
|
5373
5623
|
setTimeZone(timeZone: string | undefined): void;
|
|
5374
5624
|
getTimeZone(): string | undefined;
|
|
5375
5625
|
/**
|
|
5376
|
-
* Format
|
|
5377
|
-
* {@link setFormat})
|
|
5378
|
-
*
|
|
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.
|
|
5379
5631
|
*/
|
|
5380
|
-
formatX(
|
|
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.
|
|
5637
|
+
*/
|
|
5638
|
+
formatPointX(coord: number, interval: number): string;
|
|
5381
5639
|
private resetHysteresis;
|
|
5382
5640
|
timeToX(time: number): number;
|
|
5383
5641
|
/** X in physical (bitmap) pixels, snapped to the pixel grid — for
|
|
@@ -5404,6 +5662,8 @@ export declare class XScale {
|
|
|
5404
5662
|
ticks: number[];
|
|
5405
5663
|
tickInterval: number;
|
|
5406
5664
|
};
|
|
5665
|
+
/** One tick per category whose band centre is in view. */
|
|
5666
|
+
private bandTicks;
|
|
5407
5667
|
getRange(): XRange;
|
|
5408
5668
|
getMediaWidth(): number;
|
|
5409
5669
|
/**
|
|
@@ -5412,12 +5672,17 @@ export declare class XScale {
|
|
|
5412
5672
|
* tier inside a ratio band so micro pan/zoom doesn't flip label density.
|
|
5413
5673
|
*/
|
|
5414
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;
|
|
5415
5680
|
private countTicks;
|
|
5416
5681
|
}
|
|
5417
5682
|
|
|
5418
5683
|
export declare const YAxis: DefineComponent<__VLS_Props_21, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_21> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
5419
5684
|
containerRef: HTMLDivElement;
|
|
5420
|
-
},
|
|
5685
|
+
}, any>;
|
|
5421
5686
|
|
|
5422
5687
|
/** Configuration for the Y axis. */
|
|
5423
5688
|
export declare interface YAxisConfig {
|