@wick-charts/vue 0.6.2 → 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 +45 -39
- package/dist/composables.js +39 -26
- package/dist/core/dist/animation/config.js +92 -75
- package/dist/core/dist/axis/dom-labels.js +56 -43
- 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/options.js +5 -5
- package/dist/core/dist/chart/scale-guards.js +26 -0
- package/dist/core/dist/chart/y-target.js +46 -19
- package/dist/core/dist/chart.js +670 -518
- package/dist/core/dist/components/crosshair.js +8 -8
- package/dist/core/dist/components/grid.js +26 -17
- package/dist/core/dist/components/marker.js +28 -28
- package/dist/core/dist/components/reference-line.js +16 -16
- package/dist/core/dist/data/decimation.js +58 -39
- package/dist/core/dist/interactions/handler.js +3 -2
- package/dist/core/dist/interactions/zoom.js +6 -5
- package/dist/core/dist/navigator/controller.js +47 -44
- package/dist/core/dist/perf/perf-hud.js +3 -3
- package/dist/core/dist/scales/log-scale.js +76 -0
- package/dist/core/dist/scales/y-scale.js +134 -35
- package/dist/core/dist/series/band.js +670 -0
- package/dist/core/dist/series/bar-intro.js +11 -11
- package/dist/core/dist/series/bar.js +301 -251
- package/dist/core/dist/series/base-multi-layer.js +100 -76
- package/dist/core/dist/series/candlestick.js +238 -235
- package/dist/core/dist/series/heatmap.js +5 -5
- package/dist/core/dist/series/line-intro.js +50 -40
- package/dist/core/dist/series/line.js +561 -483
- 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/series/scale-stack.js +25 -0
- package/dist/core/dist/snapshots.js +36 -35
- package/dist/core/dist/tooltip-position.js +5 -5
- package/dist/core/dist/utils/point.js +10 -0
- package/dist/index.d.ts +501 -128
- package/dist/index.js +195 -189
- package/dist/ui/Crosshair.vue.js +14 -14
- package/dist/ui/HeatmapTooltip.vue.js +6 -6
- package/dist/ui/InfoBar.vue.js +100 -81
- package/dist/ui/PieTooltip.vue.js +4 -4
- package/dist/ui/TimeAxis.vue.js +23 -22
- package/dist/ui/Tooltip.vue.js +140 -111
- package/dist/ui/YAxis.vue.js +25 -24
- package/dist/ui/YLabel.vue.js +63 -70
- package/package.json +2 -2
- package/src/BandSeries.vue +87 -0
- package/src/ChartContainer.vue +20 -8
- package/src/composables.ts +35 -1
- package/src/index.ts +13 -0
- package/src/ui/Crosshair.vue +2 -2
- package/src/ui/InfoBar.vue +20 -1
- package/src/ui/TimeAxis.vue +7 -4
- package/src/ui/Tooltip.vue +40 -3
- package/src/ui/YAxis.vue +5 -3
- package/src/ui/YLabel.vue +5 -16
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
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as H, computed as a, useSlots as R, ref as x, onMounted as O, onUnmounted as P, watchEffect as B, openBlock as m, createElementBlock as g, Fragment as D, unref as b, normalizeStyle as y, createElementVNode as s, toDisplayString as _, createCommentVNode as I, renderSlot as L } from "vue";
|
|
2
2
|
import { computeTooltipPosition as C } from "../core/dist/tooltip-position.js";
|
|
3
|
-
import { formatCompact as
|
|
4
|
-
import { useCrosshairPosition as
|
|
5
|
-
import { useChartInstance as
|
|
3
|
+
import { formatCompact as M } from "../core/dist/utils/format.js";
|
|
4
|
+
import { useCrosshairPosition as X } from "../composables.js";
|
|
5
|
+
import { useChartInstance as Y } from "../context.js";
|
|
6
6
|
const U = { style: { display: "flex", alignItems: "center", gap: "8px" } }, A = { style: { fontWeight: 600 } }, N = { style: { display: "flex", justifyContent: "space-between", gap: "16px" } }, V = { style: { opacity: 0.6 } }, j = { style: { fontWeight: 600 } }, G = ["data-measured"], $ = 160, q = 70, te = /* @__PURE__ */ H({
|
|
7
7
|
__name: "PieTooltip",
|
|
8
8
|
props: {
|
|
@@ -10,7 +10,7 @@ const U = { style: { display: "flex", alignItems: "center", gap: "8px" } }, A =
|
|
|
10
10
|
format: { type: Function }
|
|
11
11
|
},
|
|
12
12
|
setup(T) {
|
|
13
|
-
const S = T, k = a(() => S.format ??
|
|
13
|
+
const S = T, k = a(() => S.format ?? M), i = Y(), l = X(i), W = R(), d = a(() => typeof W.default == "function"), c = x(0), w = () => {
|
|
14
14
|
c.value++;
|
|
15
15
|
};
|
|
16
16
|
O(() => {
|
package/dist/ui/TimeAxis.vue.js
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { mountAxisLabels as
|
|
1
|
+
import { defineComponent as c, computed as p, ref as m, watch as f, onUnmounted as u, onMounted as x, openBlock as b, createElementBlock as y, normalizeStyle as h, unref as o } from "vue";
|
|
2
|
+
import { mountAxisLabels as L } from "../core/dist/axis/dom-labels.js";
|
|
3
|
+
import { useAxisLayout as d } from "../composables.js";
|
|
3
4
|
import { useChartInstance as g } from "../context.js";
|
|
4
|
-
const
|
|
5
|
+
const D = /* @__PURE__ */ c({
|
|
5
6
|
__name: "TimeAxis",
|
|
6
7
|
props: {
|
|
7
8
|
labelCount: {},
|
|
8
9
|
minLabelSpacing: {}
|
|
9
10
|
},
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
labelCount:
|
|
14
|
-
minLabelSpacing:
|
|
11
|
+
setup(r) {
|
|
12
|
+
const e = r, n = g(), t = d(n), a = p(() => t.value.yAxisPosition === "left"), l = m(null), s = () => {
|
|
13
|
+
n.setTimeAxisLabelDensity({
|
|
14
|
+
labelCount: e.labelCount ?? null,
|
|
15
|
+
minLabelSpacing: e.minLabelSpacing ?? null
|
|
15
16
|
});
|
|
16
17
|
};
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
s(), f(() => [e.labelCount, e.minLabelSpacing], s), u(() => {
|
|
19
|
+
n.setTimeAxisLabelDensity({ labelCount: null, minLabelSpacing: null });
|
|
19
20
|
});
|
|
20
|
-
let
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
}),
|
|
24
|
-
|
|
25
|
-
}), (
|
|
21
|
+
let i = null;
|
|
22
|
+
return x(() => {
|
|
23
|
+
l.value !== null && (i = L({ chart: n, container: l.value, axis: "x" }));
|
|
24
|
+
}), u(() => {
|
|
25
|
+
i?.(), i = null;
|
|
26
|
+
}), (A, v) => (b(), y("div", {
|
|
26
27
|
ref_key: "containerRef",
|
|
27
|
-
ref:
|
|
28
|
-
style:
|
|
28
|
+
ref: l,
|
|
29
|
+
style: h({
|
|
29
30
|
position: "absolute",
|
|
30
|
-
left:
|
|
31
|
+
left: (a.value ? o(t).yAxisWidth : 0) + "px",
|
|
31
32
|
bottom: "0",
|
|
32
|
-
right: o(
|
|
33
|
-
height: o(
|
|
33
|
+
right: (a.value ? 0 : o(t).yAxisWidth) + "px",
|
|
34
|
+
height: o(t).xAxisHeight + "px",
|
|
34
35
|
pointerEvents: "none",
|
|
35
36
|
display: "flex",
|
|
36
37
|
alignItems: "center"
|
|
@@ -39,5 +40,5 @@ const _ = /* @__PURE__ */ r({
|
|
|
39
40
|
}
|
|
40
41
|
});
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
D as default
|
|
43
44
|
};
|