@wick-charts/vue 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +18 -3
  2. package/dist/BarSeries.vue.js +26 -20
  3. package/dist/CandlestickSeries.vue.js +30 -24
  4. package/dist/ChartContainer.vue.js +88 -65
  5. package/dist/HeatmapSeries.vue.js +40 -0
  6. package/dist/HeatmapSeries.vue2.js +4 -0
  7. package/dist/LineSeries.vue.js +26 -20
  8. package/dist/PieSeries.vue.js +24 -18
  9. package/dist/core/dist/animation/animator.js +21 -21
  10. package/dist/core/dist/animation/config.js +114 -87
  11. package/dist/core/dist/animation/easing.js +3 -1
  12. package/dist/core/dist/animation/intro-wave.js +68 -0
  13. package/dist/core/dist/axis/dom-labels.js +13 -14
  14. package/dist/core/dist/chart/badge-animator.js +56 -0
  15. package/dist/core/dist/chart/edge-indicators.js +28 -13
  16. package/dist/core/dist/chart/last-value.js +18 -17
  17. package/dist/core/dist/chart/y-target.js +13 -12
  18. package/dist/core/dist/chart.js +679 -452
  19. package/dist/core/dist/components/annotation-chip.js +28 -0
  20. package/dist/core/dist/components/edge-indicator.js +58 -26
  21. package/dist/core/dist/components/loading-indicator.js +46 -0
  22. package/dist/core/dist/components/marker.js +49 -31
  23. package/dist/core/dist/components/reference-line.js +27 -36
  24. package/dist/core/dist/components/time-region.js +30 -28
  25. package/dist/core/dist/data/store.js +38 -19
  26. package/dist/core/dist/data/sync.js +60 -38
  27. package/dist/core/dist/heatmap-tooltip.js +16 -0
  28. package/dist/core/dist/interactions/handler.js +67 -43
  29. package/dist/core/dist/perf/perf-hud.js +5 -5
  30. package/dist/core/dist/scales/x-scale.js +85 -37
  31. package/dist/core/dist/scales/y-scale.js +38 -27
  32. package/dist/core/dist/series/bar-intro.js +18 -0
  33. package/dist/core/dist/series/bar.js +337 -205
  34. package/dist/core/dist/series/base-multi-layer.js +224 -96
  35. package/dist/core/dist/series/candlestick-intro.js +57 -0
  36. package/dist/core/dist/series/candlestick.js +454 -276
  37. package/dist/core/dist/series/heatmap.js +387 -0
  38. package/dist/core/dist/series/line-intro.js +85 -0
  39. package/dist/core/dist/series/line.js +590 -282
  40. package/dist/core/dist/series/painters/builtins.js +2 -2
  41. package/dist/core/dist/series/pie.js +396 -259
  42. package/dist/core/dist/series/register-builtins.js +8 -7
  43. package/dist/core/dist/series/types.js +6 -0
  44. package/dist/core/dist/series/wave-intro.js +26 -0
  45. package/dist/core/dist/theme/create.js +69 -63
  46. package/dist/core/dist/theme/themes/mint-breeze.js +2 -2
  47. package/dist/core/dist/theme/themes/sand-dune.js +2 -2
  48. package/dist/core/dist/utils/color.js +109 -34
  49. package/dist/core/dist/utils/deep-equal.js +18 -0
  50. package/dist/core/dist/utils/time.js +25 -19
  51. package/dist/index.d.ts +1405 -123
  52. package/dist/index.js +177 -130
  53. package/dist/ui/Crosshair.vue.js +20 -21
  54. package/dist/ui/HeatmapTooltip.vue.js +96 -0
  55. package/dist/ui/HeatmapTooltip.vue2.js +4 -0
  56. package/dist/ui/InfoBar.vue.js +46 -47
  57. package/dist/ui/Legend.vue.js +80 -79
  58. package/dist/ui/PieLegend.vue.js +5 -5
  59. package/dist/ui/PieTooltip.vue.js +77 -67
  60. package/dist/ui/Tooltip.vue.js +60 -60
  61. package/dist/ui/YAxis.vue.js +2 -2
  62. package/dist/ui/YLabel.vue.js +94 -61
  63. package/package.json +2 -2
  64. package/src/BarSeries.vue +23 -7
  65. package/src/CandlestickSeries.vue +23 -7
  66. package/src/ChartContainer.vue +134 -12
  67. package/src/HeatmapSeries.vue +69 -0
  68. package/src/LineSeries.vue +23 -7
  69. package/src/PieSeries.vue +22 -6
  70. package/src/index.ts +84 -3
  71. package/src/ui/Crosshair.vue +1 -2
  72. package/src/ui/HeatmapTooltip.vue +144 -0
  73. package/src/ui/InfoBar.vue +1 -2
  74. package/src/ui/Legend.vue +13 -0
  75. package/src/ui/Marker.vue +1 -1
  76. package/src/ui/PieTooltip.vue +10 -0
  77. package/src/ui/ReferenceLine.vue +2 -2
  78. package/src/ui/TimeRegion.vue +2 -2
  79. package/src/ui/Tooltip.vue +2 -2
  80. package/src/ui/YLabel.vue +123 -8
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  High-performance timeseries charts for **React**, **Vue**, and **Svelte**. Canvas-rendered, tree-shakeable, zero runtime dependencies.
9
9
 
