@wick-charts/vue 0.6.4 → 0.8.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 (55) hide show
  1. package/README.md +21 -7
  2. package/dist/BandSeries.vue.js +20 -18
  3. package/dist/BarSeries.vue.js +15 -13
  4. package/dist/CandlestickSeries.vue.js +31 -29
  5. package/dist/ChartContainer.vue.js +77 -70
  6. package/dist/LineSeries.vue.js +19 -17
  7. package/dist/composables.js +46 -36
  8. package/dist/core/dist/animation/viewport-engine.js +155 -96
  9. package/dist/core/dist/axis/dom-labels.js +56 -51
  10. package/dist/core/dist/chart/scale-guards.js +23 -5
  11. package/dist/core/dist/chart/x-guards.js +37 -0
  12. package/dist/core/dist/chart.js +1286 -843
  13. package/dist/core/dist/data/sync.js +37 -31
  14. package/dist/core/dist/navigator/controller.js +37 -37
  15. package/dist/core/dist/perf/perf-hud.js +3 -3
  16. package/dist/core/dist/scales/tick-tracker.js +2 -2
  17. package/dist/core/dist/scales/x-scale.js +167 -53
  18. package/dist/core/dist/scales/y-scale.js +36 -34
  19. package/dist/core/dist/series/band.js +266 -213
  20. package/dist/core/dist/series/bar.js +297 -291
  21. package/dist/core/dist/series/base-multi-layer.js +283 -237
  22. package/dist/core/dist/series/candlestick.js +1 -0
  23. package/dist/core/dist/series/line.js +21 -20
  24. package/dist/core/dist/snapshots.js +55 -43
  25. package/dist/index.d.ts +323 -58
  26. package/dist/index.js +9 -9
  27. package/dist/ui/Crosshair.vue.js +51 -27
  28. package/dist/ui/InfoBar.vue.js +37 -37
  29. package/dist/ui/Marker.vue.js +14 -11
  30. package/dist/ui/Navigator.vue.js +23 -23
  31. package/dist/ui/ReferenceLine.vue.js +19 -16
  32. package/dist/ui/Tooltip.vue.js +91 -86
  33. package/dist/ui/XAxis.vue.js +48 -0
  34. package/dist/ui/XAxis.vue2.js +4 -0
  35. package/dist/ui/YAxis.vue.js +44 -28
  36. package/dist/ui/YLabel.vue.js +78 -74
  37. package/package.json +9 -3
  38. package/src/BandSeries.vue +11 -6
  39. package/src/BarSeries.vue +13 -6
  40. package/src/CandlestickSeries.vue +9 -5
  41. package/src/ChartContainer.vue +20 -0
  42. package/src/LineSeries.vue +13 -6
  43. package/src/composables.ts +23 -4
  44. package/src/index.ts +8 -1
  45. package/src/ui/Crosshair.vue +41 -1
  46. package/src/ui/InfoBar.vue +2 -1
  47. package/src/ui/Marker.vue +5 -1
  48. package/src/ui/Navigator.vue +2 -1
  49. package/src/ui/ReferenceLine.vue +5 -1
  50. package/src/ui/Tooltip.vue +7 -4
  51. package/src/ui/{TimeAxis.vue → XAxis.vue} +18 -5
  52. package/src/ui/YAxis.vue +66 -12
  53. package/src/ui/YLabel.vue +35 -5
  54. package/dist/ui/TimeAxis.vue.js +0 -44
  55. package/dist/ui/TimeAxis.vue2.js +0 -4
package/dist/index.js CHANGED
@@ -17,10 +17,10 @@ import { default as y } from "./ui/NumberFlow.vue.js";
17
17
  import { default as q } from "./ui/PieLegend.vue.js";
18
18
  import { default as V } from "./ui/PieTooltip.vue.js";
19
19
  import { default as E } from "./ui/ReferenceLine.vue.js";
