@wick-charts/vue 0.5.0 → 0.6.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 +18 -3
- package/dist/BarSeries.vue.js +26 -20
- package/dist/CandlestickSeries.vue.js +30 -24
- package/dist/ChartContainer.vue.js +88 -65
- package/dist/HeatmapSeries.vue.js +40 -0
- package/dist/HeatmapSeries.vue2.js +4 -0
- package/dist/LineSeries.vue.js +26 -20
- package/dist/PieSeries.vue.js +24 -18
- package/dist/core/dist/animation/animator.js +21 -21
- package/dist/core/dist/animation/config.js +114 -87
- package/dist/core/dist/animation/easing.js +3 -1
- package/dist/core/dist/animation/intro-wave.js +68 -0
- package/dist/core/dist/axis/dom-labels.js +13 -14
- package/dist/core/dist/chart/badge-animator.js +56 -0
- package/dist/core/dist/chart/edge-indicators.js +28 -13
- package/dist/core/dist/chart/last-value.js +18 -17
- package/dist/core/dist/chart/y-target.js +13 -12
- package/dist/core/dist/chart.js +908 -626
- package/dist/core/dist/components/annotation-chip.js +28 -0
- package/dist/core/dist/components/edge-indicator.js +58 -26
- package/dist/core/dist/components/loading-indicator.js +46 -0
- package/dist/core/dist/components/marker.js +49 -31
- package/dist/core/dist/components/reference-line.js +27 -36
- package/dist/core/dist/components/time-region.js +30 -28
- package/dist/core/dist/data/store.js +38 -19
- package/dist/core/dist/data/sync.js +60 -38
- package/dist/core/dist/heatmap-tooltip.js +16 -0
- package/dist/core/dist/interactions/handler.js +67 -43
- package/dist/core/dist/perf/perf-hud.js +2 -2
- package/dist/core/dist/scales/x-scale.js +85 -37
- package/dist/core/dist/scales/y-scale.js +38 -27
- package/dist/core/dist/series/bar-intro.js +18 -0
- package/dist/core/dist/series/bar.js +337 -205
- package/dist/core/dist/series/base-multi-layer.js +224 -96
- package/dist/core/dist/series/candlestick-intro.js +57 -0
- package/dist/core/dist/series/candlestick.js +454 -276
- package/dist/core/dist/series/heatmap.js +387 -0
- package/dist/core/dist/series/line-intro.js +85 -0
- package/dist/core/dist/series/line.js +590 -282
- package/dist/core/dist/series/painters/builtins.js +2 -2
- package/dist/core/dist/series/pie.js +396 -259
- package/dist/core/dist/series/register-builtins.js +8 -7
- package/dist/core/dist/series/types.js +6 -0
- package/dist/core/dist/series/wave-intro.js +26 -0
- package/dist/core/dist/theme/create.js +69 -63
- package/dist/core/dist/theme/themes/mint-breeze.js +2 -2
- package/dist/core/dist/theme/themes/sand-dune.js +2 -2
- package/dist/core/dist/utils/color.js +109 -34
- package/dist/core/dist/utils/deep-equal.js +18 -0
- package/dist/core/dist/utils/time.js +25 -19
- package/dist/index.d.ts +1411 -122
- package/dist/index.js +177 -130
- package/dist/ui/Crosshair.vue.js +20 -21
- package/dist/ui/HeatmapTooltip.vue.js +96 -0
- package/dist/ui/HeatmapTooltip.vue2.js +4 -0
- package/dist/ui/InfoBar.vue.js +46 -47
- package/dist/ui/Legend.vue.js +80 -79
- package/dist/ui/PieLegend.vue.js +5 -5
- package/dist/ui/PieTooltip.vue.js +77 -67
- package/dist/ui/Tooltip.vue.js +60 -60
- package/dist/ui/YAxis.vue.js +2 -2
- package/dist/ui/YLabel.vue.js +94 -61
- package/package.json +2 -2
- package/src/BarSeries.vue +23 -7
- package/src/CandlestickSeries.vue +23 -7
- package/src/ChartContainer.vue +134 -12
- package/src/HeatmapSeries.vue +69 -0
- package/src/LineSeries.vue +23 -7
- package/src/PieSeries.vue +22 -6
- package/src/index.ts +84 -3
- package/src/ui/Crosshair.vue +1 -2
- package/src/ui/HeatmapTooltip.vue +144 -0
- package/src/ui/InfoBar.vue +1 -2
- package/src/ui/Legend.vue +13 -0
- package/src/ui/Marker.vue +1 -1
- package/src/ui/PieTooltip.vue +10 -0
- package/src/ui/ReferenceLine.vue +2 -2
- package/src/ui/TimeRegion.vue +2 -2
- package/src/ui/Tooltip.vue +2 -2
- package/src/ui/YLabel.vue +123 -8
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
High-performance timeseries charts for **React**, **Vue**, and **Svelte**. Canvas-rendered, tree-shakeable, zero runtime dependencies.
|
|
9
9
|
|
|
10
|
-
[Live Demo](https://wick-charts.eeff.io/) · [Docs](https://wick-charts.eeff.io/api/chart-container)
|
|
10
|
+
[Live Demo](https://wick-charts.eeff.io/) · [Docs](https://wick-charts.eeff.io/api/chart-container/)
|
|
11
11
|
|
|
12
12
|
## Features
|
|
13
13
|
|
|
@@ -53,9 +53,24 @@ const props = defineProps(['data']);
|
|
|
53
53
|
|
|
54
54
|
Every component, prop, type, and slot context lives in the docs site:
|
|
55
55
|
|
|
56
|
-
[wick-charts.eeff.io/api/chart-container](https://wick-charts.eeff.io/api/chart-container)
|
|
56
|
+
[wick-charts.eeff.io/api/chart-container/](https://wick-charts.eeff.io/api/chart-container/)
|
|
57
57
|
|
|
58
|
-
Start there for [ChartContainer](https://wick-charts.eeff.io/api/chart-container), then drill into the series ([Candlestick](https://wick-charts.eeff.io/api/candlestick-series), [Line](https://wick-charts.eeff.io/api/line-series), [Bar](https://wick-charts.eeff.io/api/bar-series), [Pie](https://wick-charts.eeff.io/api/pie-series), [Sparkline](https://wick-charts.eeff.io/api/sparkline)) and overlays ([Tooltip](https://wick-charts.eeff.io/api/tooltip), [InfoBar](https://wick-charts.eeff.io/api/info-bar), [Crosshair](https://wick-charts.eeff.io/api/crosshair), [Legend](https://wick-charts.eeff.io/api/legend), [YAxis](https://wick-charts.eeff.io/api/y-axis), [XAxis](https://wick-charts.eeff.io/api/x-axis), [Navigator](https://wick-charts.eeff.io/api/navigator), …).
|
|
58
|
+
Start there for [ChartContainer](https://wick-charts.eeff.io/api/chart-container/), then drill into the series ([Candlestick](https://wick-charts.eeff.io/api/candlestick-series/), [Line](https://wick-charts.eeff.io/api/line-series/), [Bar](https://wick-charts.eeff.io/api/bar-series/), [Pie](https://wick-charts.eeff.io/api/pie-series/), [Sparkline](https://wick-charts.eeff.io/api/sparkline/)) and overlays ([Tooltip](https://wick-charts.eeff.io/api/tooltip/), [InfoBar](https://wick-charts.eeff.io/api/info-bar/), [Crosshair](https://wick-charts.eeff.io/api/crosshair/), [Legend](https://wick-charts.eeff.io/api/legend/), [YAxis](https://wick-charts.eeff.io/api/y-axis/), [XAxis](https://wick-charts.eeff.io/api/x-axis/), [Navigator](https://wick-charts.eeff.io/api/navigator/), …).
|
|
59
|
+
|
|
60
|
+
## No framework? Use the engine directly
|
|
61
|
+
|
|
62
|
+
`ChartInstance` and every series/theme/painter has no framework dependency — it's a plain canvas engine that each of `@wick-charts/react`, `@wick-charts/vue`, and `@wick-charts/svelte` bundles and re-exports in full. Any one of them is a supported vanilla entry point; you don't need React/Vue/Svelte installed to use it this way (`sideEffects: false` + per-module ESM means the framework-specific components tree-shake out when unused):
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
import { CandlestickSeriesDef, ChartInstance, registerBuiltinSeries } from '@wick-charts/react';
|
|
66
|
+
|
|
67
|
+
registerBuiltinSeries();
|
|
68
|
+
const chart = new ChartInstance(document.getElementById('chart')!);
|
|
69
|
+
const seriesId = chart.addSeries(CandlestickSeriesDef, {});
|
|
70
|
+
chart.setSeriesData(seriesId, data);
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
There's no separate `@wick-charts/core` package on npm — the three framework packages are the supported way to install the engine.
|
|
59
74
|
|
|
60
75
|
## Bundle size
|
|
61
76
|
|
package/dist/BarSeries.vue.js
CHANGED
|
@@ -1,44 +1,50 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { toLayers as
|
|
1
|
+
import { defineComponent as u, ref as p, onMounted as d, onUnmounted as c, watch as o, createCommentVNode as f } from "vue";
|
|
2
|
+
import { toLayers as m, EMPTY_SYNC_STATE as v, syncLayers as y } from "./core/dist/data/sync.js";
|
|
3
3
|
import { BarSeriesDef as S } from "./core/dist/series/bar.js";
|
|
4
4
|
import { useChartInstance as _ } from "./context.js";
|
|
5
|
-
const
|
|
5
|
+
const E = /* @__PURE__ */ u({
|
|
6
6
|
__name: "BarSeries",
|
|
7
7
|
props: {
|
|
8
8
|
data: {},
|
|
9
9
|
options: {},
|
|
10
|
-
id: {}
|
|
10
|
+
id: {},
|
|
11
|
+
visible: { type: Boolean, default: !0 }
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const a =
|
|
14
|
-
let
|
|
15
|
-
function
|
|
16
|
-
|
|
13
|
+
setup(l) {
|
|
14
|
+
const a = l, s = _(), r = p(null);
|
|
15
|
+
let i = [];
|
|
16
|
+
function n(e, t) {
|
|
17
|
+
i = y({ chart: s, id: e, data: t, prev: i });
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
-
const e =
|
|
19
|
+
return d(() => {
|
|
20
|
+
const e = m(a.data).length, t = s.addSeries(S, {
|
|
20
21
|
...a.options,
|
|
21
22
|
layers: e,
|
|
22
23
|
id: a.id
|
|
23
24
|
});
|
|
24
|
-
r.value = t,
|
|
25
|
-
}),
|
|
26
|
-
r.value &&
|
|
27
|
-
}),
|
|
25
|
+
r.value = t, i = new Array(e).fill(v), n(t, a.data), s.setSeriesVisible(t, a.visible);
|
|
26
|
+
}), c(() => {
|
|
27
|
+
r.value && s.removeSeries(r.value);
|
|
28
|
+
}), o(
|
|
28
29
|
() => a.data,
|
|
29
30
|
(e) => {
|
|
30
31
|
const t = r.value;
|
|
31
|
-
t &&
|
|
32
|
+
t && n(t, e);
|
|
32
33
|
}
|
|
33
|
-
),
|
|
34
|
+
), o(
|
|
34
35
|
() => a.options,
|
|
35
36
|
(e) => {
|
|
36
|
-
r.value && e &&
|
|
37
|
+
r.value && e && s.updateSeriesOptions(r.value, e);
|
|
37
38
|
},
|
|
38
39
|
{ deep: !0 }
|
|
39
|
-
), (
|
|
40
|
+
), o(
|
|
41
|
+
() => a.visible,
|
|
42
|
+
(e) => {
|
|
43
|
+
r.value && s.setSeriesVisible(r.value, e);
|
|
44
|
+
}
|
|
45
|
+
), (e, t) => f("", !0);
|
|
40
46
|
}
|
|
41
47
|
});
|
|
42
48
|
export {
|
|
43
|
-
|
|
49
|
+
E as default
|
|
44
50
|
};
|
|
@@ -1,45 +1,51 @@
|
|
|
1
|
-
import { defineComponent as p, ref as
|
|
2
|
-
import { toLayers as
|
|
1
|
+
import { defineComponent as p, ref as c, onMounted as f, onUnmounted as m, watch as r, createCommentVNode as v } from "vue";
|
|
2
|
+
import { toLayers as d, syncSeriesLayer as S, EMPTY_SYNC_STATE as b } from "./core/dist/data/sync.js";
|
|
3
3
|
import { CandlestickSeriesDef as y } from "./core/dist/series/candlestick.js";
|
|
4
|
-
import { useChartInstance as
|
|
5
|
-
const
|
|
4
|
+
import { useChartInstance as _ } from "./context.js";
|
|
5
|
+
const V = /* @__PURE__ */ p({
|
|
6
6
|
__name: "CandlestickSeries",
|
|
7
7
|
props: {
|
|
8
8
|
data: {},
|
|
9
9
|
options: {},
|
|
10
|
-
id: {}
|
|
10
|
+
id: {},
|
|
11
|
+
visible: { type: Boolean, default: !0 }
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const t =
|
|
14
|
-
let o =
|
|
15
|
-
function n(e,
|
|
16
|
-
const
|
|
17
|
-
|
|
13
|
+
setup(u) {
|
|
14
|
+
const t = u, s = _(), a = c(null);
|
|
15
|
+
let o = b;
|
|
16
|
+
function n(e, i) {
|
|
17
|
+
const l = d(i)[0];
|
|
18
|
+
s.setSeriesLabels(e, [l.label]), o = S({ chart: s, id: e, data: l.data, prev: o });
|
|
18
19
|
}
|
|
19
|
-
return
|
|
20
|
-
const e =
|
|
20
|
+
return f(() => {
|
|
21
|
+
const e = s.addSeries(y, {
|
|
21
22
|
...t.options,
|
|
22
23
|
id: t.id,
|
|
23
|
-
label:
|
|
24
|
+
label: d(t.data)[0].label
|
|
24
25
|
});
|
|
25
|
-
a.value = e, n(e, t.data);
|
|
26
|
-
}),
|
|
27
|
-
a.value &&
|
|
28
|
-
}),
|
|
26
|
+
a.value = e, n(e, t.data), s.setSeriesVisible(e, t.visible);
|
|
27
|
+
}), m(() => {
|
|
28
|
+
a.value && s.removeSeries(a.value);
|
|
29
|
+
}), r(
|
|
29
30
|
() => t.data,
|
|
30
31
|
(e) => {
|
|
31
|
-
const
|
|
32
|
-
|
|
32
|
+
const i = a.value;
|
|
33
|
+
i && n(i, e);
|
|
33
34
|
}
|
|
34
|
-
),
|
|
35
|
+
), r(
|
|
35
36
|
() => t.options,
|
|
36
37
|
(e) => {
|
|
37
|
-
a.value && e &&
|
|
38
|
+
a.value && e && s.updateSeriesOptions(a.value, e);
|
|
38
39
|
},
|
|
39
40
|
{ deep: !0 }
|
|
40
|
-
), (
|
|
41
|
+
), r(
|
|
42
|
+
() => t.visible,
|
|
43
|
+
(e) => {
|
|
44
|
+
a.value && s.setSeriesVisible(a.value, e);
|
|
45
|
+
}
|
|
46
|
+
), (e, i) => v("", !0);
|
|
41
47
|
}
|
|
42
48
|
});
|
|
43
49
|
export {
|
|
44
|
-
|
|
50
|
+
V as default
|
|
45
51
|
};
|
|
@@ -1,88 +1,111 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ChartInstance as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as $, ref as r, shallowRef as M, provide as l, computed as P, onMounted as D, nextTick as h, onUnmounted as T, watch as d, openBlock as g, createElementBlock as p, normalizeStyle as j, createElementVNode as o, createCommentVNode as A, renderSlot as N } from "vue";
|
|
2
|
+
import { ChartInstance as z } from "./core/dist/chart.js";
|
|
3
|
+
import { deepEqual as H } from "./core/dist/utils/deep-equal.js";
|
|
4
|
+
import { catppuccin as q } from "./core/dist/theme/themes/catppuccin.js";
|
|
5
|
+
import { ChartKey as G, ThemeKey as I, TitleAnchorKey as U, InfoBarAnchorKey as F, LegendAnchorKey as J, LegendRightAnchorKey as Q, NavigatorAnchorKey as W } from "./context.js";
|
|
6
|
+
const X = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-height": "0" } }, Y = { style: { display: "flex", "flex-direction": "column", flex: "1", "min-width": "0", "min-height": "0" } }, Z = {
|
|
6
7
|
key: 0,
|
|
7
8
|
"data-chart-header": "",
|
|
8
9
|
style: { "flex-shrink": "0", display: "flex", "flex-direction": "column", "pointer-events": "none" }
|
|
9
|
-
},
|
|
10
|
+
}, ee = {
|
|
10
11
|
key: 1,
|
|
11
12
|
"data-chart-series-overlay": "",
|
|
12
13
|
style: { position: "absolute", inset: "0", "pointer-events": "none", "z-index": "3" }
|
|
13
|
-
},
|
|
14
|
+
}, le = /* @__PURE__ */ $({
|
|
14
15
|
__name: "ChartContainer",
|
|
15
16
|
props: {
|
|
16
|
-
theme: { default: () =>
|
|
17
|
+
theme: { default: () => q.theme },
|
|
17
18
|
axis: {},
|
|
18
19
|
padding: {},
|
|
19
20
|
viewport: {},
|
|
21
|
+
visibleRange: {},
|
|
20
22
|
gradient: { type: Boolean, default: !0 },
|
|
21
|
-
interactive: { type: Boolean },
|
|
23
|
+
interactive: { type: Boolean, default: !0 },
|
|
22
24
|
grid: {},
|
|
23
25
|
headerLayout: { default: "overlay" },
|
|
24
26
|
animations: { type: [Boolean, Object] },
|
|
25
27
|
perf: {},
|
|
26
|
-
onEdgeReached: {}
|
|
28
|
+
onEdgeReached: {},
|
|
29
|
+
onPointClick: {},
|
|
30
|
+
onPointDoubleClick: {},
|
|
31
|
+
onSeriesHover: {},
|
|
32
|
+
onReady: {},
|
|
33
|
+
onVisibleRangeChange: {},
|
|
34
|
+
onCrosshairMove: {}
|
|
27
35
|
},
|
|
28
|
-
setup(
|
|
29
|
-
const e =
|
|
30
|
-
|
|
31
|
-
let
|
|
32
|
-
const
|
|
36
|
+
setup(y) {
|
|
37
|
+
const e = y, c = r(), n = M(null), m = M(e.theme), u = e.perf, v = e.onEdgeReached, w = r(null), b = r(null), R = r(null), C = r(null), _ = r(null), E = r(null);
|
|
38
|
+
l(G, n), l(I, m), l(U, b), l(F, R), l(J, C), l(Q, _), l(W, E);
|
|
39
|
+
let s = null;
|
|
40
|
+
const k = r(0), B = P(() => e.headerLayout === "overlay" ? k.value : 0);
|
|
33
41
|
function x() {
|
|
34
|
-
if (!
|
|
35
|
-
const
|
|
36
|
-
e.padding?.bottom !== void 0 && (
|
|
42
|
+
if (!n.value) return;
|
|
43
|
+
const i = { top: (e.padding?.top ?? 20) + B.value };
|
|
44
|
+
e.padding?.bottom !== void 0 && (i.bottom = e.padding.bottom), e.padding?.right !== void 0 && (i.right = e.padding.right), e.padding?.left !== void 0 && (i.left = e.padding.left), n.value.setPadding(i);
|
|
37
45
|
}
|
|
38
|
-
function
|
|
39
|
-
|
|
40
|
-
const t = e.headerLayout === "overlay" ?
|
|
46
|
+
function L() {
|
|
47
|
+
s?.disconnect(), s = null;
|
|
48
|
+
const t = e.headerLayout === "overlay" ? w.value : null;
|
|
41
49
|
if (!t) {
|
|
42
|
-
|
|
50
|
+
k.value = 0, x();
|
|
43
51
|
return;
|
|
44
52
|
}
|
|
45
|
-
const
|
|
46
|
-
|
|
53
|
+
const i = () => {
|
|
54
|
+
k.value = t.getBoundingClientRect().height, x();
|
|
47
55
|
};
|
|
48
|
-
|
|
56
|
+
i(), s = new ResizeObserver(i), s.observe(t);
|
|
49
57
|
}
|
|
50
|
-
|
|
58
|
+
function V(t) {
|
|
59
|
+
t.on("pointClick", (a) => e.onPointClick?.(a)), t.on("pointDoubleClick", (a) => e.onPointDoubleClick?.(a)), t.on("seriesHover", (a) => e.onSeriesHover?.(a)), t.on("crosshairMove", (a) => e.onCrosshairMove?.(a));
|
|
60
|
+
const i = () => e.onVisibleRangeChange?.(t.getVisibleRange());
|
|
61
|
+
t.on("viewportChange", i), t.on("dataUpdate", i), t.on("seriesChange", i);
|
|
62
|
+
}
|
|
63
|
+
D(async () => {
|
|
51
64
|
if (!c.value) return;
|
|
52
65
|
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),
|
|
54
|
-
}),
|
|
55
|
-
|
|
56
|
-
}),
|
|
66
|
+
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), u !== void 0 && (t.perf = u), v && (t.onEdgeReached = v), e.animations !== void 0 && (t.animations = e.animations), n.value = new z(c.value, t), V(n.value), e.onReady?.(n.value), await h(), L();
|
|
67
|
+
}), T(() => {
|
|
68
|
+
s?.disconnect(), s = null, n.value?.destroy(), n.value = null;
|
|
69
|
+
}), d(
|
|
57
70
|
() => e.headerLayout,
|
|
58
71
|
async () => {
|
|
59
|
-
|
|
72
|
+
n.value && (await h(), L());
|
|
60
73
|
}
|
|
61
|
-
),
|
|
74
|
+
), d(
|
|
62
75
|
() => e.theme,
|
|
63
76
|
(t) => {
|
|
64
|
-
|
|
77
|
+
n.value && t && (n.value.setTheme(t), m.value = t);
|
|
65
78
|
}
|
|
66
|
-
),
|
|
79
|
+
), d(
|
|
67
80
|
() => e.axis,
|
|
68
81
|
(t) => {
|
|
69
|
-
|
|
82
|
+
n.value && t && n.value.setAxis(t);
|
|
70
83
|
},
|
|
71
84
|
{ deep: !0 }
|
|
72
|
-
),
|
|
85
|
+
), d(
|
|
73
86
|
() => e.grid?.visible,
|
|
74
87
|
() => {
|
|
75
|
-
|
|
88
|
+
n.value && e.grid !== void 0 && n.value.setGrid(e.grid);
|
|
76
89
|
}
|
|
77
|
-
)
|
|
90
|
+
);
|
|
91
|
+
let K = e.animations;
|
|
92
|
+
d(
|
|
78
93
|
() => e.animations,
|
|
79
94
|
async (t) => {
|
|
80
|
-
if (!
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
e.axis && (
|
|
95
|
+
if (H(t, K) || (K = t, !n.value || !c.value)) return;
|
|
96
|
+
n.value.destroy(), n.value = null, await h();
|
|
97
|
+
const i = {};
|
|
98
|
+
e.axis && (i.axis = e.axis), e.theme && (i.theme = e.theme), e.padding && (i.padding = e.padding), e.viewport && (i.viewport = e.viewport), e.interactive !== void 0 && (i.interactive = e.interactive), e.grid !== void 0 && (i.grid = e.grid), u !== void 0 && (i.perf = u), v && (i.onEdgeReached = v), t !== void 0 && (i.animations = t), n.value = new z(c.value, i), V(n.value), e.onReady?.(n.value);
|
|
84
99
|
}
|
|
85
|
-
)
|
|
100
|
+
);
|
|
101
|
+
let f;
|
|
102
|
+
d(
|
|
103
|
+
() => [n.value, e.visibleRange],
|
|
104
|
+
async ([t, i]) => {
|
|
105
|
+
!t || i === void 0 || f !== void 0 && f.instance === t && H(f.spec, i) || (f = { instance: t, spec: i }, await h(), t.setVisibleRange(i));
|
|
106
|
+
},
|
|
107
|
+
{ immediate: !0 }
|
|
108
|
+
), d(
|
|
86
109
|
() => [
|
|
87
110
|
e.padding?.top,
|
|
88
111
|
e.padding?.bottom,
|
|
@@ -92,53 +115,53 @@ const F = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-h
|
|
|
92
115
|
],
|
|
93
116
|
x
|
|
94
117
|
);
|
|
95
|
-
const
|
|
96
|
-
const t =
|
|
97
|
-
return `position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; background: ${e.gradient ? `linear-gradient(to bottom, ${
|
|
118
|
+
const S = P(() => {
|
|
119
|
+
const t = m.value, [i, a] = t?.chartGradient ?? ["transparent", "transparent"], O = t?.background ?? "transparent";
|
|
120
|
+
return `position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 240px; overflow: hidden; background: ${e.gradient ? `linear-gradient(to bottom, ${i} 0%, ${O} 70%, ${a} 100%)` : O}`;
|
|
98
121
|
});
|
|
99
|
-
return (t,
|
|
100
|
-
style:
|
|
122
|
+
return (t, i) => (g(), p("div", {
|
|
123
|
+
style: j(S.value)
|
|
101
124
|
}, [
|
|
102
|
-
o("div",
|
|
103
|
-
o("div",
|
|
104
|
-
|
|
125
|
+
o("div", X, [
|
|
126
|
+
o("div", Y, [
|
|
127
|
+
y.headerLayout === "inline" ? (g(), p("div", Z, [
|
|
105
128
|
o("div", {
|
|
106
129
|
ref_key: "titleAnchor",
|
|
107
|
-
ref:
|
|
130
|
+
ref: b,
|
|
108
131
|
"data-chart-title-anchor": ""
|
|
109
132
|
}, null, 512),
|
|
110
133
|
o("div", {
|
|
111
134
|
ref_key: "infoBarAnchor",
|
|
112
|
-
ref:
|
|
135
|
+
ref: R,
|
|
113
136
|
"data-tooltip-legend-anchor": ""
|
|
114
137
|
}, null, 512)
|
|
115
|
-
])) :
|
|
138
|
+
])) : A("", !0),
|
|
116
139
|
o("div", {
|
|
117
140
|
ref_key: "containerRef",
|
|
118
141
|
ref: c,
|
|
119
142
|
style: { position: "relative", flex: "1", "min-width": "0", "min-height": "0", overflow: "hidden" }
|
|
120
143
|
}, [
|
|
121
|
-
|
|
144
|
+
y.headerLayout === "overlay" ? (g(), p("div", {
|
|
122
145
|
key: 0,
|
|
123
146
|
ref_key: "topOverlayRef",
|
|
124
|
-
ref:
|
|
147
|
+
ref: w,
|
|
125
148
|
"data-chart-top-overlay": "",
|
|
126
149
|
style: { position: "absolute", top: "0", left: "0", right: "0", "z-index": "2", "pointer-events": "none", display: "flex", "flex-direction": "column" }
|
|
127
150
|
}, [
|
|
128
151
|
o("div", {
|
|
129
152
|
ref_key: "titleAnchor",
|
|
130
|
-
ref:
|
|
153
|
+
ref: b,
|
|
131
154
|
"data-chart-title-anchor": ""
|
|
132
155
|
}, null, 512),
|
|
133
156
|
o("div", {
|
|
134
157
|
ref_key: "infoBarAnchor",
|
|
135
|
-
ref:
|
|
158
|
+
ref: R,
|
|
136
159
|
"data-tooltip-legend-anchor": ""
|
|
137
160
|
}, null, 512)
|
|
138
|
-
], 512)) :
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
])) :
|
|
161
|
+
], 512)) : A("", !0),
|
|
162
|
+
n.value ? (g(), p("div", ee, [
|
|
163
|
+
N(t.$slots, "default")
|
|
164
|
+
])) : A("", !0)
|
|
142
165
|
], 512)
|
|
143
166
|
]),
|
|
144
167
|
o("div", {
|
|
@@ -150,13 +173,13 @@ const F = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-h
|
|
|
150
173
|
]),
|
|
151
174
|
o("div", {
|
|
152
175
|
ref_key: "legendAnchor",
|
|
153
|
-
ref:
|
|
176
|
+
ref: C,
|
|
154
177
|
"data-legend-anchor": "",
|
|
155
178
|
style: { flex: "0 0 auto" }
|
|
156
179
|
}, null, 512),
|
|
157
180
|
o("div", {
|
|
158
181
|
ref_key: "navigatorAnchor",
|
|
159
|
-
ref:
|
|
182
|
+
ref: E,
|
|
160
183
|
"data-navigator-anchor": "",
|
|
161
184
|
style: { flex: "0 0 auto" }
|
|
162
185
|
}, null, 512)
|
|
@@ -164,5 +187,5 @@ const F = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-h
|
|
|
164
187
|
}
|
|
165
188
|
});
|
|
166
189
|
export {
|
|
167
|
-
|
|
190
|
+
le as default
|
|
168
191
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineComponent as o, ref as n, onMounted as u, onUnmounted as l, watch as s, createCommentVNode as d } from "vue";
|
|
2
|
+
import { HeatmapSeriesDef as p } from "./core/dist/series/heatmap.js";
|
|
3
|
+
import { useChartInstance as m } from "./context.js";
|
|
4
|
+
const _ = /* @__PURE__ */ o({
|
|
5
|
+
__name: "HeatmapSeries",
|
|
6
|
+
props: {
|
|
7
|
+
data: {},
|
|
8
|
+
options: {},
|
|
9
|
+
id: {},
|
|
10
|
+
visible: { type: Boolean, default: !0 }
|
|
11
|
+
},
|
|
12
|
+
setup(r) {
|
|
13
|
+
const a = r, i = m(), t = n(null);
|
|
14
|
+
return u(() => {
|
|
15
|
+
const e = i.addSeries(p, { ...a.options, id: a.id });
|
|
16
|
+
t.value = e, a.data.length > 0 && i.setSeriesData(e, a.data), i.setSeriesVisible(e, a.visible);
|
|
17
|
+
}), l(() => {
|
|
18
|
+
t.value && i.removeSeries(t.value);
|
|
19
|
+
}), s(
|
|
20
|
+
() => a.data,
|
|
21
|
+
(e) => {
|
|
22
|
+
t.value && i.setSeriesData(t.value, e);
|
|
23
|
+
}
|
|
24
|
+
), s(
|
|
25
|
+
() => a.options,
|
|
26
|
+
(e) => {
|
|
27
|
+
t.value && e && i.updateSeriesOptions(t.value, e);
|
|
28
|
+
},
|
|
29
|
+
{ deep: !0 }
|
|
30
|
+
), s(
|
|
31
|
+
() => a.visible,
|
|
32
|
+
(e) => {
|
|
33
|
+
t.value && i.setSeriesVisible(t.value, e);
|
|
34
|
+
}
|
|
35
|
+
), (e, f) => d("", !0);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
export {
|
|
39
|
+
_ as default
|
|
40
|
+
};
|
package/dist/LineSeries.vue.js
CHANGED
|
@@ -1,44 +1,50 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { toLayers as
|
|
1
|
+
import { defineComponent as u, ref as p, onMounted as d, onUnmounted as c, watch as n, createCommentVNode as f } from "vue";
|
|
2
|
+
import { toLayers as m, EMPTY_SYNC_STATE as v, syncLayers as y } from "./core/dist/data/sync.js";
|
|
3
3
|
import { LineSeriesDef as S } from "./core/dist/series/line.js";
|
|
4
4
|
import { useChartInstance as _ } from "./context.js";
|
|
5
|
-
const
|
|
5
|
+
const E = /* @__PURE__ */ u({
|
|
6
6
|
__name: "LineSeries",
|
|
7
7
|
props: {
|
|
8
8
|
data: {},
|
|
9
9
|
options: {},
|
|
10
|
-
id: {}
|
|
10
|
+
id: {},
|
|
11
|
+
visible: { type: Boolean, default: !0 }
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const a =
|
|
14
|
-
let
|
|
15
|
-
function
|
|
16
|
-
|
|
13
|
+
setup(l) {
|
|
14
|
+
const a = l, s = _(), r = p(null);
|
|
15
|
+
let i = [];
|
|
16
|
+
function o(e, t) {
|
|
17
|
+
i = y({ chart: s, id: e, data: t, prev: i });
|
|
17
18
|
}
|
|
18
|
-
return
|
|
19
|
-
const e =
|
|
19
|
+
return d(() => {
|
|
20
|
+
const e = m(a.data).length, t = s.addSeries(S, {
|
|
20
21
|
...a.options,
|
|
21
22
|
layers: e,
|
|
22
23
|
id: a.id
|
|
23
24
|
});
|
|
24
|
-
r.value = t,
|
|
25
|
-
}),
|
|
26
|
-
r.value &&
|
|
27
|
-
}),
|
|
25
|
+
r.value = t, i = new Array(e).fill(v), o(t, a.data), s.setSeriesVisible(t, a.visible);
|
|
26
|
+
}), c(() => {
|
|
27
|
+
r.value && s.removeSeries(r.value);
|
|
28
|
+
}), n(
|
|
28
29
|
() => a.data,
|
|
29
30
|
(e) => {
|
|
30
31
|
const t = r.value;
|
|
31
|
-
t &&
|
|
32
|
+
t && o(t, e);
|
|
32
33
|
}
|
|
33
|
-
),
|
|
34
|
+
), n(
|
|
34
35
|
() => a.options,
|
|
35
36
|
(e) => {
|
|
36
|
-
r.value && e &&
|
|
37
|
+
r.value && e && s.updateSeriesOptions(r.value, e);
|
|
37
38
|
},
|
|
38
39
|
{ deep: !0 }
|
|
39
|
-
), (
|
|
40
|
+
), n(
|
|
41
|
+
() => a.visible,
|
|
42
|
+
(e) => {
|
|
43
|
+
r.value && s.setSeriesVisible(r.value, e);
|
|
44
|
+
}
|
|
45
|
+
), (e, t) => f("", !0);
|
|
40
46
|
}
|
|
41
47
|
});
|
|
42
48
|
export {
|
|
43
|
-
|
|
49
|
+
E as default
|
|
44
50
|
};
|
package/dist/PieSeries.vue.js
CHANGED
|
@@ -1,32 +1,38 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { PieSeriesDef as
|
|
3
|
-
import { useChartInstance as
|
|
4
|
-
const h = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as o, ref as n, onMounted as u, onUnmounted as l, watch as a, createCommentVNode as d } from "vue";
|
|
2
|
+
import { PieSeriesDef as p } from "./core/dist/series/pie.js";
|
|
3
|
+
import { useChartInstance as f } from "./context.js";
|
|
4
|
+
const h = /* @__PURE__ */ o({
|
|
5
5
|
__name: "PieSeries",
|
|
6
6
|
props: {
|
|
7
7
|
data: {},
|
|
8
8
|
options: {},
|
|
9
|
-
id: {}
|
|
9
|
+
id: {},
|
|
10
|
+
visible: { type: Boolean, default: !0 }
|
|
10
11
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
12
|
+
setup(r) {
|
|
13
|
+
const i = r, s = f(), t = n(null);
|
|
13
14
|
return u(() => {
|
|
14
|
-
const e =
|
|
15
|
-
t.value = e,
|
|
16
|
-
}),
|
|
17
|
-
t.value &&
|
|
18
|
-
}),
|
|
19
|
-
() =>
|
|
15
|
+
const e = s.addSeries(p, { ...i.options, id: i.id });
|
|
16
|
+
t.value = e, i.data.length > 0 && s.setSeriesData(e, i.data), s.setSeriesVisible(e, i.visible);
|
|
17
|
+
}), l(() => {
|
|
18
|
+
t.value && s.removeSeries(t.value);
|
|
19
|
+
}), a(
|
|
20
|
+
() => i.data,
|
|
20
21
|
(e) => {
|
|
21
|
-
t.value && e.length > 0 &&
|
|
22
|
+
t.value && e.length > 0 && s.setSeriesData(t.value, e);
|
|
22
23
|
}
|
|
23
|
-
),
|
|
24
|
-
() =>
|
|
24
|
+
), a(
|
|
25
|
+
() => i.options,
|
|
25
26
|
(e) => {
|
|
26
|
-
t.value && e &&
|
|
27
|
+
t.value && e && s.updateSeriesOptions(t.value, e);
|
|
27
28
|
},
|
|
28
29
|
{ deep: !0 }
|
|
29
|
-
), (
|
|
30
|
+
), a(
|
|
31
|
+
() => i.visible,
|
|
32
|
+
(e) => {
|
|
33
|
+
t.value && s.setSeriesVisible(t.value, e);
|
|
34
|
+
}
|
|
35
|
+
), (e, c) => d("", !0);
|
|
30
36
|
}
|
|
31
37
|
});
|
|
32
38
|
export {
|