@wick-charts/vue 0.6.3 → 0.7.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.
- package/README.md +6 -6
- package/dist/BandSeries.vue.js +52 -0
- package/dist/BandSeries.vue2.js +4 -0
- package/dist/BarSeries.vue.js +15 -13
- package/dist/CandlestickSeries.vue.js +31 -29
- package/dist/ChartContainer.vue.js +75 -68
- package/dist/LineSeries.vue.js +19 -17
- package/dist/composables.js +46 -36
- package/dist/core/dist/animation/config.js +92 -75
- package/dist/core/dist/animation/viewport-engine.js +155 -96
- package/dist/core/dist/axis/dom-labels.js +56 -51
- package/dist/core/dist/chart/badge-animator.js +30 -22
- package/dist/core/dist/chart/edge-indicators.js +22 -21
- package/dist/core/dist/chart/last-value.js +33 -26
- package/dist/core/dist/chart/scale-guards.js +23 -5
- package/dist/core/dist/chart/x-guards.js +37 -0
- package/dist/core/dist/chart.js +1286 -842
- package/dist/core/dist/data/decimation.js +58 -39
- package/dist/core/dist/data/sync.js +37 -31
- package/dist/core/dist/navigator/controller.js +41 -41
- package/dist/core/dist/perf/perf-hud.js +3 -3
- package/dist/core/dist/scales/tick-tracker.js +2 -2
- package/dist/core/dist/scales/x-scale.js +167 -53
- package/dist/core/dist/scales/y-scale.js +36 -34
- package/dist/core/dist/series/band.js +723 -0
- package/dist/core/dist/series/bar.js +297 -291
- package/dist/core/dist/series/base-multi-layer.js +283 -237
- package/dist/core/dist/series/candlestick.js +32 -31
- package/dist/core/dist/series/heatmap.js +5 -5
- package/dist/core/dist/series/line-intro.js +47 -37
- package/dist/core/dist/series/line.js +489 -448
- package/dist/core/dist/series/painters/builtins.js +4 -4
- package/dist/core/dist/series/painters/canvas-path.js +64 -52
- package/dist/core/dist/series/register-builtins.js +9 -8
- package/dist/core/dist/snapshots.js +59 -46
- package/dist/core/dist/utils/point.js +10 -0
- package/dist/index.d.ts +552 -129
- package/dist/index.js +195 -191
- package/dist/ui/Crosshair.vue.js +51 -27
- package/dist/ui/InfoBar.vue.js +98 -79
- package/dist/ui/Marker.vue.js +14 -11
- package/dist/ui/Navigator.vue.js +23 -23
- package/dist/ui/ReferenceLine.vue.js +19 -16
- package/dist/ui/Tooltip.vue.js +116 -84
- package/dist/ui/XAxis.vue.js +48 -0
- package/dist/ui/XAxis.vue2.js +4 -0
- package/dist/ui/YAxis.vue.js +44 -28
- package/dist/ui/YLabel.vue.js +82 -85
- package/package.json +2 -2
- package/src/BandSeries.vue +92 -0
- package/src/BarSeries.vue +13 -6
- package/src/CandlestickSeries.vue +9 -5
- package/src/ChartContainer.vue +20 -0
- package/src/LineSeries.vue +13 -6
- package/src/composables.ts +23 -4
- package/src/index.ts +16 -1
- package/src/ui/Crosshair.vue +41 -1
- package/src/ui/InfoBar.vue +22 -2
- package/src/ui/Marker.vue +5 -1
- package/src/ui/Navigator.vue +2 -1
- package/src/ui/ReferenceLine.vue +5 -1
- package/src/ui/Tooltip.vue +43 -6
- package/src/ui/{TimeAxis.vue → XAxis.vue} +18 -5
- package/src/ui/YAxis.vue +66 -12
- package/src/ui/YLabel.vue +37 -18
- package/dist/ui/TimeAxis.vue.js +0 -44
- package/dist/ui/TimeAxis.vue2.js +0 -4
package/dist/ui/Tooltip.vue.js
CHANGED
|
@@ -1,88 +1,101 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { buildHoverSnapshots as
|
|
3
|
-
import { resolveCandlestickBodyColor as
|
|
4
|
-
import { computeTooltipPosition as
|
|
5
|
-
import { formatCompact as
|
|
6
|
-
import { formatDate as
|
|
7
|
-
import { useCrosshairPosition as
|
|
8
|
-
import { useChartInstance as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as X, computed as h, ref as z, onMounted as Y, onUnmounted as Z, useSlots as $, watchEffect as K, openBlock as i, createElementBlock as n, Fragment as f, unref as d, normalizeStyle as m, createElementVNode as s, createTextVNode as R, toDisplayString as c, createCommentVNode as w, renderList as H, renderSlot as U } from "vue";
|
|
2
|
+
import { buildHoverSnapshots as j, formatHeaderX as q } from "../core/dist/snapshots.js";
|
|
3
|
+
import { resolveCandlestickBodyColor as G } from "../core/dist/theme/resolve.js";
|
|
4
|
+
import { computeTooltipPosition as I } from "../core/dist/tooltip-position.js";
|
|
5
|
+
import { formatCompact as J, formatPriceAdaptive as Q } from "../core/dist/utils/format.js";
|
|
6
|
+
import { formatDate as ee } from "../core/dist/utils/time.js";
|
|
7
|
+
import { useCrosshairPosition as te } from "../composables.js";
|
|
8
|
+
import { useChartInstance as oe } from "../context.js";
|
|
9
|
+
const ae = {
|
|
10
10
|
key: 0,
|
|
11
11
|
style: { display: "grid", gridTemplateColumns: "auto 1fr", gap: "4px 12px" }
|
|
12
|
-
},
|
|
12
|
+
}, le = { style: { opacity: 0.5 } }, ie = {
|
|
13
13
|
key: 1,
|
|
14
14
|
style: { display: "flex", alignItems: "center", gap: "8px", padding: "2px 0" }
|
|
15
|
-
},
|
|
15
|
+
}, ne = { style: {
|
|
16
|
+
opacity: 0.6,
|
|
17
|
+
flex: "1",
|
|
18
|
+
minWidth: 0,
|
|
19
|
+
overflow: "hidden",
|
|
20
|
+
textOverflow: "ellipsis",
|
|
21
|
+
whiteSpace: "nowrap"
|
|
22
|
+
} }, re = {
|
|
23
|
+
key: 2,
|
|
24
|
+
style: { display: "flex", alignItems: "center", gap: "8px", padding: "2px 0" }
|
|
25
|
+
}, se = { style: { opacity: 0.6, flex: "1" } }, ue = ["data-measured"], ye = /* @__PURE__ */ X({
|
|
16
26
|
__name: "Tooltip",
|
|
17
27
|
props: {
|
|
18
28
|
sort: {},
|
|
19
29
|
format: { type: Function }
|
|
20
30
|
},
|
|
21
|
-
setup(
|
|
22
|
-
const F =
|
|
23
|
-
() => F.format ?? ((a,
|
|
24
|
-
), t =
|
|
31
|
+
setup(T) {
|
|
32
|
+
const F = T, O = h(() => F.sort ?? "none"), x = h(
|
|
33
|
+
() => F.format ?? ((a, r) => r === "volume" ? J(a) : Q(a))
|
|
34
|
+
), t = oe(), u = te(t), C = z(0), W = () => {
|
|
25
35
|
C.value++;
|
|
26
36
|
};
|
|
27
|
-
|
|
37
|
+
Y(() => {
|
|
28
38
|
t.on("overlayChange", W), t.getSeriesIds().length > 0 && C.value++;
|
|
29
|
-
}),
|
|
39
|
+
}), Z(() => {
|
|
30
40
|
t.off("overlayChange", W);
|
|
31
41
|
});
|
|
32
|
-
const o =
|
|
33
|
-
time:
|
|
34
|
-
sort:
|
|
42
|
+
const o = h(() => t.getTheme()), V = h(() => t.getDataInterval()), v = h(() => (C.value, u.value ? j(t, {
|
|
43
|
+
time: u.value.time,
|
|
44
|
+
sort: O.value,
|
|
35
45
|
cacheKey: "tooltip"
|
|
36
|
-
}) : [])),
|
|
46
|
+
}) : [])), _ = h(() => u.value?.time ?? 0), A = $(), y = h(() => typeof A.default == "function"), B = z(null), b = z(null);
|
|
37
47
|
let S = null;
|
|
38
|
-
|
|
39
|
-
if (!
|
|
40
|
-
const
|
|
41
|
-
!
|
|
48
|
+
K((a) => {
|
|
49
|
+
if (!y.value) return;
|
|
50
|
+
const r = B.value;
|
|
51
|
+
!r || typeof ResizeObserver > "u" || (S = new ResizeObserver((e) => {
|
|
42
52
|
const l = e[0]?.contentRect;
|
|
43
53
|
if (!l) return;
|
|
44
|
-
const
|
|
45
|
-
(!
|
|
46
|
-
}), S.observe(
|
|
54
|
+
const k = b.value;
|
|
55
|
+
(!k || k.width !== l.width || k.height !== l.height) && (b.value = { width: l.width, height: l.height });
|
|
56
|
+
}), S.observe(r), a(() => {
|
|
47
57
|
S?.disconnect(), S = null;
|
|
48
58
|
}));
|
|
49
59
|
});
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
52
|
-
const a = t.getMediaSize(),
|
|
53
|
-
if (
|
|
54
|
-
const
|
|
55
|
-
return
|
|
56
|
-
x:
|
|
57
|
-
y:
|
|
58
|
-
chartLeft:
|
|
60
|
+
const g = h(() => {
|
|
61
|
+
if (!u.value || v.value.length === 0) return null;
|
|
62
|
+
const a = t.getMediaSize(), r = t.plotLeft, e = t.getLayout().chartArea.width, l = a.height - t.xAxisHeight;
|
|
63
|
+
if (y.value) {
|
|
64
|
+
const p = b.value;
|
|
65
|
+
return p ? I({
|
|
66
|
+
x: u.value.mediaX,
|
|
67
|
+
y: u.value.mediaY,
|
|
68
|
+
chartLeft: r,
|
|
59
69
|
chartWidth: e,
|
|
60
70
|
chartHeight: l,
|
|
61
|
-
tooltipWidth:
|
|
62
|
-
tooltipHeight:
|
|
63
|
-
}) : { left:
|
|
71
|
+
tooltipWidth: p.width,
|
|
72
|
+
tooltipHeight: p.height
|
|
73
|
+
}) : { left: r, top: 0 };
|
|
64
74
|
}
|
|
65
|
-
const
|
|
66
|
-
return
|
|
67
|
-
x:
|
|
68
|
-
y:
|
|
69
|
-
chartLeft:
|
|
75
|
+
const k = v.value.some((p) => "open" in p.data), P = v.value.filter((p) => !("open" in p.data)).length, D = v.value.some((p) => "high" in p.data && !("open" in p.data)) ? 220 : 160, M = k ? 140 : 40 + P * 22;
|
|
76
|
+
return I({
|
|
77
|
+
x: u.value.mediaX,
|
|
78
|
+
y: u.value.mediaY,
|
|
79
|
+
chartLeft: r,
|
|
70
80
|
chartWidth: e,
|
|
71
81
|
chartHeight: l,
|
|
72
|
-
tooltipWidth:
|
|
73
|
-
tooltipHeight:
|
|
82
|
+
tooltipWidth: D,
|
|
83
|
+
tooltipHeight: M
|
|
74
84
|
});
|
|
75
|
-
}),
|
|
76
|
-
function
|
|
85
|
+
}), E = h(() => !y.value || b.value !== null);
|
|
86
|
+
function L(a) {
|
|
77
87
|
return "open" in a;
|
|
78
88
|
}
|
|
79
|
-
|
|
80
|
-
|
|
89
|
+
function N(a) {
|
|
90
|
+
return "high" in a && !L(a);
|
|
91
|
+
}
|
|
92
|
+
return (a, r) => (i(), n(f, null, [
|
|
93
|
+
d(u) && v.value.length > 0 && g.value && !y.value ? (i(), n("div", {
|
|
81
94
|
key: 0,
|
|
82
95
|
style: m({
|
|
83
96
|
position: "absolute",
|
|
84
|
-
left:
|
|
85
|
-
top:
|
|
97
|
+
left: g.value.left + "px",
|
|
98
|
+
top: g.value.top + "px",
|
|
86
99
|
pointerEvents: "none",
|
|
87
100
|
background: o.value.tooltip.background,
|
|
88
101
|
backdropFilter: "blur(12px)",
|
|
@@ -100,7 +113,7 @@ const ee = {
|
|
|
100
113
|
transition: "opacity 0.15s ease"
|
|
101
114
|
})
|
|
102
115
|
}, [
|
|
103
|
-
|
|
116
|
+
s("div", {
|
|
104
117
|
style: m({
|
|
105
118
|
fontSize: o.value.axis.fontSize + "px",
|
|
106
119
|
color: o.value.axis.textColor,
|
|
@@ -109,38 +122,57 @@ const ee = {
|
|
|
109
122
|
borderBottom: "1px solid " + o.value.tooltip.borderColor,
|
|
110
123
|
letterSpacing: "0.02em"
|
|
111
124
|
})
|
|
112
|
-
},
|
|
113
|
-
|
|
125
|
+
}, [
|
|
126
|
+
d(t).timeScale.getType() === "time" ? (i(), n(f, { key: 0 }, [
|
|
127
|
+
R(c(d(ee)(_.value, { locale: d(t).timeScale.getLocale(), timeZone: d(t).timeScale.getTimeZone() })), 1)
|
|
128
|
+
], 64)) : w("", !0),
|
|
129
|
+
R(" " + c(d(q)(d(t), { time: _.value, snapshots: v.value, interval: V.value })), 1)
|
|
130
|
+
], 4),
|
|
131
|
+
(i(!0), n(f, null, H(v.value, (e) => (i(), n(f, {
|
|
114
132
|
key: e.id
|
|
115
133
|
}, [
|
|
116
|
-
|
|
117
|
-
(
|
|
134
|
+
L(e.data) ? (i(), n("div", ae, [
|
|
135
|
+
(i(!0), n(f, null, H([
|
|
118
136
|
{ label: "Open", val: e.data.open, field: "open" },
|
|
119
137
|
{ label: "High", val: e.data.high, field: "high" },
|
|
120
138
|
{ label: "Low", val: e.data.low, field: "low" },
|
|
121
139
|
{ label: "Close", val: e.data.close, field: "close" }
|
|
122
|
-
], (l) => (
|
|
140
|
+
], (l) => (i(), n(f, {
|
|
123
141
|
key: l.label
|
|
124
142
|
}, [
|
|
125
|
-
|
|
126
|
-
|
|
143
|
+
s("span", le, c(l.label), 1),
|
|
144
|
+
s("span", {
|
|
127
145
|
style: m({
|
|
128
146
|
fontWeight: 600,
|
|
129
|
-
color:
|
|
147
|
+
color: d(G)(
|
|
130
148
|
e.data.close >= e.data.open ? o.value.candlestick.up.body : o.value.candlestick.down.body
|
|
131
149
|
),
|
|
132
150
|
textAlign: "right"
|
|
133
151
|
})
|
|
134
|
-
},
|
|
152
|
+
}, c(x.value(l.val, l.field)), 5)
|
|
135
153
|
], 64))), 128)),
|
|
136
|
-
e.data.volume != null ? (
|
|
137
|
-
|
|
138
|
-
|
|
154
|
+
e.data.volume != null ? (i(), n(f, { key: 0 }, [
|
|
155
|
+
r[0] || (r[0] = s("span", { style: { opacity: 0.5 } }, "Volume", -1)),
|
|
156
|
+
s("span", {
|
|
139
157
|
style: m({ fontWeight: 600, color: o.value.tooltip.textColor, textAlign: "right" })
|
|
140
|
-
},
|
|
141
|
-
], 64)) :
|
|
142
|
-
])) : (
|
|
143
|
-
|
|
158
|
+
}, c(x.value(e.data.volume, "volume")), 5)
|
|
159
|
+
], 64)) : w("", !0)
|
|
160
|
+
])) : N(e.data) ? (i(), n("div", ie, [
|
|
161
|
+
s("span", {
|
|
162
|
+
style: m({
|
|
163
|
+
width: "8px",
|
|
164
|
+
height: "8px",
|
|
165
|
+
borderRadius: "2px",
|
|
166
|
+
background: e.color,
|
|
167
|
+
flexShrink: 0
|
|
168
|
+
})
|
|
169
|
+
}, null, 4),
|
|
170
|
+
s("span", ne, c(e.label ?? "Range"), 1),
|
|
171
|
+
s("span", {
|
|
172
|
+
style: m({ fontWeight: 600, color: e.color, whiteSpace: "nowrap" })
|
|
173
|
+
}, c(x.value(e.data.low, "low")) + " – " + c(x.value(e.data.high, "high")), 5)
|
|
174
|
+
])) : (i(), n("div", re, [
|
|
175
|
+
s("span", {
|
|
144
176
|
style: m({
|
|
145
177
|
width: "8px",
|
|
146
178
|
height: "8px",
|
|
@@ -149,22 +181,22 @@ const ee = {
|
|
|
149
181
|
flexShrink: 0
|
|
150
182
|
})
|
|
151
183
|
}, null, 4),
|
|
152
|
-
|
|
153
|
-
|
|
184
|
+
s("span", se, c(e.label ?? "Value"), 1),
|
|
185
|
+
s("span", {
|
|
154
186
|
style: m({ fontWeight: 600, color: e.color })
|
|
155
|
-
},
|
|
187
|
+
}, c(x.value(e.data.value, "value")), 5)
|
|
156
188
|
]))
|
|
157
189
|
], 64))), 128))
|
|
158
|
-
], 4)) :
|
|
159
|
-
|
|
190
|
+
], 4)) : w("", !0),
|
|
191
|
+
d(u) && v.value.length > 0 && g.value && y.value ? (i(), n("div", {
|
|
160
192
|
key: 1,
|
|
161
193
|
ref_key: "containerRef",
|
|
162
194
|
ref: B,
|
|
163
|
-
"data-measured":
|
|
195
|
+
"data-measured": E.value ? "true" : "false",
|
|
164
196
|
style: m({
|
|
165
197
|
position: "absolute",
|
|
166
|
-
left:
|
|
167
|
-
top:
|
|
198
|
+
left: g.value.left + "px",
|
|
199
|
+
top: g.value.top + "px",
|
|
168
200
|
pointerEvents: "none",
|
|
169
201
|
background: o.value.tooltip.background,
|
|
170
202
|
backdropFilter: "blur(12px)",
|
|
@@ -178,20 +210,20 @@ const ee = {
|
|
|
178
210
|
fontVariantNumeric: "tabular-nums",
|
|
179
211
|
color: o.value.tooltip.textColor,
|
|
180
212
|
width: "max-content",
|
|
181
|
-
maxWidth:
|
|
213
|
+
maxWidth: d(t).getLayout().chartArea.width + "px",
|
|
182
214
|
boxSizing: "border-box",
|
|
183
215
|
zIndex: 10,
|
|
184
216
|
visibility: b.value !== null ? "visible" : "hidden"
|
|
185
217
|
})
|
|
186
218
|
}, [
|
|
187
|
-
|
|
188
|
-
snapshots:
|
|
189
|
-
time:
|
|
219
|
+
U(a.$slots, "default", {
|
|
220
|
+
snapshots: v.value,
|
|
221
|
+
time: _.value
|
|
190
222
|
})
|
|
191
|
-
], 12,
|
|
223
|
+
], 12, ue)) : w("", !0)
|
|
192
224
|
], 64));
|
|
193
225
|
}
|
|
194
226
|
});
|
|
195
227
|
export {
|
|
196
|
-
|
|
228
|
+
ye as default
|
|
197
229
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent as c, ref as p, watch as r, onUnmounted as u, onMounted as f, openBlock as x, createElementBlock as b, normalizeStyle as h, unref as i } from "vue";
|
|
2
|
+
import { mountAxisLabels as y } from "../core/dist/axis/dom-labels.js";
|
|
3
|
+
import { useAxisLayout as A } from "../composables.js";
|
|
4
|
+
import { useChartInstance as g } from "../context.js";
|
|
5
|
+
const v = /* @__PURE__ */ c({
|
|
6
|
+
__name: "XAxis",
|
|
7
|
+
props: {
|
|
8
|
+
labelCount: {},
|
|
9
|
+
minLabelSpacing: {},
|
|
10
|
+
format: { type: Function }
|
|
11
|
+
},
|
|
12
|
+
setup(m) {
|
|
13
|
+
const n = m, e = g(), t = A(e), l = p(null), a = () => {
|
|
14
|
+
e.setTimeAxisLabelDensity({
|
|
15
|
+
labelCount: n.labelCount ?? null,
|
|
16
|
+
minLabelSpacing: n.minLabelSpacing ?? null
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
a(), r(() => [n.labelCount, n.minLabelSpacing], a), e.setXAxisFormat(n.format ?? null), r(
|
|
20
|
+
() => n.format,
|
|
21
|
+
(s) => e.setXAxisFormat(s ?? null)
|
|
22
|
+
), u(() => {
|
|
23
|
+
e.setTimeAxisLabelDensity({ labelCount: null, minLabelSpacing: null }), e.setXAxisFormat(null);
|
|
24
|
+
});
|
|
25
|
+
let o = null;
|
|
26
|
+
return f(() => {
|
|
27
|
+
l.value !== null && (o = y({ chart: e, container: l.value, axis: "x" }));
|
|
28
|
+
}), u(() => {
|
|
29
|
+
o?.(), o = null;
|
|
30
|
+
}), (s, L) => (x(), b("div", {
|
|
31
|
+
ref_key: "containerRef",
|
|
32
|
+
ref: l,
|
|
33
|
+
style: h({
|
|
34
|
+
position: "absolute",
|
|
35
|
+
left: i(t).leftAxisWidth + "px",
|
|
36
|
+
bottom: "0",
|
|
37
|
+
right: i(t).rightAxisWidth + "px",
|
|
38
|
+
height: i(t).xAxisHeight + "px",
|
|
39
|
+
pointerEvents: "none",
|
|
40
|
+
display: "flex",
|
|
41
|
+
alignItems: "center"
|
|
42
|
+
})
|
|
43
|
+
}, null, 4));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
v as default
|
|
48
|
+
};
|
package/dist/ui/YAxis.vue.js
CHANGED
|
@@ -1,43 +1,59 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { mountAxisLabels as
|
|
3
|
-
import { useAxisLayout as
|
|
4
|
-
import { useChartInstance as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as L, ref as C, computed as x, onMounted as A, watch as c, onUnmounted as i, openBlock as S, createElementBlock as Y, normalizeStyle as _, unref as k, createCommentVNode as w } from "vue";
|
|
2
|
+
import { mountAxisLabels as F } from "../core/dist/axis/dom-labels.js";
|
|
3
|
+
import { useAxisLayout as D, useYRange as R } from "../composables.js";
|
|
4
|
+
import { useChartInstance as B } from "../context.js";
|
|
5
|
+
const M = /* @__PURE__ */ L({
|
|
6
6
|
__name: "YAxis",
|
|
7
7
|
props: {
|
|
8
8
|
format: { type: Function },
|
|
9
9
|
labelCount: {},
|
|
10
|
-
minLabelSpacing: {}
|
|
10
|
+
minLabelSpacing: {},
|
|
11
|
+
scale: {}
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
labelCount: n.labelCount ?? null,
|
|
18
|
-
minLabelSpacing: n.minLabelSpacing ?? null
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
r(), c(() => [n.labelCount, n.minLabelSpacing], r), a(() => t.setYAxisLabelDensity({ labelCount: null, minLabelSpacing: null }));
|
|
13
|
+
setup(g) {
|
|
14
|
+
const e = g, l = B(), r = D(l), h = R(l), s = C(null), t = x(() => (h.value, e.scale === void 0 || l.getYScaleIds().includes(e.scale))), u = x(() => {
|
|
15
|
+
const { yAxisPosition: v, yAxisWidth: b } = r.value;
|
|
16
|
+
return e.scale === void 0 ? { position: v, width: b } : t.value ? l.getYScaleColumn(e.scale) : null;
|
|
17
|
+
});
|
|
22
18
|
let o = null;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
}
|
|
19
|
+
const m = () => {
|
|
20
|
+
o !== null && (l.setYAxisFormat({ format: null, scale: o.scale }), o = null);
|
|
21
|
+
}, p = () => {
|
|
22
|
+
m(), t.value && (l.setYAxisFormat({ format: e.format ?? null, scale: e.scale }), o = { scale: e.scale });
|
|
23
|
+
};
|
|
24
|
+
A(p), c(() => [e.format, e.scale, t.value], p), i(m);
|
|
25
|
+
let n = null;
|
|
26
|
+
const f = () => {
|
|
27
|
+
n !== null && (l.setYAxisLabelDensity({ labelCount: null, minLabelSpacing: null, scale: n.scale }), n = null);
|
|
28
|
+
}, d = () => {
|
|
29
|
+
n !== null && n.scale !== e.scale && f(), t.value && (l.setYAxisLabelDensity({
|
|
30
|
+
labelCount: e.labelCount ?? null,
|
|
31
|
+
minLabelSpacing: e.minLabelSpacing ?? null,
|
|
32
|
+
scale: e.scale
|
|
33
|
+
}), n = { scale: e.scale });
|
|
34
|
+
};
|
|
35
|
+
d(), c(() => [e.labelCount, e.minLabelSpacing, e.scale, t.value], d), i(f);
|
|
36
|
+
let a = null;
|
|
37
|
+
const y = () => {
|
|
38
|
+
a?.(), a = null, s.value !== null && (a = F({ chart: l, container: s.value, axis: "y", scale: e.scale }));
|
|
39
|
+
};
|
|
40
|
+
return A(y), c([s, () => e.scale], y, { flush: "post" }), i(() => {
|
|
41
|
+
a?.(), a = null;
|
|
42
|
+
}), (v, b) => u.value ? (S(), Y("div", {
|
|
43
|
+
key: 0,
|
|
28
44
|
ref_key: "containerRef",
|
|
29
|
-
ref:
|
|
30
|
-
style:
|
|
45
|
+
ref: s,
|
|
46
|
+
style: _({
|
|
31
47
|
position: "absolute",
|
|
32
|
-
[
|
|
48
|
+
[u.value.position]: "0",
|
|
33
49
|
top: "0",
|
|
34
|
-
bottom:
|
|
35
|
-
width:
|
|
50
|
+
bottom: k(r).xAxisHeight + "px",
|
|
51
|
+
width: u.value.width + "px",
|
|
36
52
|
pointerEvents: "none"
|
|
37
53
|
})
|
|
38
|
-
}, null, 4));
|
|
54
|
+
}, null, 4)) : w("", !0);
|
|
39
55
|
}
|
|
40
56
|
});
|
|
41
57
|
export {
|
|
42
|
-
|
|
58
|
+
M as default
|
|
43
59
|
};
|