10
- [Live Demo](https://wick-charts.eeff.io/) · [Docs](https://wick-charts.eeff.io/api/chart-container)
10
+ [Live Demo](https://wick-charts.eeff.io/) · [Docs](https://wick-charts.eeff.io/api/chart-container/)
11
11
 
12
12
  ## Features
13
13
 
@@ -53,9 +53,24 @@ const props = defineProps(['data']);
53
53
 
54
54
  Every component, prop, type, and slot context lives in the docs site:
55
55
 
56
- [wick-charts.eeff.io/api/chart-container](https://wick-charts.eeff.io/api/chart-container)
56
+ [wick-charts.eeff.io/api/chart-container/](https://wick-charts.eeff.io/api/chart-container/)
57
57
 
58
- Start there for [ChartContainer](https://wick-charts.eeff.io/api/chart-container), then drill into the series ([Candlestick](https://wick-charts.eeff.io/api/candlestick-series), [Line](https://wick-charts.eeff.io/api/line-series), [Bar](https://wick-charts.eeff.io/api/bar-series), [Pie](https://wick-charts.eeff.io/api/pie-series), [Sparkline](https://wick-charts.eeff.io/api/sparkline)) and overlays ([Tooltip](https://wick-charts.eeff.io/api/tooltip), [InfoBar](https://wick-charts.eeff.io/api/info-bar), [Crosshair](https://wick-charts.eeff.io/api/crosshair), [Legend](https://wick-charts.eeff.io/api/legend), [YAxis](https://wick-charts.eeff.io/api/y-axis), [XAxis](https://wick-charts.eeff.io/api/x-axis), [Navigator](https://wick-charts.eeff.io/api/navigator), …).
58
+ Start there for [ChartContainer](https://wick-charts.eeff.io/api/chart-container/), then drill into the series ([Candlestick](https://wick-charts.eeff.io/api/candlestick-series/), [Line](https://wick-charts.eeff.io/api/line-series/), [Bar](https://wick-charts.eeff.io/api/bar-series/), [Pie](https://wick-charts.eeff.io/api/pie-series/), [Sparkline](https://wick-charts.eeff.io/api/sparkline/)) and overlays ([Tooltip](https://wick-charts.eeff.io/api/tooltip/), [InfoBar](https://wick-charts.eeff.io/api/info-bar/), [Crosshair](https://wick-charts.eeff.io/api/crosshair/), [Legend](https://wick-charts.eeff.io/api/legend/), [YAxis](https://wick-charts.eeff.io/api/y-axis/), [XAxis](https://wick-charts.eeff.io/api/x-axis/), [Navigator](https://wick-charts.eeff.io/api/navigator/), …).
59
+
60
+ ## No framework? Use the engine directly
61
+
62
+ `ChartInstance` and every series/theme/painter has no framework dependency — it's a plain canvas engine that each of `@wick-charts/react`, `@wick-charts/vue`, and `@wick-charts/svelte` bundles and re-exports in full. Any one of them is a supported vanilla entry point; you don't need React/Vue/Svelte installed to use it this way (`sideEffects: false` + per-module ESM means the framework-specific components tree-shake out when unused):
63
+
64
+ ```ts
65
+ import { CandlestickSeriesDef, ChartInstance, registerBuiltinSeries } from '@wick-charts/react';
66
+
67
+ registerBuiltinSeries();
68
+ const chart = new ChartInstance(document.getElementById('chart')!);
69
+ const seriesId = chart.addSeries(CandlestickSeriesDef, {});
70
+ chart.setSeriesData(seriesId, data);
71
+ ```
72
+
73
+ There's no separate `@wick-charts/core` package on npm — the three framework packages are the supported way to install the engine.
59
74
 
60
75
  ## Bundle size
61
76
 
@@ -1,44 +1,50 @@
1
- import { defineComponent as p, ref as d, onMounted as c, onUnmounted as l, watch as i, createCommentVNode as m } from "vue";
2
- import { toLayers as f, EMPTY_SYNC_STATE as v, syncLayers as y } from "./core/dist/data/sync.js";
1
+ import { defineComponent as u, ref as p, onMounted as d, onUnmounted as c, watch as o, createCommentVNode as f } from "vue";
2
+ import { toLayers as m, EMPTY_SYNC_STATE as v, syncLayers as y } from "./core/dist/data/sync.js";
3
3
  import { BarSeriesDef as S } from "./core/dist/series/bar.js";
4
4
  import { useChartInstance as _ } from "./context.js";
5
- const w = /* @__PURE__ */ p({
5
+ const E = /* @__PURE__ */ u({
6
6
  __name: "BarSeries",
7
7
  props: {
8
8
  data: {},
9
9
  options: {},
10
- id: {}
10
+ id: {},
11
+ visible: { type: Boolean, default: !0 }
11
12
  },
12
- setup(u) {
13
- const a = u, o = _(), r = d(null);
14
- let n = [];
15
- function s(e, t) {
16
- n = y({ chart: o, id: e, data: t, prev: n });
13
+ setup(l) {
14
+ const a = l, s = _(), r = p(null);
15
+ let i = [];
16
+ function n(e, t) {
17
+ i = y({ chart: s, id: e, data: t, prev: i });
17
18
  }
18
- return c(() => {
19
- const e = f(a.data).length, t = o.addSeries(S, {
19
+ return d(() => {
20
+ const e = m(a.data).length, t = s.addSeries(S, {
20
21
  ...a.options,
21
22
  layers: e,
22
23
  id: a.id
23
24
  });
24
- r.value = t, n = new Array(e).fill(v), s(t, a.data);
25
- }), l(() => {
26
- r.value && o.removeSeries(r.value);
27
- }), i(
25
+ r.value = t, i = new Array(e).fill(v), n(t, a.data), s.setSeriesVisible(t, a.visible);
26
+ }), c(() => {
27
+ r.value && s.removeSeries(r.value);
28
+ }), o(
28
29
  () => a.data,
29
30
  (e) => {
30
31
  const t = r.value;
31
- t && s(t, e);
32
+ t && n(t, e);
32
33
  }
33
- ), i(
34
+ ), o(
34
35
  () => a.options,
35
36
  (e) => {
36
- r.value && e && o.updateSeriesOptions(r.value, e);
37
+ r.value && e && s.updateSeriesOptions(r.value, e);
37
38
  },
38
39
  { deep: !0 }
39
- ), (e, t) => m("", !0);
40
+ ), o(
41
+ () => a.visible,
42
+ (e) => {
43
+ r.value && s.setSeriesVisible(r.value, e);
44
+ }
45
+ ), (e, t) => f("", !0);
40
46
  }
41
47
  });
42
48
  export {
43
- w as default
49
+ E as default
44
50
  };
@@ -1,45 +1,51 @@
1
- import { defineComponent as p, ref as u, onMounted as m, onUnmounted as f, watch as d, createCommentVNode as S } from "vue";
2
- import { toLayers as l, syncSeriesLayer as v, EMPTY_SYNC_STATE as _ } from "./core/dist/data/sync.js";
1
+ import { defineComponent as p, ref as c, onMounted as f, onUnmounted as m, watch as r, createCommentVNode as v } from "vue";
2
+ import { toLayers as d, syncSeriesLayer as S, EMPTY_SYNC_STATE as b } from "./core/dist/data/sync.js";
3
3
  import { CandlestickSeriesDef as y } from "./core/dist/series/candlestick.js";
4
- import { useChartInstance as C } from "./context.js";
5
- const k = /* @__PURE__ */ p({
4
+ import { useChartInstance as _ } from "./context.js";
5
+ const V = /* @__PURE__ */ p({
6
6
  __name: "CandlestickSeries",
7
7
  props: {
8
8
  data: {},
9
9
  options: {},
10
- id: {}
10
+ id: {},
11
+ visible: { type: Boolean, default: !0 }
11
12
  },
12
- setup(c) {
13
- const t = c, r = C(), a = u(null);
14
- let o = _;
15
- function n(e, s) {
16
- const i = l(s)[0];
17
- r.setSeriesLabels(e, [i.label]), o = v({ chart: r, id: e, data: i.data, prev: o });
13
+ setup(u) {
14
+ const t = u, s = _(), a = c(null);
15
+ let o = b;
16
+ function n(e, i) {
17
+ const l = d(i)[0];
18
+ s.setSeriesLabels(e, [l.label]), o = S({ chart: s, id: e, data: l.data, prev: o });
18
19
  }
19
- return m(() => {
20
- const e = r.addSeries(y, {
20
+ return f(() => {
21
+ const e = s.addSeries(y, {
21
22
  ...t.options,
22
23
  id: t.id,
23
- label: l(t.data)[0].label
24
+ label: d(t.data)[0].label
24
25
  });
25
- a.value = e, n(e, t.data);
26
- }), f(() => {
27
- a.value && r.removeSeries(a.value);
28
- }), d(
26
+ a.value = e, n(e, t.data), s.setSeriesVisible(e, t.visible);
27
+ }), m(() => {
28
+ a.value && s.removeSeries(a.value);
29
+ }), r(
29
30
  () => t.data,
30
31
  (e) => {
31
- const s = a.value;
32
- s && n(s, e);
32
+ const i = a.value;
33
+ i && n(i, e);
33
34
  }
34
- ), d(
35
+ ), r(
35
36
  () => t.options,
36
37
  (e) => {
37
- a.value && e && r.updateSeriesOptions(a.value, e);
38
+ a.value && e && s.updateSeriesOptions(a.value, e);
38
39
  },
39
40
  { deep: !0 }
40
- ), (e, s) => S("", !0);
41
+ ), r(
42
+ () => t.visible,
43
+ (e) => {
44
+ a.value && s.setSeriesVisible(a.value, e);
45
+ }
46
+ ), (e, i) => v("", !0);
41
47
  }
42
48
  });
43
49
  export {
44
- k as default
50
+ V as default
45
51
  };
@@ -1,88 +1,111 @@
1
- import { defineComponent as T, ref as a, shallowRef as O, provide as r, computed as C, onMounted as j, nextTick as b, onUnmounted as M, watch as l, openBlock as u, createElementBlock as v, normalizeStyle as N, createElementVNode as o, createCommentVNode as k, renderSlot as S } from "vue";
2
- import { ChartInstance as K } from "./core/dist/chart.js";
3
- import { catppuccin as G } from "./core/dist/theme/themes/catppuccin.js";
4
- import { ChartKey as H, ThemeKey as I, TitleAnchorKey as P, InfoBarAnchorKey as V, LegendAnchorKey as U, LegendRightAnchorKey as q, NavigatorAnchorKey as D } from "./context.js";
5
- const F = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-height": "0" } }, J = { style: { display: "flex", "flex-direction": "column", flex: "1", "min-width": "0", "min-height": "0" } }, Q = {
1
+ import { defineComponent as $, ref as r, shallowRef as M, provide as l, computed as P, onMounted as D, nextTick as h, onUnmounted as T, watch as d, openBlock as g, createElementBlock as p, normalizeStyle as j, createElementVNode as o, createCommentVNode as A, renderSlot as N } from "vue";
2
+ import { ChartInstance as z } from "./core/dist/chart.js";
3
+ import { deepEqual as H } from "./core/dist/utils/deep-equal.js";
4
+ import { catppuccin as q } from "./core/dist/theme/themes/catppuccin.js";
5
+ import { ChartKey as G, ThemeKey as I, TitleAnchorKey as U, InfoBarAnchorKey as F, LegendAnchorKey as J, LegendRightAnchorKey as Q, NavigatorAnchorKey as W } from "./context.js";
6
+ const X = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-height": "0" } }, Y = { style: { display: "flex", "flex-direction": "column", flex: "1", "min-width": "0", "min-height": "0" } }, Z = {
6
7
  key: 0,
7
8
  "data-chart-header": "",
8
9
  style: { "flex-shrink": "0", display: "flex", "flex-direction": "column", "pointer-events": "none" }
9
- }, W = {
10
+ }, ee = {
10
11
  key: 1,
11
12
  "data-chart-series-overlay": "",
12
13
  style: { position: "absolute", inset: "0", "pointer-events": "none", "z-index": "3" }
13
- }, ne = /* @__PURE__ */ T({
14
+ }, le = /* @__PURE__ */ $({
14
15
  __name: "ChartContainer",
15
16
  props: {
16
- theme: { default: () => G.theme },
17
+ theme: { default: () => q.theme },
17
18
  axis: {},
18
19
  padding: {},
19
20
  viewport: {},
21
+ visibleRange: {},
20
22
  gradient: { type: Boolean, default: !0 },
21
- interactive: { type: Boolean },
23
+ interactive: { type: Boolean, default: !0 },
22
24
  grid: {},
23
25
  headerLayout: { default: "overlay" },
24
26
  animations: { type: [Boolean, Object] },
25
27
  perf: {},
26
- onEdgeReached: {}
28
+ onEdgeReached: {},
29
+ onPointClick: {},
30
+ onPointDoubleClick: {},
31
+ onSeriesHover: {},
32
+ onReady: {},
33
+ onVisibleRangeChange: {},
34
+ onCrosshairMove: {}
27
35
  },
28
- setup(h) {
29
- const e = h, c = a(), i = O(null), p = O(e.theme), s = e.perf, f = e.onEdgeReached, A = a(null), g = a(null), y = a(null), w = a(null), _ = a(null), R = a(null);
30
- r(H, i), r(I, p), r(P, g), r(V, y), r(U, w), r(q, _), r(D, R);
31
- let d = null;
32
- const m = a(0), B = C(() => e.headerLayout === "overlay" ? m.value : 0);
36
+ setup(y) {
37
+ const e = y, c = r(), n = M(null), m = M(e.theme), u = e.perf, v = e.onEdgeReached, w = r(null), b = r(null), R = r(null), C = r(null), _ = r(null), E = r(null);
38
+ l(G, n), l(I, m), l(U, b), l(F, R), l(J, C), l(Q, _), l(W, E);
39
+ let s = null;
40
+ const k = r(0), B = P(() => e.headerLayout === "overlay" ? k.value : 0);
33
41
  function x() {
34
- if (!i.value) return;
35
- const n = { top: (e.padding?.top ?? 20) + B.value };
36
- e.padding?.bottom !== void 0 && (n.bottom = e.padding.bottom), e.padding?.right !== void 0 && (n.right = e.padding.right), e.padding?.left !== void 0 && (n.left = e.padding.left), i.value.setPadding(n);
42
+ if (!n.value) return;
43
+ const i = { top: (e.padding?.top ?? 20) + B.value };
44
+ e.padding?.bottom !== void 0 && (i.bottom = e.padding.bottom), e.padding?.right !== void 0 && (i.right = e.padding.right), e.padding?.left !== void 0 && (i.left = e.padding.left), n.value.setPadding(i);
37
45
  }
38
- function E() {
39
- d?.disconnect(), d = null;
40
- const t = e.headerLayout === "overlay" ? A.value : null;
46
+ function L() {
47
+ s?.disconnect(), s = null;
48
+ const t = e.headerLayout === "overlay" ? w.value : null;
41
49
  if (!t) {
42
- m.value = 0, x();
50
+ k.value = 0, x();
43
51
  return;
44
52
  }
45
- const n = () => {
46
- m.value = t.getBoundingClientRect().height, x();
53
+ const i = () => {
54
+ k.value = t.getBoundingClientRect().height, x();
47
55
  };
48
- n(), d = new ResizeObserver(n), d.observe(t);
56
+ i(), s = new ResizeObserver(i), s.observe(t);
49
57
  }
50
- j(async () => {
58
+ function V(t) {
59
+ t.on("pointClick", (a) => e.onPointClick?.(a)), t.on("pointDoubleClick", (a) => e.onPointDoubleClick?.(a)), t.on("seriesHover", (a) => e.onSeriesHover?.(a)), t.on("crosshairMove", (a) => e.onCrosshairMove?.(a));
60
+ const i = () => e.onVisibleRangeChange?.(t.getVisibleRange());
61
+ t.on("viewportChange", i), t.on("dataUpdate", i), t.on("seriesChange", i);
62
+ }
63
+ D(async () => {
51
64
  if (!c.value) return;
52
65
  const t = {};
53
- e.axis && (t.axis = e.axis), e.theme && (t.theme = e.theme), e.padding && (t.padding = e.padding), e.viewport && (t.viewport = e.viewport), e.interactive !== void 0 && (t.interactive = e.interactive), e.grid !== void 0 && (t.grid = e.grid), s !== void 0 && (t.perf = s), f && (t.onEdgeReached = f), e.animations !== void 0 && (t.animations = e.animations), i.value = new K(c.value, t), await b(), E();
54
- }), M(() => {
55
- d?.disconnect(), d = null, i.value?.destroy(), i.value = null;
56
- }), l(
66
+ e.axis && (t.axis = e.axis), e.theme && (t.theme = e.theme), e.padding && (t.padding = e.padding), e.viewport && (t.viewport = e.viewport), e.interactive !== void 0 && (t.interactive = e.interactive), e.grid !== void 0 && (t.grid = e.grid), u !== void 0 && (t.perf = u), v && (t.onEdgeReached = v), e.animations !== void 0 && (t.animations = e.animations), n.value = new z(c.value, t), V(n.value), e.onReady?.(n.value), await h(), L();
67
+ }), T(() => {
68
+ s?.disconnect(), s = null, n.value?.destroy(), n.value = null;
69
+ }), d(
57
70
  () => e.headerLayout,
58
71
  async () => {
59
- i.value && (await b(), E());
72
+ n.value && (await h(), L());
60
73
  }
61
- ), l(
74
+ ), d(
62
75
  () => e.theme,
63
76
  (t) => {
64
- i.value && t && (i.value.setTheme(t), p.value = t);
77
+ n.value && t && (n.value.setTheme(t), m.value = t);
65
78
  }
66
- ), l(
79
+ ), d(
67
80
  () => e.axis,
68
81
  (t) => {
69
- i.value && t && i.value.setAxis(t);
82
+ n.value && t && n.value.setAxis(t);
70
83
  },
71
84
  { deep: !0 }
72
- ), l(
85
+ ), d(
73
86
  () => e.grid?.visible,
74
87
  () => {
75
- i.value && e.grid !== void 0 && i.value.setGrid(e.grid);
88
+ n.value && e.grid !== void 0 && n.value.setGrid(e.grid);
76
89
  }
77
- ), l(
90
+ );
91
+ let K = e.animations;
92
+ d(
78
93
  () => e.animations,
79
94
  async (t) => {
80
- if (!i.value || !c.value) return;
81
- i.value.destroy(), i.value = null, await b();
82
- const n = {};
83
- e.axis && (n.axis = e.axis), e.theme && (n.theme = e.theme), e.padding && (n.padding = e.padding), e.viewport && (n.viewport = e.viewport), e.interactive !== void 0 && (n.interactive = e.interactive), e.grid !== void 0 && (n.grid = e.grid), s !== void 0 && (n.perf = s), f && (n.onEdgeReached = f), t !== void 0 && (n.animations = t), i.value = new K(c.value, n);
95
+ if (H(t, K) || (K = t, !n.value || !c.value)) return;
96
+ n.value.destroy(), n.value = null, await h();
97
+ const i = {};
98
+ e.axis && (i.axis = e.axis), e.theme && (i.theme = e.theme), e.padding && (i.padding = e.padding), e.viewport && (i.viewport = e.viewport), e.interactive !== void 0 && (i.interactive = e.interactive), e.grid !== void 0 && (i.grid = e.grid), u !== void 0 && (i.perf = u), v && (i.onEdgeReached = v), t !== void 0 && (i.animations = t), n.value = new z(c.value, i), V(n.value), e.onReady?.(n.value);
84
99
  }
85
- ), l(
100
+ );
101
+ let f;
102
+ d(
103
+ () => [n.value, e.visibleRange],
104
+ async ([t, i]) => {
105
+ !t || i === void 0 || f !== void 0 && f.instance === t && H(f.spec, i) || (f = { instance: t, spec: i }, await h(), t.setVisibleRange(i));
106
+ },
107
+ { immediate: !0 }
108
+ ), d(
86
109
  () => [
87
110
  e.padding?.top,
88
111
  e.padding?.bottom,
@@ -92,53 +115,53 @@ const F = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-h
92
115
  ],
93
116
  x
94
117
  );
95
- const z = C(() => {
96
- const t = p.value, [n, $] = t?.chartGradient ?? ["transparent", "transparent"], L = t?.background ?? "transparent";
97
- return `position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; background: ${e.gradient ? `linear-gradient(to bottom, ${n} 0%, ${L} 70%, ${$} 100%)` : L}`;
118
+ const S = P(() => {
119
+ const t = m.value, [i, a] = t?.chartGradient ?? ["transparent", "transparent"], O = t?.background ?? "transparent";
120
+ return `position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 240px; overflow: hidden; background: ${e.gradient ? `linear-gradient(to bottom, ${i} 0%, ${O} 70%, ${a} 100%)` : O}`;
98
121
  });
99
- return (t, n) => (u(), v("div", {
100
- style: N(z.value)
122
+ return (t, i) => (g(), p("div", {
123
+ style: j(S.value)
101
124
  }, [
102
- o("div", F, [
103
- o("div", J, [
104
- h.headerLayout === "inline" ? (u(), v("div", Q, [
125
+ o("div", X, [
126
+ o("div", Y, [
127
+ y.headerLayout === "inline" ? (g(), p("div", Z, [
105
128
  o("div", {
106
129
  ref_key: "titleAnchor",
107
- ref: g,
130
+ ref: b,
108
131
  "data-chart-title-anchor": ""
109
132
  }, null, 512),
110
133
  o("div", {
111
134
  ref_key: "infoBarAnchor",
112
- ref: y,
135
+ ref: R,
113
136
  "data-tooltip-legend-anchor": ""
114
137
  }, null, 512)
115
- ])) : k("", !0),
138
+ ])) : A("", !0),
116
139
  o("div", {
117
140
  ref_key: "containerRef",
118
141
  ref: c,
119
142
  style: { position: "relative", flex: "1", "min-width": "0", "min-height": "0", overflow: "hidden" }
120
143
  }, [
121
- h.headerLayout === "overlay" ? (u(), v("div", {
144
+ y.headerLayout === "overlay" ? (g(), p("div", {
122
145
  key: 0,
123
146
  ref_key: "topOverlayRef",
124
- ref: A,
147
+ ref: w,
125
148
  "data-chart-top-overlay": "",
126
149
  style: { position: "absolute", top: "0", left: "0", right: "0", "z-index": "2", "pointer-events": "none", display: "flex", "flex-direction": "column" }
127
150
  }, [
128
151
  o("div", {
129
152
  ref_key: "titleAnchor",
130
- ref: g,
153
+ ref: b,
131
154
  "data-chart-title-anchor": ""
132
155
  }, null, 512),
133
156
  o("div", {
134
157
  ref_key: "infoBarAnchor",
135
- ref: y,
158
+ ref: R,
136
159
  "data-tooltip-legend-anchor": ""
137
160
  }, null, 512)
138
- ], 512)) : k("", !0),
139
- i.value ? (u(), v("div", W, [
140
- S(t.$slots, "default")
141
- ])) : k("", !0)
161
+ ], 512)) : A("", !0),
162
+ n.value ? (g(), p("div", ee, [
163
+ N(t.$slots, "default")
164
+ ])) : A("", !0)
142
165
  ], 512)
143
166
  ]),
144
167
  o("div", {
@@ -150,13 +173,13 @@ const F = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-h
150
173
  ]),
151
174
  o("div", {
152
175
  ref_key: "legendAnchor",
153
- ref: w,
176
+ ref: C,
154
177
  "data-legend-anchor": "",
155
178
  style: { flex: "0 0 auto" }
156
179
  }, null, 512),
157
180
  o("div", {
158
181
  ref_key: "navigatorAnchor",
159
- ref: R,
182
+ ref: E,
160
183
  "data-navigator-anchor": "",
161
184
  style: { flex: "0 0 auto" }
162
185
  }, null, 512)
@@ -164,5 +187,5 @@ const F = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-h
164
187
  }
165
188
  });
166
189
  export {
167
- ne as default
190
+ le as default
168
191
  };
@@ -0,0 +1,40 @@
1
+ import { defineComponent as o, ref as n, onMounted as u, onUnmounted as l, watch as s, createCommentVNode as d } from "vue";
2
+ import { HeatmapSeriesDef as p } from "./core/dist/series/heatmap.js";
3
+ import { useChartInstance as m } from "./context.js";
4
+ const _ = /* @__PURE__ */ o({
5
+ __name: "HeatmapSeries",
6
+ props: {
7
+ data: {},
8
+ options: {},
9
+ id: {},
10
+ visible: { type: Boolean, default: !0 }
11
+ },
12
+ setup(r) {
13
+ const a = r, i = m(), t = n(null);
14
+ return u(() => {
15
+ const e = i.addSeries(p, { ...a.options, id: a.id });
16
+ t.value = e, a.data.length > 0 && i.setSeriesData(e, a.data), i.setSeriesVisible(e, a.visible);
17
+ }), l(() => {
18
+ t.value && i.removeSeries(t.value);
19
+ }), s(
20
+ () => a.data,
21
+ (e) => {
22
+ t.value && i.setSeriesData(t.value, e);
23
+ }
24
+ ), s(
25
+ () => a.options,
26
+ (e) => {
27
+ t.value && e && i.updateSeriesOptions(t.value, e);
28
+ },
29
+ { deep: !0 }
30
+ ), s(
31
+ () => a.visible,
32
+ (e) => {
33
+ t.value && i.setSeriesVisible(t.value, e);
34
+ }
35
+ ), (e, f) => d("", !0);
36
+ }
37
+ });
38
+ export {
39
+ _ as default
40
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./HeatmapSeries.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,44 +1,50 @@
1
- import { defineComponent as p, ref as d, onMounted as c, onUnmounted as l, watch as i, createCommentVNode as m } from "vue";
2
- import { toLayers as f, EMPTY_SYNC_STATE as v, syncLayers as y } from "./core/dist/data/sync.js";
1
+ import { defineComponent as u, ref as p, onMounted as d, onUnmounted as c, watch as n, createCommentVNode as f } from "vue";
2
+ import { toLayers as m, EMPTY_SYNC_STATE as v, syncLayers as y } from "./core/dist/data/sync.js";
3
3
  import { LineSeriesDef as S } from "./core/dist/series/line.js";
4
4
  import { useChartInstance as _ } from "./context.js";
5
- const A = /* @__PURE__ */ p({
5
+ const E = /* @__PURE__ */ u({
6
6
  __name: "LineSeries",
7
7
  props: {
8
8
  data: {},
9
9
  options: {},
10
- id: {}
10
+ id: {},
11
+ visible: { type: Boolean, default: !0 }
11
12
  },
12
- setup(u) {
13
- const a = u, n = _(), r = d(null);
14
- let o = [];
15
- function s(e, t) {
16
- o = y({ chart: n, id: e, data: t, prev: o });
13
+ setup(l) {
14
+ const a = l, s = _(), r = p(null);
15
+ let i = [];
16
+ function o(e, t) {
17
+ i = y({ chart: s, id: e, data: t, prev: i });
17
18
  }
18
- return c(() => {
19
- const e = f(a.data).length, t = n.addSeries(S, {
19
+ return d(() => {
20
+ const e = m(a.data).length, t = s.addSeries(S, {
20
21
  ...a.options,
21
22
  layers: e,
22
23
  id: a.id
23
24
  });
24
- r.value = t, o = new Array(e).fill(v), s(t, a.data);
25
- }), l(() => {
26
- r.value && n.removeSeries(r.value);
27
- }), i(
25
+ r.value = t, i = new Array(e).fill(v), o(t, a.data), s.setSeriesVisible(t, a.visible);
26
+ }), c(() => {
27
+ r.value && s.removeSeries(r.value);
28
+ }), n(
28
29
  () => a.data,
29
30
  (e) => {
30
31
  const t = r.value;
31
- t && s(t, e);
32
+ t && o(t, e);
32
33
  }
33
- ), i(
34
+ ), n(
34
35
  () => a.options,
35
36
  (e) => {
36
- r.value && e && n.updateSeriesOptions(r.value, e);
37
+ r.value && e && s.updateSeriesOptions(r.value, e);
37
38
  },
38
39
  { deep: !0 }
39
- ), (e, t) => m("", !0);
40
+ ), n(
41
+ () => a.visible,
42
+ (e) => {
43
+ r.value && s.setSeriesVisible(r.value, e);
44
+ }
45
+ ), (e, t) => f("", !0);
40
46
  }
41
47
  });
42
48
  export {
43
- A as default
49
+ E as default
44
50
  };
@@ -1,32 +1,38 @@
1
- import { defineComponent as i, ref as n, onMounted as u, onUnmounted as d, watch as r, createCommentVNode as p } from "vue";
2
- import { PieSeriesDef as m } from "./core/dist/series/pie.js";
3
- import { useChartInstance as c } from "./context.js";
4
- const h = /* @__PURE__ */ i({
1
+ import { defineComponent as o, ref as n, onMounted as u, onUnmounted as l, watch as a, createCommentVNode as d } from "vue";
2
+ import { PieSeriesDef as p } from "./core/dist/series/pie.js";
3
+ import { useChartInstance as f } from "./context.js";
4
+ const h = /* @__PURE__ */ o({
5
5
  __name: "PieSeries",
6
6
  props: {
7
7
  data: {},
8
8
  options: {},
9
- id: {}
9
+ id: {},
10
+ visible: { type: Boolean, default: !0 }
10
11
  },
11
- setup(s) {
12
- const a = s, o = c(), t = n(null);
12
+ setup(r) {
13
+ const i = r, s = f(), t = n(null);
13
14
  return u(() => {
14
- const e = o.addSeries(m, { ...a.options, id: a.id });
15
- t.value = e, a.data.length > 0 && o.setSeriesData(e, a.data);
16
- }), d(() => {
17
- t.value && o.removeSeries(t.value);
18
- }), r(
19
- () => a.data,
15
+ const e = s.addSeries(p, { ...i.options, id: i.id });
16
+ t.value = e, i.data.length > 0 && s.setSeriesData(e, i.data), s.setSeriesVisible(e, i.visible);
17
+ }), l(() => {
18
+ t.value && s.removeSeries(t.value);
19
+ }), a(
20
+ () => i.data,
20
21
  (e) => {
21
- t.value && e.length > 0 && o.setSeriesData(t.value, e);
22
+ t.value && e.length > 0 && s.setSeriesData(t.value, e);
22
23
  }
23
- ), r(
24
- () => a.options,
24
+ ), a(
25
+ () => i.options,
25
26
  (e) => {
26
- t.value && e && o.updateSeriesOptions(t.value, e);
27
+ t.value && e && s.updateSeriesOptions(t.value, e);
27
28
  },
28
29
  { deep: !0 }
29
- ), (e, f) => p("", !0);
30
+ ), a(
31
+ () => i.visible,
32
+ (e) => {
33
+ t.value && s.setSeriesVisible(t.value, e);
34
+ }
35
+ ), (e, c) => d("", !0);
30
36
  }
31
37
  });
32
38
  export {