@wick-charts/vue 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/BandSeries.vue.js +50 -0
- package/dist/BandSeries.vue2.js +4 -0
- package/dist/ChartContainer.vue.js +16 -16
- package/dist/LineSeries.vue.js +2 -2
- package/dist/core/dist/animation/config.js +92 -75
- 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.js +168 -167
- package/dist/core/dist/data/decimation.js +58 -39
- package/dist/core/dist/navigator/controller.js +10 -10
- package/dist/core/dist/perf/perf-hud.js +6 -6
- package/dist/core/dist/series/band.js +670 -0
- package/dist/core/dist/series/bar.js +14 -14
- package/dist/core/dist/series/candlestick.js +31 -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 +485 -445
- 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 +36 -35
- package/dist/core/dist/utils/point.js +10 -0
- package/dist/index.d.ts +255 -97
- package/dist/index.js +195 -191
- package/dist/ui/InfoBar.vue.js +100 -81
- package/dist/ui/Tooltip.vue.js +118 -91
- package/dist/ui/YLabel.vue.js +62 -69
- package/package.json +2 -2
- package/src/BandSeries.vue +87 -0
- package/src/index.ts +8 -0
- package/src/ui/InfoBar.vue +20 -1
- package/src/ui/Tooltip.vue +36 -2
- package/src/ui/YLabel.vue +2 -13
package/dist/ui/InfoBar.vue.js
CHANGED
|
@@ -1,62 +1,68 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { buildHoverSnapshots as P, buildLastSnapshots as
|
|
3
|
-
import { resolveCandlestickBodyColor as
|
|
4
|
-
import { formatCompact as
|
|
5
|
-
import { useCrosshairPosition as
|
|
6
|
-
import { useChartInstance as
|
|
7
|
-
const
|
|
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 = {
|
|
8
8
|
key: 0,
|
|
9
9
|
style: { display: "inline-flex", alignItems: "center", gap: "4px" }
|
|
10
|
-
},
|
|
10
|
+
}, Z = {
|
|
11
11
|
key: 1,
|
|
12
12
|
style: { display: "inline-flex", alignItems: "center", gap: "3px" }
|
|
13
|
-
},
|
|
13
|
+
}, ee = {
|
|
14
|
+
key: 2,
|
|
15
|
+
style: { display: "inline-flex", alignItems: "center", gap: "3px" }
|
|
16
|
+
}, ie = /* @__PURE__ */ W({
|
|
14
17
|
__name: "InfoBar",
|
|
15
18
|
props: {
|
|
16
19
|
sort: {},
|
|
17
20
|
format: { type: Function }
|
|
18
21
|
},
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
() =>
|
|
22
|
-
),
|
|
23
|
-
if (!
|
|
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);
|
|
26
|
+
if (!o)
|
|
24
27
|
throw new Error("<InfoBar> must be used within <ChartContainer>: missing ThemeKey.");
|
|
25
28
|
if (!g)
|
|
26
29
|
throw new Error("<InfoBar> must be used within <ChartContainer>: missing InfoBarAnchorKey.");
|
|
27
|
-
const
|
|
28
|
-
|
|
30
|
+
const h = N(0), C = () => {
|
|
31
|
+
h.value++;
|
|
29
32
|
};
|
|
30
33
|
T(() => {
|
|
31
|
-
|
|
32
|
-
}),
|
|
33
|
-
|
|
34
|
+
u.on("overlayChange", C), u.getSeriesIds().length > 0 && h.value++;
|
|
35
|
+
}), A(() => {
|
|
36
|
+
u.off("overlayChange", C);
|
|
34
37
|
});
|
|
35
|
-
const x =
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
return
|
|
39
|
-
}),
|
|
40
|
-
() =>
|
|
41
|
-
),
|
|
42
|
-
function
|
|
43
|
-
return "open" in
|
|
38
|
+
const x = i(() => {
|
|
39
|
+
h.value;
|
|
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");
|
|
45
|
+
function I(a) {
|
|
46
|
+
return "open" in a;
|
|
47
|
+
}
|
|
48
|
+
function V(a) {
|
|
49
|
+
return "high" in a && !I(a);
|
|
44
50
|
}
|
|
45
|
-
return (
|
|
51
|
+
return (a, _) => t(g) && t(o) && d.value.length > 0 ? (n(), R(D, {
|
|
46
52
|
key: 0,
|
|
47
|
-
to:
|
|
53
|
+
to: t(g)
|
|
48
54
|
}, [
|
|
49
|
-
|
|
55
|
+
l("div", {
|
|
50
56
|
"data-tooltip-legend": "",
|
|
51
|
-
style:
|
|
52
|
-
|
|
57
|
+
style: r(
|
|
58
|
+
w.value ? {
|
|
53
59
|
display: "flex",
|
|
54
60
|
alignItems: "center",
|
|
55
61
|
flexShrink: 0,
|
|
56
|
-
fontSize:
|
|
57
|
-
fontFamily:
|
|
62
|
+
fontSize: t(o).typography.fontSize + "px",
|
|
63
|
+
fontFamily: t(o).typography.fontFamily,
|
|
58
64
|
fontVariantNumeric: "tabular-nums",
|
|
59
|
-
opacity:
|
|
65
|
+
opacity: m.value ? 1 : 0.6,
|
|
60
66
|
transition: "opacity 0.2s ease",
|
|
61
67
|
pointerEvents: "none"
|
|
62
68
|
} : {
|
|
@@ -66,77 +72,90 @@ const Q = {
|
|
|
66
72
|
flexWrap: "wrap",
|
|
67
73
|
padding: "4px 8px",
|
|
68
74
|
flexShrink: 0,
|
|
69
|
-
fontSize:
|
|
70
|
-
fontFamily:
|
|
75
|
+
fontSize: t(o).typography.fontSize + "px",
|
|
76
|
+
fontFamily: t(o).typography.fontFamily,
|
|
71
77
|
fontVariantNumeric: "tabular-nums",
|
|
72
|
-
opacity:
|
|
78
|
+
opacity: m.value ? 1 : 0.6,
|
|
73
79
|
transition: "opacity 0.2s ease",
|
|
74
80
|
pointerEvents: "none"
|
|
75
81
|
}
|
|
76
82
|
)
|
|
77
83
|
}, [
|
|
78
|
-
|
|
84
|
+
w.value ? M(a.$slots, "default", {
|
|
79
85
|
key: 0,
|
|
80
|
-
snapshots:
|
|
81
|
-
time:
|
|
82
|
-
isHover:
|
|
83
|
-
}) : (
|
|
84
|
-
|
|
85
|
-
style:
|
|
86
|
-
},
|
|
87
|
-
(
|
|
88
|
-
key:
|
|
86
|
+
snapshots: d.value,
|
|
87
|
+
time: S.value,
|
|
88
|
+
isHover: m.value
|
|
89
|
+
}) : (n(), s(c, { key: 1 }, [
|
|
90
|
+
l("span", {
|
|
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, {
|
|
94
|
+
key: e.id
|
|
89
95
|
}, [
|
|
90
|
-
|
|
91
|
-
(
|
|
92
|
-
{ label: "O", field: "open", val:
|
|
93
|
-
{ label: "H", field: "high", val:
|
|
94
|
-
{ label: "L", field: "low", val:
|
|
95
|
-
{ label: "C", field: "close", val:
|
|
96
|
-
], (
|
|
97
|
-
key:
|
|
96
|
+
I(e.data) ? (n(), s("span", Y, [
|
|
97
|
+
(n(!0), s(c, null, F([
|
|
98
|
+
{ label: "O", field: "open", val: e.data.open },
|
|
99
|
+
{ label: "H", field: "high", val: e.data.high },
|
|
100
|
+
{ label: "L", field: "low", val: e.data.low },
|
|
101
|
+
{ label: "C", field: "close", val: e.data.close }
|
|
102
|
+
], (v) => (n(), s(c, {
|
|
103
|
+
key: v.label
|
|
98
104
|
}, [
|
|
99
|
-
|
|
100
|
-
style:
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
style:
|
|
104
|
-
color:
|
|
105
|
-
|
|
105
|
+
l("span", {
|
|
106
|
+
style: r({ color: t(o).axis.textColor, opacity: 0.5, marginLeft: "5px" })
|
|
107
|
+
}, p(v.label), 5),
|
|
108
|
+
l("span", {
|
|
109
|
+
style: r({
|
|
110
|
+
color: t(j)(
|
|
111
|
+
e.data.close >= e.data.open ? t(o).candlestick.up.body : t(o).candlestick.down.body
|
|
106
112
|
),
|
|
107
113
|
fontWeight: 500,
|
|
108
114
|
marginLeft: "2px"
|
|
109
115
|
})
|
|
110
|
-
},
|
|
116
|
+
}, p(f.value(v.val, v.field)), 5)
|
|
111
117
|
], 64))), 128)),
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
style:
|
|
118
|
+
e.data.volume != null ? (n(), s(c, { key: 0 }, [
|
|
119
|
+
l("span", {
|
|
120
|
+
style: r({ color: t(o).axis.textColor, opacity: 0.5, marginLeft: "5px" })
|
|
115
121
|
}, "V", 4),
|
|
116
|
-
|
|
117
|
-
style:
|
|
118
|
-
},
|
|
119
|
-
], 64)) :
|
|
120
|
-
])) : (
|
|
121
|
-
|
|
122
|
-
style:
|
|
122
|
+
l("span", {
|
|
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, [
|
|
127
|
+
l("span", {
|
|
128
|
+
style: r({
|
|
129
|
+
width: "6px",
|
|
130
|
+
height: "6px",
|
|
131
|
+
borderRadius: "1px",
|
|
132
|
+
background: e.color,
|
|
133
|
+
flexShrink: 0
|
|
134
|
+
})
|
|
135
|
+
}, null, 4),
|
|
136
|
+
l("span", {
|
|
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, [
|
|
140
|
+
l("span", {
|
|
141
|
+
style: r({
|
|
123
142
|
width: "6px",
|
|
124
143
|
height: "6px",
|
|
125
144
|
borderRadius: "50%",
|
|
126
|
-
background:
|
|
145
|
+
background: e.color,
|
|
127
146
|
flexShrink: 0
|
|
128
147
|
})
|
|
129
148
|
}, null, 4),
|
|
130
|
-
|
|
131
|
-
style:
|
|
132
|
-
},
|
|
149
|
+
l("span", {
|
|
150
|
+
style: r({ color: e.color, fontWeight: 500 })
|
|
151
|
+
}, p(f.value(e.data.value, "value")), 5)
|
|
133
152
|
]))
|
|
134
153
|
], 64))), 128))
|
|
135
154
|
], 64))
|
|
136
155
|
], 4)
|
|
137
|
-
], 8, ["to"])) :
|
|
156
|
+
], 8, ["to"])) : L("", !0);
|
|
138
157
|
}
|
|
139
158
|
});
|
|
140
159
|
export {
|
|
141
|
-
|
|
160
|
+
ie as default
|
|
142
161
|
};
|
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 D, computed as c, ref as _, onMounted as X, onUnmounted as Y, useSlots as Z, watchEffect as $, openBlock as n, createElementBlock as r, Fragment as x, unref as v, normalizeStyle as h, createElementVNode as s, toDisplayString as d, renderList as H, createCommentVNode as z, renderSlot as K } from "vue";
|
|
2
|
+
import { buildHoverSnapshots as U } from "../core/dist/snapshots.js";
|
|
3
|
+
import { resolveCandlestickBodyColor as j } from "../core/dist/theme/resolve.js";
|
|
4
|
+
import { computeTooltipPosition as I } from "../core/dist/tooltip-position.js";
|
|
5
|
+
import { formatCompact as q, formatPriceAdaptive as G } from "../core/dist/utils/format.js";
|
|
6
|
+
import { formatDate as J } from "../core/dist/utils/time.js";
|
|
7
|
+
import { useCrosshairPosition as Q } from "../composables.js";
|
|
8
|
+
import { useChartInstance as ee } from "../context.js";
|
|
9
|
+
const te = {
|
|
10
10
|
key: 0,
|
|
11
11
|
style: { display: "grid", gridTemplateColumns: "auto 1fr", gap: "4px 12px" }
|
|
12
|
-
},
|
|
12
|
+
}, oe = { style: { opacity: 0.5 } }, ae = {
|
|
13
13
|
key: 1,
|
|
14
14
|
style: { display: "flex", alignItems: "center", gap: "8px", padding: "2px 0" }
|
|
15
|
-
}, le = { style: {
|
|
15
|
+
}, le = { style: {
|
|
16
|
+
opacity: 0.6,
|
|
17
|
+
flex: "1",
|
|
18
|
+
minWidth: 0,
|
|
19
|
+
overflow: "hidden",
|
|
20
|
+
textOverflow: "ellipsis",
|
|
21
|
+
whiteSpace: "nowrap"
|
|
22
|
+
} }, ie = {
|
|
23
|
+
key: 2,
|
|
24
|
+
style: { display: "flex", alignItems: "center", gap: "8px", padding: "2px 0" }
|
|
25
|
+
}, ne = { style: { opacity: 0.6, flex: "1" } }, re = ["data-measured"], xe = /* @__PURE__ */ D({
|
|
16
26
|
__name: "Tooltip",
|
|
17
27
|
props: {
|
|
18
28
|
sort: {},
|
|
19
29
|
format: { type: Function }
|
|
20
30
|
},
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
23
|
-
() =>
|
|
24
|
-
), t =
|
|
25
|
-
|
|
31
|
+
setup(L) {
|
|
32
|
+
const W = L, O = c(() => W.sort ?? "none"), g = c(
|
|
33
|
+
() => W.format ?? ((a, i) => i === "volume" ? q(a) : G(a))
|
|
34
|
+
), t = ee(), u = Q(t), w = _(0), F = () => {
|
|
35
|
+
w.value++;
|
|
26
36
|
};
|
|
27
|
-
|
|
28
|
-
t.on("overlayChange",
|
|
29
|
-
}),
|
|
30
|
-
t.off("overlayChange",
|
|
37
|
+
X(() => {
|
|
38
|
+
t.on("overlayChange", F), t.getSeriesIds().length > 0 && w.value++;
|
|
39
|
+
}), Y(() => {
|
|
40
|
+
t.off("overlayChange", F);
|
|
31
41
|
});
|
|
32
|
-
const o =
|
|
33
|
-
time:
|
|
34
|
-
sort:
|
|
42
|
+
const o = c(() => t.getTheme()), A = c(() => t.getDataInterval()), f = c(() => (w.value, u.value ? U(t, {
|
|
43
|
+
time: u.value.time,
|
|
44
|
+
sort: O.value,
|
|
35
45
|
cacheKey: "tooltip"
|
|
36
|
-
}) : [])),
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
if (!
|
|
46
|
+
}) : [])), C = c(() => u.value?.time ?? 0), T = Z(), y = c(() => typeof T.default == "function"), B = _(null), b = _(null);
|
|
47
|
+
let k = null;
|
|
48
|
+
$((a) => {
|
|
49
|
+
if (!y.value) return;
|
|
40
50
|
const i = B.value;
|
|
41
|
-
!i || typeof ResizeObserver > "u" || (
|
|
51
|
+
!i || typeof ResizeObserver > "u" || (k = new ResizeObserver((e) => {
|
|
42
52
|
const l = e[0]?.contentRect;
|
|
43
53
|
if (!l) return;
|
|
44
|
-
const
|
|
45
|
-
(!
|
|
46
|
-
}),
|
|
47
|
-
|
|
54
|
+
const S = b.value;
|
|
55
|
+
(!S || S.width !== l.width || S.height !== l.height) && (b.value = { width: l.width, height: l.height });
|
|
56
|
+
}), k.observe(i), a(() => {
|
|
57
|
+
k?.disconnect(), k = null;
|
|
48
58
|
}));
|
|
49
59
|
});
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
60
|
+
const m = c(() => {
|
|
61
|
+
if (!u.value || f.value.length === 0) return null;
|
|
52
62
|
const a = t.getMediaSize(), i = t.plotLeft, e = a.width - t.yAxisWidth, l = a.height - t.xAxisHeight;
|
|
53
|
-
if (
|
|
54
|
-
const
|
|
55
|
-
return
|
|
56
|
-
x:
|
|
57
|
-
y:
|
|
63
|
+
if (y.value) {
|
|
64
|
+
const p = b.value;
|
|
65
|
+
return p ? I({
|
|
66
|
+
x: u.value.mediaX,
|
|
67
|
+
y: u.value.mediaY,
|
|
58
68
|
chartLeft: i,
|
|
59
69
|
chartWidth: e,
|
|
60
70
|
chartHeight: l,
|
|
61
|
-
tooltipWidth:
|
|
62
|
-
tooltipHeight:
|
|
71
|
+
tooltipWidth: p.width,
|
|
72
|
+
tooltipHeight: p.height
|
|
63
73
|
}) : { left: i, top: 0 };
|
|
64
74
|
}
|
|
65
|
-
const
|
|
66
|
-
return
|
|
67
|
-
x:
|
|
68
|
-
y:
|
|
75
|
+
const S = f.value.some((p) => "open" in p.data), M = f.value.filter((p) => !("open" in p.data)).length, N = f.value.some((p) => "high" in p.data && !("open" in p.data)) ? 220 : 160, P = S ? 140 : 40 + M * 22;
|
|
76
|
+
return I({
|
|
77
|
+
x: u.value.mediaX,
|
|
78
|
+
y: u.value.mediaY,
|
|
69
79
|
chartLeft: i,
|
|
70
80
|
chartWidth: e,
|
|
71
81
|
chartHeight: l,
|
|
72
|
-
tooltipWidth:
|
|
73
|
-
tooltipHeight:
|
|
82
|
+
tooltipWidth: N,
|
|
83
|
+
tooltipHeight: P
|
|
74
84
|
});
|
|
75
|
-
}),
|
|
76
|
-
function
|
|
85
|
+
}), V = c(() => !y.value || b.value !== null);
|
|
86
|
+
function R(a) {
|
|
77
87
|
return "open" in a;
|
|
78
88
|
}
|
|
79
|
-
|
|
80
|
-
|
|
89
|
+
function E(a) {
|
|
90
|
+
return "high" in a && !R(a);
|
|
91
|
+
}
|
|
92
|
+
return (a, i) => (n(), r(x, null, [
|
|
93
|
+
v(u) && f.value.length > 0 && m.value && !y.value ? (n(), r("div", {
|
|
81
94
|
key: 0,
|
|
82
|
-
style:
|
|
95
|
+
style: h({
|
|
83
96
|
position: "absolute",
|
|
84
|
-
left:
|
|
85
|
-
top:
|
|
97
|
+
left: m.value.left + "px",
|
|
98
|
+
top: m.value.top + "px",
|
|
86
99
|
pointerEvents: "none",
|
|
87
100
|
background: o.value.tooltip.background,
|
|
88
101
|
backdropFilter: "blur(12px)",
|
|
@@ -100,8 +113,8 @@ const ee = {
|
|
|
100
113
|
transition: "opacity 0.15s ease"
|
|
101
114
|
})
|
|
102
115
|
}, [
|
|
103
|
-
|
|
104
|
-
style:
|
|
116
|
+
s("div", {
|
|
117
|
+
style: h({
|
|
105
118
|
fontSize: o.value.axis.fontSize + "px",
|
|
106
119
|
color: o.value.axis.textColor,
|
|
107
120
|
marginBottom: "8px",
|
|
@@ -109,39 +122,53 @@ const ee = {
|
|
|
109
122
|
borderBottom: "1px solid " + o.value.tooltip.borderColor,
|
|
110
123
|
letterSpacing: "0.02em"
|
|
111
124
|
})
|
|
112
|
-
},
|
|
113
|
-
(
|
|
125
|
+
}, d(v(J)(C.value, { locale: v(t).timeScale.getLocale(), timeZone: v(t).timeScale.getTimeZone() })) + " " + d(v(t).timeScale.formatX(C.value, A.value)), 5),
|
|
126
|
+
(n(!0), r(x, null, H(f.value, (e) => (n(), r(x, {
|
|
114
127
|
key: e.id
|
|
115
128
|
}, [
|
|
116
|
-
|
|
117
|
-
(
|
|
129
|
+
R(e.data) ? (n(), r("div", te, [
|
|
130
|
+
(n(!0), r(x, null, H([
|
|
118
131
|
{ label: "Open", val: e.data.open, field: "open" },
|
|
119
132
|
{ label: "High", val: e.data.high, field: "high" },
|
|
120
133
|
{ label: "Low", val: e.data.low, field: "low" },
|
|
121
134
|
{ label: "Close", val: e.data.close, field: "close" }
|
|
122
|
-
], (l) => (
|
|
135
|
+
], (l) => (n(), r(x, {
|
|
123
136
|
key: l.label
|
|
124
137
|
}, [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
style:
|
|
138
|
+
s("span", oe, d(l.label), 1),
|
|
139
|
+
s("span", {
|
|
140
|
+
style: h({
|
|
128
141
|
fontWeight: 600,
|
|
129
|
-
color:
|
|
142
|
+
color: v(j)(
|
|
130
143
|
e.data.close >= e.data.open ? o.value.candlestick.up.body : o.value.candlestick.down.body
|
|
131
144
|
),
|
|
132
145
|
textAlign: "right"
|
|
133
146
|
})
|
|
134
|
-
},
|
|
147
|
+
}, d(g.value(l.val, l.field)), 5)
|
|
135
148
|
], 64))), 128)),
|
|
136
|
-
e.data.volume != null ? (
|
|
137
|
-
i[0] || (i[0] =
|
|
138
|
-
|
|
139
|
-
style:
|
|
140
|
-
},
|
|
141
|
-
], 64)) :
|
|
142
|
-
])) : (
|
|
143
|
-
|
|
144
|
-
style:
|
|
149
|
+
e.data.volume != null ? (n(), r(x, { key: 0 }, [
|
|
150
|
+
i[0] || (i[0] = s("span", { style: { opacity: 0.5 } }, "Volume", -1)),
|
|
151
|
+
s("span", {
|
|
152
|
+
style: h({ fontWeight: 600, color: o.value.tooltip.textColor, textAlign: "right" })
|
|
153
|
+
}, d(g.value(e.data.volume, "volume")), 5)
|
|
154
|
+
], 64)) : z("", !0)
|
|
155
|
+
])) : E(e.data) ? (n(), r("div", ae, [
|
|
156
|
+
s("span", {
|
|
157
|
+
style: h({
|
|
158
|
+
width: "8px",
|
|
159
|
+
height: "8px",
|
|
160
|
+
borderRadius: "2px",
|
|
161
|
+
background: e.color,
|
|
162
|
+
flexShrink: 0
|
|
163
|
+
})
|
|
164
|
+
}, null, 4),
|
|
165
|
+
s("span", le, d(e.label ?? "Range"), 1),
|
|
166
|
+
s("span", {
|
|
167
|
+
style: h({ fontWeight: 600, color: e.color, whiteSpace: "nowrap" })
|
|
168
|
+
}, d(g.value(e.data.low, "low")) + " – " + d(g.value(e.data.high, "high")), 5)
|
|
169
|
+
])) : (n(), r("div", ie, [
|
|
170
|
+
s("span", {
|
|
171
|
+
style: h({
|
|
145
172
|
width: "8px",
|
|
146
173
|
height: "8px",
|
|
147
174
|
borderRadius: "50%",
|
|
@@ -149,22 +176,22 @@ const ee = {
|
|
|
149
176
|
flexShrink: 0
|
|
150
177
|
})
|
|
151
178
|
}, null, 4),
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
style:
|
|
155
|
-
},
|
|
179
|
+
s("span", ne, d(e.label ?? "Value"), 1),
|
|
180
|
+
s("span", {
|
|
181
|
+
style: h({ fontWeight: 600, color: e.color })
|
|
182
|
+
}, d(g.value(e.data.value, "value")), 5)
|
|
156
183
|
]))
|
|
157
184
|
], 64))), 128))
|
|
158
|
-
], 4)) :
|
|
159
|
-
|
|
185
|
+
], 4)) : z("", !0),
|
|
186
|
+
v(u) && f.value.length > 0 && m.value && y.value ? (n(), r("div", {
|
|
160
187
|
key: 1,
|
|
161
188
|
ref_key: "containerRef",
|
|
162
189
|
ref: B,
|
|
163
|
-
"data-measured":
|
|
164
|
-
style:
|
|
190
|
+
"data-measured": V.value ? "true" : "false",
|
|
191
|
+
style: h({
|
|
165
192
|
position: "absolute",
|
|
166
|
-
left:
|
|
167
|
-
top:
|
|
193
|
+
left: m.value.left + "px",
|
|
194
|
+
top: m.value.top + "px",
|
|
168
195
|
pointerEvents: "none",
|
|
169
196
|
background: o.value.tooltip.background,
|
|
170
197
|
backdropFilter: "blur(12px)",
|
|
@@ -178,20 +205,20 @@ const ee = {
|
|
|
178
205
|
fontVariantNumeric: "tabular-nums",
|
|
179
206
|
color: o.value.tooltip.textColor,
|
|
180
207
|
width: "max-content",
|
|
181
|
-
maxWidth:
|
|
208
|
+
maxWidth: v(t).getMediaSize().width - v(t).yAxisWidth + "px",
|
|
182
209
|
boxSizing: "border-box",
|
|
183
210
|
zIndex: 10,
|
|
184
211
|
visibility: b.value !== null ? "visible" : "hidden"
|
|
185
212
|
})
|
|
186
213
|
}, [
|
|
187
|
-
|
|
188
|
-
snapshots:
|
|
189
|
-
time:
|
|
214
|
+
K(a.$slots, "default", {
|
|
215
|
+
snapshots: f.value,
|
|
216
|
+
time: C.value
|
|
190
217
|
})
|
|
191
|
-
], 12,
|
|
218
|
+
], 12, re)) : z("", !0)
|
|
192
219
|
], 64));
|
|
193
220
|
}
|
|
194
221
|
});
|
|
195
222
|
export {
|
|
196
|
-
|
|
223
|
+
xe as default
|
|
197
224
|
};
|