20
- import { default as U, default as j } from "./ui/TimeAxis.vue.js";
21
- import { default as K } from "./ui/TimeRegion.vue.js";
22
- import { default as W } from "./ui/Title.vue.js";
23
- import { default as _ } from "./ui/Tooltip.vue.js";
20
+ import { default as U } from "./ui/TimeRegion.vue.js";
21
+ import { default as J } from "./ui/Title.vue.js";
22
+ import { default as Q } from "./ui/Tooltip.vue.js";
23
+ import { default as Z, default as _ } from "./ui/XAxis.vue.js";
24
24
  import { default as ee } from "./ui/YAxis.vue.js";
25
25
  import { default as oe } from "./ui/YLabel.vue.js";
26
26
  import { BandSeriesDef as ae } from "./core/dist/series/band.js";
@@ -107,11 +107,11 @@ export {
107
107
  Ie as PieSeriesDef,
108
108
  V as PieTooltip,
109
109
  E as ReferenceLine,
110
- U as TimeAxis,
111
- K as TimeRegion,
112
- W as Title,
113
- _ as Tooltip,
114
- j as XAxis,
110
+ Z as TimeAxis,
111
+ U as TimeRegion,
112
+ J as Title,
113
+ Q as Tooltip,
114
+ _ as XAxis,
115
115
  ve as XScale,
116
116
  ee as YAxis,
117
117
  oe as YLabel,
@@ -1,21 +1,34 @@
1
- import { defineComponent as v, ref as d, onMounted as f, onUnmounted as y, computed as n, unref as t, openBlock as h, createElementBlock as x, Fragment as g, createElementVNode as c, normalizeStyle as m, toDisplayString as u, createCommentVNode as b } from "vue";
2
- import { useCrosshairPosition as C } from "../composables.js";
3
- import { useChartInstance as S } from "../context.js";
4
- const E = /* @__PURE__ */ v({
1
+ import { defineComponent as C, ref as Y, onMounted as _, onUnmounted as I, computed as a, unref as n, openBlock as u, createElementBlock as c, Fragment as g, normalizeStyle as p, toDisplayString as v, createCommentVNode as h, renderList as T, createElementVNode as V } from "vue";
2
+ import { useCrosshairPosition as z } from "../composables.js";
3
+ import { useChartInstance as B } from "../context.js";
4
+ const P = /* @__PURE__ */ C({
5
5
  __name: "Crosshair",
6
- setup(k) {
7
- const e = S(), o = C(e), r = d(0), l = () => {
8
- r.value++;
6
+ setup(E) {
7
+ const e = B(), t = z(e), l = Y(0), d = () => {
8
+ l.value++;
9
9
  };
10
- f(() => e.on("overlayChange", l)), y(() => e.off("overlayChange", l));
11
- const a = n(() => (r.value, e.getTheme())), i = n(() => e.getDataInterval()), p = n(() => (o.value, e.timeScale.niceTickValues(i.value).tickInterval || i.value)), s = n(() => ({
10
+ _(() => e.on("overlayChange", d)), I(() => e.off("overlayChange", d));
11
+ const i = a(() => (l.value, e.getTheme())), f = a(() => e.getDataInterval()), S = a(() => (t.value, e.timeScale.niceTickValues(f.value).tickInterval || f.value)), b = a(() => {
12
+ l.value;
13
+ const o = t.value;
14
+ return o === null ? "" : e.yScale.formatY(o.y);
15
+ }), y = a(() => {
16
+ l.value;
17
+ const o = t.value;
18
+ return o === null ? [] : e.getYScaleIds().flatMap((s) => {
19
+ const r = e.getYScaleColumn(s);
20
+ if (r === null) return [];
21
+ const x = e.getYScale(s);
22
+ return [{ scale: s, position: r.position, text: x.formatY(x.yToValue(o.mediaY)) }];
23
+ });
24
+ }), k = a(() => y.value.some((o) => o.position === e.yAxisPosition)), m = a(() => ({
12
25
  // Blend the theme's labelBackground at 80% opacity so the axis grid
13
26
  // shows through — keeps the badge from looking like an opaque block
14
27
  // while still masking whatever tick sits underneath.
15
- background: `color-mix(in srgb, ${a.value.crosshair.labelBackground} 80%, transparent)`,
16
- color: a.value.crosshair.labelTextColor,
17
- fontSize: a.value.axis.fontSize + "px",
18
- fontFamily: a.value.typography.fontFamily,
28
+ background: `color-mix(in srgb, ${i.value.crosshair.labelBackground} 80%, transparent)`,
29
+ color: i.value.crosshair.labelTextColor,
30
+ fontSize: i.value.axis.fontSize + "px",
31
+ fontFamily: i.value.typography.fontFamily,
19
32
  fontVariantNumeric: "tabular-nums",
20
33
  padding: "2px 6px",
21
34
  borderRadius: "2px",
@@ -25,28 +38,39 @@ const E = /* @__PURE__ */ v({
25
38
  // live last-value stays visible when the crosshair crosses its row.
26
39
  zIndex: 2
27
40
  }));
28
- return (_, I) => t(o) ? (h(), x(g, { key: 0 }, [
29
- c("div", {
30
- style: m({
41
+ return (o, s) => n(t) ? (u(), c(g, { key: 0 }, [
42
+ k.value ? h("", !0) : (u(), c("div", {
43
+ key: 0,
44
+ style: p({
31
45
  position: "absolute",
32
- [t(e).yAxisPosition]: "0",
33
- top: t(o).mediaY + "px",
46
+ [n(e).yAxisPosition]: "0",
47
+ top: n(t).mediaY + "px",
34
48
  transform: "translateY(-50%)",
35
- ...s.value
49
+ ...m.value
36
50
  })
37
- }, u(t(e).yScale.formatY(t(o).y)), 5),
38
- c("div", {
39
- style: m({
51
+ }, v(b.value), 5)),
52
+ (u(!0), c(g, null, T(y.value, (r) => (u(), c("div", {
53
+ key: r.scale,
54
+ style: p({
55
+ position: "absolute",
56
+ [r.position]: "0",
57
+ top: n(t).mediaY + "px",
58
+ transform: "translateY(-50%)",
59
+ ...m.value
60
+ })
61
+ }, v(r.text), 5))), 128)),
62
+ V("div", {
63
+ style: p({
40
64
  position: "absolute",
41
65
  bottom: "0",
42
- left: t(o).mediaX + "px",
66
+ left: n(t).mediaX + "px",
43
67
  transform: "translateX(-50%)",
44
- ...s.value
68
+ ...m.value
45
69
  })
46
- }, u(t(e).timeScale.formatX(t(o).time, p.value)), 5)
47
- ], 64)) : b("", !0);
70
+ }, v(n(e).timeScale.formatX(n(t).time, S.value)), 5)
71
+ ], 64)) : h("", !0);
48
72
  }
49
73
  });
50
74
  export {
51
- E as default
75
+ P as default
52
76
  };
@@ -1,28 +1,28 @@
1
- import { defineComponent as W, computed as i, inject as B, ref as N, onMounted as T, onUnmounted as A, useSlots as O, unref as t, openBlock as n, createBlock as R, Teleport as D, createElementVNode as l, normalizeStyle as r, renderSlot as M, createElementBlock as s, Fragment as c, toDisplayString as p, renderList as F, createCommentVNode as L } from "vue";
2
- import { buildHoverSnapshots as P, buildLastSnapshots as $ } from "../core/dist/snapshots.js";
3
- import { resolveCandlestickBodyColor as j } from "../core/dist/theme/resolve.js";
4
- import { formatCompact as U, formatPriceAdaptive as X } from "../core/dist/utils/format.js";
5
- import { useCrosshairPosition as q } from "../composables.js";
6
- import { useChartInstance as G, ThemeKey as J, InfoBarAnchorKey as Q } from "../context.js";
7
- const Y = {
1
+ import { defineComponent as W, computed as i, inject as B, ref as N, onMounted as T, onUnmounted as A, useSlots as O, unref as t, openBlock as n, createBlock as R, Teleport as $, createElementVNode as l, normalizeStyle as r, renderSlot as D, createElementBlock as s, Fragment as f, toDisplayString as p, renderList as L, createCommentVNode as F } from "vue";
2
+ import { buildHoverSnapshots as M, buildLastSnapshots as P, formatHeaderX as j } from "../core/dist/snapshots.js";
3
+ import { resolveCandlestickBodyColor as U } from "../core/dist/theme/resolve.js";
4
+ import { formatCompact as X, formatPriceAdaptive as q } from "../core/dist/utils/format.js";
5
+ import { useCrosshairPosition as G } from "../composables.js";
6
+ import { useChartInstance as J, ThemeKey as Q, InfoBarAnchorKey as Y } from "../context.js";
7
+ const Z = {
8
8
  key: 0,
9
9
  style: { display: "inline-flex", alignItems: "center", gap: "4px" }
10
- }, Z = {
10
+ }, ee = {
11
11
  key: 1,
12
12
  style: { display: "inline-flex", alignItems: "center", gap: "3px" }
13
- }, ee = {
13
+ }, te = {
14
14
  key: 2,
15
15
  style: { display: "inline-flex", alignItems: "center", gap: "3px" }
16
- }, ie = /* @__PURE__ */ W({
16
+ }, se = /* @__PURE__ */ W({
17
17
  __name: "InfoBar",
18
18
  props: {
19
19
  sort: {},
20
20
  format: { type: Function }
21
21
  },
22
22
  setup(E) {
23
- const b = E, k = i(() => b.sort ?? "none"), f = i(
24
- () => b.format ?? ((a, _) => _ === "volume" ? U(a) : X(a))
25
- ), u = G(), y = q(u), o = B(J), g = B(Q);
23
+ const b = E, k = i(() => b.sort ?? "none"), d = i(
24
+ () => b.format ?? ((a, _) => _ === "volume" ? X(a) : q(a))
25
+ ), u = J(), y = G(u), o = B(Q), g = B(Y);
26
26
  if (!o)
27
27
  throw new Error("<InfoBar> must be used within <ChartContainer>: missing ThemeKey.");
28
28
  if (!g)
@@ -38,17 +38,17 @@ const Y = {
38
38
  const x = i(() => {
39
39
  h.value;
40
40
  const a = y.value;
41
- return a === null ? null : P(u, { time: a.time, sort: k.value, cacheKey: "infobar-hover" });
42
- }), K = i(() => (h.value, $(u, { sort: k.value, cacheKey: "infobar-last" }))), m = i(() => x.value !== null && x.value.length > 0), d = i(
43
- () => m.value ? x.value : K.value
44
- ), z = i(() => u.getDataInterval()), S = i(() => d.value.length === 0 ? 0 : m.value && y.value ? y.value.time : Math.max(...d.value.map((a) => a.data.time))), H = O(), w = i(() => typeof H.default == "function");
41
+ return a === null ? null : M(u, { time: a.time, sort: k.value, cacheKey: "infobar-hover" });
42
+ }), H = i(() => (h.value, P(u, { sort: k.value, cacheKey: "infobar-last" }))), m = i(() => x.value !== null && x.value.length > 0), c = i(
43
+ () => m.value ? x.value : H.value
44
+ ), K = i(() => u.getDataInterval()), S = i(() => c.value.length === 0 ? 0 : m.value && y.value ? y.value.time : Math.max(...c.value.map((a) => a.data.time))), z = O(), w = i(() => typeof z.default == "function");
45
45
  function I(a) {
46
46
  return "open" in a;
47
47
  }
48
48
  function V(a) {
49
49
  return "high" in a && !I(a);
50
50
  }
51
- return (a, _) => t(g) && t(o) && d.value.length > 0 ? (n(), R(D, {
51
+ return (a, _) => t(g) && t(o) && c.value.length > 0 ? (n(), R($, {
52
52
  key: 0,
53
53
  to: t(g)
54
54
  }, [
@@ -81,25 +81,25 @@ const Y = {
81
81
  }
82
82
  )
83
83
  }, [
84
- w.value ? M(a.$slots, "default", {
84
+ w.value ? D(a.$slots, "default", {
85
85
  key: 0,
86
- snapshots: d.value,
86
+ snapshots: c.value,
87
87
  time: S.value,
88
88
  isHover: m.value
89
- }) : (n(), s(c, { key: 1 }, [
89
+ }) : (n(), s(f, { key: 1 }, [
90
90
  l("span", {
91
91
  style: r({ color: t(o).axis.textColor, marginRight: "2px" })
92
- }, p(t(u).timeScale.formatX(S.value, z.value)), 5),
93
- (n(!0), s(c, null, F(d.value, (e) => (n(), s(c, {
92
+ }, p(t(j)(t(u), { time: S.value, snapshots: c.value, interval: K.value })), 5),
93
+ (n(!0), s(f, null, L(c.value, (e) => (n(), s(f, {
94
94
  key: e.id
95
95
  }, [
96
- I(e.data) ? (n(), s("span", Y, [
97
- (n(!0), s(c, null, F([
96
+ I(e.data) ? (n(), s("span", Z, [
97
+ (n(!0), s(f, null, L([
98
98
  { label: "O", field: "open", val: e.data.open },
99
99
  { label: "H", field: "high", val: e.data.high },
100
100
  { label: "L", field: "low", val: e.data.low },
101
101
  { label: "C", field: "close", val: e.data.close }
102
- ], (v) => (n(), s(c, {
102
+ ], (v) => (n(), s(f, {
103
103
  key: v.label
104
104
  }, [
105
105
  l("span", {
@@ -107,23 +107,23 @@ const Y = {
107
107
  }, p(v.label), 5),
108
108
  l("span", {
109
109
  style: r({
110
- color: t(j)(
110
+ color: t(U)(
111
111
  e.data.close >= e.data.open ? t(o).candlestick.up.body : t(o).candlestick.down.body
112
112
  ),
113
113
  fontWeight: 500,
114
114
  marginLeft: "2px"
115
115
  })
116
- }, p(f.value(v.val, v.field)), 5)
116
+ }, p(d.value(v.val, v.field)), 5)
117
117
  ], 64))), 128)),
118
- e.data.volume != null ? (n(), s(c, { key: 0 }, [
118
+ e.data.volume != null ? (n(), s(f, { key: 0 }, [
119
119
  l("span", {
120
120
  style: r({ color: t(o).axis.textColor, opacity: 0.5, marginLeft: "5px" })
121
121
  }, "V", 4),
122
122
  l("span", {
123
123
  style: r({ color: t(o).axis.textColor, fontWeight: 500, marginLeft: "2px" })
124
- }, p(f.value(e.data.volume, "volume")), 5)
125
- ], 64)) : L("", !0)
126
- ])) : V(e.data) ? (n(), s("span", Z, [
124
+ }, p(d.value(e.data.volume, "volume")), 5)
125
+ ], 64)) : F("", !0)
126
+ ])) : V(e.data) ? (n(), s("span", ee, [
127
127
  l("span", {
128
128
  style: r({
129
129
  width: "6px",
@@ -135,8 +135,8 @@ const Y = {
135
135
  }, null, 4),
136
136
  l("span", {
137
137
  style: r({ color: e.color, fontWeight: 500 })
138
- }, p(f.value(e.data.low, "low")) + " – " + p(f.value(e.data.high, "high")), 5)
139
- ])) : (n(), s("span", ee, [
138
+ }, p(d.value(e.data.low, "low")) + " – " + p(d.value(e.data.high, "high")), 5)
139
+ ])) : (n(), s("span", te, [
140
140
  l("span", {
141
141
  style: r({
142
142
  width: "6px",
@@ -148,14 +148,14 @@ const Y = {
148
148
  }, null, 4),
149
149
  l("span", {
150
150
  style: r({ color: e.color, fontWeight: 500 })
151
- }, p(f.value(e.data.value, "value")), 5)
151
+ }, p(d.value(e.data.value, "value")), 5)
152
152
  ]))
153
153
  ], 64))), 128))
154
154
  ], 64))
155
155
  ], 4)
156
- ], 8, ["to"])) : L("", !0);
156
+ ], 8, ["to"])) : F("", !0);
157
157
  }
158
158
  });
159
159
  export {
160
- ie as default
160
+ se as default
161
161
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as s, onMounted as o, onUnmounted as t, watch as u, createCommentVNode as n } from "vue";
2
- import { useChartInstance as p } from "../context.js";
2
+ import { useChartInstance as c } from "../context.js";
3
3
  const h = /* @__PURE__ */ s({
4
4
  __name: "Marker",
5
5
  props: {
@@ -9,37 +9,40 @@ const h = /* @__PURE__ */ s({
9
9
  shape: {},
10
10
  pulse: { type: Boolean },
11
11
  label: {},
12
- color: {}
12
+ color: {},
13
+ scale: {}
13
14
  },
14
- setup(a) {
15
- const e = a, r = p();
15
+ setup(r) {
16
+ const e = r, a = c();
16
17
  let l = null;
17
18
  return o(() => {
18
- l = r.addMarker({
19
+ l = a.addMarker({
19
20
  time: e.time,
20
21
  value: e.value,
21
22
  seriesId: e.seriesId,
22
23
  shape: e.shape,
23
24
  pulse: e.pulse,
24
25
  label: e.label,
25
- color: e.color
26
+ color: e.color,
27
+ scale: e.scale
26
28
  });
27
29
  }), t(() => {
28
- l !== null && r.removeMarker(l), l = null;
30
+ l !== null && a.removeMarker(l), l = null;
29
31
  }), u(
30
- () => [e.time, e.value, e.seriesId, e.shape, e.pulse, e.label, e.color],
32
+ () => [e.time, e.value, e.seriesId, e.shape, e.pulse, e.label, e.color, e.scale],
31
33
  () => {
32
- l !== null && r.updateMarker(l, {
34
+ l !== null && a.updateMarker(l, {
33
35
  time: e.time,
34
36
  value: e.value,
35
37
  seriesId: e.seriesId,
36
38
  shape: e.shape,
37
39
  pulse: e.pulse,
38
40
  label: e.label,
39
- color: e.color
41
+ color: e.color,
42
+ scale: e.scale
40
43
  });
41
44
  }
42
- ), (i, m) => n("", !0);
45
+ ), (p, i) => n("", !0);
43
46
  }
44
47
  });
45
48
  export {
@@ -1,58 +1,58 @@
1
- import { defineComponent as f, inject as n, ref as m, shallowRef as d, computed as p, watch as i, onBeforeUnmount as g, unref as u, openBlock as y, createBlock as _, Teleport as w, createElementVNode as C, normalizeStyle as N, createCommentVNode as k } from "vue";
2
- import { NavigatorController as R } from "../core/dist/navigator/controller.js";
3
- import { NavigatorAnchorKey as x, ChartKey as B, ThemeKey as K } from "../context.js";
4
- const V = /* @__PURE__ */ f({
1
+ import { defineComponent as d, inject as n, ref as p, shallowRef as g, computed as u, watch as l, onBeforeUnmount as y, unref as c, openBlock as _, createBlock as w, Teleport as N, createElementVNode as k, normalizeStyle as C, createCommentVNode as R } from "vue";
2
+ import { NavigatorController as x } from "../core/dist/navigator/controller.js";
3
+ import { NavigatorAnchorKey as B, ChartKey as K, ThemeKey as T } from "../context.js";
4
+ const S = /* @__PURE__ */ d({
5
5
  __name: "Navigator",
6
6
  props: {
7
7
  data: {},
8
8
  height: {}
9
9
  },
10
- setup(c) {
11
- const t = c, a = n(x), l = n(B), h = n(K);
12
- if (!a || !l || !h)
10
+ setup(v) {
11
+ const t = v, a = n(B), r = n(K), h = n(T);
12
+ if (!a || !r || !h)
13
13
  throw new Error("<Navigator> must be used within <ChartContainer>.");
14
- const s = m(null), o = d(null), v = p(() => t.height ?? h.value.navigator.height);
15
- return i(
16
- [s, () => l.value],
17
- ([e, r]) => {
18
- !e || !r || o.value || (o.value = new R({
14
+ const s = p(null), o = g(null), m = u(() => t.height ?? h.value.navigator.height), f = u(() => r.value?.checkTimeOnlyFeature("Navigator") ?? !1);
15
+ return l(
16
+ [s, () => r.value],
17
+ ([e, i]) => {
18
+ !e || !i || o.value || (o.value = new x({
19
19
  container: e,
20
- chart: r,
20
+ chart: i,
21
21
  data: t.data,
22
22
  options: t.height !== void 0 ? { height: t.height } : void 0
23
23
  }));
24
24
  },
25
25
  { flush: "post", immediate: !0 }
26
- ), i(
26
+ ), l(
27
27
  () => t.data,
28
28
  (e) => {
29
29
  o.value?.setData(e);
30
30
  }
31
- ), i(
31
+ ), l(
32
32
  () => t.height,
33
33
  (e) => {
34
34
  o.value?.setOptions(e !== void 0 ? { height: e } : {});
35
35
  }
36
- ), g(() => {
36
+ ), y(() => {
37
37
  o.value?.destroy(), o.value = null;
38
- }), (e, r) => u(a) ? (y(), _(w, {
38
+ }), (e, i) => c(a) && f.value ? (_(), w(N, {
39
39
  key: 0,
40
- to: u(a)
40
+ to: c(a)
41
41
  }, [
42
- C("div", {
42
+ k("div", {
43
43
  ref_key: "stripRef",
44
44
  ref: s,
45
45
  "data-chart-navigator": "",
46
- style: N({
46
+ style: C({
47
47
  position: "relative",
48
48
  width: "100%",
49
- height: v.value + "px",
49
+ height: m.value + "px",
50
50
  flexShrink: 0
51
51
  })
52
52
  }, null, 4)
53
- ], 8, ["to"])) : k("", !0);
53
+ ], 8, ["to"])) : R("", !0);
54
54
  }
55
55
  });
56
56
  export {
57
- V as default
57
+ S as default
58
58
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as n, onMounted as r, onUnmounted as a, watch as i, createCommentVNode as u } from "vue";
2
- import { useChartInstance as c } from "../context.js";
3
- const p = /* @__PURE__ */ n({
1
+ import { defineComponent as a, onMounted as n, onUnmounted as r, watch as c, createCommentVNode as i } from "vue";
2
+ import { useChartInstance as s } from "../context.js";
3
+ const p = /* @__PURE__ */ a({
4
4
  __name: "ReferenceLine",
5
5
  props: {
6
6
  value: {},
@@ -8,35 +8,38 @@ const p = /* @__PURE__ */ n({
8
8
  color: {},
9
9
  label: {},
10
10
  style: {},
11
- width: {}
11
+ width: {},
12
+ scale: {}
12
13
  },
13
14
  setup(o) {
14
- const e = o, l = c();
15
- let t = null;
16
- return r(() => {
17
- t = l.addLine({
15
+ const e = o, t = s();
16
+ let l = null;
17
+ return n(() => {
18
+ l = t.addLine({
18
19
  value: e.value,
19
20
  time: e.time,
20
21
  color: e.color,
21
22
  label: e.label,
22
23
  style: e.style,
23
- width: e.width
24
+ width: e.width,
25
+ scale: e.scale
24
26
  });
25
- }), a(() => {
26
- t !== null && l.removeLine(t), t = null;
27
- }), i(
28
- () => [e.value, e.time, e.color, e.label, e.style, e.width],
27
+ }), r(() => {
28
+ l !== null && t.removeLine(l), l = null;
29
+ }), c(
30
+ () => [e.value, e.time, e.color, e.label, e.style, e.width, e.scale],
29
31
  () => {
30
- t !== null && l.updateLine(t, {
32
+ l !== null && t.updateLine(l, {
31
33
  value: e.value,
32
34
  time: e.time,
33
35
  color: e.color,
34
36
  label: e.label,
35
37
  style: e.style,
36
- width: e.width
38
+ width: e.width,
39
+ scale: e.scale
37
40
  });
38
41
  }
39
- ), (m, s) => u("", !0);
42
+ ), (u, m) => i("", !0);
40
43
  }
41
44
  });
42
45
  export {