@wick-charts/vue 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -145
- package/dist/index.d.ts +229 -65
- package/dist/index.js +3072 -2756
- package/package.json +2 -2
- package/src/ChartContainer.vue +26 -0
- package/src/ui/TimeAxis.vue +1 -1
- package/src/ui/YAxis.vue +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wick-charts/vue",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "High-performance canvas timeseries charts for Vue — candlestick, line, bar, pie. Tree-shakeable, zero runtime deps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"vue": ">=3.3.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@wick-charts/core": "^0.3.
|
|
48
|
+
"@wick-charts/core": "^0.3.4"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "vite build"
|
package/src/ChartContainer.vue
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import {
|
|
3
|
+
type AnimationsConfig,
|
|
3
4
|
type AxisConfig,
|
|
4
5
|
ChartInstance,
|
|
5
6
|
type ChartOptions,
|
|
@@ -48,6 +49,19 @@ const props = withDefaults(
|
|
|
48
49
|
* - `'inline'`: flex siblings above the canvas — the canvas (and grid) shift down.
|
|
49
50
|
*/
|
|
50
51
|
headerLayout?: 'overlay' | 'inline';
|
|
52
|
+
/**
|
|
53
|
+
* Chart-level animation configuration. See `AnimationsConfig` for the full shape.
|
|
54
|
+
*
|
|
55
|
+
* Two layers — chart-level (this prop) sets defaults for every series; per-series
|
|
56
|
+
* options on `<LineSeries>`/`<CandlestickSeries>`/`<BarSeries>` override that
|
|
57
|
+
* default for that one series.
|
|
58
|
+
*
|
|
59
|
+
* Shorthands: `true` / omitted — built-in defaults; `false` — disables every
|
|
60
|
+
* animation category; `{ points: false }` / `{ viewport: false }` disables a
|
|
61
|
+
* category. Updating this prop calls `chart.setAnimations(...)` so the new
|
|
62
|
+
* durations take effect on the next animation / render.
|
|
63
|
+
*/
|
|
64
|
+
animations?: boolean | AnimationsConfig;
|
|
51
65
|
/**
|
|
52
66
|
* Enable runtime performance instrumentation. Off by default. Read at mount only;
|
|
53
67
|
* later changes are ignored.
|
|
@@ -138,6 +152,7 @@ onMounted(async () => {
|
|
|
138
152
|
if (props.interactive !== undefined) options.interactive = props.interactive;
|
|
139
153
|
if (props.grid !== undefined) options.grid = props.grid;
|
|
140
154
|
if (perfAtMount !== undefined) options.perf = perfAtMount;
|
|
155
|
+
if (props.animations !== undefined) options.animations = props.animations;
|
|
141
156
|
chart.value = new ChartInstance(containerRef.value, options);
|
|
142
157
|
|
|
143
158
|
await nextTick();
|
|
@@ -187,6 +202,17 @@ watch(
|
|
|
187
202
|
},
|
|
188
203
|
);
|
|
189
204
|
|
|
205
|
+
// Stringify the animations config so callers can pass a fresh object identity
|
|
206
|
+
// without thrashing animator state when nothing has actually changed.
|
|
207
|
+
watch(
|
|
208
|
+
() => JSON.stringify(props.animations),
|
|
209
|
+
() => {
|
|
210
|
+
if (chart.value && props.animations !== undefined) {
|
|
211
|
+
chart.value.setAnimations(props.animations);
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
);
|
|
215
|
+
|
|
190
216
|
// Re-apply padding on any input that affects it — including `headerExtra`,
|
|
191
217
|
// so a runtime `headerLayout` toggle re-runs even when `padding` is undefined
|
|
192
218
|
// (the default top=20 still needs the fold-in/out).
|
package/src/ui/TimeAxis.vue
CHANGED
package/src/ui/YAxis.vue
CHANGED