@wick-charts/vue 0.8.0 → 0.8.2

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 (48) hide show
  1. package/README.md +2 -0
  2. package/dist/BandSeries.vue.js +43 -32
  3. package/dist/BarSeries.vue.js +44 -33
  4. package/dist/CandlestickSeries.vue.js +24 -23
  5. package/dist/ChartContainer.vue.js +1 -1
  6. package/dist/HeatmapSeries.vue.js +21 -20
  7. package/dist/LineSeries.vue.js +43 -32
  8. package/dist/PieSeries.vue.js +25 -24
  9. package/dist/composables.js +63 -36
  10. package/dist/core/dist/axis/dom-labels.js +64 -53
  11. package/dist/core/dist/chart/badge-animator.js +38 -28
  12. package/dist/core/dist/chart/options.js +1 -1
  13. package/dist/core/dist/chart/y-target.js +38 -32
  14. package/dist/core/dist/chart.js +852 -709
  15. package/dist/core/dist/data/decimation.js +52 -51
  16. package/dist/core/dist/data/store.js +38 -20
  17. package/dist/core/dist/data/sync.js +97 -59
  18. package/dist/core/dist/navigator/controller.js +11 -11
  19. package/dist/core/dist/perf/perf-hud.js +3 -3
  20. package/dist/core/dist/scales/tick-tracker.js +2 -1
  21. package/dist/core/dist/scales/time-ticks.js +99 -0
  22. package/dist/core/dist/scales/x-scale.js +33 -27
  23. package/dist/core/dist/series/band.js +83 -83
  24. package/dist/core/dist/series/bar.js +240 -211
  25. package/dist/core/dist/series/base-multi-layer.js +288 -240
  26. package/dist/core/dist/series/candlestick.js +168 -168
  27. package/dist/core/dist/series/line.js +545 -455
  28. package/dist/core/dist/snapshots.js +109 -86
  29. package/dist/core/dist/utils/point.js +4 -0
  30. package/dist/core/dist/utils/time.js +42 -26
  31. package/dist/index.d.ts +67 -28
  32. package/dist/ui/InfoBar.vue.js +69 -69
  33. package/dist/ui/NumberFlow.vue.js +36 -27
  34. package/dist/ui/Tooltip.vue.js +128 -131
  35. package/dist/ui/YLabel.vue.js +47 -47
  36. package/package.json +2 -2
  37. package/src/BandSeries.vue +20 -5
  38. package/src/BarSeries.vue +20 -5
  39. package/src/CandlestickSeries.vue +5 -4
  40. package/src/ChartContainer.vue +15 -9
  41. package/src/HeatmapSeries.vue +5 -4
  42. package/src/LineSeries.vue +20 -5
  43. package/src/PieSeries.vue +6 -5
  44. package/src/composables.ts +64 -1
  45. package/src/ui/InfoBar.vue +11 -3
  46. package/src/ui/NumberFlow.vue +17 -3
  47. package/src/ui/Tooltip.vue +23 -12
  48. package/src/ui/YLabel.vue +28 -27
package/README.md CHANGED
@@ -49,6 +49,8 @@ const props = defineProps(['data']);
49
49
  </template>
