@wick-charts/vue 0.4.2 → 0.5.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.
Files changed (144) hide show
  1. package/README.md +5 -3
  2. package/dist/BarSeries.vue.js +44 -0
  3. package/dist/BarSeries.vue2.js +4 -0
  4. package/dist/CandlestickSeries.vue.js +45 -0
  5. package/dist/CandlestickSeries.vue2.js +4 -0
  6. package/dist/ChartContainer.vue.js +168 -0
  7. package/dist/ChartContainer.vue2.js +4 -0
  8. package/dist/LineSeries.vue.js +44 -0
  9. package/dist/LineSeries.vue2.js +4 -0
  10. package/dist/PieSeries.vue.js +34 -0
  11. package/dist/PieSeries.vue2.js +4 -0
  12. package/dist/composables.js +44 -0
  13. package/dist/context.js +25 -0
  14. package/dist/core/dist/animation/animator.js +72 -0
  15. package/dist/core/dist/animation/config.js +145 -0
  16. package/dist/core/dist/animation/easing.js +4 -0
  17. package/dist/core/dist/animation/scalar-spring.js +57 -0
  18. package/dist/core/dist/animation/spring.js +11 -0
  19. package/dist/core/dist/animation/time.js +19 -0
  20. package/dist/core/dist/animation/viewport-engine.js +174 -0
  21. package/dist/core/dist/animation/visible-range-spring.js +64 -0
  22. package/dist/core/dist/animation/y-range-hermite.js +72 -0
  23. package/dist/core/dist/animation/y-range-snap.js +31 -0
  24. package/dist/core/dist/animation/y-range-spring.js +59 -0
  25. package/dist/core/dist/axis/dom-labels.js +60 -0
  26. package/dist/core/dist/canvas-manager.js +109 -0
  27. package/dist/core/dist/chart/edge-indicators.js +26 -0
  28. package/dist/core/dist/chart/fit-to-data.js +9 -0
  29. package/dist/core/dist/chart/last-value.js +31 -0
  30. package/dist/core/dist/chart/options.js +35 -0
  31. package/dist/core/dist/chart/pan-zoom-math.js +66 -0
  32. package/dist/core/dist/chart/streaming-cadence.js +70 -0
  33. package/dist/core/dist/chart/streaming-target.js +22 -0
  34. package/dist/core/dist/chart/viewport-padding.js +6 -0
  35. package/dist/core/dist/chart/y-target.js +24 -0
  36. package/dist/core/dist/chart.js +1495 -0
  37. package/dist/core/dist/components/crosshair.js +9 -0
  38. package/dist/core/dist/components/edge-indicator.js +36 -0
  39. package/dist/core/dist/components/grid.js +22 -0
  40. package/dist/core/dist/components/marker.js +41 -0
  41. package/dist/core/dist/components/reference-line.js +48 -0
  42. package/dist/core/dist/components/time-region.js +35 -0
  43. package/dist/core/dist/data/decimation.js +54 -0
  44. package/dist/core/dist/data/store.js +76 -0
  45. package/dist/core/dist/data/sync.js +47 -0
  46. package/dist/core/dist/events.js +19 -0
  47. package/dist/core/dist/interactions/handler.js +84 -0
  48. package/dist/core/dist/interactions/pan.js +26 -0
  49. package/dist/core/dist/interactions/zoom.js +21 -0
  50. package/dist/core/dist/navigator/controller.js +374 -0
  51. package/dist/core/dist/navigator/decimate.js +44 -0
  52. package/dist/core/dist/navigator/interactions.js +28 -0
  53. package/dist/core/dist/navigator/render.js +68 -0
  54. package/dist/core/dist/perf/counting-context.js +19 -0
  55. package/dist/core/dist/perf/perf-hud.js +453 -0
  56. package/dist/core/dist/perf/perf-monitor.js +132 -0
  57. package/dist/core/dist/render-scheduler.js +31 -0
  58. package/dist/core/dist/scales/tick-tracker.js +110 -0
  59. package/dist/core/dist/scales/x-scale.js +145 -0
  60. package/dist/core/dist/scales/y-scale.js +156 -0
  61. package/dist/core/dist/series/bar.js +341 -0
  62. package/dist/core/dist/series/base-multi-layer.js +438 -0
  63. package/dist/core/dist/series/candlestick.js +481 -0
  64. package/dist/core/dist/series/definition.js +11 -0
  65. package/dist/core/dist/series/line.js +446 -0
  66. package/dist/core/dist/series/painters/builtins.js +36 -0
  67. package/dist/core/dist/series/painters/canvas-path.js +79 -0
  68. package/dist/core/dist/series/painters/resolve.js +32 -0
  69. package/dist/core/dist/series/pie.js +545 -0
  70. package/dist/core/dist/series/register-builtins.js +11 -0
  71. package/dist/core/dist/series/stack-math.js +17 -0
  72. package/dist/core/dist/snapshots.js +107 -0
  73. package/dist/core/dist/theme/create.js +176 -0
  74. package/dist/core/dist/theme/resolve.js +14 -0
  75. package/dist/core/dist/theme/themes/andromeda.js +33 -0
  76. package/dist/core/dist/theme/themes/ayu-mirage.js +33 -0
  77. package/dist/core/dist/theme/themes/catppuccin.js +33 -0
  78. package/dist/core/dist/theme/themes/dracula.js +35 -0
  79. package/dist/core/dist/theme/themes/github-light.js +34 -0
  80. package/dist/core/dist/theme/themes/gruvbox.js +33 -0
  81. package/dist/core/dist/theme/themes/handwritten.js +101 -0
  82. package/dist/core/dist/theme/themes/high-contrast.js +33 -0
  83. package/dist/core/dist/theme/themes/lavender-mist.js +33 -0
  84. package/dist/core/dist/theme/themes/light-pink.js +34 -0
  85. package/dist/core/dist/theme/themes/material-palenight.js +33 -0
  86. package/dist/core/dist/theme/themes/minimal-light.js +34 -0
  87. package/dist/core/dist/theme/themes/mint-breeze.js +33 -0
  88. package/dist/core/dist/theme/themes/monokai-pro.js +33 -0
  89. package/dist/core/dist/theme/themes/night-owl.js +35 -0
  90. package/dist/core/dist/theme/themes/one-dark-pro.js +33 -0
  91. package/dist/core/dist/theme/themes/panda.js +33 -0
  92. package/dist/core/dist/theme/themes/peach-cream.js +33 -0
  93. package/dist/core/dist/theme/themes/quiet-light.js +37 -0
  94. package/dist/core/dist/theme/themes/rose-pine-dawn.js +33 -0
  95. package/dist/core/dist/theme/themes/sand-dune.js +33 -0
  96. package/dist/core/dist/theme/themes/solarized-light.js +34 -0
  97. package/dist/core/dist/tooltip-position.js +10 -0
  98. package/dist/core/dist/utils/color.js +37 -0
  99. package/dist/core/dist/utils/format.js +29 -0
  100. package/dist/core/dist/utils/math.js +26 -0
  101. package/dist/core/dist/utils/poisoned-data-reporter.js +15 -0
  102. package/dist/core/dist/utils/time.js +41 -0
  103. package/dist/index.d.ts +827 -63
  104. package/dist/index.js +142 -8025
  105. package/dist/ui/Crosshair.vue.js +53 -0
  106. package/dist/ui/Crosshair.vue2.js +4 -0
  107. package/dist/ui/InfoBar.vue.js +143 -0
  108. package/dist/ui/InfoBar.vue2.js +4 -0
  109. package/dist/ui/Legend.vue.js +212 -0
  110. package/dist/ui/Legend.vue2.js +4 -0
  111. package/dist/ui/Marker.vue.js +47 -0
  112. package/dist/ui/Marker.vue2.js +4 -0
  113. package/dist/ui/Navigator.vue.js +58 -0
  114. package/dist/ui/Navigator.vue2.js +4 -0
  115. package/dist/ui/NumberFlow.vue.js +69 -0
  116. package/dist/ui/NumberFlow.vue2.js +4 -0
  117. package/dist/ui/PieLegend.vue.js +132 -0
  118. package/dist/ui/PieLegend.vue2.js +4 -0
  119. package/dist/ui/PieTooltip.vue.js +135 -0
  120. package/dist/ui/PieTooltip.vue2.js +4 -0
  121. package/dist/ui/ReferenceLine.vue.js +44 -0
  122. package/dist/ui/ReferenceLine.vue2.js +4 -0
  123. package/dist/ui/TimeAxis.vue.js +43 -0
  124. package/dist/ui/TimeAxis.vue2.js +4 -0
  125. package/dist/ui/TimeRegion.vue.js +41 -0
  126. package/dist/ui/TimeRegion.vue2.js +4 -0
  127. package/dist/ui/Title.vue.js +54 -0
  128. package/dist/ui/Title.vue2.js +4 -0
  129. package/dist/ui/Tooltip.vue.js +195 -0
  130. package/dist/ui/Tooltip.vue2.js +4 -0
  131. package/dist/ui/YAxis.vue.js +42 -0
  132. package/dist/ui/YAxis.vue2.js +4 -0
  133. package/dist/ui/YLabel.vue.js +105 -0
  134. package/dist/ui/YLabel.vue2.js +4 -0
  135. package/package.json +2 -2
  136. package/src/BarSeries.vue +12 -13
  137. package/src/CandlestickSeries.vue +17 -6
  138. package/src/LineSeries.vue +12 -13
  139. package/src/PieSeries.vue +2 -1
  140. package/src/index.ts +23 -0
  141. package/src/ui/Legend.vue +1 -2
  142. package/src/ui/Marker.vue +62 -0
  143. package/src/ui/ReferenceLine.vue +58 -0
  144. package/src/ui/TimeRegion.vue +54 -0
