@wick-charts/vue 0.4.2 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +1550 -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 +834 -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
@@ -1316,6 +1615,13 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
1316
1615
  * current crosshair is a no-op (no emit). Combined with the y-preservation
1317
1616
  * above, this lets N charts broadcast their hover to each other without
1318
1617
  * a feedback-loop guard.
1618
+ *
1619
+ * The echo protection assumes the broadcast is **synchronous** (call
1620
+ * `setCrosshair` directly from the `crosshairMove` listener). An echo
1621
+ * routed through an async hop — a state store, a React render — can
1622
+ * arrive with a stale `time` while the origin chart streams, miss the
1623
+ * idempotency check, and flip that chart to time-anchored until the next
1624
+ * real pointer move (see {@link #syncCrosshairToViewport}).
1319
1625
  */
1320
1626
  setCrosshair(pos: {
1321
1627
  time: number;
@@ -1381,7 +1687,25 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> implements
1381
1687
  }[] | null;
1382
1688
  /** Get the primary display color for a series. */
1383
1689
  getSeriesColor(seriesId: string): string | null;
1690
+ /** The series' primary name (first layer). Used for single-layer overlays. */
1384
1691
  getSeriesLabel(seriesId: string): string | undefined;
1692
+ /** The display name of one layer, or `undefined` when that layer is unnamed. */
1693
+ getLayerLabel(seriesId: string, layerIndex: number): string | undefined;
1694
+ /**
1695
+ * Set every layer's display name at once (index = layer). Drives the tooltip,
1696
+ * legend, and info bar. Called by the framework wrappers as the carried
1697
+ * per-layer labels in `data` change. No-ops (and skips the overlay bump) when
1698
+ * the labels are unchanged, so it's safe to call on every data tick.
1699
+ */
1700
+ setSeriesLabels(seriesId: string, labels: (string | undefined)[]): void;
1701
+ /**
1702
+ * Set the per-layer color overrides carried in `data` (sparse — `undefined`
1703
+ * leaves that layer on the theme base). A {@link ValueColor} per layer: a
1704
+ * string (uniform) or a function of value (per bar / per segment). Handed to
1705
+ * the renderer, which keeps them separate from the theme base so a theme swap
1706
+ * preserves them. Called by the framework wrappers; no-ops when unchanged.
1707
+ */
1708
+ setLayerColors(seriesId: string, overrides: (ValueColor | undefined)[]): void;
1385
1709
  /** Get per-layer colors for a series. Returns null for single-layer non-bar/line series. */
1386
1710
  getSeriesLayers(seriesId: string): {
1387
1711
  color: string;
@@ -1572,20 +1896,17 @@ export declare interface ChartOptions {
1572
1896
  onEdgeReached?: (info: EdgeReachedInfo) => void;
1573
1897
  /**
1574
1898
  * Runtime performance instrumentation. Opt-in — absent by default so the
1575
- * hot render path stays free of timing/counting overhead.
1899
+ * hot render path stays free of timing/counting overhead, and so bundles
1900
+ * without instrumentation carry no perf code at all (the chart never
1901
+ * imports it; whatever you pass here is what ships).
1576
1902
  *
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.
1903
+ * - omitted — no instrumentation, no HUD.
1904
+ * - `perfHud()` — monitor + visible HUD overlay (replaces the old `perf: true`).
1905
+ * - `PerfMonitor` instance — instrument without a HUD; useful when the host
1906
+ * consumes stats via `monitor.onFrame` and renders its own UI, or when
1907
+ * several charts share one telemetry sink.
1584
1908
  */
1585
- perf?: boolean | PerfMonitor | (PerfMonitorOptions & {
1586
- hud?: boolean;
1587
- monitor?: PerfMonitor;
1588
- });
1909
+ perf?: PerfMonitor | PerfConfig;
1589
1910
  }
1590
1911
 
1591
1912
  /**
@@ -1643,6 +1964,35 @@ export declare interface ChartTheme {
1643
1964
  };
1644
1965
  /** Color palette for multi-series charts (stacked bars, overlays). */
1645
1966
  seriesColors: string[];
1967
+ /**
1968
+ * Default single-layer bar color. A {@link ValueColor}: a string for a uniform
1969
+ * bar, or a function of the bar's value for sign / threshold coloring.
1970
+ * {@link createTheme} defaults it to a sign function (candlestick up / down
1971
+ * body), which is how bars get green-up / red-down without any option.
1972
+ *
1973
+ * Optional so hand-built theme literals keep compiling — the bar renderer
1974
+ * falls back to {@link ChartTheme.seriesColors}`[0]`. A function value makes
1975
+ * the theme non-JSON-serializable; that is an accepted trade-off (the theme
1976
+ * editor simply omits it).
1977
+ */
1978
+ bar?: {
1979
+ /** Default fill — a string (uniform) or a value-fn (e.g. sign-based up/down). */
1980
+ color: ValueColor;
1981
+ };
1982
+ /**
1983
+ * Pie / donut specific colors. Optional so hand-built theme literals that
1984
+ * predate the field keep compiling — renderers fall back to
1985
+ * {@link ChartTheme.axis} `textColor` (the same muted tone
1986
+ * {@link createTheme} derives by default).
1987
+ */
1988
+ pie?: {
1989
+ /**
1990
+ * Fill of the synthetic "Other" slice produced by small-slice grouping.
1991
+ * Deliberately muted: a vivid palette color would give the aggregate the
1992
+ * same visual weight as a real category.
1993
+ */
1994
+ otherColor: string;
1995
+ };
1646
1996
  /** Bollinger band / envelope fill colors. */
1647
1997
  bands: {
1648
1998
  /** Fill for the upper band region (above the middle band). */
@@ -1964,6 +2314,17 @@ declare type LegendMode = 'toggle' | 'isolate' | 'solo';
1964
2314
 
1965
2315
  export declare const lightPink: ThemePreset;
1966
2316
 
2317
+ /** Internal bookkeeping for a registered reference line. `coord` is a Y value (horizontal) or normalized epoch ms (vertical). */
2318
+ declare interface LineEntry {
2319
+ id: string;
2320
+ orientation: ReferenceLineOrientation;
2321
+ coord: number;
2322
+ color?: string;
2323
+ label?: string;
2324
+ style: ReferenceLineStyle;
2325
+ width: number;
2326
+ }
2327
+
1967
2328
  /**
1968
2329
  * Entrance animation styles for new line points.
1969
2330
  * - `'none'` — new segments appear instantly.
@@ -2013,12 +2374,12 @@ declare interface LinePoint {
2013
2374
 
2014
2375
  export declare const LineSeries: DefineComponent<__VLS_Props_4, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2015
2376
 
2377
+ /** Series definition for `chart.addSeries` — keeps the chart renderer-agnostic
2378
+ * so hosts that never render lines don't bundle this module. */
2379
+ export declare const LineSeriesDef: SeriesDefinition<LineSeriesOptions>;
2380
+
2016
2381
  /** Visual options for a line series. */
2017
2382
  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
2383
  /** Stroke width in CSS pixels. Default: 1. `0` hides the line stroke. */
2023
2384
  strokeWidth: number;
2024
2385
  /** Area-fill configuration. Default: `{ visible: true }`. */
@@ -2119,10 +2480,75 @@ export declare interface LineSeriesOptions {
2119
2480
  * to `'straight'`.
2120
2481
  */
2121
2482
  linePainter?: LinePainter;
2483
+ /**
2484
+ * Threshold coloring. Paints the stroke and the area fill one color below a Y
2485
+ * `value` and another above it, with the switch pinned to that value's pixel
2486
+ * row — a vertical canvas gradient, so it tracks the Y-axis as it autoscales.
2487
+ * Use it to make a series visibly "go critical" past a limit: the line runs
2488
+ * calm below the level and hot above it.
2489
+ *
2490
+ * Positional, so it is independent of (and overrides) the per-layer
2491
+ * `data.color` for the stroke and fill. Applies to unstacked lines only.
2492
+ *
2493
+ * ```
2494
+ * <LineSeries data={data} options={{ threshold: { value: 70, above: '#f0556a' } }} />
2495
+ * ```
2496
+ */
2497
+ threshold?: {
2498
+ /** Y data value where the color switches. */
2499
+ value: number;
2500
+ /** Color above the threshold (toward the top of the plot). */
2501
+ above: string;
2502
+ /** Color below the threshold. Default: the series' resolved color. */
2503
+ below?: string;
2504
+ };
2122
2505
  }
2123
2506
 
2124
2507
  declare type Listener = (...args: any[]) => void;
2125
2508
 
2509
+ export declare const Marker: DefineComponent<__VLS_Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_8> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2510
+
2511
+ /**
2512
+ * A point annotation pinned to a `time` (X) and a `value` (Y) — "anomaly opened
2513
+ * here", "deploy happened here". Markers live outside the series model, so they
2514
+ * are excluded from tooltips, the legend, and the Y-range autoscale, and never
2515
+ * pollute series queries. Drawn on the overlay layer, clipped to the plot area.
2516
+ */
2517
+ export declare interface MarkerConfig {
2518
+ /** X anchor — epoch ms or a `Date`. Normalized on the way in. */
2519
+ time: TimeValue;
2520
+ /**
2521
+ * Y anchor as a data value. Omit and set {@link MarkerConfig.seriesId} to snap
2522
+ * the marker to that series' nearest data point at `time`.
2523
+ */
2524
+ value?: number;
2525
+ /** Snap Y to this series' value at `time` when `value` is omitted. Also the default color source. */
2526
+ seriesId?: string;
2527
+ /** Glyph at the anchor. Default: `'dot'`. */
2528
+ shape?: MarkerShape;
2529
+ /** Reuse the line pulse halo around the anchor. Default: `false`. */
2530
+ pulse?: boolean;
2531
+ /** Optional text label drawn in a pill next to the anchor. */
2532
+ label?: string;
2533
+ /** Color override. Falls back to the series color (when `seriesId` is set), then the theme line color. */
2534
+ color?: string;
2535
+ }
2536
+
2537
+ /** Internal bookkeeping for a registered marker. `time` is normalized to epoch ms; `shape`/`pulse` carry resolved defaults. */
2538
+ declare interface MarkerEntry {
2539
+ id: string;
2540
+ time: number;
2541
+ value?: number;
2542
+ seriesId?: string;
2543
+ shape: MarkerShape;
2544
+ pulse: boolean;
2545
+ label?: string;
2546
+ color?: string;
2547
+ }
2548
+
2549
+ /** Glyph drawn at the marker anchor. Arrows point their tip *at* the anchor point. */
2550
+ export declare type MarkerShape = 'dot' | 'circle' | 'arrow-up' | 'arrow-down';
2551
+
2126
2552
  export declare const materialPalenight: ThemePreset;
2127
2553
 
2128
2554
  /**
@@ -2140,7 +2566,19 @@ export declare const mintBreeze: ThemePreset;
2140
2566
 
2141
2567
  export declare const monokaiPro: ThemePreset;
2142
2568
 
2143
- declare const Navigator_2: DefineComponent<__VLS_Props_8, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_8> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
2569
+ /**
2570
+ * Omnivorous `data` shape for line and bar series. Accepts, interchangeably:
2571
+ * - `TimePointInput[]` — one auto-named layer (the common single-series case);
2572
+ * - `TimePointInput[][]` — N auto-named layers;
2573
+ * - `SeriesLayer<TimePointInput>` — one named/colored layer;
2574
+ * - an array mixing raw `TimePointInput[]` layers and named `SeriesLayer`s.
2575
+ *
2576
+ * Everything normalizes to `SeriesLayer[]` internally (see `toLayers`). Time
2577
+ * accepts epoch milliseconds or a `Date` on every point.
2578
+ */
2579
+ declare type MultiLayerData = TimePointInput[] | SeriesLayer<TimePointInput> | Array<TimePointInput[] | SeriesLayer<TimePointInput>>;
2580
+
2581
+ declare const Navigator_2: DefineComponent<__VLS_Props_9, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_9> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
2144
2582
  stripRef: HTMLDivElement;
2145
2583
  }, any>;
2146
2584
  export { Navigator_2 as Navigator }
@@ -2166,9 +2604,14 @@ export declare interface NavigatorCandlePoint {
2166
2604
  * active zone aligns with the main chart's plot area (matches the TimeAxis).
2167
2605
  *
2168
2606
  * Event topology — navigator is a pure listener on the chart side, never emits:
2169
- * chart.viewportChange → reposition window DOM + redraw on next frame
2607
+ * chart.viewportChange → reposition window DOM on next frame (canvas untouched)
2608
+ * chart.tickFrame → reposition window DOM on next frame (window glide)
2170
2609
  * chart.overlayChange → full redraw (catches data + theme swaps)
2171
2610
  * ResizeObserver → resize canvas + full redraw
2611
+ *
2612
+ * The canvas miniature depends only on data / theme / size, so per-frame
2613
+ * viewport signals take the light DOM-only path — a wheel-zoom or pan never
2614
+ * re-decimates the dataset or repaints the strip.
2172
2615
  */
2173
2616
  export declare class NavigatorController {
2174
2617
  #private;
@@ -2227,7 +2670,7 @@ export declare const nightOwl: ThemePreset;
2227
2670
  /** Convert a {@link TimeValue} (number ms or Date) to a millisecond timestamp. */
2228
2671
  export declare function normalizeTime(t: TimeValue): number;
2229
2672
 
2230
- export declare const NumberFlow: DefineComponent<__VLS_Props_9, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_9> & Readonly<{}>, {
2673
+ export declare const NumberFlow: DefineComponent<__VLS_Props_10, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_10> & Readonly<{}>, {
2231
2674
  locale: string;
2232
2675
  spinDuration: number;
2233
2676
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLSpanElement>;
@@ -2249,6 +2692,31 @@ export declare type OHLCInput = Omit<OHLCData, 'time'> & {
2249
2692
 
2250
2693
  export declare const oneDarkPro: ThemePreset;
2251
2694
 
2695
+ /** Overlay render state passed to {@link SeriesRenderer.drawOverlay}. */
2696
+ declare interface OverlayRenderContext {
2697
+ scope: BitmapCoordinateSpace;
2698
+ timeScale: XScale;
2699
+ yScale: YScale;
2700
+ theme: ChartTheme;
2701
+ dataInterval: number;
2702
+ /** Vertical padding in **CSS pixels** — see {@link RenderPadding}. */
2703
+ padding: RenderPadding;
2704
+ /** Current crosshair position, or null when none. */
2705
+ crosshair: {
2706
+ mediaX: number;
2707
+ mediaY: number;
2708
+ time: number;
2709
+ y: number;
2710
+ } | null;
2711
+ /**
2712
+ * Engine-owned animation state. Pulse renderers read `state.pulsePhase`
2713
+ * here so the halo cycles off the same clock the rest of the chart uses.
2714
+ */
2715
+ state?: AnimationState;
2716
+ /** The chart-side id for this series. See {@link SeriesRenderContext.seriesId}. */
2717
+ seriesId?: string;
2718
+ }
2719
+
2252
2720
  /**
2253
2721
  * Engine context shared by every painter. `ctx.globalAlpha` is ALREADY composed
2254
2722
  * (layer × series × entrance fade) by the renderer, and every geometry handed to
@@ -2287,6 +2755,39 @@ declare interface PanZoomTarget {
2287
2755
 
2288
2756
  export declare const peachCream: ThemePreset;
2289
2757
 
2758
+ /**
2759
+ * Chart-ready perf configuration: a monitor plus an optional HUD mount.
2760
+ * Produced by {@link perfHud} (or hand-assembled); passed as the chart's
2761
+ * `perf` option. The chart itself never imports perf code — whatever the
2762
+ * config carries is all that ships in the bundle.
2763
+ */
2764
+ export declare interface PerfConfig {
2765
+ /** Monitor that collects frame timing / draw calls for this chart. */
2766
+ monitor: PerfMonitor;
2767
+ /** Mounts the HUD overlay; the chart calls it at construction and destroys the result. */
2768
+ hud?: (container: HTMLElement, monitor: PerfMonitor) => {
2769
+ destroy(): void;
2770
+ };
2771
+ /** True when the config constructed the monitor — the chart then destroys it on teardown. */
2772
+ ownsMonitor?: boolean;
2773
+ }
2774
+
2775
+ /**
2776
+ * Performance instrumentation with the visible HUD overlay — the factory
2777
+ * replacement for the old `perf: true`:
2778
+ *
2779
+ * ```ts
2780
+ * new ChartInstance(el, { perf: perfHud() });
2781
+ * <ChartContainer perf={perfHud({ windowMs: 500 })} />
2782
+ * perfHud(sharedMonitor) // HUD on an externally-owned monitor
2783
+ * ```
2784
+ *
2785
+ * Importing this factory is what pulls the monitor + HUD code into the
2786
+ * bundle; pass a bare `PerfMonitor` instance as `perf` for HUD-less
2787
+ * instrumentation.
2788
+ */
2789
+ export declare function perfHud(init?: PerfMonitorOptions | PerfMonitor): PerfConfig;
2790
+
2290
2791
  /**
2291
2792
  * Collects per-frame timing, draw-call counts, per-series render ms, and heap
2292
2793
  * usage. All collection sites short-circuit to no-ops when no monitor is
@@ -2297,7 +2798,7 @@ export declare const peachCream: ThemePreset;
2297
2798
  * monitor. Multiple charts may share a monitor, but `perSeries` keys must be
2298
2799
  * unique across charts or samples will collide.
2299
2800
  */
2300
- declare class PerfMonitor {
2801
+ export declare class PerfMonitor {
2301
2802
  /** Draw-call tally map for the main layer. Mutated in place by the counting context; cleared at the start of each frame. */
2302
2803
  readonly drawCallsMain: Map<string, number>;
2303
2804
  /** Draw-call tally map for the overlay layer. Same contract as `drawCallsMain`. */
@@ -2321,6 +2822,13 @@ declare class PerfMonitor {
2321
2822
  constructor(options?: PerfMonitorOptions);
2322
2823
  /** Clear the draw-call tally for the given layer. Call at the start of each frame. */
2323
2824
  resetDrawCalls(kind: FrameKind): void;
2825
+ /**
2826
+ * Wrap a 2D context in a draw-call-counting Proxy feeding this monitor's
2827
+ * tally for `kind`. Lives on the monitor (rather than being imported by
2828
+ * the chart's canvas manager) so charts without instrumentation carry no
2829
+ * perf code at all.
2830
+ */
2831
+ wrapContext(ctx: CanvasRenderingContext2D, kind: FrameKind): CanvasRenderingContext2D;
2324
2832
  /** Record a completed frame's wall-clock duration and emit stats to subscribers. */
2325
2833
  recordFrame(kind: FrameKind, ms: number, timestamp: number): void;
2326
2834
  /** 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 +2843,7 @@ declare class PerfMonitor {
2335
2843
  private sampleHeap;
2336
2844
  }
2337
2845
 
2338
- declare interface PerfMonitorOptions {
2846
+ export declare interface PerfMonitorOptions {
2339
2847
  /**
2340
2848
  * Age of the rolling window in milliseconds. Samples older than this are
2341
2849
  * dropped from FPS / percentile calculations. Defaults to 5000 (5 seconds).
@@ -2357,12 +2865,15 @@ declare interface PerfMonitorOptions {
2357
2865
 
2358
2866
  declare type PerfOption = NonNullable<ChartOptions['perf']>;
2359
2867
 
2360
- declare interface PerfStats {
2868
+ export declare interface PerfStats {
2361
2869
  /**
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.
2870
+ * Main-layer renders per second. During continuous rendering this is the
2871
+ * rate of the trailing run of back-to-back frames (so it reflects the
2872
+ * *current* rate immediately instead of ramping up as idle time ages out
2873
+ * of the window); for sparse on-demand renders it is the window-wide
2874
+ * average. Charts render on demand (data change, pan, zoom, resize,
2875
+ * streaming tick), so `0` during an idle chart is normal — not a stutter.
2876
+ * `0` until two frames have been recorded.
2366
2877
  */
2367
2878
  mainRendersPerSec: number;
2368
2879
  /** Same as {@link mainRendersPerSec} but for the overlay (crosshair + pulse) layer. */
@@ -2436,8 +2947,33 @@ declare type PieLegendMode = 'value' | 'percent' | 'both';
2436
2947
 
2437
2948
  declare type PieLegendPosition = 'bottom' | 'right' | 'overlay';
2438
2949
 
2950
+ /**
2951
+ * Grouping of the smallest slices into a single synthetic "Other" slice.
2952
+ * Enabled by default: when the data holds more than {@link maxSlices} slices,
2953
+ * the largest `maxSlices - 1` keep their original order and the rest are
2954
+ * summed into one "Other" slice appended at the end. The grouped slice
2955
+ * behaves like a regular slice in labels / legend / tooltip / hit-testing.
2956
+ */
2957
+ declare interface PieOtherOptions {
2958
+ /** Max number of rendered slices including "Other". Default: 8. */
2959
+ maxSlices?: number;
2960
+ /** Label of the aggregated slice. Default: `'Other'`. */
2961
+ label?: string;
2962
+ /**
2963
+ * Color override for the aggregated slice. Default: `theme.pie.otherColor`
2964
+ * (falls back to `axis.textColor` for themes without a `pie` block) — a
2965
+ * muted tone so the aggregate doesn't carry the same visual weight as a
2966
+ * real category.
2967
+ */
2968
+ color?: string;
2969
+ }
2970
+
2439
2971
  export declare const PieSeries: DefineComponent<__VLS_Props_5, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
2440
2972
 
2973
+ /** Series definition for `chart.addSeries` — keeps the chart renderer-agnostic
2974
+ * so hosts that never render pies don't bundle this module. */
2975
+ export declare const PieSeriesDef: SeriesDefinition<PieSeriesOptions>;
2976
+
2441
2977
  /** Visual options for a pie/donut series. `innerRadiusRatio > 0` makes it a donut. */
2442
2978
  export declare interface PieSeriesOptions {
2443
2979
  /** Palette fallback (defaults to theme.seriesColors). */
@@ -2450,6 +2986,13 @@ export declare interface PieSeriesOptions {
2450
2986
  label?: string;
2451
2987
  /** Per-slice label rendering on the pie itself. See {@link PieLabelsOptions}. */
2452
2988
  sliceLabels?: PieLabelsOptions;
2989
+ /**
2990
+ * Group the smallest slices into a single "Other" slice when the dataset
2991
+ * exceeds `maxSlices` (default: 8 rendered slices total). On by default so
2992
+ * dense datasets stay readable — pass `false` to always render every slice.
2993
+ * See {@link PieOtherOptions}.
2994
+ */
2995
+ other?: boolean | PieOtherOptions;
2453
2996
  /**
2454
2997
  * When `true`, enables pie motion effects: the outside-label entrance
2455
2998
  * draw-in on mount / data swap, and the hover-explode slice offset.
@@ -2459,6 +3002,14 @@ export declare interface PieSeriesOptions {
2459
3002
  * value.
2460
3003
  */
2461
3004
  animate?: boolean;
3005
+ /**
3006
+ * Per-slice radial *depth* gradient — a subtle lightening from the slice
3007
+ * center toward its edge that gives the pie a soft 3D sheen. On by default.
3008
+ * Set `false` for flat, solid-color slices (the material / infographic
3009
+ * look). Orthogonal to {@link innerShadow}: an explicit `innerShadow` still
3010
+ * paints its dark rim band even when the depth gradient is off.
3011
+ */
3012
+ gradient?: boolean;
2462
3013
  /**
2463
3014
  * Ambient *outer* drop-shadow behind each slice. Adds lift for flat
2464
3015
  * dashboards. Omit / `false` to disable (default). `true` uses soft
@@ -2494,6 +3045,11 @@ export declare interface PieSeriesOptions {
2494
3045
  };
2495
3046
  }
2496
3047
 
3048
+ /** A spatial renderer with no time axis (Pie). Has no time-series queries. */
3049
+ declare interface PieSeriesRenderer extends BaseSeriesRenderer {
3050
+ readonly kind: 'pie';
3051
+ }
3052
+
2497
3053
  /** Optional min/max constraints for the Y axis. Omit a side for automatic scaling. */
2498
3054
  /** A single slice in a pie/donut chart. */
2499
3055
  export declare interface PieSliceData {
@@ -2515,6 +3071,83 @@ declare interface Rect {
2515
3071
  height: number;
2516
3072
  }
2517
3073
 
3074
+ export declare const ReferenceLine: DefineComponent<__VLS_Props_13, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_13> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
3075
+
3076
+ /**
3077
+ * A straight reference line across the plot — a horizontal threshold / baseline
3078
+ * pinned to a `value`, or a vertical event boundary pinned to a `time`. Like
3079
+ * markers and regions, reference lines stay out of the series model: they don't
3080
+ * affect the Y-range autoscale, tooltips, or the legend. Drawn on the overlay
3081
+ * layer, *above* the series and clipped to the plot area, so the line reads on
3082
+ * top of the data the way a threshold should.
3083
+ */
3084
+ export declare interface ReferenceLineConfig {
3085
+ /** Horizontal line at this Y data value. Mutually exclusive with {@link time}. */
3086
+ value?: number;
3087
+ /** Vertical line at this `time` (epoch ms or `Date`). Mutually exclusive with {@link value}. */
3088
+ time?: TimeValue;
3089
+ /** Line and label-pill color. Default: the theme line color. */
3090
+ color?: string;
3091
+ /** Optional text label drawn in a pill at the line's near end. */
3092
+ label?: string;
3093
+ /** Dash style. Default: `'dashed'`. */
3094
+ style?: ReferenceLineStyle;
3095
+ /** Stroke width in CSS pixels. Default: `1`. */
3096
+ width?: number;
3097
+ }
3098
+
3099
+ /** Orientation of a resolved reference line. */
3100
+ export declare type ReferenceLineOrientation = 'horizontal' | 'vertical';
3101
+
3102
+ /** Dash pattern of a {@link ReferenceLineConfig}. */
3103
+ export declare type ReferenceLineStyle = 'solid' | 'dashed';
3104
+
3105
+ /** Internal bookkeeping for a registered time region. `from`/`to` are normalized to epoch ms; `to: null` is open-ended. */
3106
+ declare interface RegionEntry {
3107
+ id: string;
3108
+ from: number;
3109
+ to: number | null;
3110
+ fill?: string;
3111
+ color?: string;
3112
+ label?: string;
3113
+ }
3114
+
3115
+ /**
3116
+ * Register the four built-in series so the string form
3117
+ * `chart.addSeries('line', …)` resolves. Call it once at startup.
3118
+ *
3119
+ * Importing this helper pulls every renderer into the bundle — hosts that
3120
+ * care about size should pass definitions directly instead:
3121
+ * `chart.addSeries(LineSeriesDef, options)`.
3122
+ */
3123
+ export declare function registerBuiltinSeries(): void;
3124
+
3125
+ /**
3126
+ * Make a definition resolvable through the string form
3127
+ * `chart.addSeries('line', …)`. The built-ins register in one call via
3128
+ * `registerBuiltinSeries()`; hosts that pass definitions directly never
3129
+ * need the registry.
3130
+ */
3131
+ export declare function registerSeriesDefinition(def: SeriesDefinition): void;
3132
+
3133
+ /**
3134
+ * Vertical padding reserved at the top/bottom of the chart area.
3135
+ *
3136
+ * **Unitless on its own** — the unit is fixed by the call site:
3137
+ * - In {@link SeriesRenderContext} / {@link OverlayRenderContext}: **CSS pixels**
3138
+ * (multiply by `scope.verticalPixelRatio` to convert to bitmap pixels).
3139
+ * - In {@link SeriesRenderer.hitTest}: **bitmap pixels** (the chart pre-scales
3140
+ * so the values align with the `bx`/`by` bitmap-space pointer coords).
3141
+ *
3142
+ * Time-based renderers absorb this implicitly via the YScale's value range,
3143
+ * but spatial renderers (Pie) need the raw pixel reservation to keep their
3144
+ * layout out of the Title / InfoBar overlay regions.
3145
+ */
3146
+ declare interface RenderPadding {
3147
+ top: number;
3148
+ bottom: number;
3149
+ }
3150
+
2518
3151
  /**
2519
3152
  * Resolve the effective font size for a given axis, falling back to the
2520
3153
  * shared `axis.fontSize` default when no per-axis override is set.
@@ -2594,6 +3227,72 @@ export declare interface RoundedRectArgs {
2594
3227
 
2595
3228
  export declare const sandDune: ThemePreset;
2596
3229
 
3230
+ /** Environment the chart hands a {@link SeriesDefinition} when constructing its renderer. */
3231
+ export declare interface SeriesCreateEnv {
3232
+ /** Active chart theme — definitions read their default colours from it. */
3233
+ theme: ChartTheme;
3234
+ /** Number of stacked layers requested via `layers` (`1` when omitted). */
3235
+ layerCount: number;
3236
+ }
3237
+
3238
+ /**
3239
+ * A series type the chart knows how to instantiate.
3240
+ *
3241
+ * Pass one to `chart.addSeries(def, options)` — the chart itself stays
3242
+ * renderer-agnostic, so bundlers only ship the series a host actually
3243
+ * imports. The built-in definitions live next to their renderers
3244
+ * (`CandlestickSeriesDef`, `LineSeriesDef`, `BarSeriesDef`, `PieSeriesDef`).
3245
+ */
3246
+ export declare interface SeriesDefinition<O = Record<string, unknown>> {
3247
+ /** Discriminator for animation defaults and string-form lookup. */
3248
+ readonly type: SeriesType;
3249
+ /** Construct the renderer. `options` arrives with the chart's animation defaults/overrides already merged. */
3250
+ create(env: SeriesCreateEnv, options: Partial<O>): SeriesRenderer;
3251
+ }
3252
+
3253
+ /**
3254
+ * A single named (and optionally colored) layer. Carries the layer's display
3255
+ * name and color *alongside* its data, so `Tooltip` / `Legend` show per-layer
3256
+ * names without a separate `label` option. `color` applies to line/bar layers;
3257
+ * a candlestick stream ignores it (candle colors come from `up` / `down`).
3258
+ */
3259
+ declare interface SeriesLayer<T> {
3260
+ /** Display name shown in tooltip / legend. A multi-layer series defaults each unnamed layer to `Series N`. */
3261
+ label?: string;
3262
+ /** Stroke + fill color for this layer; overrides the theme default. A function colors per bar / per line segment by value. Ignored by candlestick. */
3263
+ color?: ValueColor;
3264
+ /** The layer's points. */
3265
+ data: T[];
3266
+ }
3267
+
3268
+ declare interface SeriesRenderContext {
3269
+ scope: BitmapCoordinateSpace;
3270
+ timeScale: XScale;
3271
+ yScale: YScale;
3272
+ theme: ChartTheme;
3273
+ dataInterval: number;
3274
+ /** Vertical padding in **CSS pixels** — see {@link RenderPadding}. */
3275
+ padding: RenderPadding;
3276
+ /**
3277
+ * Engine-owned animation state — pulse phase, live values, entry
3278
+ * progress. Optional during the Phase 2 migration: renderers that
3279
+ * haven't been ported yet keep reading their own state and ignore this.
3280
+ */
3281
+ state?: AnimationState;
3282
+ /**
3283
+ * The id under which the chart registered this series — used by
3284
+ * stateful per-series lookups (`state.pulsePhase.get(seriesId)`,
3285
+ * `state.seriesAlpha.get(seriesId)`).
3286
+ */
3287
+ seriesId?: string;
3288
+ }
3289
+
3290
+ /**
3291
+ * Every series renderer is one of these. Discriminated on `kind`: narrow with
3292
+ * `kind === 'pie'` (or `!== 'pie'`) to reach the variant-specific surface.
3293
+ */
3294
+ declare type SeriesRenderer = TimeSeriesRenderer | PieSeriesRenderer;
3295
+
2597
3296
  /**
2598
3297
  * Frozen, per-row snapshot of a series at a single point in time. The shape
2599
3298
  * `buildHoverSnapshots` / `buildLastSnapshots` return to overlay slot
@@ -2667,6 +3366,8 @@ export declare interface ThemeConfig {
2667
3366
  };
2668
3367
  line?: Partial<ChartTheme['line']>;
2669
3368
  seriesColors?: string[];
3369
+ bar?: Partial<NonNullable<ChartTheme['bar']>>;
3370
+ pie?: Partial<NonNullable<ChartTheme['pie']>>;
2670
3371
  bands?: Partial<ChartTheme['bands']>;
2671
3372
  crosshair?: Partial<ChartTheme['crosshair']>;
2672
3373
  axis?: Partial<ChartTheme['axis']>;
@@ -2730,7 +3431,7 @@ declare interface TickTrackerSnapshot {
2730
3431
  readonly isAnimating: boolean;
2731
3432
  }
2732
3433
 
2733
- export declare const TimeAxis: DefineComponent<__VLS_Props_12, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_12> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
3434
+ export declare const TimeAxis: DefineComponent<__VLS_Props_14, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_14> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
2734
3435
  containerRef: HTMLDivElement;
2735
3436
  }, HTMLDivElement>;
2736
3437
 
@@ -2745,6 +3446,67 @@ export declare type TimePointInput = Omit<TimePoint, 'time'> & {
2745
3446
  time: TimeValue;
2746
3447
  };
2747
3448
 
3449
+ export declare const TimeRegion: DefineComponent<__VLS_Props_15, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_15> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
3450
+
3451
+ /**
3452
+ * A translucent vertical band shading the interval `[from, to]` — Grafana's
3453
+ * "annotation region", TradingView's highlighted session, an SRE anomaly
3454
+ * window. Regions live outside the series model: they never affect the Y-range
3455
+ * autoscale, tooltips, or the legend. Drawn on the main layer *behind* the
3456
+ * series so the data reads on top of the shading, clipped to the plot area.
3457
+ */
3458
+ export declare interface TimeRegionConfig {
3459
+ /** Left edge — epoch ms or a `Date`. Normalized on the way in. */
3460
+ from: TimeValue;
3461
+ /**
3462
+ * Right edge — epoch ms or a `Date`. Omit (or pass `'now'`) for an open-ended
3463
+ * region that extends to the right edge of the plot — the "still firing" case.
3464
+ */
3465
+ to?: TimeRegionEnd;
3466
+ /** Band fill — any CSS color, typically translucent. Default: a faint tint of `color`. */
3467
+ fill?: string;
3468
+ /** Optional text label drawn in a pill at the top of the band. */
3469
+ label?: string;
3470
+ /** Edge-line and label-pill accent. Default: the theme's muted axis text color. */
3471
+ color?: string;
3472
+ }
3473
+
3474
+ /**
3475
+ * Right edge of a {@link TimeRegionConfig}. A concrete time closes the band;
3476
+ * `'now'` (or an omitted `to`) leaves it open-ended — it extends to the right
3477
+ * edge of the plot, the "still firing" case.
3478
+ */
3479
+ export declare type TimeRegionEnd = TimeValue | 'now';
3480
+
3481
+ /**
3482
+ * A renderer with a time axis (Candlestick, Line, Bar). Owns its data and
3483
+ * answers the time-series queries directly — Chart never reaches into a store.
3484
+ * Multi-layer renderers (Line, Bar) aggregate across their layers internally;
3485
+ * `getLastDataPoint` / `getSecondLastDataPoint` / `getVisibleDataPoints` are
3486
+ * pinned to layer 0 (see {@link BaseMultiLayerSeries}).
3487
+ */
3488
+ declare interface TimeSeriesRenderer extends BaseSeriesRenderer {
3489
+ readonly kind: 'candlestick' | 'line' | 'bar';
3490
+ /** Earliest/latest sample time across all owned layers, or null when empty. */
3491
+ getTimeBounds(): {
3492
+ first: number;
3493
+ last: number;
3494
+ } | null;
3495
+ /** Last data point (layer 0 for multi-layer), or null when empty. */
3496
+ getLastDataPoint(): OHLCData | TimePoint | null;
3497
+ /** Second-to-last data point (layer 0 for multi-layer), or null. */
3498
+ getSecondLastDataPoint(): OHLCData | TimePoint | null;
3499
+ /** First `maxCount` sample times from the first populated layer — feeds interval detection. */
3500
+ sampleTimes(maxCount: number): number[];
3501
+ /** Visible points in `[from, to]` (layer 0 for multi-layer). */
3502
+ getVisibleDataPoints(from: number, to: number): readonly (OHLCData | TimePoint)[];
3503
+ /** Effective min/max for auto-range (stacked totals for multi-layer; raw min/max otherwise). */
3504
+ getValueRange(from: number, to: number): {
3505
+ min: number;
3506
+ max: number;
3507
+ } | null;
3508
+ }
3509
+
2748
3510
  /**
2749
3511
  * Accepted time input: a timestamp in **milliseconds** (like `Date.now()`) or a `Date` object.
2750
3512
  * `Date` values are converted to milliseconds internally via `Date.getTime()`.
@@ -2892,6 +3654,15 @@ export declare function useVisibleRange(chart: ChartInstance): Ref<VisibleRange>
2892
3654
 
2893
3655
  export declare function useYRange(chart: ChartInstance): Ref<YRange>;
2894
3656
 
3657
+ /**
3658
+ * A color, or a function of a datum's value → color. The function form is
3659
+ * evaluated per element — per bar in a bar series, per segment in a line — so
3660
+ * one layer can paint by sign / threshold (e.g. `v => v >= 0 ? up : down`)
3661
+ * without any extra option. Used both for the per-layer `data` override and the
3662
+ * theme's default bar color.
3663
+ */
3664
+ declare type ValueColor = string | ((value: number) => string);
3665
+
2895
3666
  /**
2896
3667
  * Default value formatters used across the chart library.
2897
3668
  *
@@ -3006,7 +3777,7 @@ declare class XScale {
3006
3777
  private countTicks;
3007
3778
  }
3008
3779
 
3009
- export declare const YAxis: DefineComponent<__VLS_Props_15, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_15> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
3780
+ export declare const YAxis: DefineComponent<__VLS_Props_18, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_18> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
3010
3781
  containerRef: HTMLDivElement;
3011
3782
  }, HTMLDivElement>;
3012
3783