@wick-charts/vue 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,20 +2,23 @@
2
2
 
3
3
  <!-- Generated from README.tmpl.md — edit the template, not this file. -->
4
4
 
5
- High-performance timeseries charts for **React**, **Vue**, and **Svelte**. Canvas-rendered, tree-shakeable, ~36KB gzipped when tree-shaken.
5
+ [![codecov](https://codecov.io/gh/mo4islona/wick-charts/branch/main/graph/badge.svg)](https://codecov.io/gh/mo4islona/wick-charts) [![license](https://img.shields.io/github/license/mo4islona/wick-charts.svg)](./LICENSE)
6
+ [![npm @wick-charts/vue](https://img.shields.io/npm/v/@wick-charts/vue.svg?label=%40wick-charts%2Fvue)](https://www.npmjs.com/package/@wick-charts/vue)
6
7
 
7
- [Live Demo](https://mo4islona.github.io/wick-charts/)
8
+ High-performance timeseries charts for **React**, **Vue**, and **Svelte**. Canvas-rendered, tree-shakeable, zero runtime dependencies.
9
+
10
+ [Live Demo](https://mo4islona.github.io/wick-charts/) · [Docs](https://mo4islona.github.io/wick-charts/#/api/chart-container)
8
11
 
9
12
  ## Features
10
13
 
11
- - **Candlestick, Line, Bar, Pie** — all from one package
12
- - **Real-time streaming** — append/update data at 60fps
13
- - **22 built-in themes** — dark, light, and custom
14
+ - **Candlestick, Line, Bar, Pie, Sparkline** — all from one package
15
+ - **Real-time streaming** — append/update at 60fps with coordinated animations
16
+ - **22 built-in themes** plus `createTheme()` for custom palettes
14
17
  - **Interactive** — zoom, pan, crosshair, tooltips
15
18
  - **Stacking** — normal and percent modes for line/bar
16
- - **Custom-render helpers** — `buildHoverSnapshots` / `buildLastSnapshots` / `computeTooltipPosition` for overlays that need to escape the built-in UI (structural-equality cache included)
19
+ - **Custom-render slots** — keep the built-in positioning, replace the contents
17
20
  - **Tree-shakeable** — import only what you use
18
- - **Zero dependencies** — just your framework
21
+ - **Zero runtime dependencies** — just your framework
19
22
 
20
23
  ## Install
21
24
 
@@ -46,150 +49,23 @@ const props = defineProps(['data']);
46
49
  </template>
47
50
  ```
48
51
 
49
- ## Series Types
50
-
51
- | Component | Data Format | Description |
52
- |---|---|---|
53
- | `CandlestickSeries` | `{ time, open, high, low, close, volume? }[]` | OHLC candlesticks with volume bars |
54
- | `LineSeries` | `{ time, value }[][]` | Line/area charts, multi-layer, stacking |
55
- | `BarSeries` | `{ time, value }[][]` | Histogram/bar charts, stacking |
56
- | `PieSeries` | `{ label, value, color? }[]` | Pie and donut charts |
57
-
58
- ## UI Overlays
59
-
60
- Every DOM overlay ships a default UI **and** a scoped slot / render-prop so you can replace the contents with your own layout. Positioning, crosshair wiring, and data computation stay in the library — the slot just hands you the already-computed data.
61
-
62
- | Component | Description | Slot ctx |
63
- |---|---|---|
64
- | `Tooltip` | Floating glass tooltip near cursor on hover | `{ snapshots, time }` |
65
- | `InfoBar` | Compact OHLC / values info bar hoisted above the canvas | `{ snapshots, time, isHover }` |
66
- | `Title` | Chart title / subtitle bar hoisted above the canvas | — |
67
- | `Crosshair` | Axis labels at cursor position | — |
68
- | `YAxis` | Vertical price/value axis with animated ticks | — |
69
- | `TimeAxis` | Horizontal time axis with animated ticks | — |
70
- | `YLabel` | Floating price badge with dashed line | `{ value, y, bgColor, isLive, direction, format }` |
71
- | `Legend` | Clickable legend with toggle/isolate modes | `{ items: LegendItem[] }` |
72
- | `PieTooltip` | Tooltip for pie/donut hover | `{ info, format }` |
73
- | `PieLegend` | Slice labels with values or percentages | `{ slices, mode, format }` |
74
-
75
- ## Custom render (slots / render-props)
76
-
77
- ```vue
78
- <!-- Vue — same context, different syntax -->
79
- <Tooltip v-slot="{ snapshots, time }">
80
- <div
81
- v-for="s in snapshots.filter((x) => x.seriesId === 'btc' || x.seriesId === 'eth')"
82
- :key="s.id"
83
- :style="{ color: s.color }"
84
- >
85
- {{ s.label }}: {{ s.data.close ?? s.data.value }}
86
- </div>
87
- </Tooltip>
88
- ```
89
-
90
- Each overlay has its own slot context (see the Slot ctx column above); the shape is consistent across frameworks for the same overlay.
91
-
92
- ### Public helpers (re-exported from each framework package)
93
-
94
- - `buildHoverSnapshots(chart, { time, sort?, cacheKey })` / `buildLastSnapshots(chart, { sort?, cacheKey })` — structural-equality-cached snapshot arrays for building your own floating widgets. Calls with the same args return the **same reference** while the chart's overlay version is unchanged, so `React.memo` / Vue `computed` / Svelte `$:` skip renders on no-op mousemoves.
95
- - `computeTooltipPosition({ x, y, chartWidth, chartHeight, tooltipWidth, tooltipHeight, offsetX?, offsetY? })` — flip + clamp positioning for a tooltip container you own.
96
- - Types: `SeriesSnapshot`, `LegendItem`, `SliceInfo`, `HoverInfo`.
97
-
98
- ## Custom number formatting
99
-
100
- Every numeric overlay accepts a `format` prop so you can override the default label rendering. Two shared helpers ship in each framework package (`@wick-charts/react`, `@wick-charts/vue`, `@wick-charts/svelte`):
101
-
102
- - `formatCompact(v)` — K/M/B/T suffixes with adaptive precision. Default for `YAxis` (at ranges ≥ 1e6), `PieLegend`, `PieTooltip`, `Sparkline`.
103
- - `formatPriceAdaptive(v)` — full-precision display that scales decimals to the value's magnitude. Default for `Tooltip` / `InfoBar` OHLC and line-value cells. Handles sub-cent prices (`0.00001234` → `"0.00001234"`, not `"0.00"`).
104
-
105
- ```vue
106
- <script setup>
107
- import { Tooltip, YAxis, formatCompact } from '@wick-charts/vue';
108
-
109
- const yFormat = (v) => `$${formatCompact(v)}`;
110
- const tipFormat = (v, field) => (field === 'volume' ? formatCompact(v) : v.toFixed(4));
111
- </script>
112
-
113
- <template>
114
- <YAxis :format="yFormat" />
115
- <Tooltip :format="tipFormat" />
116
- </template>
117
- ```
118
-
119
- Tooltip / InfoBar pass a `field` arg (`'open' | 'high' | 'low' | 'close' | 'volume' | 'value'`) so you can branch on which cell you're formatting. All other overlays receive a single `value: number`.
52
+ ## API
120
53
 
121
- ## Themes
54
+ Every component, prop, type, and slot context lives in the docs site:
122
55
 
123
- 22 built-in themes. Import only the ones you need (tree-shakable) and pass them to `ChartContainer` or `ThemeProvider` for global theming.
56
+ [mo4islona.github.io/wick-charts/#/api/chart-container](https://mo4islona.github.io/wick-charts/#/api/chart-container)
124
57
 
125
- ```vue
126
- <script setup>
127
- import { catppuccin } from '@wick-charts/vue';
128
- // Dark: andromeda, ayuMirage, catppuccin, dracula, gruvbox, highContrast,
129
- // materialPalenight, monokaiPro, nightOwl, oneDarkPro, panda
130
- // Light: githubLight, handwritten, lavenderMist, lightPink, minimalLight, mintBreeze,
131
- // peachCream, quietLight, rosePineDawn, sandDune, solarizedLight
132
- </script>
133
-
134
- <template>
135
- <ChartContainer :theme="catppuccin.theme" />
136
- </template>
137
- ```
138
-
139
- Create custom themes with `createTheme()`:
140
-
141
- ```ts
142
- import { createTheme } from '@wick-charts/vue';
143
-
144
- const myTheme = createTheme({
145
- background: '#1a1b2e',
146
- candlestick: {
147
- up: { body: '#00d4aa' },
148
- down: { body: '#ff5577' },
149
- },
150
- axis: { textColor: '#8888aa' },
151
- });
152
- ```
153
-
154
- ## Real-Time Data
155
-
156
- ```vue
157
- <template>
158
- <!-- Full replace (initial load) -->
159
- <CandlestickSeries :data="allCandles" />
160
- </template>
161
-
162
- <!--
163
- The component auto-detects changes:
164
- - data.length grew by 1-5 → append
165
- - data.length same → update last point
166
- - data.length shrunk or grew by >5 → full replace
167
- -->
168
- ```
169
-
170
- ## Configuration
171
-
172
- ```vue
173
- <template>
174
- <ChartContainer
175
- :theme="theme"
176
- :axis="{
177
- y: { visible: true, width: 55, min: 0, max: 'auto' },
178
- x: { visible: true, height: 30 },
179
- }"
180
- />
181
- </template>
182
-
183
- <!-- Vue ChartContainer currently accepts theme + axis; padding/gradient/grid/interactive are React-only. -->
184
- ```
58
+ Start there for [ChartContainer](https://mo4islona.github.io/wick-charts/#/api/chart-container), then drill into the series ([Candlestick](https://mo4islona.github.io/wick-charts/#/api/candlestick-series), [Line](https://mo4islona.github.io/wick-charts/#/api/line-series), [Bar](https://mo4islona.github.io/wick-charts/#/api/bar-series), [Pie](https://mo4islona.github.io/wick-charts/#/api/pie-series), [Sparkline](https://mo4islona.github.io/wick-charts/#/api/sparkline)) and overlays ([Tooltip](https://mo4islona.github.io/wick-charts/#/api/tooltip), [InfoBar](https://mo4islona.github.io/wick-charts/#/api/info-bar), [Crosshair](https://mo4islona.github.io/wick-charts/#/api/crosshair), [Legend](https://mo4islona.github.io/wick-charts/#/api/legend), [YAxis](https://mo4islona.github.io/wick-charts/#/api/y-axis), [XAxis](https://mo4islona.github.io/wick-charts/#/api/x-axis), [Navigator](https://mo4islona.github.io/wick-charts/#/api/navigator), …).
185
59
 
186
- ## Bundle Size
60
+ ## Bundle size
187
61
 
188
- Full `dist/index.js` (minified + gzipped):
62
+ Tree-shaken React scenarios via `pnpm size` (esbuild, minified, browser target, React/ReactDOM external):
189
63
 
190
- | Package | Raw | Gzip |
191
- |---|---|---|
192
- | `@wick-charts/vue` | 219 KB | 57.3 KB |
64
+ | Scenario | Raw | Gzip | Brotli |
65
+ |---|---:|---:|---:|
66
+ | Candlestick only | 147 KB | 44 KB | 38 KB |
67
+ | Line only | 147 KB | 44 KB | 38 KB |
68
+ | Full React | 164 KB | 49 KB | 41 KB |
193
69
 
194
70
  ## Migration
195
71
 
package/dist/index.d.ts CHANGED
@@ -165,6 +165,19 @@ declare type __VLS_Props_3 = {
165
165
  * - `'inline'`: flex siblings above the canvas — the canvas (and grid) shift down.
166
166
  */
167
167
  headerLayout?: 'overlay' | 'inline';
168
+ /**
169
+ * Chart-level animation configuration. See `AnimationsConfig` for the full shape.
170
+ *
171
+ * Two layers — chart-level (this prop) sets defaults for every series; per-series
172
+ * options on `<LineSeries>`/`<CandlestickSeries>`/`<BarSeries>` override that
173
+ * default for that one series.
174
+ *
175
+ * Shorthands: `true` / omitted — built-in defaults; `false` — disables every
176
+ * animation category; `{ points: false }` / `{ viewport: false }` disables a
177
+ * category. Updating this prop calls `chart.setAnimations(...)` so the new
178
+ * durations take effect on the next animation / render.
179
+ */
180
+ animations?: boolean | AnimationsConfig;
168
181
  /**
169
182
  * Enable runtime performance instrumentation. Off by default. Read at mount only;
170
183
  * later changes are ignored.
@@ -445,39 +458,67 @@ declare type __VLS_WithTemplateSlots_8<T, S> = T & {
445
458
  export declare const andromeda: ThemePreset;
446
459
 
447
460
  /**
448
- * Chart-level animation configuration. Split into two independent domains so
449
- * per-series defaults can't bleed into viewport-interaction timings:
461
+ * Chart-level animation configuration. Two independent domains so per-series
462
+ * defaults can't bleed into viewport-interaction timings.
463
+ *
464
+ * **Two layers — chart-level vs per-series.** The same data-animation knobs
465
+ * live on both layers; remember which is which:
450
466
  *
451
- * - `points` — animations applied to data: per-series entrance tween, live-
452
- * tracking smoothing of the last candle/bar/line value, pulse cadence.
453
- * These values act as defaults for each series. Per-series options always
454
- * win unless the chart-level category is explicitly `false`, in which case
455
- * the whole category is forced off.
467
+ * | Field | Chart-level (here) | Per-series option |
468
+ * | ----- | ------------------ | ----------------- |
469
+ * | Entry duration | {@link AnimationsConfig.points}`.enterMs` | `<XSeries options={{ entryMs }}>` (canonical name; `enterMs` is a `@deprecated` alias) |
470
+ * | Live smoothing | `points.smoothMs` | `options={{ smoothMs }}` |
471
+ * | Line pulse period | `points.pulseMs` | `<LineSeries options={{ pulseMs }}>` |
456
472
  *
457
- * - `viewport` — animations applied to viewport interactions: post-gesture
458
- * rebound duration and Y-axis range smoothing.
473
+ * Resolution: per-series option **wins** (it's the override). The chart-
474
+ * level field acts as the default for every series that didn't set its own
475
+ * override — *except* when the chart-level category is explicitly `false`,
476
+ * which is a hard disable that overrides per-series too.
459
477
  *
460
- * User-initiated pan/zoom (wheel, drag, touch) always applies instantly. The
461
- * latency of an exponential chase reads as laggy in practice. API-driven
462
- * transitions (`fitToData`, `scrollToEnd`) and post-gesture rebound still
463
- * tween via their own fixed-duration ease-out.
478
+ * - `points` — applied to data: entrance tween, live-tracking smoothing of
479
+ * the last candle/bar/line value, line pulse cadence.
480
+ * - `viewport` — applied to viewport interactions: post-gesture rebound,
481
+ * Y-axis range chase, optional per-event ease for pan/zoom. Has no
482
+ * per-series equivalent — these are chart-level only.
483
+ *
484
+ * All settling animations share a 250 ms default so the X re-fit, Y range
485
+ * update, and last-bar live-track all settle on the same frame on a
486
+ * streaming tick. Pulse cycle period (600 ms) and `inputResponseMs` (0,
487
+ * opt-in) keep their own values.
464
488
  */
465
489
  declare interface AnimationsConfig {
466
490
  /**
467
491
  * Data-series animations. `false` disables every point animation (entrance,
468
- * live-smoothing, pulse) across every series. An object overrides individual
469
- * categories; omitted fields fall back to the built-in defaults.
492
+ * live-smoothing, pulse) across every series — overrides any per-series
493
+ * option set on the same fields. An object overrides individual categories;
494
+ * omitted fields fall back to the built-in defaults.
495
+ *
496
+ * Per-series options (`<LineSeries options={{ entryMs, smoothMs, pulseMs }}>`)
497
+ * win over chart-level numeric values. The chart-level field becomes the
498
+ * default for series that don't set their own.
470
499
  */
471
500
  points?: false | {
472
- /** Per-point entrance duration (ms). `false`/`0` disables. Default: 400. */
501
+ /**
502
+ * Per-point entrance duration (ms). Default: 250.
503
+ * Per-series equivalent: `<XSeries options={{ entryMs }}>` (note the
504
+ * `y` — chart-level uses `enterMs`, per-series uses `entryMs` for
505
+ * historical reasons; both refer to the same animation). `false` /
506
+ * `0` disables.
507
+ */
473
508
  enterMs?: AnimationTime;
474
509
  /**
475
- * Exponential-smoothing time constant (ms) for live last-value chase.
476
- * `false`/`0` disables smoothing — the last point snaps to the target.
477
- * Default: 70 ms (equivalent to the legacy `liveSmoothRate = 14`).
510
+ * Live-value chase duration (ms) for the displayed last point on
511
+ * `updateData` ticks. Animator-driven cubic ease — after this many ms
512
+ * with no new updates, the displayed value reaches exactly the
513
+ * actual last value. Default: 250. Per-series equivalent:
514
+ * `options={{ smoothMs }}`. `false` / `0` snaps.
478
515
  */
479
516
  smoothMs?: AnimationTime;
480
- /** Pulse cycle period (ms) for the line last-point halo. Default: 600. */
517
+ /**
518
+ * Pulse cycle period (ms) for the line last-point halo — periodic,
519
+ * not a one-shot transition. Default: 600. Per-series equivalent:
520
+ * `<LineSeries options={{ pulseMs }}>`. `false` / `0` disables.
521
+ */
481
522
  pulseMs?: AnimationTime;
482
523
  };
483
524
  /**
@@ -488,15 +529,33 @@ declare interface AnimationsConfig {
488
529
  /** Rebound (snap-back) duration after pan/zoom overshoot (ms). Default: 350. */
489
530
  reboundMs?: AnimationTime;
490
531
  /**
491
- * Y-axis range transition scale. **Frame-count-based, calibrated at
492
- * 60 Hz — not wall-clock ms.** Each render frame closes
493
- * `min(1, 16 / yAxisMs)` of the remaining gap. Default 80 ≈ the
494
- * legacy 0.2-per-frame closure. `false` / `0` snaps the Y range
495
- * instantly. Unlike `smoothMs` / `entryMs` / `reboundMs`, the
496
- * perceptual duration scales with frame time on refresh rates far
497
- * from 60 Hz.
532
+ * Y-axis range transition duration in wall-clock milliseconds. The Y
533
+ * min and max each ride their own {@link Animator} that retargets on
534
+ * data updates and eases toward the new bound over this many ms.
535
+ * Default `250` (shares the lockstep-arrival budget with viewport and
536
+ * live-track). Inward contraction always eases. Outward expansion
537
+ * eases when the per-point entrance is enabled (the entering candle's
538
+ * fade masks the brief overshoot); when entrance is hard-disabled
539
+ * (`points.enterMs === 0`), Y bounds snap outward to keep new
540
+ * highs/lows from clipping at the canvas edge. `false` / `0` snaps
541
+ * the Y range instantly on every update.
498
542
  */
499
543
  yAxisMs?: AnimationTime;
544
+ /**
545
+ * Per-event ease applied to user pan/zoom commits. Logical state
546
+ * advances synchronously (gesture math, edge detection, autoscroll
547
+ * all read the committed target); the visual range eases over this
548
+ * duration so back-to-back wheel/trackpad events interpolate
549
+ * smoothly through the same animator.
550
+ *
551
+ * Default `0` (instant-apply, matches the long-standing pre-Phase-5
552
+ * behaviour). Opt in via `inputResponseMs: 60` for an eased pan/zoom
553
+ * feel — the default is conservative because the animated visual
554
+ * range diverges from the committed target until the ease completes,
555
+ * and existing consumers reading `chart.getVisibleRange()`
556
+ * synchronously after a wheel/pan expect the new value.
557
+ */
558
+ inputResponseMs?: AnimationTime;
500
559
  };
501
560
  }
502
561
 
@@ -590,12 +649,24 @@ export declare interface BarSeriesOptions {
590
649
  /** @deprecated Use {@link entryAnimation} instead. */
591
650
  enterAnimation?: BarEntryAnimation;
592
651
  /**
593
- * Entrance animation duration in milliseconds. `false` or `0` disables the
594
- * per-bar entrance (equivalent to `entryAnimation: 'none'`). Omit to inherit
595
- * from {@link AnimationsConfig.points}.`entryMs` (default 400).
652
+ * Per-bar entrance duration in milliseconds. Default: `250`.
653
+ *
654
+ * ```
655
+ * // Override for one series:
656
+ * <BarSeries options={{ entryMs: 600 }} data={data} />
657
+ *
658
+ * // Or set the default for every series at once:
659
+ * <ChartContainer animations={{ points: { enterMs: 600 } }}>
660
+ * <BarSeries data={data} />
661
+ * </ChartContainer>
662
+ * ```
663
+ *
664
+ * Note: chart-level uses `enterMs`, per-series uses `entryMs` — same
665
+ * animation, two names for historical reasons.
596
666
  *
597
- * When `animations.points.entryMs` is `false` at the chart level, the
598
- * entrance is forced off regardless of this field.
667
+ * `false` or `0` disables the entrance (equivalent to
668
+ * `entryAnimation: 'none'`). A chart-level `animations.points: false` is a
669
+ * hard disable that wins over this field.
599
670
  *
600
671
  * @see BarSeriesOptions.entryAnimation
601
672
  */
@@ -603,13 +674,22 @@ export declare interface BarSeriesOptions {
603
674
  /** @deprecated Use {@link entryMs} instead. */
604
675
  enterMs?: number | false;
605
676
  /**
606
- * Exponential-smoothing time constant (ms) for live-tracking the last
607
- * bar's value under `updateLastPoint`. `0` or `false` snaps directly to the
608
- * target (no smoothing). Omit to inherit from
609
- * {@link AnimationsConfig.points}.`smoothMs` (default 70 ms).
677
+ * How long the displayed bar value takes to catch up to the actual one
678
+ * on every `updateLastPoint`. Default: `250` ms.
610
679
  *
611
- * When `animations.points.smoothMs` is `false` at the chart level, smoothing
612
- * is forced off regardless of this field.
680
+ * ```
681
+ * // Per-series override:
682
+ * <BarSeries options={{ smoothMs: 100 }} data={data} />
683
+ *
684
+ * // Chart-level default:
685
+ * <ChartContainer animations={{ points: { smoothMs: 100 } }}>
686
+ * <BarSeries data={data} />
687
+ * </ChartContainer>
688
+ * ```
689
+ *
690
+ * `0` or `false` snaps the displayed value to the target on every tick
691
+ * (no smoothing). A chart-level `animations.points: false` is a hard
692
+ * disable that wins over this field.
613
693
  */
614
694
  smoothMs?: number | false;
615
695
  }
@@ -707,12 +787,24 @@ export declare interface CandlestickSeriesOptions {
707
787
  /** @deprecated Use {@link entryAnimation} instead. */
708
788
  enterAnimation?: CandlestickEntryAnimation;
709
789
  /**
710
- * Entrance animation duration in milliseconds. `false` or `0` disables the
711
- * per-candle entrance (equivalent to `entryAnimation: 'none'`). Omit to
712
- * inherit from {@link AnimationsConfig.points}.`entryMs` (default 400).
790
+ * Per-candle entrance duration in milliseconds. Default: `250`.
791
+ *
792
+ * ```
793
+ * // Override for one series:
794
+ * <CandlestickSeries options={{ entryMs: 600 }} data={data} />
795
+ *
796
+ * // Or set the default for every series at once:
797
+ * <ChartContainer animations={{ points: { enterMs: 600 } }}>
798
+ * <CandlestickSeries data={data} />
799
+ * </ChartContainer>
800
+ * ```
801
+ *
802
+ * Note: chart-level uses `enterMs`, per-series uses `entryMs` — same
803
+ * animation, two names for historical reasons.
713
804
  *
714
- * When `animations.points.entryMs` is `false` at the chart level, the
715
- * entrance is forced off regardless of this field.
805
+ * `false` or `0` disables the entrance (equivalent to
806
+ * `entryAnimation: 'none'`). A chart-level `animations.points: false` is a
807
+ * hard disable that wins over this field.
716
808
  *
717
809
  * @see CandlestickSeriesOptions.entryAnimation
718
810
  */
@@ -720,13 +812,22 @@ export declare interface CandlestickSeriesOptions {
720
812
  /** @deprecated Use {@link entryMs} instead. */
721
813
  enterMs?: number | false;
722
814
  /**
723
- * Exponential-smoothing time constant (ms) for live-tracking the last
724
- * candle's O/H/L/C under `updateLastPoint`. `0` or `false` snaps directly
725
- * to the target (no smoothing). Omit to inherit from
726
- * {@link AnimationsConfig.points}.`smoothMs` (default 70 ms).
815
+ * How long the displayed OHLC takes to catch up to the actual last value
816
+ * on every `updateLastPoint`. Default: `250` ms.
727
817
  *
728
- * When `animations.points.smoothMs` is `false` at the chart level, smoothing
729
- * is forced off regardless of this field.
818
+ * ```
819
+ * // Per-series override:
820
+ * <CandlestickSeries options={{ smoothMs: 100 }} data={data} />
821
+ *
822
+ * // Chart-level default:
823
+ * <ChartContainer animations={{ points: { smoothMs: 100 } }}>
824
+ * <CandlestickSeries data={data} />
825
+ * </ChartContainer>
826
+ * ```
827
+ *
828
+ * `0` or `false` snaps the displayed value to the target on every tick
829
+ * (no smoothing). A chart-level `animations.points: false` is a hard
830
+ * disable that wins over this field.
730
831
  */
731
832
  smoothMs?: number | false;
732
833
  }
@@ -944,6 +1045,25 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> {
944
1045
  * a wrapper re-applies padding reactively (e.g. in response to a Title /
945
1046
  * InfoBar ResizeObserver).
946
1047
  */
1048
+ /**
1049
+ * Replace the chart-level animation configuration at runtime. Updates the
1050
+ * resolved durations and propagates them to every dependent subsystem:
1051
+ *
1052
+ * - viewport: reboundMs (next rebound), inputResponseMs (next pan/zoom).
1053
+ * - per-frame: yAxisMs (next render).
1054
+ * - existing series: only the **hard-disable** signal (0 / false) is pushed
1055
+ * into renderers — that's the documented contract on
1056
+ * {@link AnimationsConfig.points}, "chart-level `false` wins over per-
1057
+ * series". Numeric chart-level changes update the default for *new*
1058
+ * series but leave existing per-series overrides intact, which avoids
1059
+ * silently clobbering custom values on every prop update from a React
1060
+ * wrapper.
1061
+ *
1062
+ * In-flight animations are NOT cancelled — the new durations apply to the
1063
+ * next animation that fires. To force-snap the current animation, call
1064
+ * the relevant API explicitly (e.g. `setRange`) afterwards.
1065
+ */
1066
+ setAnimations(animations: ChartOptions['animations']): void;
947
1067
  setPadding(padding: ChartOptions['padding']): void;
948
1068
  /** Show or hide the background grid. Takes effect on the next render frame. */
949
1069
  setGrid(grid: {
@@ -972,6 +1092,17 @@ export declare class ChartInstance extends EventEmitter<ChartEvents> {
972
1092
  private getDataBounds;
973
1093
  private onDataChanged;
974
1094
  private updateDataInterval;
1095
+ /**
1096
+ * Sample data inside `targetVisible` and return the unbounded [min, max] of
1097
+ * the visible series, or `null` when nothing is in view. Bounds are NOT
1098
+ * applied here — the caller composes them via {@link resolveBound}.
1099
+ *
1100
+ * `targetVisible` is the X *destination* (logicalRange), not the animating
1101
+ * current. Sampling against a moving X would make Y chase a definition of
1102
+ * "in view" that shifts every frame; passing the destination explicitly
1103
+ * keeps Y on a stable target so X and Y converge together.
1104
+ */
1105
+ private computeTargetYRange;
975
1106
  private updateYRange;
976
1107
  /** Resolve an {@link AxisBound} to a concrete numeric value. */
977
1108
  private resolveBound;
@@ -1279,6 +1410,13 @@ export declare interface CrosshairPosition {
1279
1410
  y: number;
1280
1411
  }
1281
1412
 
1413
+ /**
1414
+ * @deprecated Use a named preset instead — `catppuccin.theme` is the new
1415
+ * default dark palette, and `dracula`, `nightOwl`, `oneDarkPro`, `gruvbox`,
1416
+ * `monokaiPro`, `materialPalenight`, or `panda` cover the rest of the
1417
+ * dark spectrum. `darkTheme` is kept as an alias for the previous default
1418
+ * and will be removed in a future major release.
1419
+ */
1282
1420
  export declare const darkTheme: ChartTheme;
1283
1421
 
1284
1422
  export declare function detectInterval(times: number[]): number;
@@ -1414,6 +1552,13 @@ declare type LegendMode = 'toggle' | 'isolate' | 'solo';
1414
1552
 
1415
1553
  export declare const lightPink: ThemePreset;
1416
1554
 
1555
+ /**
1556
+ * @deprecated Use a named light preset instead — `quietLight`, `githubLight`,
1557
+ * `solarizedLight`, `minimalLight`, `peachCream`, `sandDune`, `lightPink`,
1558
+ * `lavenderMist`, `mintBreeze`, `rosePineDawn`, or `handwritten`. `lightTheme`
1559
+ * is kept as an alias for the previous default and will be removed in a
1560
+ * future major release.
1561
+ */
1417
1562
  export declare const lightTheme: ChartTheme;
1418
1563
 
1419
1564
  /** @deprecated Use {@link TimePoint} instead. */
@@ -1447,11 +1592,23 @@ export declare interface LineSeriesOptions {
1447
1592
  */
1448
1593
  pulse: boolean;
1449
1594
  /**
1450
- * Pulse cycle period in milliseconds. `false`/`0` disables the halo (both
1451
- * the drawing and the associated animation loop). Omit to inherit from
1452
- * {@link AnimationsConfig.points}.`pulseMs` (default 600 ms). When
1453
- * `animations.points.pulseMs` is `false` at the chart level the pulse is
1454
- * forced off regardless of this field.
1595
+ * Period of one halo pulse cycle in milliseconds. Continuous loop, not a
1596
+ * one-shot — short values pulse fast, long values pulse slowly. Default:
1597
+ * `600` (≈ 1.7 Hz, a calm "breathing" rhythm).
1598
+ *
1599
+ * ```
1600
+ * // Per-series override:
1601
+ * <LineSeries options={{ pulseMs: 1200 }} data={data} />
1602
+ *
1603
+ * // Chart-level default:
1604
+ * <ChartContainer animations={{ points: { pulseMs: 1200 } }}>
1605
+ * <LineSeries data={data} />
1606
+ * </ChartContainer>
1607
+ * ```
1608
+ *
1609
+ * `false` or `0` turns the halo off entirely (drawing and animation loop).
1610
+ * A chart-level `animations.points: false` is a hard disable that wins
1611
+ * over this field.
1455
1612
  */
1456
1613
  pulseMs?: number | false;
1457
1614
  /** Stacking mode. Default: 'off'. */
@@ -1467,12 +1624,24 @@ export declare interface LineSeriesOptions {
1467
1624
  /** @deprecated Use {@link entryAnimation} instead. */
1468
1625
  enterAnimation?: LineEntryAnimation;
1469
1626
  /**
1470
- * Entrance animation duration in milliseconds. `false` or `0` disables the
1471
- * per-point entrance (equivalent to `entryAnimation: 'none'`). Omit to
1472
- * inherit from {@link AnimationsConfig.points}.`entryMs` (default 400).
1627
+ * Per-point entrance duration in milliseconds. Default: `250`.
1473
1628
  *
1474
- * When `animations.points.entryMs` is `false` at the chart level, the
1475
- * entrance is forced off regardless of this field.
1629
+ * ```
1630
+ * // Override for one series:
1631
+ * <LineSeries options={{ entryMs: 600 }} data={data} />
1632
+ *
1633
+ * // Or set the default for every series at once:
1634
+ * <ChartContainer animations={{ points: { enterMs: 600 } }}>
1635
+ * <LineSeries data={data} />
1636
+ * </ChartContainer>
1637
+ * ```
1638
+ *
1639
+ * Note: chart-level uses `enterMs`, per-series uses `entryMs` — same
1640
+ * animation, two names for historical reasons.
1641
+ *
1642
+ * `false` or `0` disables the entrance (equivalent to
1643
+ * `entryAnimation: 'none'`). A chart-level `animations.points: false` is a
1644
+ * hard disable that wins over this field.
1476
1645
  *
1477
1646
  * @see LineSeriesOptions.entryAnimation
1478
1647
  */
@@ -1480,13 +1649,22 @@ export declare interface LineSeriesOptions {
1480
1649
  /** @deprecated Use {@link entryMs} instead. */
1481
1650
  enterMs?: number | false;
1482
1651
  /**
1483
- * Exponential-smoothing time constant (ms) for live-tracking the last
1484
- * point's value under `updateLastPoint`. `0` or `false` snaps directly to
1485
- * the target (no smoothing). Omit to inherit from
1486
- * {@link AnimationsConfig.points}.`smoothMs` (default 70 ms).
1652
+ * How long the displayed last value takes to catch up to the actual one
1653
+ * on every `updateLastPoint`. Default: `250` ms.
1654
+ *
1655
+ * ```
1656
+ * // Per-series override:
1657
+ * <LineSeries options={{ smoothMs: 100 }} data={data} />
1658
+ *
1659
+ * // Chart-level default:
1660
+ * <ChartContainer animations={{ points: { smoothMs: 100 } }}>
1661
+ * <LineSeries data={data} />
1662
+ * </ChartContainer>
1663
+ * ```
1487
1664
  *
1488
- * When `animations.points.smoothMs` is `false` at the chart level, smoothing
1489
- * is forced off regardless of this field.
1665
+ * `0` or `false` snaps the displayed value to the target on every tick
1666
+ * (no smoothing). A chart-level `animations.points: false` is a hard
1667
+ * disable that wins over this field.
1490
1668
  */
1491
1669
  smoothMs?: number | false;
1492
1670
  }