package/dist/index.d.ts CHANGED
@@ -26,32 +26,45 @@ position: "bottom" | "right";
26
26
  mode: LegendMode;
27
27
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
28
28
 
29
- declare const __VLS_component_4: DefineComponent<__VLS_Props_10, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_10> & Readonly<{}>, {
29
+ declare const __VLS_component_4: DefineComponent<__VLS_Props_11, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_11> & Readonly<{}>, {
30
30
  position: PieLegendPosition;
31
31
  format: ValueFormatter;
32
32
  mode: PieLegendMode;
33
33
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
34
34
 
35
- declare const __VLS_component_5: DefineComponent<__VLS_Props_11, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_11> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
35
+ declare const __VLS_component_5: DefineComponent<__VLS_Props_12, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_12> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
36
36
  containerRef: HTMLDivElement;
37
37
  }, any>;
38
38
 
39
- declare const __VLS_component_6: DefineComponent<__VLS_Props_13, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_13> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
39
+ declare const __VLS_component_6: DefineComponent<__VLS_Props_16, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_16> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
40
40
 
41
- declare const __VLS_component_7: DefineComponent<__VLS_Props_14, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_14> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
41
+ declare const __VLS_component_7: DefineComponent<__VLS_Props_17, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_17> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
42
42
  containerRef: HTMLDivElement;
43
43
  }, any>;
44
44
 
45
- declare const __VLS_component_8: DefineComponent<__VLS_Props_16, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_16> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
45
+ declare const __VLS_component_8: DefineComponent<__VLS_Props_19, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_19> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
46
46
 
47
47
  declare type __VLS_Props = {
48
- data: TimePoint[][];
48
+ /** Flat `TimePoint[]`, `TimePoint[][]`, or named `{ label, color?, data }` layers. Time accepts ms or `Date`. */
49
+ data: MultiLayerData;
49
50
  options?: Partial<BarSeriesOptions>;
50
51
  /** Stable series ID — same value across remounts. */
51
52
  id?: string;
52
53
  };
53
54
 
54
55
  declare type __VLS_Props_10 = {
56
+ value: number;
57
+ /**
58
+ * Value-to-string formatter. Defaults to the current locale's
59
+ * `Intl.NumberFormat` when omitted. `Intl.NumberFormatOptions` is also
60
+ * accepted (legacy) — routed through the built-in `Intl.NumberFormat`.
61
+ */
62
+ format?: ((value: number) => string) | Intl.NumberFormatOptions;
63
+ locale?: string;
64
+ spinDuration?: number;
65
+ };
66
+
67
+ declare type __VLS_Props_11 = {
55
68
  /**
56
69
  * Owning series id. **Optional** — when omitted, the first visible pie
57
70
  * series is picked.
@@ -65,7 +78,7 @@ declare type __VLS_Props_10 = {
65
78
  position?: PieLegendPosition;
66
79
  };
67
80
 
68
- declare type __VLS_Props_11 = {
81
+ declare type __VLS_Props_12 = {
69
82
  /**
70
83
  * Owning series id. **Optional** — when omitted, the first visible pie
71
84
  * series is picked.
@@ -75,14 +88,42 @@ declare type __VLS_Props_11 = {
75
88
  format?: ValueFormatter;
76
89
  };
77
90
 
78
- declare type __VLS_Props_12 = {
91
+ declare type __VLS_Props_13 = {
92
+ /** Horizontal line at this Y data value. Mutually exclusive with `time`. */
93
+ value?: number;
94
+ /** Vertical line at this `time` (epoch ms or `Date`). Mutually exclusive with `value`. */
95
+ time?: TimeValue;
96
+ /** Line and label-pill color. Default: the theme line color. */
97
+ color?: string;
98
+ /** Optional text label drawn in a pill at the line's near end. */
99
+ label?: string;
100
+ /** Dash style. Default: `'dashed'`. */
101
+ style?: ReferenceLineStyle;
102
+ /** Stroke width in CSS pixels. Default: `1`. */
103
+ width?: number;
104
+ };
105
+
106
+ declare type __VLS_Props_14 = {
79
107
  /** Desired number of labels (≥ 2). Overrides chart-level `axis.x.labelCount`. */
80
108
  labelCount?: number;
81
109
  /** Minimum pixel gap between adjacent labels (hard floor). Overrides chart-level. */
82
110
  minLabelSpacing?: number;
83
111
  };
84
112
 
