@wick-charts/vue 0.8.0 → 0.8.2
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 -0
- package/dist/BandSeries.vue.js +43 -32
- package/dist/BarSeries.vue.js +44 -33
- package/dist/CandlestickSeries.vue.js +24 -23
- package/dist/ChartContainer.vue.js +1 -1
- package/dist/HeatmapSeries.vue.js +21 -20
- package/dist/LineSeries.vue.js +43 -32
- package/dist/PieSeries.vue.js +25 -24
- package/dist/composables.js +63 -36
- package/dist/core/dist/axis/dom-labels.js +64 -53
- package/dist/core/dist/chart/badge-animator.js +38 -28
- package/dist/core/dist/chart/options.js +1 -1
- package/dist/core/dist/chart/y-target.js +38 -32
- package/dist/core/dist/chart.js +852 -709
- package/dist/core/dist/data/decimation.js +52 -51
- package/dist/core/dist/data/store.js +38 -20
- package/dist/core/dist/data/sync.js +97 -59
- package/dist/core/dist/navigator/controller.js +11 -11
- package/dist/core/dist/perf/perf-hud.js +3 -3
- package/dist/core/dist/scales/tick-tracker.js +2 -1
- package/dist/core/dist/scales/time-ticks.js +99 -0
- package/dist/core/dist/scales/x-scale.js +33 -27
- package/dist/core/dist/series/band.js +83 -83
- package/dist/core/dist/series/bar.js +240 -211
- package/dist/core/dist/series/base-multi-layer.js +288 -240
- package/dist/core/dist/series/candlestick.js +168 -168
- package/dist/core/dist/series/line.js +545 -455
- package/dist/core/dist/snapshots.js +109 -86
- package/dist/core/dist/utils/point.js +4 -0
- package/dist/core/dist/utils/time.js +42 -26
- package/dist/index.d.ts +67 -28
- package/dist/ui/InfoBar.vue.js +69 -69
- package/dist/ui/NumberFlow.vue.js +36 -27
- package/dist/ui/Tooltip.vue.js +128 -131
- package/dist/ui/YLabel.vue.js +47 -47
- package/package.json +2 -2
- package/src/BandSeries.vue +20 -5
- package/src/BarSeries.vue +20 -5
- package/src/CandlestickSeries.vue +5 -4
- package/src/ChartContainer.vue +15 -9
- package/src/HeatmapSeries.vue +5 -4
- package/src/LineSeries.vue +20 -5
- package/src/PieSeries.vue +6 -5
- package/src/composables.ts +64 -1
- package/src/ui/InfoBar.vue +11 -3
- package/src/ui/NumberFlow.vue +17 -3
- package/src/ui/Tooltip.vue +23 -12
- package/src/ui/YLabel.vue +28 -27
package/README.md
CHANGED
|
@@ -49,6 +49,8 @@ const props = defineProps(['data']);
|
|
|
49
49
|
</template>
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
`ChartContainer` fills its parent (`width` and `height` are `100%`), so give the parent a height. The container also has a 240px `min-height`, so a parent with no height still shows a chart. For a smaller chart, such as a sparkline in a table row, set `min-height: 0` (`minHeight: 0` in React) in the container's `style`.
|
|
53
|
+
|
|
52
54
|
## API
|
|
53
55
|
|
|
54
56
|
Every component, prop, type, and slot context lives in the docs site:
|
package/dist/BandSeries.vue.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { toLayers as
|
|
3
|
-
import { BandSeriesDef as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as f, ref as m, onMounted as v, onUnmounted as S, watch as o, createCommentVNode as y } from "vue";
|
|
2
|
+
import { toLayers as c, syncLayers as _, EMPTY_SYNC_STATE as h } from "./core/dist/data/sync.js";
|
|
3
|
+
import { BandSeriesDef as b } from "./core/dist/series/band.js";
|
|
4
|
+
import { rawSeriesData as d, seriesDataSource as C } from "./composables.js";
|
|
5
|
+
import { useChartInstance as w } from "./context.js";
|
|
6
|
+
const g = /* @__PURE__ */ f({
|
|
6
7
|
__name: "BandSeries",
|
|
7
8
|
props: {
|
|
8
9
|
data: {},
|
|
@@ -11,42 +12,52 @@ const B = /* @__PURE__ */ u({
|
|
|
11
12
|
visible: { type: Boolean, default: !0 },
|
|
12
13
|
scale: {}
|
|
13
14
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
let
|
|
17
|
-
function
|
|
18
|
-
|
|
15
|
+
setup(p) {
|
|
16
|
+
const r = p, s = w(), a = m(null);
|
|
17
|
+
let n = [], i = 0;
|
|
18
|
+
function l(e, t) {
|
|
19
|
+
n = _({ chart: s, id: e, data: t, prev: n });
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
function u(e) {
|
|
22
|
+
i = c(e).length;
|
|
23
|
+
const t = s.addSeries(b, {
|
|
24
|
+
...r.options,
|
|
25
|
+
scale: r.scale,
|
|
26
|
+
layers: i,
|
|
27
|
+
id: r.id
|
|
26
28
|
});
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
(
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
a.value = t, n = new Array(i).fill(h), l(t, e), s.setSeriesVisible(t, r.visible);
|
|
30
|
+
}
|
|
31
|
+
return v(() => {
|
|
32
|
+
u(d(r.data));
|
|
33
|
+
}), S(() => {
|
|
34
|
+
a.value && s.removeSeries(a.value);
|
|
35
|
+
}), o(
|
|
36
|
+
C(() => r.data),
|
|
37
|
+
() => {
|
|
38
|
+
const e = d(r.data), t = a.value;
|
|
39
|
+
if (t) {
|
|
40
|
+
if (c(e).length !== i) {
|
|
41
|
+
s.removeSeries(t), u(e);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
l(t, e);
|
|
45
|
+
}
|
|
35
46
|
}
|
|
36
|
-
),
|
|
37
|
-
() => [
|
|
47
|
+
), o(
|
|
48
|
+
() => [r.options, r.scale],
|
|
38
49
|
([e, t]) => {
|
|
39
|
-
|
|
50
|
+
a.value && s.updateSeriesOptions(a.value, e ? { ...e, scale: t } : { scale: t });
|
|
40
51
|
},
|
|
41
52
|
{ deep: !0 }
|
|
42
|
-
),
|
|
43
|
-
() =>
|
|
53
|
+
), o(
|
|
54
|
+
() => r.visible,
|
|
44
55
|
(e) => {
|
|
45
|
-
|
|
56
|
+
a.value && s.setSeriesVisible(a.value, e);
|
|
46
57
|
}
|
|
47
|
-
), (e, t) =>
|
|
58
|
+
), (e, t) => y("", !0);
|
|
48
59
|
}
|
|
49
60
|
});
|
|
50
61
|
export {
|
|
51
|
-
|
|
62
|
+
g as default
|
|
52
63
|
};
|
package/dist/BarSeries.vue.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { toLayers as
|
|
3
|
-
import { BarSeriesDef as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as f, ref as m, onMounted as v, onUnmounted as S, watch as n, createCommentVNode as y } from "vue";
|
|
2
|
+
import { toLayers as c, syncLayers as _, EMPTY_SYNC_STATE as h } from "./core/dist/data/sync.js";
|
|
3
|
+
import { BarSeriesDef as b } from "./core/dist/series/bar.js";
|
|
4
|
+
import { rawSeriesData as p, seriesDataSource as C } from "./composables.js";
|
|
5
|
+
import { useChartInstance as D } from "./context.js";
|
|
6
|
+
const g = /* @__PURE__ */ f({
|
|
6
7
|
__name: "BarSeries",
|
|
7
8
|
props: {
|
|
8
9
|
data: {},
|
|
@@ -11,42 +12,52 @@ const B = /* @__PURE__ */ u({
|
|
|
11
12
|
visible: { type: Boolean, default: !0 },
|
|
12
13
|
scale: {}
|
|
13
14
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
let
|
|
17
|
-
function
|
|
18
|
-
|
|
15
|
+
setup(d) {
|
|
16
|
+
const t = d, s = D(), a = m(null);
|
|
17
|
+
let o = [], i = 0;
|
|
18
|
+
function l(e, r) {
|
|
19
|
+
o = _({ chart: s, id: e, data: r, prev: o });
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
function u(e) {
|
|
22
|
+
i = c(e).length;
|
|
23
|
+
const r = s.addSeries(b, {
|
|
24
|
+
...t.options,
|
|
25
|
+
scale: t.scale,
|
|
26
|
+
layers: i,
|
|
27
|
+
id: t.id
|
|
26
28
|
});
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
(
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
a.value = r, o = new Array(i).fill(h), l(r, e), s.setSeriesVisible(r, t.visible);
|
|
30
|
+
}
|
|
31
|
+
return v(() => {
|
|
32
|
+
u(p(t.data));
|
|
33
|
+
}), S(() => {
|
|
34
|
+
a.value && s.removeSeries(a.value);
|
|
35
|
+
}), n(
|
|
36
|
+
C(() => t.data),
|
|
37
|
+
() => {
|
|
38
|
+
const e = p(t.data), r = a.value;
|
|
39
|
+
if (r) {
|
|
40
|
+
if (c(e).length !== i) {
|
|
41
|
+
s.removeSeries(r), u(e);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
l(r, e);
|
|
45
|
+
}
|
|
35
46
|
}
|
|
36
|
-
),
|
|
37
|
-
() => [
|
|
38
|
-
([e,
|
|
39
|
-
|
|
47
|
+
), n(
|
|
48
|
+
() => [t.options, t.scale],
|
|
49
|
+
([e, r]) => {
|
|
50
|
+
a.value && s.updateSeriesOptions(a.value, e ? { ...e, scale: r } : { scale: r });
|
|
40
51
|
},
|
|
41
52
|
{ deep: !0 }
|
|
42
|
-
),
|
|
43
|
-
() =>
|
|
53
|
+
), n(
|
|
54
|
+
() => t.visible,
|
|
44
55
|
(e) => {
|
|
45
|
-
|
|
56
|
+
a.value && s.setSeriesVisible(a.value, e);
|
|
46
57
|
}
|
|
47
|
-
), (e,
|
|
58
|
+
), (e, r) => y("", !0);
|
|
48
59
|
}
|
|
49
60
|
});
|
|
50
61
|
export {
|
|
51
|
-
|
|
62
|
+
g as default
|
|
52
63
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { toLayers as u, syncSeriesLayer as
|
|
3
|
-
import { CandlestickSeriesDef as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as p, ref as m, onMounted as f, onUnmounted as v, watch as i, createCommentVNode as S } from "vue";
|
|
2
|
+
import { toLayers as u, syncSeriesLayer as b, EMPTY_SYNC_STATE as _ } from "./core/dist/data/sync.js";
|
|
3
|
+
import { CandlestickSeriesDef as y } from "./core/dist/series/candlestick.js";
|
|
4
|
+
import { rawSeriesData as c, seriesDataSource as C } from "./composables.js";
|
|
5
|
+
import { useChartInstance as h } from "./context.js";
|
|
6
|
+
const V = /* @__PURE__ */ p({
|
|
6
7
|
__name: "CandlestickSeries",
|
|
7
8
|
props: {
|
|
8
9
|
data: {},
|
|
@@ -11,41 +12,41 @@ const V = /* @__PURE__ */ d({
|
|
|
11
12
|
visible: { type: Boolean, default: !0 },
|
|
12
13
|
scale: {}
|
|
13
14
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const a =
|
|
16
|
-
let o =
|
|
17
|
-
function n(e,
|
|
18
|
-
const l = u(
|
|
19
|
-
|
|
15
|
+
setup(d) {
|
|
16
|
+
const a = d, s = h(), t = m(null);
|
|
17
|
+
let o = _;
|
|
18
|
+
function n(e, r) {
|
|
19
|
+
const l = u(r)[0];
|
|
20
|
+
s.setSeriesLabels(e, [l.label]), o = b({ chart: s, id: e, data: l.data, prev: o });
|
|
20
21
|
}
|
|
21
22
|
return f(() => {
|
|
22
|
-
const e =
|
|
23
|
+
const e = s.addSeries(y, {
|
|
23
24
|
...a.options,
|
|
24
25
|
scale: a.scale,
|
|
25
26
|
id: a.id,
|
|
26
27
|
label: u(a.data)[0].label
|
|
27
28
|
});
|
|
28
|
-
t.value = e, n(e, a.data),
|
|
29
|
-
}),
|
|
30
|
-
t.value &&
|
|
29
|
+
t.value = e, n(e, c(a.data)), s.setSeriesVisible(e, a.visible);
|
|
30
|
+
}), v(() => {
|
|
31
|
+
t.value && s.removeSeries(t.value);
|
|
31
32
|
}), i(
|
|
32
|
-
() => a.data,
|
|
33
|
-
(
|
|
34
|
-
const
|
|
35
|
-
|
|
33
|
+
C(() => a.data),
|
|
34
|
+
() => {
|
|
35
|
+
const e = t.value;
|
|
36
|
+
e && n(e, c(a.data));
|
|
36
37
|
}
|
|
37
38
|
), i(
|
|
38
39
|
() => [a.options, a.scale],
|
|
39
|
-
([e,
|
|
40
|
-
t.value &&
|
|
40
|
+
([e, r]) => {
|
|
41
|
+
t.value && s.updateSeriesOptions(t.value, e ? { ...e, scale: r } : { scale: r });
|
|
41
42
|
},
|
|
42
43
|
{ deep: !0 }
|
|
43
44
|
), i(
|
|
44
45
|
() => a.visible,
|
|
45
46
|
(e) => {
|
|
46
|
-
t.value &&
|
|
47
|
+
t.value && s.setSeriesVisible(t.value, e);
|
|
47
48
|
}
|
|
48
|
-
), (e,
|
|
49
|
+
), (e, r) => S("", !0);
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
52
|
export {
|
|
@@ -25,7 +25,7 @@ const ie = { style: { display: "flex", "flex-direction": "row", flex: "1", "min-
|
|
|
25
25
|
grid: {},
|
|
26
26
|
fade: { type: [Boolean, Object], default: void 0 },
|
|
27
27
|
headerLayout: { default: "overlay" },
|
|
28
|
-
animations: { type: [Boolean, Object] },
|
|
28
|
+
animations: { type: [Boolean, Object], default: void 0 },
|
|
29
29
|
perf: {},
|
|
30
30
|
onEdgeReached: {},
|
|
31
31
|
onPointClick: {},
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { HeatmapSeriesDef as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defineComponent as n, ref as u, onMounted as d, onUnmounted as l, watch as s, createCommentVNode as p } from "vue";
|
|
2
|
+
import { HeatmapSeriesDef as m } from "./core/dist/series/heatmap.js";
|
|
3
|
+
import { rawSeriesData as r, seriesDataSource as f } from "./composables.js";
|
|
4
|
+
import { useChartInstance as c } from "./context.js";
|
|
5
|
+
const D = /* @__PURE__ */ n({
|
|
5
6
|
__name: "HeatmapSeries",
|
|
6
7
|
props: {
|
|
7
8
|
data: {},
|
|
@@ -9,32 +10,32 @@ const _ = /* @__PURE__ */ o({
|
|
|
9
10
|
id: {},
|
|
10
11
|
visible: { type: Boolean, default: !0 }
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
const
|
|
16
|
-
t.value =
|
|
13
|
+
setup(o) {
|
|
14
|
+
const e = o, i = c(), t = u(null);
|
|
15
|
+
return d(() => {
|
|
16
|
+
const a = i.addSeries(m, { ...e.options, id: e.id });
|
|
17
|
+
t.value = a, e.data.length > 0 && i.setSeriesData(a, r(e.data)), i.setSeriesVisible(a, e.visible);
|
|
17
18
|
}), l(() => {
|
|
18
19
|
t.value && i.removeSeries(t.value);
|
|
19
20
|
}), s(
|
|
20
|
-
() =>
|
|
21
|
-
(
|
|
22
|
-
t.value && i.setSeriesData(t.value, e);
|
|
21
|
+
f(() => e.data),
|
|
22
|
+
() => {
|
|
23
|
+
t.value && i.setSeriesData(t.value, r(e.data));
|
|
23
24
|
}
|
|
24
25
|
), s(
|
|
25
|
-
() =>
|
|
26
|
-
(
|
|
27
|
-
t.value &&
|
|
26
|
+
() => e.options,
|
|
27
|
+
(a) => {
|
|
28
|
+
t.value && a && i.updateSeriesOptions(t.value, a);
|
|
28
29
|
},
|
|
29
30
|
{ deep: !0 }
|
|
30
31
|
), s(
|
|
31
|
-
() =>
|
|
32
|
-
(
|
|
33
|
-
t.value && i.setSeriesVisible(t.value,
|
|
32
|
+
() => e.visible,
|
|
33
|
+
(a) => {
|
|
34
|
+
t.value && i.setSeriesVisible(t.value, a);
|
|
34
35
|
}
|
|
35
|
-
), (
|
|
36
|
+
), (a, v) => p("", !0);
|
|
36
37
|
}
|
|
37
38
|
});
|
|
38
39
|
export {
|
|
39
|
-
|
|
40
|
+
D as default
|
|
40
41
|
};
|
package/dist/LineSeries.vue.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { toLayers as
|
|
3
|
-
import { LineSeriesDef as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as f, ref as m, onMounted as v, onUnmounted as S, watch as o, createCommentVNode as y } from "vue";
|
|
2
|
+
import { toLayers as c, syncLayers as _, EMPTY_SYNC_STATE as h } from "./core/dist/data/sync.js";
|
|
3
|
+
import { LineSeriesDef as b } from "./core/dist/series/line.js";
|
|
4
|
+
import { rawSeriesData as p, seriesDataSource as C } from "./composables.js";
|
|
5
|
+
import { useChartInstance as D } from "./context.js";
|
|
6
|
+
const g = /* @__PURE__ */ f({
|
|
6
7
|
__name: "LineSeries",
|
|
7
8
|
props: {
|
|
8
9
|
data: {},
|
|
@@ -11,42 +12,52 @@ const T = /* @__PURE__ */ u({
|
|
|
11
12
|
visible: { type: Boolean, default: !0 },
|
|
12
13
|
scale: {}
|
|
13
14
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
let
|
|
17
|
-
function
|
|
18
|
-
|
|
15
|
+
setup(d) {
|
|
16
|
+
const r = d, s = D(), a = m(null);
|
|
17
|
+
let n = [], i = 0;
|
|
18
|
+
function l(e, t) {
|
|
19
|
+
n = _({ chart: s, id: e, data: t, prev: n });
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
function u(e) {
|
|
22
|
+
i = c(e).length;
|
|
23
|
+
const t = s.addSeries(b, {
|
|
24
|
+
...r.options,
|
|
25
|
+
scale: r.scale,
|
|
26
|
+
layers: i,
|
|
27
|
+
id: r.id
|
|
26
28
|
});
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
(
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
a.value = t, n = new Array(i).fill(h), l(t, e), s.setSeriesVisible(t, r.visible);
|
|
30
|
+
}
|
|
31
|
+
return v(() => {
|
|
32
|
+
u(p(r.data));
|
|
33
|
+
}), S(() => {
|
|
34
|
+
a.value && s.removeSeries(a.value);
|
|
35
|
+
}), o(
|
|
36
|
+
C(() => r.data),
|
|
37
|
+
() => {
|
|
38
|
+
const e = p(r.data), t = a.value;
|
|
39
|
+
if (t) {
|
|
40
|
+
if (c(e).length !== i) {
|
|
41
|
+
s.removeSeries(t), u(e);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
l(t, e);
|
|
45
|
+
}
|
|
35
46
|
}
|
|
36
|
-
),
|
|
37
|
-
() => [
|
|
47
|
+
), o(
|
|
48
|
+
() => [r.options, r.scale],
|
|
38
49
|
([e, t]) => {
|
|
39
|
-
|
|
50
|
+
a.value && s.updateSeriesOptions(a.value, e ? { ...e, scale: t } : { scale: t });
|
|
40
51
|
},
|
|
41
52
|
{ deep: !0 }
|
|
42
|
-
),
|
|
43
|
-
() =>
|
|
53
|
+
), o(
|
|
54
|
+
() => r.visible,
|
|
44
55
|
(e) => {
|
|
45
|
-
|
|
56
|
+
a.value && s.setSeriesVisible(a.value, e);
|
|
46
57
|
}
|
|
47
|
-
), (e, t) =>
|
|
58
|
+
), (e, t) => y("", !0);
|
|
48
59
|
}
|
|
49
60
|
});
|
|
50
61
|
export {
|
|
51
|
-
|
|
62
|
+
g as default
|
|
52
63
|
};
|
package/dist/PieSeries.vue.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { PieSeriesDef as
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defineComponent as n, ref as u, onMounted as d, onUnmounted as l, watch as s, createCommentVNode as p } from "vue";
|
|
2
|
+
import { PieSeriesDef as f } from "./core/dist/series/pie.js";
|
|
3
|
+
import { rawSeriesData as r, seriesDataSource as m } from "./composables.js";
|
|
4
|
+
import { useChartInstance as c } from "./context.js";
|
|
5
|
+
const D = /* @__PURE__ */ n({
|
|
5
6
|
__name: "PieSeries",
|
|
6
7
|
props: {
|
|
7
8
|
data: {},
|
|
@@ -9,32 +10,32 @@ const h = /* @__PURE__ */ o({
|
|
|
9
10
|
id: {},
|
|
10
11
|
visible: { type: Boolean, default: !0 }
|
|
11
12
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
return
|
|
15
|
-
const
|
|
16
|
-
t.value =
|
|
13
|
+
setup(o) {
|
|
14
|
+
const e = o, i = c(), t = u(null);
|
|
15
|
+
return d(() => {
|
|
16
|
+
const a = i.addSeries(f, { ...e.options, id: e.id });
|
|
17
|
+
t.value = a, e.data.length > 0 && i.setSeriesData(a, r(e.data)), i.setSeriesVisible(a, e.visible);
|
|
17
18
|
}), l(() => {
|
|
18
|
-
t.value &&
|
|
19
|
-
}),
|
|
20
|
-
() =>
|
|
21
|
-
(
|
|
22
|
-
t.value && e.length > 0 &&
|
|
19
|
+
t.value && i.removeSeries(t.value);
|
|
20
|
+
}), s(
|
|
21
|
+
m(() => e.data),
|
|
22
|
+
() => {
|
|
23
|
+
t.value && e.data.length > 0 && i.setSeriesData(t.value, r(e.data));
|
|
23
24
|
}
|
|
24
|
-
),
|
|
25
|
-
() =>
|
|
26
|
-
(
|
|
27
|
-
t.value &&
|
|
25
|
+
), s(
|
|
26
|
+
() => e.options,
|
|
27
|
+
(a) => {
|
|
28
|
+
t.value && a && i.updateSeriesOptions(t.value, a);
|
|
28
29
|
},
|
|
29
30
|
{ deep: !0 }
|
|
30
|
-
),
|
|
31
|
-
() =>
|
|
32
|
-
(
|
|
33
|
-
t.value &&
|
|
31
|
+
), s(
|
|
32
|
+
() => e.visible,
|
|
33
|
+
(a) => {
|
|
34
|
+
t.value && i.setSeriesVisible(t.value, a);
|
|
34
35
|
}
|
|
35
|
-
), (
|
|
36
|
+
), (a, v) => p("", !0);
|
|
36
37
|
}
|
|
37
38
|
});
|
|
38
39
|
export {
|
|
39
|
-
|
|
40
|
+
D as default
|
|
40
41
|
};
|
package/dist/composables.js
CHANGED
|
@@ -1,17 +1,42 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
function
|
|
3
|
-
|
|
1
|
+
import { toRaw as A, ref as a, onMounted as u, onUnmounted as l } from "vue";
|
|
2
|
+
function f(e) {
|
|
3
|
+
return typeof e == "object" && e !== null && !Array.isArray(e) && Array.isArray(Reflect.get(e, "data"));
|
|
4
|
+
}
|
|
5
|
+
function c(e) {
|
|
6
|
+
return f(e) ? [e.data] : Array.isArray(e) ? Array.isArray(e[0]) || f(e[0]) ? e.map((t) => f(t) ? t.data : t) : [e] : [];
|
|
7
|
+
}
|
|
8
|
+
function v(e) {
|
|
9
|
+
const n = A(e), t = (o) => {
|
|
10
|
+
if (!f(o)) return A(o);
|
|
11
|
+
const s = A(o);
|
|
12
|
+
return { ...s, data: A(s.data) };
|
|
13
|
+
};
|
|
14
|
+
return Array.isArray(n) ? Array.isArray(n[0]) || f(n[0]) ? n.map(t) : n : t(n);
|
|
15
|
+
}
|
|
16
|
+
function p(e) {
|
|
17
|
+
return () => {
|
|
18
|
+
const n = e(), t = [n];
|
|
19
|
+
for (const i of c(n)) {
|
|
20
|
+
t.push(i, i.length);
|
|
21
|
+
const o = i[i.length - 1];
|
|
22
|
+
typeof o == "object" && o !== null && t.push(...Object.values(o));
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function h(e) {
|
|
28
|
+
const n = a(e.getVisibleRange()), t = () => {
|
|
4
29
|
n.value = e.getVisibleRange();
|
|
5
30
|
};
|
|
6
|
-
return u(() => e.on("viewportChange",
|
|
31
|
+
return u(() => e.on("viewportChange", t)), l(() => e.off("viewportChange", t)), n;
|
|
7
32
|
}
|
|
8
|
-
function
|
|
9
|
-
const n =
|
|
33
|
+
function C(e) {
|
|
34
|
+
const n = a(e.getYRange()), t = () => {
|
|
10
35
|
n.value = e.getYRange();
|
|
11
36
|
};
|
|
12
|
-
return u(() => e.on("viewportChange",
|
|
37
|
+
return u(() => e.on("viewportChange", t)), l(() => e.off("viewportChange", t)), n;
|
|
13
38
|
}
|
|
14
|
-
function
|
|
39
|
+
function d(e) {
|
|
15
40
|
return {
|
|
16
41
|
yAxisPosition: e.yAxisPosition,
|
|
17
42
|
yAxisWidth: e.yAxisWidth,
|
|
@@ -22,46 +47,48 @@ function r(e) {
|
|
|
22
47
|
rightAxisScale: e.getAxisColumnScale("right")
|
|
23
48
|
};
|
|
24
49
|
}
|
|
25
|
-
function
|
|
26
|
-
const n =
|
|
27
|
-
const
|
|
28
|
-
o.yAxisPosition ===
|
|
50
|
+
function S(e) {
|
|
51
|
+
const n = a(d(e)), t = () => {
|
|
52
|
+
const i = d(e), o = n.value;
|
|
53
|
+
o.yAxisPosition === i.yAxisPosition && o.yAxisWidth === i.yAxisWidth && o.xAxisHeight === i.xAxisHeight && o.leftAxisWidth === i.leftAxisWidth && o.rightAxisWidth === i.rightAxisWidth && o.leftAxisScale === i.leftAxisScale && o.rightAxisScale === i.rightAxisScale || (n.value = i);
|
|
29
54
|
};
|
|
30
55
|
return u(() => {
|
|
31
|
-
|
|
32
|
-
}),
|
|
56
|
+
t(), e.on("viewportChange", t);
|
|
57
|
+
}), l(() => e.off("viewportChange", t)), n;
|
|
33
58
|
}
|
|
34
|
-
function
|
|
35
|
-
let
|
|
36
|
-
const
|
|
37
|
-
let o =
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
|
|
59
|
+
function w(e, n) {
|
|
60
|
+
let t = e.getLastValue(n);
|
|
61
|
+
const i = () => e.getYScale(e.getSeriesScale(n));
|
|
62
|
+
let o = t ? i().valueToY(t.value) : null;
|
|
63
|
+
const s = a(t), g = () => {
|
|
64
|
+
const r = e.getLastValue(n), x = r ? i().valueToY(r.value) : null;
|
|
65
|
+
t?.value === r?.value && t?.isLive === r?.isLive && o === x || (t = r, o = x, s.value = r);
|
|
41
66
|
};
|
|
42
67
|
return u(() => {
|
|
43
68
|
e.on("dataUpdate", g), e.on("viewportChange", g);
|
|
44
|
-
}),
|
|
69
|
+
}), l(() => {
|
|
45
70
|
e.off("dataUpdate", g), e.off("viewportChange", g);
|
|
46
|
-
}),
|
|
71
|
+
}), s;
|
|
47
72
|
}
|
|
48
|
-
function
|
|
49
|
-
const
|
|
50
|
-
|
|
73
|
+
function W(e, n) {
|
|
74
|
+
const t = a(e.getPreviousClose(n)), i = () => {
|
|
75
|
+
t.value = e.getPreviousClose(n);
|
|
51
76
|
};
|
|
52
|
-
return u(() => e.on("dataUpdate",
|
|
77
|
+
return u(() => e.on("dataUpdate", i)), l(() => e.off("dataUpdate", i)), t;
|
|
53
78
|
}
|
|
54
|
-
function
|
|
55
|
-
const n =
|
|
79
|
+
function P(e) {
|
|
80
|
+
const n = a(e.getCrosshairPosition()), t = () => {
|
|
56
81
|
n.value = e.getCrosshairPosition();
|
|
57
82
|
};
|
|
58
|
-
return u(() => e.on("crosshairMove",
|
|
83
|
+
return u(() => e.on("crosshairMove", t)), l(() => e.off("crosshairMove", t)), n;
|
|
59
84
|
}
|
|
60
85
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
86
|
+
v as rawSeriesData,
|
|
87
|
+
p as seriesDataSource,
|
|
88
|
+
S as useAxisLayout,
|
|
89
|
+
P as useCrosshairPosition,
|
|
90
|
+
w as useLastYValue,
|
|
91
|
+
W as usePreviousClose,
|
|
92
|
+
h as useVisibleRange,
|
|
93
|
+
C as useYRange
|
|
67
94
|
};
|