50
50
  ```
51
51
 
52
+ `ChartContainer` fills its parent (`width` and `height` are `100%`), so give the parent a height. The container also has a 240px `min-height`, so a parent with no height still shows a chart. For a smaller chart, such as a sparkline in a table row, set `min-height: 0` (`minHeight: 0` in React) in the container's `style`.
53
+
52
54
  ## API
53
55
 
54
56
  Every component, prop, type, and slot context lives in the docs site:
@@ -1,8 +1,9 @@
1
- import { defineComponent as u, ref as d, onMounted as c, onUnmounted as p, watch as n, createCommentVNode as f } from "vue";
2
- import { toLayers as m, EMPTY_SYNC_STATE as v, syncLayers as S } from "./core/dist/data/sync.js";
3
- import { BandSeriesDef as y } from "./core/dist/series/band.js";
4
- import { useChartInstance as _ } from "./context.js";
5
- const B = /* @__PURE__ */ u({
1
+ import { defineComponent as f, ref as m, onMounted as v, onUnmounted as S, watch as o, createCommentVNode as y } from "vue";
2
+ import { toLayers as c, syncLayers as _, EMPTY_SYNC_STATE as h } from "./core/dist/data/sync.js";
3
+ import { BandSeriesDef as b } from "./core/dist/series/band.js";
4
+ import { rawSeriesData as d, seriesDataSource as C } from "./composables.js";
5
+ import { useChartInstance as w } from "./context.js";
6
+ const g = /* @__PURE__ */ f({
6
7
  __name: "BandSeries",
7
8
  props: {
8
9
  data: {},
@@ -11,42 +12,52 @@ const B = /* @__PURE__ */ u({
11
12
  visible: { type: Boolean, default: !0 },
12
13
  scale: {}
13
14
  },
14
- setup(l) {
15
- const a = l, r = _(), s = d(null);
16
- let i = [];
17
- function o(e, t) {
18
- i = S({ chart: r, id: e, data: t, prev: i });
15
+ setup(p) {
16
+ const r = p, s = w(), a = m(null);
17
+ let n = [], i = 0;
18
+ function l(e, t) {
19
+ n = _({ chart: s, id: e, data: t, prev: n });
19
20
  }
20
- return c(() => {
21
- const e = m(a.data).length, t = r.addSeries(y, {
22
- ...a.options,
23
- scale: a.scale,
24
- layers: e,
25
- id: a.id
21
+ function u(e) {
22
+ i = c(e).length;
23
+ const t = s.addSeries(b, {
24
+ ...r.options,
25
+ scale: r.scale,
26
+ layers: i,
27
+ id: r.id
26
28
  });
27
- s.value = t, i = new Array(e).fill(v), o(t, a.data), r.setSeriesVisible(t, a.visible);
28
- }), p(() => {
29
- s.value && r.removeSeries(s.value);
30
- }), n(
31
- () => a.data,
32
- (e) => {
33
- const t = s.value;
34
- t && o(t, e);
29
+ a.value = t, n = new Array(i).fill(h), l(t, e), s.setSeriesVisible(t, r.visible);
30
+ }
31
+ return v(() => {
32
+ u(d(r.data));
33
+ }), S(() => {
34
+ a.value && s.removeSeries(a.value);
35
+ }), o(
36
+ C(() => r.data),
37
+ () => {
38
+ const e = d(r.data), t = a.value;
39
+ if (t) {
40
+ if (c(e).length !== i) {
41
+ s.removeSeries(t), u(e);
42
+ return;
43
+ }
44
+ l(t, e);
45
+ }
35
46
  }
36
- ), n(
37
- () => [a.options, a.scale],
47
+ ), o(
48
+ () => [r.options, r.scale],
38
49
  ([e, t]) => {
39
- s.value && r.updateSeriesOptions(s.value, e ? { ...e, scale: t } : { scale: t });
50
+ a.value && s.updateSeriesOptions(a.value, e ? { ...e, scale: t } : { scale: t });
40
51
  },
41
52
  { deep: !0 }
42
- ), n(
43
- () => a.visible,
53
+ ), o(
54
+ () => r.visible,
44
55
  (e) => {
45
- s.value && r.setSeriesVisible(s.value, e);
56
+ a.value && s.setSeriesVisible(a.value, e);
46
57
  }
47
- ), (e, t) => f("", !0);
58
+ ), (e, t) => y("", !0);
48
59
  }
49
60
  });
50
61
  export {
51
- B as default
62
+ g as default
52
63
  };
@@ -1,8 +1,9 @@
1
- import { defineComponent as u, ref as c, onMounted as d, onUnmounted as p, watch as o, createCommentVNode as f } from "vue";
2
- import { toLayers as m, EMPTY_SYNC_STATE as v, syncLayers as S } from "./core/dist/data/sync.js";
3
- import { BarSeriesDef as y } from "./core/dist/series/bar.js";
4
- import { useChartInstance as _ } from "./context.js";
5
- const B = /* @__PURE__ */ u({
1
+ import { defineComponent as f, ref as m, onMounted as v, onUnmounted as S, watch as n, createCommentVNode as y } from "vue";
2
+ import { toLayers as c, syncLayers as _, EMPTY_SYNC_STATE as h } from "./core/dist/data/sync.js";
3
+ import { BarSeriesDef as b } from "./core/dist/series/bar.js";
4
+ import { rawSeriesData as p, seriesDataSource as C } from "./composables.js";
5
+ import { useChartInstance as D } from "./context.js";
6
+ const g = /* @__PURE__ */ f({
6
7
  __name: "BarSeries",
7
8
  props: {
8
9
  data: {},
@@ -11,42 +12,52 @@ const B = /* @__PURE__ */ u({
11
12
  visible: { type: Boolean, default: !0 },
12
13
  scale: {}
13
14
  },
14
- setup(l) {
15
- const a = l, s = _(), r = c(null);
16
- let i = [];
17
- function n(e, t) {
18
- i = S({ chart: s, id: e, data: t, prev: i });
15
+ setup(d) {
16
+ const t = d, s = D(), a = m(null);
17
+ let o = [], i = 0;
18
+ function l(e, r) {
19
+ o = _({ chart: s, id: e, data: r, prev: o });
19
20
  }
20
- return d(() => {
21
- const e = m(a.data).length, t = s.addSeries(y, {
22
- ...a.options,
23
- scale: a.scale,
24
- layers: e,
25
- id: a.id
21
+ function u(e) {
22
+ i = c(e).length;
23
+ const r = s.addSeries(b, {
24
+ ...t.options,
25
+ scale: t.scale,
26
+ layers: i,
27
+ id: t.id
26
28
  });
27
- r.value = t, i = new Array(e).fill(v), n(t, a.data), s.setSeriesVisible(t, a.visible);
28
- }), p(() => {
29
- r.value && s.removeSeries(r.value);
30
- }), o(
31
- () => a.data,
32
- (e) => {
33
- const t = r.value;
34
- t && n(t, e);
29
+ a.value = r, o = new Array(i).fill(h), l(r, e), s.setSeriesVisible(r, t.visible);
30
+ }
31
+ return v(() => {
32
+ u(p(t.data));
33
+ }), S(() => {
34
+ a.value && s.removeSeries(a.value);
35
+ }), n(
36
+ C(() => t.data),
37
+ () => {
38
+ const e = p(t.data), r = a.value;
39
+ if (r) {
40
+ if (c(e).length !== i) {
41
+ s.removeSeries(r), u(e);
42
+ return;
43
+ }
44
+ l(r, e);
45
+ }
35
46
  }
36
- ), o(
37
- () => [a.options, a.scale],
38
- ([e, t]) => {
39
- r.value && s.updateSeriesOptions(r.value, e ? { ...e, scale: t } : { scale: t });
47
+ ), n(
48
+ () => [t.options, t.scale],
49
+ ([e, r]) => {
50
+ a.value && s.updateSeriesOptions(a.value, e ? { ...e, scale: r } : { scale: r });
40
51
  },
41
52
  { deep: !0 }
42
- ), o(
43
- () => a.visible,
53
+ ), n(
54
+ () => t.visible,
44
55
  (e) => {
45
- r.value && s.setSeriesVisible(r.value, e);
56
+ a.value && s.setSeriesVisible(a.value, e);
46
57
  }
47
- ), (e, t) => f("", !0);
58
+ ), (e, r) => y("", !0);
48
59
  }
49
60
  });
50
61
  export {
51
- B as default
62
+ g as default
52
63
  };
@@ -1,8 +1,9 @@
1
- import { defineComponent as d, ref as p, onMounted as f, onUnmounted as m, watch as i, createCommentVNode as v } from "vue";
2
- import { toLayers as u, syncSeriesLayer as S, EMPTY_SYNC_STATE as b } from "./core/dist/data/sync.js";
3
- import { CandlestickSeriesDef as _ } from "./core/dist/series/candlestick.js";
4
- import { useChartInstance as y } from "./context.js";
5
- const V = /* @__PURE__ */ d({
1
+ import { defineComponent as p, ref as m, onMounted as f, onUnmounted as v, watch as i, createCommentVNode as S } from "vue";
2
+ import { toLayers as u, syncSeriesLayer as b, EMPTY_SYNC_STATE as _ } from "./core/dist/data/sync.js";
3
+ import { CandlestickSeriesDef as y } from "./core/dist/series/candlestick.js";
4
+ import { rawSeriesData as c, seriesDataSource as C } from "./composables.js";
5
+ import { useChartInstance as h } from "./context.js";
6
+ const V = /* @__PURE__ */ p({
6
7
  __name: "CandlestickSeries",
7
8
  props: {
8
9
  data: {},
@@ -11,41 +12,41 @@ const V = /* @__PURE__ */ d({
11
12
  visible: { type: Boolean, default: !0 },
12
13
  scale: {}
13
14
  },
14
- setup(c) {
15
- const a = c, r = y(), t = p(null);
16
- let o = b;
17
- function n(e, s) {
18
- const l = u(s)[0];
19
- r.setSeriesLabels(e, [l.label]), o = S({ chart: r, id: e, data: l.data, prev: o });
15
+ setup(d) {
16
+ const a = d, s = h(), t = m(null);
17
+ let o = _;
18
+ function n(e, r) {
19
+ const l = u(r)[0];
20
+ s.setSeriesLabels(e, [l.label]), o = b({ chart: s, id: e, data: l.data, prev: o });
20
21
  }
21
22
  return f(() => {
22
- const e = r.addSeries(_, {
23
+ const e = s.addSeries(y, {
23
24
  ...a.options,
24
25
  scale: a.scale,
25
26
  id: a.id,
26
27
  label: u(a.data)[0].label
27
28
  });
28
- t.value = e, n(e, a.data), r.setSeriesVisible(e, a.visible);
29
- }), m(() => {
30
- t.value && r.removeSeries(t.value);
29
+ t.value = e, n(e, c(a.data)), s.setSeriesVisible(e, a.visible);
30
+ }), v(() => {
31
+ t.value && s.removeSeries(t.value);
31
32
  }), i(
32
- () => a.data,
33
- (e) => {
34
- const s = t.value;
35
- s && n(s, e);
33
+ C(() => a.data),
34
+ () => {
35
+ const e = t.value;
36
+ e && n(e, c(a.data));
36
37
  }
37
38
  ), i(
38
39
  () => [a.options, a.scale],
39
- ([e, s]) => {
40
- t.value && r.updateSeriesOptions(t.value, e ? { ...e, scale: s } : { scale: s });
40
+ ([e, r]) => {
41
+ t.value && s.updateSeriesOptions(t.value, e ? { ...e, scale: r } : { scale: r });
41
42
  },
42
43
  { deep: !0 }
43
44
  ), i(
44
45
  () => a.visible,
45
46
  (e) => {
46
- t.value && r.setSeriesVisible(t.value, e);
47
+ t.value && s.setSeriesVisible(t.value, e);
47
48
  }
48
- ), (e, s) => v("", !0);
49
+ ), (e, r) => S("", !0);
49
50
  }
50
51
  });
51
52
  export {
@@ -25,7 +25,7 @@ const ie = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-
25
25
  grid: {},
26
26
  fade: { type: [Boolean, Object], default: void 0 },
27
27
  headerLayout: { default: "overlay" },
28
- animations: { type: [Boolean, Object] },
28
+ animations: { type: [Boolean, Object], default: void 0 },
29
29
  perf: {},
30
30
  onEdgeReached: {},
31
31
  onPointClick: {},
@@ -1,7 +1,8 @@
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({
1
+ import { defineComponent as n, ref as u, onMounted as d, onUnmounted as l, watch as s, createCommentVNode as p } from "vue";
2
+ import { HeatmapSeriesDef as m } from "./core/dist/series/heatmap.js";
3
+ import { rawSeriesData as r, seriesDataSource as f } from "./composables.js";
4
+ import { useChartInstance as c } from "./context.js";
5
+ const D = /* @__PURE__ */ n({
5
6
  __name: "HeatmapSeries",
6
7
  props: {
7
8
  data: {},
@@ -9,32 +10,32 @@ const _ = /* @__PURE__ */ o({
9
10
  id: {},
10
11
  visible: { type: Boolean, default: !0 }
11
12
  },
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);
13
+ setup(o) {
14
+ const e = o, i = c(), t = u(null);
15
+ return d(() => {
16
+ const a = i.addSeries(m, { ...e.options, id: e.id });
17
+ t.value = a, e.data.length > 0 && i.setSeriesData(a, r(e.data)), i.setSeriesVisible(a, e.visible);
17
18
  }), l(() => {
18
19
  t.value && i.removeSeries(t.value);
19
20
  }), s(
20
- () => a.data,
21
- (e) => {
22
- t.value && i.setSeriesData(t.value, e);
21
+ f(() => e.data),
22
+ () => {
23
+ t.value && i.setSeriesData(t.value, r(e.data));
23
24
  }
24
25
  ), s(
25
- () => a.options,
26
- (e) => {
27
- t.value && e && i.updateSeriesOptions(t.value, e);
26
+ () => e.options,
27
+ (a) => {
28
+ t.value && a && i.updateSeriesOptions(t.value, a);
28
29
  },
29
30
  { deep: !0 }
30
31
  ), s(
31
- () => a.visible,
32
- (e) => {
33
- t.value && i.setSeriesVisible(t.value, e);
32
+ () => e.visible,
33
+ (a) => {
34
+ t.value && i.setSeriesVisible(t.value, a);
34
35
  }
35
- ), (e, f) => d("", !0);
36
+ ), (a, v) => p("", !0);
36
37
  }
37
38
  });
38
39
  export {
39
- _ as default
40
+ D as default
40
41
  };
@@ -1,8 +1,9 @@
1
- import { defineComponent as u, ref as c, onMounted as d, onUnmounted as p, watch as n, createCommentVNode as f } from "vue";
2
- import { toLayers as m, EMPTY_SYNC_STATE as v, syncLayers as S } from "./core/dist/data/sync.js";
3
- import { LineSeriesDef as y } from "./core/dist/series/line.js";
4
- import { useChartInstance as _ } from "./context.js";
5
- const T = /* @__PURE__ */ u({
1
+ import { defineComponent as f, ref as m, onMounted as v, onUnmounted as S, watch as o, createCommentVNode as y } from "vue";
2
+ import { toLayers as c, syncLayers as _, EMPTY_SYNC_STATE as h } from "./core/dist/data/sync.js";
3
+ import { LineSeriesDef as b } from "./core/dist/series/line.js";
4
+ import { rawSeriesData as p, seriesDataSource as C } from "./composables.js";
5
+ import { useChartInstance as D } from "./context.js";
6
+ const g = /* @__PURE__ */ f({
6
7
  __name: "LineSeries",
7
8
  props: {
8
9
  data: {},
@@ -11,42 +12,52 @@ const T = /* @__PURE__ */ u({
11
12
  visible: { type: Boolean, default: !0 },
12
13
  scale: {}
13
14
  },
14
- setup(l) {
15
- const a = l, r = _(), s = c(null);
16
- let i = [];
17
- function o(e, t) {
18
- i = S({ chart: r, id: e, data: t, prev: i });
15
+ setup(d) {
16
+ const r = d, s = D(), a = m(null);
17
+ let n = [], i = 0;
18
+ function l(e, t) {
19
+ n = _({ chart: s, id: e, data: t, prev: n });
19
20
  }
20
- return d(() => {
21
- const e = m(a.data).length, t = r.addSeries(y, {
22
- ...a.options,
23
- scale: a.scale,
24
- layers: e,
25
- id: a.id
21
+ function u(e) {
22
+ i = c(e).length;
23
+ const t = s.addSeries(b, {
24
+ ...r.options,
25
+ scale: r.scale,
26
+ layers: i,
27
+ id: r.id
26
28
  });
27
- s.value = t, i = new Array(e).fill(v), o(t, a.data), r.setSeriesVisible(t, a.visible);
28
- }), p(() => {
29
- s.value && r.removeSeries(s.value);
30
- }), n(
31
- () => a.data,
32
- (e) => {
33
- const t = s.value;
34
- t && o(t, e);
29
+ a.value = t, n = new Array(i).fill(h), l(t, e), s.setSeriesVisible(t, r.visible);
30
+ }
31
+ return v(() => {
32
+ u(p(r.data));
33
+ }), S(() => {
34
+ a.value && s.removeSeries(a.value);
35
+ }), o(
36
+ C(() => r.data),
37
+ () => {
38
+ const e = p(r.data), t = a.value;
39
+ if (t) {
40
+ if (c(e).length !== i) {
41
+ s.removeSeries(t), u(e);
42
+ return;
43
+ }
44
+ l(t, e);
45
+ }
35
46
  }
36
- ), n(
37
- () => [a.options, a.scale],
47
+ ), o(
48
+ () => [r.options, r.scale],
38
49
  ([e, t]) => {
39
- s.value && r.updateSeriesOptions(s.value, e ? { ...e, scale: t } : { scale: t });
50
+ a.value && s.updateSeriesOptions(a.value, e ? { ...e, scale: t } : { scale: t });
40
51
  },
41
52
  { deep: !0 }
42
- ), n(
43
- () => a.visible,
53
+ ), o(
54
+ () => r.visible,
44
55
  (e) => {
45
- s.value && r.setSeriesVisible(s.value, e);
56
+ a.value && s.setSeriesVisible(a.value, e);
46
57
  }
47
- ), (e, t) => f("", !0);
58
+ ), (e, t) => y("", !0);
48
59
  }
49
60
  });
50
61
  export {
51
- T as default
62
+ g as default
52
63
  };
@@ -1,7 +1,8 @@
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({
1
+ import { defineComponent as n, ref as u, onMounted as d, onUnmounted as l, watch as s, createCommentVNode as p } from "vue";
2
+ import { PieSeriesDef as f } from "./core/dist/series/pie.js";
3
+ import { rawSeriesData as r, seriesDataSource as m } from "./composables.js";
4
+ import { useChartInstance as c } from "./context.js";
5
+ const D = /* @__PURE__ */ n({
5
6
  __name: "PieSeries",
6
7
  props: {
7
8
  data: {},
@@ -9,32 +10,32 @@ const h = /* @__PURE__ */ o({
9
10
  id: {},
10
11
  visible: { type: Boolean, default: !0 }
11
12
  },
12
- setup(r) {
13
- const i = r, s = f(), t = n(null);
14
- return u(() => {
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);
13
+ setup(o) {
14
+ const e = o, i = c(), t = u(null);
15
+ return d(() => {
16
+ const a = i.addSeries(f, { ...e.options, id: e.id });
17
+ t.value = a, e.data.length > 0 && i.setSeriesData(a, r(e.data)), i.setSeriesVisible(a, e.visible);
17
18
  }), l(() => {
18
- t.value && s.removeSeries(t.value);
19
- }), a(
20
- () => i.data,
21
- (e) => {
22
- t.value && e.length > 0 && s.setSeriesData(t.value, e);
19
+ t.value && i.removeSeries(t.value);
20
+ }), s(
21
+ m(() => e.data),
22
+ () => {
23
+ t.value && e.data.length > 0 && i.setSeriesData(t.value, r(e.data));
23
24
  }
24
- ), a(
25
- () => i.options,
26
- (e) => {
27
- t.value && e && s.updateSeriesOptions(t.value, e);
25
+ ), s(
26
+ () => e.options,
27
+ (a) => {
28
+ t.value && a && i.updateSeriesOptions(t.value, a);
28
29
  },
29
30
  { deep: !0 }
30
- ), a(
31
- () => i.visible,
32
- (e) => {
33
- t.value && s.setSeriesVisible(t.value, e);
31
+ ), s(
32
+ () => e.visible,
33
+ (a) => {
34
+ t.value && i.setSeriesVisible(t.value, a);
34
35
  }
35
- ), (e, c) => d("", !0);
36
+ ), (a, v) => p("", !0);
36
37
  }
37
38
  });
38
39
  export {
39
- h as default
40
+ D as default
40
41
  };
@@ -1,17 +1,42 @@
1
- import { ref as l, onMounted as u, onUnmounted as a } from "vue";
2
- function A(e) {
3
- const n = l(e.getVisibleRange()), i = () => {
1
+ import { toRaw as A, ref as a, onMounted as u, onUnmounted as l } from "vue";
2
+ function f(e) {
3
+ return typeof e == "object" && e !== null && !Array.isArray(e) && Array.isArray(Reflect.get(e, "data"));
4
+ }
5
+ function c(e) {
6
+ return f(e) ? [e.data] : Array.isArray(e) ? Array.isArray(e[0]) || f(e[0]) ? e.map((t) => f(t) ? t.data : t) : [e] : [];
7
+ }
8
+ function v(e) {
9
+ const n = A(e), t = (o) => {
10
+ if (!f(o)) return A(o);
11
+ const s = A(o);
12
+ return { ...s, data: A(s.data) };
13
+ };
14
+ return Array.isArray(n) ? Array.isArray(n[0]) || f(n[0]) ? n.map(t) : n : t(n);
15
+ }
16
+ function p(e) {
17
+ return () => {
18
+ const n = e(), t = [n];
19
+ for (const i of c(n)) {
20
+ t.push(i, i.length);
21
+ const o = i[i.length - 1];
22
+ typeof o == "object" && o !== null && t.push(...Object.values(o));
23
+ }
24
+ return t;
25
+ };
26
+ }
27
+ function h(e) {
28
+ const n = a(e.getVisibleRange()), t = () => {
4
29
  n.value = e.getVisibleRange();
5
30
  };
6
- return u(() => e.on("viewportChange", i)), a(() => e.off("viewportChange", i)), n;
31
+ return u(() => e.on("viewportChange", t)), l(() => e.off("viewportChange", t)), n;
7
32
  }
8
- function d(e) {
9
- const n = l(e.getYRange()), i = () => {
33
+ function C(e) {
34
+ const n = a(e.getYRange()), t = () => {
10
35
  n.value = e.getYRange();
11
36
  };
12
- return u(() => e.on("viewportChange", i)), a(() => e.off("viewportChange", i)), n;
37
+ return u(() => e.on("viewportChange", t)), l(() => e.off("viewportChange", t)), n;
13
38
  }
14
- function r(e) {
39
+ function d(e) {
15
40
  return {
16
41
  yAxisPosition: e.yAxisPosition,
17
42
  yAxisWidth: e.yAxisWidth,
@@ -22,46 +47,48 @@ function r(e) {
22
47
  rightAxisScale: e.getAxisColumnScale("right")
23
48
  };
24
49
  }
25
- function h(e) {
26
- const n = l(r(e)), i = () => {
27
- const t = r(e), o = n.value;
28
- o.yAxisPosition === t.yAxisPosition && o.yAxisWidth === t.yAxisWidth && o.xAxisHeight === t.xAxisHeight && o.leftAxisWidth === t.leftAxisWidth && o.rightAxisWidth === t.rightAxisWidth && o.leftAxisScale === t.leftAxisScale && o.rightAxisScale === t.rightAxisScale || (n.value = t);
50
+ function S(e) {
51
+ const n = a(d(e)), t = () => {
52
+ const i = d(e), o = n.value;
53
+ o.yAxisPosition === i.yAxisPosition && o.yAxisWidth === i.yAxisWidth && o.xAxisHeight === i.xAxisHeight && o.leftAxisWidth === i.leftAxisWidth && o.rightAxisWidth === i.rightAxisWidth && o.leftAxisScale === i.leftAxisScale && o.rightAxisScale === i.rightAxisScale || (n.value = i);
29
54
  };
30
55
  return u(() => {
31
- i(), e.on("viewportChange", i);
32
- }), a(() => e.off("viewportChange", i)), n;
56
+ t(), e.on("viewportChange", t);
57
+ }), l(() => e.off("viewportChange", t)), n;
33
58
  }
34
- function p(e, n) {
35
- let i = e.getLastValue(n);
36
- const t = () => e.getYScale(e.getSeriesScale(n));
37
- let o = i ? t().valueToY(i.value) : null;
38
- const x = l(i), g = () => {
39
- const s = e.getLastValue(n), f = s ? t().valueToY(s.value) : null;
40
- i?.value === s?.value && i?.isLive === s?.isLive && o === f || (i = s, o = f, x.value = s);
59
+ function w(e, n) {
60
+ let t = e.getLastValue(n);
61
+ const i = () => e.getYScale(e.getSeriesScale(n));
62
+ let o = t ? i().valueToY(t.value) : null;
63
+ const s = a(t), g = () => {
64
+ const r = e.getLastValue(n), x = r ? i().valueToY(r.value) : null;
65
+ t?.value === r?.value && t?.isLive === r?.isLive && o === x || (t = r, o = x, s.value = r);
41
66
  };
42
67
  return u(() => {
43
68
  e.on("dataUpdate", g), e.on("viewportChange", g);
44
- }), a(() => {
69
+ }), l(() => {
45
70
  e.off("dataUpdate", g), e.off("viewportChange", g);
46
- }), x;
71
+ }), s;
47
72
  }
48
- function C(e, n) {
49
- const i = l(e.getPreviousClose(n)), t = () => {
50
- i.value = e.getPreviousClose(n);
73
+ function W(e, n) {
74
+ const t = a(e.getPreviousClose(n)), i = () => {
75
+ t.value = e.getPreviousClose(n);
51
76
  };
52
- return u(() => e.on("dataUpdate", t)), a(() => e.off("dataUpdate", t)), i;
77
+ return u(() => e.on("dataUpdate", i)), l(() => e.off("dataUpdate", i)), t;
53
78
  }
54
- function c(e) {
55
- const n = l(e.getCrosshairPosition()), i = () => {
79
+ function P(e) {
80
+ const n = a(e.getCrosshairPosition()), t = () => {
56
81
  n.value = e.getCrosshairPosition();
57
82
  };
58
- return u(() => e.on("crosshairMove", i)), a(() => e.off("crosshairMove", i)), n;
83
+ return u(() => e.on("crosshairMove", t)), l(() => e.off("crosshairMove", t)), n;
59
84
  }
60
85
  export {
61
- h as useAxisLayout,
62
- c as useCrosshairPosition,
63
- p as useLastYValue,
64
- C as usePreviousClose,
65
- A as useVisibleRange,
66
- d as useYRange
86
+ v as rawSeriesData,
87
+ p as seriesDataSource,
88
+ S as useAxisLayout,
89
+ P as useCrosshairPosition,
90
+ w as useLastYValue,
91
+ W as usePreviousClose,
92
+ h as useVisibleRange,
93
+ C as useYRange
67
94
  };