@wick-charts/vue 0.5.0 → 0.5.1
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/dist/ChartContainer.vue.js +11 -11
- package/dist/core/dist/chart.js +569 -514
- package/dist/core/dist/perf/perf-hud.js +7 -7
- package/dist/index.d.ts +7 -0
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ChartInstance as
|
|
1
|
+
import { defineComponent as T, ref as a, shallowRef as O, provide as r, computed as C, onMounted as j, nextTick as b, onUnmounted as M, watch as l, openBlock as u, createElementBlock as v, normalizeStyle as N, createElementVNode as o, createCommentVNode as k, renderSlot as S } from "vue";
|
|
2
|
+
import { ChartInstance as K } from "./core/dist/chart.js";
|
|
3
3
|
import { catppuccin as G } from "./core/dist/theme/themes/catppuccin.js";
|
|
4
4
|
import { ChartKey as H, ThemeKey as I, TitleAnchorKey as P, InfoBarAnchorKey as V, LegendAnchorKey as U, LegendRightAnchorKey as q, NavigatorAnchorKey as D } from "./context.js";
|
|
5
5
|
const F = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-height": "0" } }, J = { style: { display: "flex", "flex-direction": "column", flex: "1", "min-width": "0", "min-height": "0" } }, Q = {
|
|
@@ -10,7 +10,7 @@ const F = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-h
|
|
|
10
10
|
key: 1,
|
|
11
11
|
"data-chart-series-overlay": "",
|
|
12
12
|
style: { position: "absolute", inset: "0", "pointer-events": "none", "z-index": "3" }
|
|
13
|
-
}, ne = /* @__PURE__ */
|
|
13
|
+
}, ne = /* @__PURE__ */ T({
|
|
14
14
|
__name: "ChartContainer",
|
|
15
15
|
props: {
|
|
16
16
|
theme: { default: () => G.theme },
|
|
@@ -26,10 +26,10 @@ const F = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-h
|
|
|
26
26
|
onEdgeReached: {}
|
|
27
27
|
},
|
|
28
28
|
setup(h) {
|
|
29
|
-
const e = h, c = a(), i =
|
|
29
|
+
const e = h, c = a(), i = O(null), p = O(e.theme), s = e.perf, f = e.onEdgeReached, A = a(null), g = a(null), y = a(null), w = a(null), _ = a(null), R = a(null);
|
|
30
30
|
r(H, i), r(I, p), r(P, g), r(V, y), r(U, w), r(q, _), r(D, R);
|
|
31
31
|
let d = null;
|
|
32
|
-
const m = a(0), B =
|
|
32
|
+
const m = a(0), B = C(() => e.headerLayout === "overlay" ? m.value : 0);
|
|
33
33
|
function x() {
|
|
34
34
|
if (!i.value) return;
|
|
35
35
|
const n = { top: (e.padding?.top ?? 20) + B.value };
|
|
@@ -47,11 +47,11 @@ const F = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-h
|
|
|
47
47
|
};
|
|
48
48
|
n(), d = new ResizeObserver(n), d.observe(t);
|
|
49
49
|
}
|
|
50
|
-
|
|
50
|
+
j(async () => {
|
|
51
51
|
if (!c.value) return;
|
|
52
52
|
const t = {};
|
|
53
|
-
e.axis && (t.axis = e.axis), e.theme && (t.theme = e.theme), e.padding && (t.padding = e.padding), e.viewport && (t.viewport = e.viewport), e.interactive !== void 0 && (t.interactive = e.interactive), e.grid !== void 0 && (t.grid = e.grid), s !== void 0 && (t.perf = s), f && (t.onEdgeReached = f), e.animations !== void 0 && (t.animations = e.animations), i.value = new
|
|
54
|
-
}),
|
|
53
|
+
e.axis && (t.axis = e.axis), e.theme && (t.theme = e.theme), e.padding && (t.padding = e.padding), e.viewport && (t.viewport = e.viewport), e.interactive !== void 0 && (t.interactive = e.interactive), e.grid !== void 0 && (t.grid = e.grid), s !== void 0 && (t.perf = s), f && (t.onEdgeReached = f), e.animations !== void 0 && (t.animations = e.animations), i.value = new K(c.value, t), await b(), E();
|
|
54
|
+
}), M(() => {
|
|
55
55
|
d?.disconnect(), d = null, i.value?.destroy(), i.value = null;
|
|
56
56
|
}), l(
|
|
57
57
|
() => e.headerLayout,
|
|
@@ -80,7 +80,7 @@ const F = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-h
|
|
|
80
80
|
if (!i.value || !c.value) return;
|
|
81
81
|
i.value.destroy(), i.value = null, await b();
|
|
82
82
|
const n = {};
|
|
83
|
-
e.axis && (n.axis = e.axis), e.theme && (n.theme = e.theme), e.padding && (n.padding = e.padding), e.viewport && (n.viewport = e.viewport), e.interactive !== void 0 && (n.interactive = e.interactive), e.grid !== void 0 && (n.grid = e.grid), s !== void 0 && (n.perf = s), f && (n.onEdgeReached = f), t !== void 0 && (n.animations = t), i.value = new
|
|
83
|
+
e.axis && (n.axis = e.axis), e.theme && (n.theme = e.theme), e.padding && (n.padding = e.padding), e.viewport && (n.viewport = e.viewport), e.interactive !== void 0 && (n.interactive = e.interactive), e.grid !== void 0 && (n.grid = e.grid), s !== void 0 && (n.perf = s), f && (n.onEdgeReached = f), t !== void 0 && (n.animations = t), i.value = new K(c.value, n);
|
|
84
84
|
}
|
|
85
85
|
), l(
|
|
86
86
|
() => [
|
|
@@ -92,12 +92,12 @@ const F = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-h
|
|
|
92
92
|
],
|
|
93
93
|
x
|
|
94
94
|
);
|
|
95
|
-
const z =
|
|
95
|
+
const z = C(() => {
|
|
96
96
|
const t = p.value, [n, $] = t?.chartGradient ?? ["transparent", "transparent"], L = t?.background ?? "transparent";
|
|
97
97
|
return `position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; background: ${e.gradient ? `linear-gradient(to bottom, ${n} 0%, ${L} 70%, ${$} 100%)` : L}`;
|
|
98
98
|
});
|
|
99
99
|
return (t, n) => (u(), v("div", {
|
|
100
|
-
style:
|
|
100
|
+
style: N(z.value)
|
|
101
101
|
}, [
|
|
102
102
|
o("div", F, [
|
|
103
103
|
o("div", J, [
|