85
- declare type __VLS_Props_13 = {
113
+ declare type __VLS_Props_15 = {
114
+ /** Left edge — epoch ms or a `Date`. */
115
+ from: TimeValue;
116
+ /** Right edge — epoch ms or a `Date`. Omit (or pass `'now'`) for an open-ended band to the right edge. */
117
+ to?: TimeRegionEnd;
118
+ /** Band fill — any CSS color, typically translucent. Default: a faint tint of `color`. */
119
+ fill?: string;
120
+ /** Optional text label drawn in a pill at the top of the band. */
121
+ label?: string;
122
+ /** Edge-line and label-pill accent. Default: the theme's muted axis text color. */
123
+ color?: string;
124
+ };
125
+
126
+ declare type __VLS_Props_16 = {
86
127
  /**
87
128
  * @deprecated Use the named `sub` slot instead — it accepts arbitrary
88
129
  * inline markup (icons, badges, formatted text) to mirror React's
@@ -96,12 +137,12 @@ declare type __VLS_Props_13 = {
96
137
  sub?: string;
97
138
  };
98
139
 
99
- declare type __VLS_Props_14 = {
140
+ declare type __VLS_Props_17 = {
100
141
  sort?: SnapshotSort;
101
142
  format?: TooltipFormatter;
102
143
  };
103
144
 
104
- declare type __VLS_Props_15 = {
145
+ declare type __VLS_Props_18 = {
105
146
  /** Custom tick-label formatter. Overrides the built-in range-adaptive default. */
106
147
  format?: ValueFormatter;
107
148
  /**
@@ -113,7 +154,7 @@ declare type __VLS_Props_15 = {
113
154
  minLabelSpacing?: number;
114
155
  };
115
156
 
116
- declare type __VLS_Props_16 = {
157
+ declare type __VLS_Props_19 = {
117
158
  /**
118
159
  * Owning series id. **Optional** — when omitted, the first visible
119
160
  * single-layer time series is picked, falling back to the first visible
@@ -126,7 +167,8 @@ declare type __VLS_Props_16 = {
126
167
  };
127
168
 
128
169
  declare type __VLS_Props_2 = {
129
- data: OHLCInput[];
170
+ /** Flat `OHLCInput[]`, or `{ label, data }` to name the stream. */
171
+ data: CandlestickData;
130
172
  options?: Partial<CandlestickSeriesOptions>;
131
173
  /** Stable series ID — same value across remounts. */
132
174
  id?: string;
@@ -214,7 +256,8 @@ declare type __VLS_Props_3 = {
214
256
  };
215
257
 
216
258
  declare type __VLS_Props_4 = {
217
- data: TimePoint[][];
259
+ /** Flat `TimePoint[]`, `TimePoint[][]`, or named `{ label, color?, data }` layers. Time accepts ms or `Date`. */
260
+ data: MultiLayerData;
218
261
  options?: Partial<LineSeriesOptions>;
219
262
  /** Stable series ID — same value across remounts. */
220
263
  id?: string;
@@ -240,21 +283,26 @@ declare type __VLS_Props_7 = {
240
283
  };
241
284
 
242
285
  declare type __VLS_Props_8 = {
243
- data: NavigatorData;
244
- /** Strip height in CSS pixels. Defaults to `theme.navigator.height` (60). */
245
- height?: number;
286
+ /** X anchor — epoch ms or a `Date`. */
287
+ time: TimeValue;
288
+ /** Y anchor as a data value. Omit and set `seriesId` to snap to that series' value at `time`. */
289
+ value?: number;
290
+ /** Snap Y to this series' value at `time` when `value` is omitted. Also the default color source. */
291
+ seriesId?: string;
292
+ /** Glyph at the anchor. Default: `'dot'`. Arrows point their tip at the anchor. */
293
+ shape?: MarkerShape;
294
+ /** Reuse the line pulse halo around the anchor. Default: `false`. */
295
+ pulse?: boolean;
296
+ /** Optional text label drawn in a pill next to the anchor. */
297
+ label?: string;
298
+ /** Color override. Falls back to the series color (when `seriesId` is set), then the theme line color. */
299
+ color?: string;
246
300
  };
247
301
 
248
302
  declare type __VLS_Props_9 = {
249
- value: number;
250
- /**
251
- * Value-to-string formatter. Defaults to the current locale's
252
- * `Intl.NumberFormat` when omitted. `Intl.NumberFormatOptions` is also
253
- * accepted (legacy) — routed through the built-in `Intl.NumberFormat`.
254
- */
255
- format?: ((value: number) => string) | Intl.NumberFormatOptions;
256
- locale?: string;
257
- spinDuration?: number;
303
+ data: NavigatorData;
304
+ /** Strip height in CSS pixels. Defaults to `theme.navigator.height` (60). */
305
+ height?: number;
258
306
  };
259
307
 
260
308
  declare function __VLS_template(): {
@@ -852,12 +900,12 @@ export declare type BarPainter = (env: PaintEnv, args: BarPaintArgs) => void;
852
900
 
853
901
  export declare const BarSeries: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
854
902
 
903
+ /** Series definition for `chart.addSeries` — keeps the chart renderer-agnostic
904
+ * so hosts that never render bars don't bundle this module. */
905
+ export declare const BarSeriesDef: SeriesDefinition<BarSeriesOptions>;
906
+
855
907
  /** Visual options for a bar series. */
856
908
  export declare interface BarSeriesOptions {
857
- /** Display label shown in the tooltip (e.g. "Volume"). */
858
- label?: string;
859
- /** One color per layer. */
860
- colors: string[];
861
909
  /** Width of each bar as a fraction of the available bar slot (0–1). `1` = bars touch; `0.6` = roughly 60 % of the slot. Default: 0.7. */
862
910
  barWidthRatio: number;
863
911
  /** Stacking mode. Default: 'off'. */
@@ -938,6 +986,180 @@ export declare interface BarSeriesOptions {
938
986
  projectedFrom?: number;
939
987
  }
940
988
 
989
+ /**
990
+ * Members shared by every series renderer, regardless of whether it owns a
991
+ * time axis. Chart dispatches these uniformly; type-specific behavior is
992
+ * opted into via the optional members below.
993
+ *
994
+ * Single-layer renderers (Candlestick, Pie) default most layer methods to no-ops.
995
+ * Multi-layer renderers (Line, Bar) override them against each internal store.
996
+ *
997
+ * Time-series data queries are NOT here — they live on {@link TimeSeriesRenderer}
998
+ * as required methods, so Chart narrows via `kind !== 'pie'` and calls them
999
+ * directly (no optional chaining).
1000
+ */
1001
+ declare interface BaseSeriesRenderer {
1002
+ /** Paint the series on the main layer. */
1003
+ render(ctx: SeriesRenderContext): void;
1004
+ /**
1005
+ * Replace the series' data. For multi-layer renderers (Line, Bar), `layerIndex`
1006
+ * selects which internal store to target; defaults to 0.
1007
+ */
1008
+ setData(data: unknown, layerIndex?: number): void;
1009
+ /** Append a single point (real-time tick). Optional — not all renderers support streaming. */
1010
+ appendPoint?(point: unknown, layerIndex?: number): void;
1011
+ /** Replace the last point in place (live candle update). Optional. */
1012
+ updateLastPoint?(point: unknown, layerIndex?: number): void;
1013
+ /**
1014
+ * Keep only the last `count` points; drop the oldest. No-op when the series
1015
+ * is already at or below the cap. Smooth Y-range update — does NOT trigger
1016
+ * the snap that {@link setData} forces.
1017
+ */
1018
+ keepLast?(count: number, layerIndex?: number): void;
1019
+ /** Number of visual layers the renderer owns. Default: 1. */
1020
+ getLayerCount(): number;
1021
+ /** Show/hide a layer. No-op for single-layer renderers. */
1022
+ setLayerVisible(index: number, visible: boolean): void;
1023
+ /** Current visibility of a layer. */
1024
+ isLayerVisible(index: number): boolean;
1025
+ /** Per-layer colors. Single-layer renderers return `[primary]`. */
1026
+ getLayerColors(): string[];
1027
+ /**
1028
+ * Set per-layer color overrides carried in `data` (sparse — `undefined` keeps
1029
+ * the theme base). Only multi-layer (line / bar) renderers implement it.
1030
+ */
1031
+ setColorOverrides?(overrides: (ValueColor | undefined)[]): void;
1032
+ /** Apply a new theme. Each renderer decides what that means for itself. */
1033
+ applyTheme(theme: ChartTheme, prevTheme: ChartTheme): void;
1034
+ /**
1035
+ * Shallow-merge new visual options into the renderer's configuration.
1036
+ * Each renderer narrows the parameter in its concrete signature.
1037
+ */
1038
+ updateOptions(options: any): void;
1039
+ /**
1040
+ * Hit-test a bitmap-space coordinate; return the hovered index or -1. Optional.
1041
+ * `padding` is in **bitmap pixels** (already scaled by `verticalPixelRatio`)
1042
+ * so its values align with the `bx`/`by`/`bitmapWidth`/`bitmapHeight` arguments
1043
+ * — the hit area then matches the painted geometry exactly.
1044
+ */
1045
+ hitTest?(bx: number, by: number, bitmapWidth: number, bitmapHeight: number, padding?: RenderPadding): number;
1046
+ /** Set the currently hovered index. Returns true if the value changed. Optional. */
1047
+ setHoverIndex?(index: number): boolean;
1048
+ /** Get info about the currently hovered element, or null. Optional. */
1049
+ getHoverInfo?(theme: ChartTheme): HoverInfo | null;
1050
+ /** Pie-style breakdown of all elements. Optional. */
1051
+ getSliceInfo?(theme: ChartTheme): SliceInfo[] | null;
1052
+ /** Last data value for the series, or null if empty. Optional. */
1053
+ getLastValue?(): number | null;
1054
+ /** Nearest data point to a given time, or null. Optional. */
1055
+ getDataAtTime?(time: number, interval: number): TimePoint | OHLCData | null;
1056
+ /**
1057
+ * For multi-layer renderers: nearest data point per visible layer at `time`.
1058
+ * Each entry carries the owning `layerIndex` (so filtered hidden layers
1059
+ * don't shift the caller's identity mapping) and the **resolved sample
1060
+ * time** of the snapped point (not the query time). Used by Chart for
1061
+ * tooltips/legends.
1062
+ * Returns null for single-layer renderers or when no visible layer has data.
1063
+ */
1064
+ getLayerSnapshots?(time: number, interval: number): {
1065
+ layerIndex: number;
1066
+ time: number;
1067
+ value: number;
1068
+ color: string;
1069
+ }[] | null;
1070
+ /**
1071
+ * Stacked last value — cumulative top of the rendered stack for multi-layer
1072
+ * renderers. Falls back to `getLastValue()` behavior for single-layer
1073
+ * renderers (or when no layer is visible). Chart uses this to anchor a
1074
+ * `<YLabel />` at the same point the canvas paints the stack head.
1075
+ */
1076
+ getStackedLastValue?(): {
1077
+ value: number;
1078
+ isLive: boolean;
1079
+ } | null;
1080
+ /**
1081
+ * Per-layer last snapshots, each with its own `time`. Useful for ragged
1082
+ * multi-layer series where layers advance independently — last-mode
1083
+ * overlays need to show each layer at its true last time, not at the
1084
+ * primary layer's time.
1085
+ * Returns null for single-layer renderers or when no visible layer has data.
1086
+ */
1087
+ getLayerLastSnapshots?(): {
1088
+ layerIndex: number;
1089
+ time: number;
1090
+ value: number;
1091
+ color: string;
1092
+ }[] | null;
1093
+ /** Total data points across all owned stores. Used by Chart for batch-load detection. */
1094
+ getTotalLength?(): number;
1095
+ /**
1096
+ * Abort in-flight entrance animations (per-point/per-bar intros). Called
1097
+ * when the user pans or zooms — continuing to tween bar fills while the
1098
+ * chart is being dragged reads as flicker.
1099
+ *
1100
+ * Live-tracking smoothing (the halo/last-value lerp) is NOT cancelled here;
1101
+ * that motion is subtle and shouldn't jump when the viewport moves.
1102
+ */
1103
+ cancelEntranceAnimations?(): void;
1104
+ /**
1105
+ * Start a series-level alpha cross-fade. Chart calls this on
1106
+ * `setSeriesVisible` so the show/hide animation lives next to the geometry
1107
+ * that owns it. `target` is the destination opacity in `[0, 1]` and
1108
+ * `durationMs <= 0` snaps. Optional — renderers that don't need a fade
1109
+ * (e.g. pie) leave it unimplemented; the chart falls back to a binary
1110
+ * visibility flag.
1111
+ */
1112
+ setAlpha?(target: number, durationMs: number): void;
1113
+ /** Current series-level opacity in `[0, 1]`. Chart applies it as `globalAlpha` during render. */
1114
+ getAlpha?(): number;
1115
+ /**
1116
+ * Start a per-layer alpha cross-fade. Chart calls this on `setLayerVisible`
1117
+ * so the toggled layer fades over the same `toggleMs` window the engine
1118
+ * uses to ease the Y axis. Renderers that don't support per-layer alpha
1119
+ * (single-store: candlestick, pie) leave it unimplemented; the chart
1120
+ * skips the call and the layer toggles binary.
1121
+ */
1122
+ setLayerAlpha?(index: number, target: number, durationMs: number): void;
1123
+ /** Current per-layer opacity in `[0, 1]`. Multiplied into `globalAlpha` by the renderer at draw time. */
1124
+ getLayerAlpha?(index: number): number;
1125
+ /** True while the renderer has an active animation (Chart polls per frame). */
1126
+ readonly needsAnimation?: boolean;
1127
+ /**
1128
+ * Optional overlay hook. Chart invokes this during the overlay pass so each
1129
+ * renderer can paint type-specific overlays (crosshair dots, pulse dots).
1130
+ */
1131
+ drawOverlay?(ctx: OverlayRenderContext): void;
1132
+ /** True when the renderer wants the overlay layer to keep ticking (pulse animations, etc.). */
1133
+ readonly overlayNeedsAnimation?: boolean;
1134
+ /**
1135
+ * True if the renderer has overlay content (e.g. pulse dots) whose positions fall within
1136
+ * [from, to]. Chart uses this to stop scheduling overlay frames when animated content is
1137
+ * fully off-screen. Default when omitted: assume visible (safe, may waste CPU).
1138
+ */
1139
+ hasOverlayContentInRange?(from: number, to: number): boolean;
1140
+ /**
1141
+ * Subscribe to data-changed notifications (any internal store update).
1142
+ * Returns an unsubscribe function.
1143
+ */
1144
+ onDataChanged?(listener: () => void): () => void;
1145
+ /** Tear down listeners and any owned resources. */
1146
+ dispose(): void;
1147
+ }
1148
+
1149
+ declare interface BitmapCoordinateSpace {
1150
+ context: CanvasRenderingContext2D;
1151
+ bitmapSize: {
1152
+ width: number;
1153
+ height: number;
1154
+ };
1155
+ mediaSize: {
1156
+ width: number;
1157
+ height: number;
1158
+ };
1159
+ horizontalPixelRatio: number;
1160
+ verticalPixelRatio: number;
1161
+ }
1162
+
941
1163
  /**
942
1164
  * Snapshot every visible series / layer at `time`. Used by hover overlays
943
1165
  * (`InfoBar` in hover mode, `Tooltip`). Hidden series and hidden layers are
@@ -1016,6 +1238,12 @@ export declare interface CandlePaintArgs {
1016
1238
  /** Paints one candle body. Owns its fill. Never re-creates the gradient. */
1017
1239
  export declare type CandlePainter = (env: PaintEnv, args: CandlePaintArgs) => void;
1018
1240
 
1241
+ /**
1242
+ * `data` shape for a candlestick series — a flat `OHLCInput[]` stream, or a
1243
+ * `SeriesLayer<OHLCInput>` that names it for the tooltip / info bar / legend.
1244
+ */
1245
+ declare type CandlestickData = OHLCInput[] | SeriesLayer<OHLCInput>;
1246
+
1019
1247
  /**
1020
1248
  * `body` shape encodes the fill mode: a single color renders flat; a
1021
1249
  * `[top, bottom]` tuple renders a 2-stop vertical gradient. Use
@@ -1041,10 +1269,12 @@ declare type CandlestickEntryAnimation = 'none' | 'fade' | 'unfold' | 'slide' |
1041
1269
 
1042
1270
  export declare const CandlestickSeries: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
1043
1271
 
1272
+ /** Series definition for `chart.addSeries` — keeps the chart renderer-agnostic
1273
+ * so hosts that never render candles don't bundle this module. */
1274
+ export declare const CandlestickSeriesDef: SeriesDefinition<CandlestickSeriesOptions>;
1275
+
1044
1276
  /** Visual options for a candlestick series. */
1045
1277
  export declare interface CandlestickSeriesOptions {
1046
- /** Display label shown in the tooltip. */
1047
- label?: string;
1048
1278
  /** Colours for bullish candles (close ≥ open). */
1049
1279
  up: CandlestickDirectionColors;
1050
1280
  /** Colours for bearish candles (close < open). */
@@ -1162,26 +1392,95 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
1162
1392
  get xAxisHeight(): number;
1163
1393
  constructor(container: HTMLElement, options?: ChartOptions);
1164
1394
  /**
1165
- * Add a series of the given `type` and return its unique ID. `options` is
1166
- * typed per `type` via the overloads. `layers` (line/bar) and `id` are
1167
- * consumed here; everything else is forwarded to the renderer.
1395
+ * Add a series and return its unique ID. `options` is typed per series via
1396
+ * the overloads. `layers` (line/bar) and `id` are consumed here; everything
1397
+ * else is forwarded to the renderer.
1398
+ *
1399
+ * Preferred form: pass a {@link SeriesDefinition}
1400
+ * (`chart.addSeries(LineSeriesDef, …)`) — the chart stays renderer-agnostic
1401
+ * and bundlers drop the series types a host never imports. The string form
1402
+ * resolves through the registry and requires a one-time
1403
+ * `registerBuiltinSeries()` call at startup.
1168
1404
  */
1169
1405
  addSeries(type: 'candlestick', options?: Partial<CandlestickSeriesOptions & {
1170
1406
  id?: string;
1407
+ label?: string;
1171
1408
  }>): string;
1172
1409
  addSeries(type: 'line', options?: Partial<LineSeriesOptions & {
1173
1410
  layers?: number;
1174
1411
  id?: string;
1412
+ label?: string;
1413
+ labels?: (string | undefined)[];
1175
1414
  }>): string;
1176
1415
  addSeries(type: 'bar', options?: Partial<BarSeriesOptions & {
1177
1416
  layers?: number;
1178
1417
  id?: string;
1418
+ label?: string;
1419
+ labels?: (string | undefined)[];
1179
1420
  }>): string;
1180
1421
  addSeries(type: 'pie', options?: Partial<PieSeriesOptions & {
1181
1422
  id?: string;
1423
+ label?: string;
1182
1424
  }>): string;
1425
+ addSeries<O>(def: SeriesDefinition<O>, options?: Partial<O> & {
1426
+ layers?: number;
1427
+ id?: string;
1428
+ label?: string;
1429
+ labels?: (string | undefined)[];
1430
+ }): string;
1183
1431
  /** Remove a series by ID and clean up its resources. */
1184
1432
  removeSeries(id: string): void;
1433
+ /**
1434
+ * Pin a point annotation to `time` (X) and `value` (Y), or to a series via
1435
+ * `seriesId` (Y snaps to the nearest data point at `time`). Returns the marker
1436
+ * id for later {@link updateMarker} / {@link removeMarker}.
1437
+ *
1438
+ * Markers render on the overlay layer and stay out of the series model — they
1439
+ * are excluded from tooltips, the legend, and the Y-range autoscale, and never
1440
+ * appear in series queries.
1441
+ */
1442
+ addMarker(config: MarkerConfig): string;
1443
+ /** Replace a marker's config in place. No-op when the id is unknown. */
1444
+ updateMarker(id: string, config: MarkerConfig): void;
1445
+ /** Remove a marker by id. No-op when the id is unknown. */
1446
+ removeMarker(id: string): void;
1447
+ /** Read-only snapshot of the registered markers (normalized). Mutate via add / update / removeMarker. */
1448
+ getMarkers(): readonly Readonly<MarkerEntry>[];
1449
+ /**
1450
+ * Shade the time interval `[from, to]` with a translucent vertical band —
1451
+ * an anomaly window, a maintenance window, a highlighted session. Omit `to`
1452
+ * (or pass `'now'`) for an open-ended band that extends to the right edge of
1453
+ * the plot — the "still firing" case. Returns the region id for later
1454
+ * {@link updateRegion} / {@link removeRegion}.
1455
+ *
1456
+ * Regions render on the main layer *behind* the series and stay out of the
1457
+ * series model — they never affect the Y-range autoscale, tooltips, or the
1458
+ * legend.
1459
+ */
1460
+ addRegion(config: TimeRegionConfig): string;
1461
+ /** Replace a region's config in place. No-op when the id is unknown. */
1462
+ updateRegion(id: string, config: TimeRegionConfig): void;
1463
+ /** Remove a region by id. No-op when the id is unknown. */
1464
+ removeRegion(id: string): void;
1465
+ /** Read-only snapshot of the registered regions (normalized). Mutate via add / update / removeRegion. */
1466
+ getRegions(): readonly Readonly<RegionEntry>[];
1467
+ /**
1468
+ * Draw a reference line across the plot — a horizontal threshold / baseline
1469
+ * pinned to a `value`, or a vertical event boundary pinned to a `time`
1470
+ * (mutually exclusive). Returns the line id for later {@link updateLine} /
1471
+ * {@link removeLine}.
1472
+ *
1473
+ * Lines render on the overlay layer *above* the series and stay out of the
1474
+ * series model — they never affect the Y-range autoscale, tooltips, or the
1475
+ * legend.
1476
+ */
1477
+ addLine(config: ReferenceLineConfig): string;
1478
+ /** Replace a reference line's config in place. No-op when the id is unknown. */
1479
+ updateLine(id: string, config: ReferenceLineConfig): void;
1480
+ /** Remove a reference line by id. No-op when the id is unknown. */
1481
+ removeLine(id: string): void;
1482
+ /** Read-only snapshot of the registered reference lines (normalized). Mutate via add / update / removeLine. */
1483
+ getLines(): readonly Readonly<LineEntry>[];
1185
1484
  /**
1186
1485
  * Read-only snapshot of the chart's X / Y viewport animation. The same
1187
1486
  * shape (`xRange`, `yRange`, `animating`) every frame — call this inside
@@ -1381,7 +1680,25 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
1381
1680
  }[] | null;
1382
1681
  /** Get the primary display color for a series. */
1383
1682
  getSeriesColor(seriesId: string): string | null;
1683
+ /** The series' primary name (first layer). Used for single-layer overlays. */
1384
1684
  getSeriesLabel(seriesId: string): string | undefined;
1685
+ /** The display name of one layer, or `undefined` when that layer is unnamed. */
1686
+ getLayerLabel(seriesId: string, layerIndex: number): string | undefined;
1687
+ /**
1688
+ * Set every layer's display name at once (index = layer). Drives the tooltip,
1689
+ * legend, and info bar. Called by the framework wrappers as the carried
1690
+ * per-layer labels in `data` change. No-ops (and skips the overlay bump) when
1691
+ * the labels are unchanged, so it's safe to call on every data tick.
1692
+ */
1693
+ setSeriesLabels(seriesId: string, labels: (string | undefined)[]): void;
1694
+ /**
1695
+ * Set the per-layer color overrides carried in `data` (sparse — `undefined`
1696
+ * leaves that layer on the theme base). A {@link ValueColor} per layer: a
1697
+ * string (uniform) or a function of value (per bar / per segment). Handed to
1698
+ * the renderer, which keeps them separate from the theme base so a theme swap
1699
+ * preserves them. Called by the framework wrappers; no-ops when unchanged.
1700
+ */
1701
+ setLayerColors(seriesId: string, overrides: (ValueColor | undefined)[]): void;
1385
1702
  /** Get per-layer colors for a series. Returns null for single-layer non-bar/line series. */
1386
1703
  getSeriesLayers(seriesId: string): {
1387
1704
  color: string;
@@ -1572,20 +1889,17 @@ export declare interface ChartOptions {
1572
1889
  onEdgeReached?: (info: EdgeReachedInfo) => void;
1573
1890
  /**
1574
1891
  * Runtime performance instrumentation. Opt-in — absent by default so the
1575
- * hot render path stays free of timing/counting overhead.
1892
+ * hot render path stays free of timing/counting overhead, and so bundles
1893
+ * without instrumentation carry no perf code at all (the chart never
1894
+ * imports it; whatever you pass here is what ships).
1576
1895
  *
1577
- * - `false` / omitted — no instrumentation, no HUD, byte-identical to a perf-free build.
1578
- * - `true` — create an internal {@link PerfMonitor} and mount a visible HUD overlay.
1579
- * - `{ hud: true, ...options }` — same, with monitor options forwarded.
1580
- * - `{ hud: false, ...options }` — instrument but do not render a HUD (useful when
1581
- * the host app consumes stats via `monitor.onFrame` and renders its own UI).
1582
- * - `PerfMonitor` instance — attach to a pre-constructed monitor. Useful when several
1583
- * charts share one telemetry sink. HUD defaults to off in this mode.
1896
+ * - omitted — no instrumentation, no HUD.
1897
+ * - `perfHud()` — monitor + visible HUD overlay (replaces the old `perf: true`).
1898
+ * - `PerfMonitor` instance — instrument without a HUD; useful when the host
1899
+ * consumes stats via `monitor.onFrame` and renders its own UI, or when
1900
+ * several charts share one telemetry sink.
1584
1901
  */
1585
- perf?: boolean | PerfMonitor | (PerfMonitorOptions & {
1586
- hud?: boolean;
1587
- monitor?: PerfMonitor;
1588
- });
1902
+ perf?: PerfMonitor | PerfConfig;
1589
1903
  }
1590
1904
 
1591
1905
  /**
@@ -1643,6 +1957,35 @@ export declare interface ChartTheme {
1643
1957
  };
1644
1958
  /** Color palette for multi-series charts (stacked bars, overlays). */
1645
1959
  seriesColors: string[];
1960
+ /**
1961
+ * Default single-layer bar color. A {@link ValueColor}: a string for a uniform
1962
+ * bar, or a function of the bar's value for sign / threshold coloring.
1963
+ * {@link createTheme} defaults it to a sign function (candlestick up / down
1964
+ * body), which is how bars get green-up / red-down without any option.
1965
+ *
1966
+ * Optional so hand-built theme literals keep compiling — the bar renderer
1967
+ * falls back to {@link ChartTheme.seriesColors}`[0]`. A function value makes
1968
+ * the theme non-JSON-serializable; that is an accepted trade-off (the theme
1969
+ * editor simply omits it).
1970
+ */
1971
+ bar?: {
1972
+ /** Default fill — a string (uniform) or a value-fn (e.g. sign-based up/down). */
1973
+ color: ValueColor;
1974
+ };
1975
+ /**
1976
+ * Pie / donut specific colors. Optional so hand-built theme literals that
1977
+ * predate the field keep compiling — renderers fall back to
1978
+ * {@link ChartTheme.axis} `textColor` (the same muted tone
1979
+ * {@link createTheme} derives by default).
1980
+ */
1981
+ pie?: {
1982
+ /**
1983
+ * Fill of the synthetic "Other" slice produced by small-slice grouping.
1984
+ * Deliberately muted: a vivid palette color would give the aggregate the
1985
+ * same visual weight as a real category.
1986
+ */
1987
+ otherColor: string;
1988
+ };
1646
1989
  /** Bollinger band / envelope fill colors. */
1647
1990
  bands: {
1648
1991
  /** Fill for the upper band region (above the middle band). */
@@ -1964,6 +2307,17 @@ declare type LegendMode = 'toggle' | 'isolate' | 'solo';
1964
2307
 
1965
2308
  export declare const lightPink: ThemePreset;
1966
2309
 
2310
+ /** Internal bookkeeping for a registered reference line. `coord` is a Y value (horizontal) or normalized epoch ms (vertical). */
2311
+ declare interface LineEntry {
2312
+ id: string;
2313
+ orientation: ReferenceLineOrientation;
2314
+ coord: number;
2315
+ color?: string;
2316
+ label?: string;
2317
+ style: ReferenceLineStyle;
2318
+ width: number;
2319
+ }
2320
+
1967
2321
  /**
1968
2322
  * Entrance animation styles for new line points.
1969
2323
  * - `'none'` — new segments appear instantly.
@@ -2013,12 +2367,12 @@ declare interface LinePoint {
2013
2367
 
2014
2368
  export declare const LineSeries: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2015
2369
 
2370
+ /** Series definition for `chart.addSeries` — keeps the chart renderer-agnostic
2371
+ * so hosts that never render lines don't bundle this module. */
2372
+ export declare const LineSeriesDef: SeriesDefinition<LineSeriesOptions>;
2373
+
2016
2374
  /** Visual options for a line series. */
2017
2375
  export declare interface LineSeriesOptions {
2018
- /** Display label shown in the tooltip (e.g. "BTC", "Revenue"). */
2019
- label?: string;
2020
- /** One color per layer. */
2021
- colors: string[];
2022
2376
  /** Stroke width in CSS pixels. Default: 1. `0` hides the line stroke. */
2023
2377
  strokeWidth: number;
2024
2378
  /** Area-fill configuration. Default: `{ visible: true }`. */
@@ -2119,10 +2473,75 @@ export declare interface LineSeriesOptions {
2119
2473
  * to `'straight'`.
2120
2474
  */
2121
2475
  linePainter?: LinePainter;
2476
+ /**
2477
+ * Threshold coloring. Paints the stroke and the area fill one color below a Y
2478
+ * `value` and another above it, with the switch pinned to that value's pixel
2479
+ * row — a vertical canvas gradient, so it tracks the Y-axis as it autoscales.
2480
+ * Use it to make a series visibly "go critical" past a limit: the line runs
2481
+ * calm below the level and hot above it.
2482
+ *
2483
+ * Positional, so it is independent of (and overrides) the per-layer
2484
+ * `data.color` for the stroke and fill. Applies to unstacked lines only.
2485
+ *
2486
+ * ```
2487
+ * <LineSeries data={data} options={{ threshold: { value: 70, above: '#f0556a' } }} />
2488
+ * ```
2489
+ */
2490
+ threshold?: {
2491
+ /** Y data value where the color switches. */
2492
+ value: number;
2493
+ /** Color above the threshold (toward the top of the plot). */
2494
+ above: string;
2495
+ /** Color below the threshold. Default: the series' resolved color. */
2496
+ below?: string;
2497
+ };
2122
2498
  }
2123
2499
 
2124
2500
  declare type Listener = (...args: any[]) => void;
2125
2501
 
2502
+ export declare const Marker: DefineComponent<__VLS_Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_8> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2503
+
2504
+ /**
2505
+ * A point annotation pinned to a `time` (X) and a `value` (Y) — "anomaly opened
2506
+ * here", "deploy happened here". Markers live outside the series model, so they
2507
+ * are excluded from tooltips, the legend, and the Y-range autoscale, and never
2508
+ * pollute series queries. Drawn on the overlay layer, clipped to the plot area.
2509
+ */
2510
+ export declare interface MarkerConfig {
2511
+ /** X anchor — epoch ms or a `Date`. Normalized on the way in. */
2512
+ time: TimeValue;
2513
+ /**
2514
+ * Y anchor as a data value. Omit and set {@link MarkerConfig.seriesId} to snap
2515
+ * the marker to that series' nearest data point at `time`.
2516
+ */
2517
+ value?: number;
2518
+ /** Snap Y to this series' value at `time` when `value` is omitted. Also the default color source. */
2519
+ seriesId?: string;
2520
+ /** Glyph at the anchor. Default: `'dot'`. */
2521
+ shape?: MarkerShape;
2522
+ /** Reuse the line pulse halo around the anchor. Default: `false`. */
2523
+ pulse?: boolean;
2524
+ /** Optional text label drawn in a pill next to the anchor. */
2525
+ label?: string;
2526
+ /** Color override. Falls back to the series color (when `seriesId` is set), then the theme line color. */
2527
+ color?: string;
2528
+ }
2529
+
2530
+ /** Internal bookkeeping for a registered marker. `time` is normalized to epoch ms; `shape`/`pulse` carry resolved defaults. */
2531
+ declare interface MarkerEntry {
2532
+ id: string;
2533
+ time: number;
2534
+ value?: number;
2535
+ seriesId?: string;
2536
+ shape: MarkerShape;
2537
+ pulse: boolean;
2538
+ label?: string;
2539
+ color?: string;
2540
+ }
2541
+
2542
+ /** Glyph drawn at the marker anchor. Arrows point their tip *at* the anchor point. */
2543
+ export declare type MarkerShape = 'dot' | 'circle' | 'arrow-up' | 'arrow-down';
2544
+
2126
2545
  export declare const materialPalenight: ThemePreset;
2127
2546
 
2128
2547
  /**
@@ -2140,7 +2559,19 @@ export declare const mintBreeze: ThemePreset;
2140
2559
 
2141
2560
  export declare const monokaiPro: ThemePreset;
2142
2561
 
2143
- declare const Navigator_2: DefineComponent<__VLS_Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_8> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
2562
+ /**
2563
+ * Omnivorous `data` shape for line and bar series. Accepts, interchangeably:
2564
+ * - `TimePointInput[]` — one auto-named layer (the common single-series case);
2565
+ * - `TimePointInput[][]` — N auto-named layers;
2566
+ * - `SeriesLayer<TimePointInput>` — one named/colored layer;
2567
+ * - an array mixing raw `TimePointInput[]` layers and named `SeriesLayer`s.
2568
+ *
2569
+ * Everything normalizes to `SeriesLayer[]` internally (see `toLayers`). Time
2570
+ * accepts epoch milliseconds or a `Date` on every point.
2571
+ */
2572
+ declare type MultiLayerData = TimePointInput[] | SeriesLayer<TimePointInput> | Array<TimePointInput[] | SeriesLayer<TimePointInput>>;
2573
+
2574
+ declare const Navigator_2: DefineComponent<__VLS_Props_9, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_9> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
2144
2575
  stripRef: HTMLDivElement;
2145
2576
  }, any>;
2146
2577
  export { Navigator_2 as Navigator }
@@ -2166,9 +2597,14 @@ export declare interface NavigatorCandlePoint {
2166
2597
  * active zone aligns with the main chart's plot area (matches the TimeAxis).
2167
2598
  *
2168
2599
  * Event topology — navigator is a pure listener on the chart side, never emits:
2169
- * chart.viewportChange → reposition window DOM + redraw on next frame
2600
+ * chart.viewportChange → reposition window DOM on next frame (canvas untouched)
2601
+ * chart.tickFrame → reposition window DOM on next frame (window glide)
2170
2602
  * chart.overlayChange → full redraw (catches data + theme swaps)
2171
2603
  * ResizeObserver → resize canvas + full redraw
2604
+ *
2605
+ * The canvas miniature depends only on data / theme / size, so per-frame
2606
+ * viewport signals take the light DOM-only path — a wheel-zoom or pan never
2607
+ * re-decimates the dataset or repaints the strip.
2172
2608
  */
2173
2609
  export declare class NavigatorController {
2174
2610
  #private;
@@ -2227,7 +2663,7 @@ export declare const nightOwl: ThemePreset;
2227
2663
  /** Convert a {@link TimeValue} (number ms or Date) to a millisecond timestamp. */
2228
2664
  export declare function normalizeTime(t: TimeValue): number;
2229
2665
 
2230
- export declare const NumberFlow: DefineComponent<__VLS_Props_9, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_9> & Readonly<{}>, {
2666
+ export declare const NumberFlow: DefineComponent<__VLS_Props_10, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_10> & Readonly<{}>, {
2231
2667
  locale: string;
2232
2668
  spinDuration: number;
2233
2669
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLSpanElement>;
@@ -2249,6 +2685,31 @@ export declare type OHLCInput = Omit<OHLCData, 'time'> & {
2249
2685
 
2250
2686
  export declare const oneDarkPro: ThemePreset;
2251
2687
 
2688
+ /** Overlay render state passed to {@link SeriesRenderer.drawOverlay}. */
2689
+ declare interface OverlayRenderContext {
2690
+ scope: BitmapCoordinateSpace;
2691
+ timeScale: XScale;
2692
+ yScale: YScale;
2693
+ theme: ChartTheme;
2694
+ dataInterval: number;
2695
+ /** Vertical padding in **CSS pixels** — see {@link RenderPadding}. */
2696
+ padding: RenderPadding;
2697
+ /** Current crosshair position, or null when none. */
2698
+ crosshair: {
2699
+ mediaX: number;
2700
+ mediaY: number;
2701
+ time: number;
2702
+ y: number;
2703
+ } | null;
2704
+ /**
2705
+ * Engine-owned animation state. Pulse renderers read `state.pulsePhase`
2706
+ * here so the halo cycles off the same clock the rest of the chart uses.
2707
+ */
2708
+ state?: AnimationState;
2709
+ /** The chart-side id for this series. See {@link SeriesRenderContext.seriesId}. */
2710
+ seriesId?: string;
2711
+ }
2712
+
2252
2713
  /**
2253
2714
  * Engine context shared by every painter. `ctx.globalAlpha` is ALREADY composed
2254
2715
  * (layer × series × entrance fade) by the renderer, and every geometry handed to
@@ -2287,6 +2748,39 @@ declare interface PanZoomTarget {
2287
2748
 
2288
2749
  export declare const peachCream: ThemePreset;
2289
2750
 
2751
+ /**
2752
+ * Chart-ready perf configuration: a monitor plus an optional HUD mount.
2753
+ * Produced by {@link perfHud} (or hand-assembled); passed as the chart's
2754
+ * `perf` option. The chart itself never imports perf code — whatever the
2755
+ * config carries is all that ships in the bundle.
2756
+ */
2757
+ export declare interface PerfConfig {
2758
+ /** Monitor that collects frame timing / draw calls for this chart. */
2759
+ monitor: PerfMonitor;
2760
+ /** Mounts the HUD overlay; the chart calls it at construction and destroys the result. */
2761
+ hud?: (container: HTMLElement, monitor: PerfMonitor) => {
2762
+ destroy(): void;
2763
+ };
2764
+ /** True when the config constructed the monitor — the chart then destroys it on teardown. */
2765
+ ownsMonitor?: boolean;
2766
+ }
2767
+
2768
+ /**
2769
+ * Performance instrumentation with the visible HUD overlay — the factory
2770
+ * replacement for the old `perf: true`:
2771
+ *
2772
+ * ```ts
2773
+ * new ChartInstance(el, { perf: perfHud() });
2774
+ * <ChartContainer perf={perfHud({ windowMs: 500 })} />
2775
+ * perfHud(sharedMonitor) // HUD on an externally-owned monitor
2776
+ * ```
2777
+ *
2778
+ * Importing this factory is what pulls the monitor + HUD code into the
2779
+ * bundle; pass a bare `PerfMonitor` instance as `perf` for HUD-less
2780
+ * instrumentation.
2781
+ */
2782
+ export declare function perfHud(init?: PerfMonitorOptions | PerfMonitor): PerfConfig;
2783
+
2290
2784
  /**
2291
2785
  * Collects per-frame timing, draw-call counts, per-series render ms, and heap
2292
2786
  * usage. All collection sites short-circuit to no-ops when no monitor is
@@ -2297,7 +2791,7 @@ export declare const peachCream: ThemePreset;
2297
2791
  * monitor. Multiple charts may share a monitor, but `perSeries` keys must be
2298
2792
  * unique across charts or samples will collide.
2299
2793
  */
2300
- declare class PerfMonitor {
2794
+ export declare class PerfMonitor {
2301
2795
  /** Draw-call tally map for the main layer. Mutated in place by the counting context; cleared at the start of each frame. */
2302
2796
  readonly drawCallsMain: Map<string, number>;
2303
2797
  /** Draw-call tally map for the overlay layer. Same contract as `drawCallsMain`. */
@@ -2321,6 +2815,13 @@ declare class PerfMonitor {
2321
2815
  constructor(options?: PerfMonitorOptions);
2322
2816
  /** Clear the draw-call tally for the given layer. Call at the start of each frame. */
2323
2817
  resetDrawCalls(kind: FrameKind): void;
2818
+ /**
2819
+ * Wrap a 2D context in a draw-call-counting Proxy feeding this monitor's
2820
+ * tally for `kind`. Lives on the monitor (rather than being imported by
2821
+ * the chart's canvas manager) so charts without instrumentation carry no
2822
+ * perf code at all.
2823
+ */
2824
+ wrapContext(ctx: CanvasRenderingContext2D, kind: FrameKind): CanvasRenderingContext2D;
2324
2825
  /** Record a completed frame's wall-clock duration and emit stats to subscribers. */
2325
2826
  recordFrame(kind: FrameKind, ms: number, timestamp: number): void;
2326
2827
  /** Record one series renderer's time slice inside the main pass. Called from inside `renderMain`, so the enclosing `recordFrame('main', …)` trim takes care of age. */
@@ -2335,7 +2836,7 @@ declare class PerfMonitor {
2335
2836
  private sampleHeap;
2336
2837
  }
2337
2838
 
2338
- declare interface PerfMonitorOptions {
2839
+ export declare interface PerfMonitorOptions {
2339
2840
  /**
2340
2841
  * Age of the rolling window in milliseconds. Samples older than this are
2341
2842
  * dropped from FPS / percentile calculations. Defaults to 5000 (5 seconds).
@@ -2357,12 +2858,15 @@ declare interface PerfMonitorOptions {
2357
2858
 
2358
2859
  declare type PerfOption = NonNullable<ChartOptions['perf']>;
2359
2860
 
2360
- declare interface PerfStats {
2861
+ export declare interface PerfStats {
2361
2862
  /**
2362
- * Main-layer renders per second, derived from the interval between recent main
2363
- * frames. Charts render on demand (data change, pan, zoom, resize, streaming
2364
- * tick), so `0` during an idle chart is normal — not a stutter. `0` until two
2365
- * frames have been recorded.
2863
+ * Main-layer renders per second. During continuous rendering this is the
2864
+ * rate of the trailing run of back-to-back frames (so it reflects the
2865
+ * *current* rate immediately instead of ramping up as idle time ages out
2866
+ * of the window); for sparse on-demand renders it is the window-wide
2867
+ * average. Charts render on demand (data change, pan, zoom, resize,
2868
+ * streaming tick), so `0` during an idle chart is normal — not a stutter.
2869
+ * `0` until two frames have been recorded.
2366
2870
  */
2367
2871
  mainRendersPerSec: number;
2368
2872
  /** Same as {@link mainRendersPerSec} but for the overlay (crosshair + pulse) layer. */
@@ -2436,8 +2940,33 @@ declare type PieLegendMode = 'value' | 'percent' | 'both';
2436
2940
 
2437
2941
  declare type PieLegendPosition = 'bottom' | 'right' | 'overlay';
2438
2942
 
2943
+ /**
2944
+ * Grouping of the smallest slices into a single synthetic "Other" slice.
2945
+ * Enabled by default: when the data holds more than {@link maxSlices} slices,
2946
+ * the largest `maxSlices - 1` keep their original order and the rest are
2947
+ * summed into one "Other" slice appended at the end. The grouped slice
2948
+ * behaves like a regular slice in labels / legend / tooltip / hit-testing.
2949
+ */
2950
+ declare interface PieOtherOptions {
2951
+ /** Max number of rendered slices including "Other". Default: 8. */
2952
+ maxSlices?: number;
2953
+ /** Label of the aggregated slice. Default: `'Other'`. */
2954
+ label?: string;
2955
+ /**
2956
+ * Color override for the aggregated slice. Default: `theme.pie.otherColor`
2957
+ * (falls back to `axis.textColor` for themes without a `pie` block) — a
2958
+ * muted tone so the aggregate doesn't carry the same visual weight as a
2959
+ * real category.
2960
+ */
2961
+ color?: string;
2962
+ }
2963
+
2439
2964
  export declare const PieSeries: DefineComponent<__VLS_Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2440
2965
 
2966
+ /** Series definition for `chart.addSeries` — keeps the chart renderer-agnostic
2967
+ * so hosts that never render pies don't bundle this module. */
2968
+ export declare const PieSeriesDef: SeriesDefinition<PieSeriesOptions>;
2969
+
2441
2970
  /** Visual options for a pie/donut series. `innerRadiusRatio > 0` makes it a donut. */
2442
2971
  export declare interface PieSeriesOptions {
2443
2972
  /** Palette fallback (defaults to theme.seriesColors). */
@@ -2450,6 +2979,13 @@ export declare interface PieSeriesOptions {
2450
2979
  label?: string;
2451
2980
  /** Per-slice label rendering on the pie itself. See {@link PieLabelsOptions}. */
2452
2981
  sliceLabels?: PieLabelsOptions;
2982
+ /**
2983
+ * Group the smallest slices into a single "Other" slice when the dataset
2984
+ * exceeds `maxSlices` (default: 8 rendered slices total). On by default so
2985
+ * dense datasets stay readable — pass `false` to always render every slice.
2986
+ * See {@link PieOtherOptions}.
2987
+ */
2988
+ other?: boolean | PieOtherOptions;
2453
2989
  /**
2454
2990
  * When `true`, enables pie motion effects: the outside-label entrance
2455
2991
  * draw-in on mount / data swap, and the hover-explode slice offset.
@@ -2459,6 +2995,14 @@ export declare interface PieSeriesOptions {
2459
2995
  * value.
2460
2996
  */
2461
2997
  animate?: boolean;
2998
+ /**
2999
+ * Per-slice radial *depth* gradient — a subtle lightening from the slice
3000
+ * center toward its edge that gives the pie a soft 3D sheen. On by default.
3001
+ * Set `false` for flat, solid-color slices (the material / infographic
3002
+ * look). Orthogonal to {@link innerShadow}: an explicit `innerShadow` still
3003
+ * paints its dark rim band even when the depth gradient is off.
3004
+ */
3005
+ gradient?: boolean;
2462
3006
  /**
2463
3007
  * Ambient *outer* drop-shadow behind each slice. Adds lift for flat
2464
3008
  * dashboards. Omit / `false` to disable (default). `true` uses soft
@@ -2494,6 +3038,11 @@ export declare interface PieSeriesOptions {
2494
3038
  };
2495
3039
  }
2496
3040
 
3041
+ /** A spatial renderer with no time axis (Pie). Has no time-series queries. */
3042
+ declare interface PieSeriesRenderer extends BaseSeriesRenderer {
3043
+ readonly kind: 'pie';
3044
+ }
3045
+
2497
3046
  /** Optional min/max constraints for the Y axis. Omit a side for automatic scaling. */
2498
3047
  /** A single slice in a pie/donut chart. */
2499
3048
  export declare interface PieSliceData {
@@ -2515,6 +3064,83 @@ declare interface Rect {
2515
3064
  height: number;
2516
3065
  }
2517
3066
 
3067
+ export declare const ReferenceLine: DefineComponent<__VLS_Props_13, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_13> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
3068
+
3069
+ /**
3070
+ * A straight reference line across the plot — a horizontal threshold / baseline
3071
+ * pinned to a `value`, or a vertical event boundary pinned to a `time`. Like
3072
+ * markers and regions, reference lines stay out of the series model: they don't
3073
+ * affect the Y-range autoscale, tooltips, or the legend. Drawn on the overlay
3074
+ * layer, *above* the series and clipped to the plot area, so the line reads on
3075
+ * top of the data the way a threshold should.
3076
+ */
3077
+ export declare interface ReferenceLineConfig {
3078
+ /** Horizontal line at this Y data value. Mutually exclusive with {@link time}. */
3079
+ value?: number;
3080
+ /** Vertical line at this `time` (epoch ms or `Date`). Mutually exclusive with {@link value}. */
3081
+ time?: TimeValue;
3082
+ /** Line and label-pill color. Default: the theme line color. */
3083
+ color?: string;
3084
+ /** Optional text label drawn in a pill at the line's near end. */
3085
+ label?: string;
3086
+ /** Dash style. Default: `'dashed'`. */
3087
+ style?: ReferenceLineStyle;
3088
+ /** Stroke width in CSS pixels. Default: `1`. */
3089
+ width?: number;
3090
+ }
3091
+
3092
+ /** Orientation of a resolved reference line. */
3093
+ export declare type ReferenceLineOrientation = 'horizontal' | 'vertical';
3094
+
3095
+ /** Dash pattern of a {@link ReferenceLineConfig}. */
3096
+ export declare type ReferenceLineStyle = 'solid' | 'dashed';
3097
+
3098
+ /** Internal bookkeeping for a registered time region. `from`/`to` are normalized to epoch ms; `to: null` is open-ended. */
3099
+ declare interface RegionEntry {
3100
+ id: string;
3101
+ from: number;
3102
+ to: number | null;
3103
+ fill?: string;
3104
+ color?: string;
3105
+ label?: string;
3106
+ }
3107
+
3108
+ /**
3109
+ * Register the four built-in series so the string form
3110
+ * `chart.addSeries('line', …)` resolves. Call it once at startup.
3111
+ *
3112
+ * Importing this helper pulls every renderer into the bundle — hosts that
3113
+ * care about size should pass definitions directly instead:
3114
+ * `chart.addSeries(LineSeriesDef, options)`.
3115
+ */
3116
+ export declare function registerBuiltinSeries(): void;
3117
+
3118
+ /**
3119
+ * Make a definition resolvable through the string form
3120
+ * `chart.addSeries('line', …)`. The built-ins register in one call via
3121
+ * `registerBuiltinSeries()`; hosts that pass definitions directly never
3122
+ * need the registry.
3123
+ */
3124
+ export declare function registerSeriesDefinition(def: SeriesDefinition): void;
3125
+
3126
+ /**
3127
+ * Vertical padding reserved at the top/bottom of the chart area.
3128
+ *
3129
+ * **Unitless on its own** — the unit is fixed by the call site:
3130
+ * - In {@link SeriesRenderContext} / {@link OverlayRenderContext}: **CSS pixels**
3131
+ * (multiply by `scope.verticalPixelRatio` to convert to bitmap pixels).
3132
+ * - In {@link SeriesRenderer.hitTest}: **bitmap pixels** (the chart pre-scales
3133
+ * so the values align with the `bx`/`by` bitmap-space pointer coords).
3134
+ *
3135
+ * Time-based renderers absorb this implicitly via the YScale's value range,
3136
+ * but spatial renderers (Pie) need the raw pixel reservation to keep their
3137
+ * layout out of the Title / InfoBar overlay regions.
3138
+ */
3139
+ declare interface RenderPadding {
3140
+ top: number;
3141
+ bottom: number;
3142
+ }
3143
+
2518
3144
  /**
2519
3145
  * Resolve the effective font size for a given axis, falling back to the
2520
3146
  * shared `axis.fontSize` default when no per-axis override is set.
@@ -2594,6 +3220,72 @@ export declare interface RoundedRectArgs {
2594
3220
 
2595
3221
  export declare const sandDune: ThemePreset;
2596
3222
 
3223
+ /** Environment the chart hands a {@link SeriesDefinition} when constructing its renderer. */
3224
+ export declare interface SeriesCreateEnv {
3225
+ /** Active chart theme — definitions read their default colours from it. */
3226
+ theme: ChartTheme;
3227
+ /** Number of stacked layers requested via `layers` (`1` when omitted). */
3228
+ layerCount: number;
3229
+ }
3230
+
3231
+ /**
3232
+ * A series type the chart knows how to instantiate.
3233
+ *
3234
+ * Pass one to `chart.addSeries(def, options)` — the chart itself stays
3235
+ * renderer-agnostic, so bundlers only ship the series a host actually
3236
+ * imports. The built-in definitions live next to their renderers
3237
+ * (`CandlestickSeriesDef`, `LineSeriesDef`, `BarSeriesDef`, `PieSeriesDef`).
3238
+ */
3239
+ export declare interface SeriesDefinition<O = Record<string, unknown>> {
3240
+ /** Discriminator for animation defaults and string-form lookup. */
3241
+ readonly type: SeriesType;
3242
+ /** Construct the renderer. `options` arrives with the chart's animation defaults/overrides already merged. */
3243
+ create(env: SeriesCreateEnv, options: Partial<O>): SeriesRenderer;
3244
+ }
3245
+
3246
+ /**
3247
+ * A single named (and optionally colored) layer. Carries the layer's display
3248
+ * name and color *alongside* its data, so `Tooltip` / `Legend` show per-layer
3249
+ * names without a separate `label` option. `color` applies to line/bar layers;
3250
+ * a candlestick stream ignores it (candle colors come from `up` / `down`).
3251
+ */
3252
+ declare interface SeriesLayer<T> {
3253
+ /** Display name shown in tooltip / legend. A multi-layer series defaults each unnamed layer to `Series N`. */
3254
+ label?: string;
3255
+ /** Stroke + fill color for this layer; overrides the theme default. A function colors per bar / per line segment by value. Ignored by candlestick. */
3256
+ color?: ValueColor;
3257
+ /** The layer's points. */
3258
+ data: T[];
3259
+ }
3260
+
3261
+ declare interface SeriesRenderContext {
3262
+ scope: BitmapCoordinateSpace;
3263
+ timeScale: XScale;
3264
+ yScale: YScale;
3265
+ theme: ChartTheme;
3266
+ dataInterval: number;
3267
+ /** Vertical padding in **CSS pixels** — see {@link RenderPadding}. */
3268
+ padding: RenderPadding;
3269
+ /**
3270
+ * Engine-owned animation state — pulse phase, live values, entry
3271
+ * progress. Optional during the Phase 2 migration: renderers that
3272
+ * haven't been ported yet keep reading their own state and ignore this.
3273
+ */
3274
+ state?: AnimationState;
3275
+ /**
3276
+ * The id under which the chart registered this series — used by
3277
+ * stateful per-series lookups (`state.pulsePhase.get(seriesId)`,
3278
+ * `state.seriesAlpha.get(seriesId)`).
3279
+ */
3280
+ seriesId?: string;
3281
+ }
3282
+
3283
+ /**
3284
+ * Every series renderer is one of these. Discriminated on `kind`: narrow with
3285
+ * `kind === 'pie'` (or `!== 'pie'`) to reach the variant-specific surface.
3286
+ */
3287
+ declare type SeriesRenderer = TimeSeriesRenderer | PieSeriesRenderer;
3288
+
2597
3289
  /**
2598
3290
  * Frozen, per-row snapshot of a series at a single point in time. The shape
2599
3291
  * `buildHoverSnapshots` / `buildLastSnapshots` return to overlay slot
@@ -2667,6 +3359,8 @@ export declare interface ThemeConfig {
2667
3359
  };
2668
3360
  line?: Partial<ChartTheme['line']>;
2669
3361
  seriesColors?: string[];
3362
+ bar?: Partial<NonNullable<ChartTheme['bar']>>;
3363
+ pie?: Partial<NonNullable<ChartTheme['pie']>>;
2670
3364
  bands?: Partial<ChartTheme['bands']>;
2671
3365
  crosshair?: Partial<ChartTheme['crosshair']>;
2672
3366
  axis?: Partial<ChartTheme['axis']>;
@@ -2730,7 +3424,7 @@ declare interface TickTrackerSnapshot {
2730
3424
  readonly isAnimating: boolean;
2731
3425
  }
2732
3426
 
2733
- export declare const TimeAxis: DefineComponent<__VLS_Props_12, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_12> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
3427
+ export declare const TimeAxis: DefineComponent<__VLS_Props_14, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_14> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
2734
3428
  containerRef: HTMLDivElement;
2735
3429
  }, HTMLDivElement>;
2736
3430
 
@@ -2745,6 +3439,67 @@ export declare type TimePointInput = Omit<TimePoint, 'time'> & {
2745
3439
  time: TimeValue;
2746
3440
  };
2747
3441
 
3442
+ export declare const TimeRegion: DefineComponent<__VLS_Props_15, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_15> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
3443
+
3444
+ /**
3445
+ * A translucent vertical band shading the interval `[from, to]` — Grafana's
3446
+ * "annotation region", TradingView's highlighted session, an SRE anomaly
3447
+ * window. Regions live outside the series model: they never affect the Y-range
3448
+ * autoscale, tooltips, or the legend. Drawn on the main layer *behind* the
3449
+ * series so the data reads on top of the shading, clipped to the plot area.
3450
+ */
3451
+ export declare interface TimeRegionConfig {
3452
+ /** Left edge — epoch ms or a `Date`. Normalized on the way in. */
3453
+ from: TimeValue;
3454
+ /**
3455
+ * Right edge — epoch ms or a `Date`. Omit (or pass `'now'`) for an open-ended
3456
+ * region that extends to the right edge of the plot — the "still firing" case.
3457
+ */
3458
+ to?: TimeRegionEnd;
3459
+ /** Band fill — any CSS color, typically translucent. Default: a faint tint of `color`. */
3460
+ fill?: string;
3461
+ /** Optional text label drawn in a pill at the top of the band. */
3462
+ label?: string;
3463
+ /** Edge-line and label-pill accent. Default: the theme's muted axis text color. */
3464
+ color?: string;
3465
+ }
3466
+
3467
+ /**
3468
+ * Right edge of a {@link TimeRegionConfig}. A concrete time closes the band;
3469
+ * `'now'` (or an omitted `to`) leaves it open-ended — it extends to the right
3470
+ * edge of the plot, the "still firing" case.
3471
+ */
3472
+ export declare type TimeRegionEnd = TimeValue | 'now';
3473
+
3474
+ /**
3475
+ * A renderer with a time axis (Candlestick, Line, Bar). Owns its data and
3476
+ * answers the time-series queries directly — Chart never reaches into a store.
3477
+ * Multi-layer renderers (Line, Bar) aggregate across their layers internally;
3478
+ * `getLastDataPoint` / `getSecondLastDataPoint` / `getVisibleDataPoints` are
3479
+ * pinned to layer 0 (see {@link BaseMultiLayerSeries}).
3480
+ */
3481
+ declare interface TimeSeriesRenderer extends BaseSeriesRenderer {
3482
+ readonly kind: 'candlestick' | 'line' | 'bar';
3483
+ /** Earliest/latest sample time across all owned layers, or null when empty. */
3484
+ getTimeBounds(): {
3485
+ first: number;
3486
+ last: number;
3487
+ } | null;
3488
+ /** Last data point (layer 0 for multi-layer), or null when empty. */
3489
+ getLastDataPoint(): OHLCData | TimePoint | null;
3490
+ /** Second-to-last data point (layer 0 for multi-layer), or null. */
3491
+ getSecondLastDataPoint(): OHLCData | TimePoint | null;
3492
+ /** First `maxCount` sample times from the first populated layer — feeds interval detection. */
3493
+ sampleTimes(maxCount: number): number[];
3494
+ /** Visible points in `[from, to]` (layer 0 for multi-layer). */
3495
+ getVisibleDataPoints(from: number, to: number): readonly (OHLCData | TimePoint)[];
3496
+ /** Effective min/max for auto-range (stacked totals for multi-layer; raw min/max otherwise). */
3497
+ getValueRange(from: number, to: number): {
3498
+ min: number;
3499
+ max: number;
3500
+ } | null;
3501
+ }
3502
+
2748
3503
  /**
2749
3504
  * Accepted time input: a timestamp in **milliseconds** (like `Date.now()`) or a `Date` object.
2750
3505
  * `Date` values are converted to milliseconds internally via `Date.getTime()`.
@@ -2892,6 +3647,15 @@ export declare function useVisibleRange(chart: ChartInstance): Ref<VisibleRange>
2892
3647
 
2893
3648
  export declare function useYRange(chart: ChartInstance): Ref<YRange>;
2894
3649
 
3650
+ /**
3651
+ * A color, or a function of a datum's value → color. The function form is
3652
+ * evaluated per element — per bar in a bar series, per segment in a line — so
3653
+ * one layer can paint by sign / threshold (e.g. `v => v >= 0 ? up : down`)
3654
+ * without any extra option. Used both for the per-layer `data` override and the
3655
+ * theme's default bar color.
3656
+ */
3657
+ declare type ValueColor = string | ((value: number) => string);
3658
+
2895
3659
  /**
2896
3660
  * Default value formatters used across the chart library.
2897
3661
  *
@@ -3006,7 +3770,7 @@ declare class XScale {
3006
3770
  private countTicks;
3007
3771
  }
3008
3772
 
3009
- export declare const YAxis: DefineComponent<__VLS_Props_15, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_15> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
3773
+ export declare const YAxis: DefineComponent<__VLS_Props_18, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_18> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
3010
3774
  containerRef: HTMLDivElement;
3011
3775
  }, HTMLDivElement>;
3012
3776