@idux/charts-core 1.0.0 → 1.1.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/CHANGELOG.md +8 -0
- package/dist/index.js +76 -74
- package/dist/index.umd.cjs +1 -1
- package/dist/types/index.d.ts +5 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @idux/charts-core
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 887b91a: Add Radar, Gauge and LiquidFill components with pure option builders, public prop types and reactive plot theme/typography configuration. Extend core option types for the new series and coordinate systems.
|
|
8
|
+
|
|
9
|
+
Schedule automatic chart resizing on the next animation frame to avoid ResizeObserver delivery loops, and cancel pending resize work when auto-resize is disabled or the chart is disposed.
|
|
10
|
+
|
|
3
11
|
## 1.0.0
|
|
4
12
|
|
|
5
13
|
### Major Changes
|
package/dist/index.js
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { DataZoomComponent as e, GridComponent as t, LegendComponent as n, TitleComponent as r, TooltipComponent as i } from "echarts/components";
|
|
2
2
|
import { LabelLayout as a, UniversalTransition as o } from "echarts/features";
|
|
3
3
|
import { SVGRenderer as s } from "echarts/renderers";
|
|
4
|
-
import { computed as c, defineComponent as l, getCurrentInstance as u, h as d, isVue2 as f, onBeforeUnmount as p, onBeforeUpdate as m, onMounted as ee, onUpdated as te, shallowRef as h, unref as g, watch as _, watchEffect as
|
|
5
|
-
import { PictorialBarChart as
|
|
6
|
-
import { init as
|
|
7
|
-
import { cloneDeep as S, isBoolean as
|
|
4
|
+
import { computed as c, defineComponent as l, getCurrentInstance as u, h as d, isVue2 as f, onBeforeUnmount as p, onBeforeUpdate as m, onMounted as ee, onUpdated as te, shallowRef as h, unref as g, watch as _, watchEffect as v } from "vue-demi";
|
|
5
|
+
import { PictorialBarChart as y } from "echarts/charts";
|
|
6
|
+
import { init as ne, registerTheme as b, use as x } from "echarts/core";
|
|
7
|
+
import { cloneDeep as S, isBoolean as re, isEqual as C, isNil as ie } from "lodash-es";
|
|
8
8
|
// composables/useResizeObserver.ts
|
|
9
|
-
function
|
|
9
|
+
function ae(e, t, n) {
|
|
10
10
|
_([
|
|
11
11
|
e,
|
|
12
12
|
t,
|
|
13
13
|
n
|
|
14
14
|
], ([e, n, r], i, a) => {
|
|
15
15
|
if (!e || !n || !r) return;
|
|
16
|
-
let o =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
let o, s = () => {
|
|
17
|
+
o === void 0 && (o = requestAnimationFrame(() => {
|
|
18
|
+
o = void 0, t.value === n && n.resize();
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
oe(e, s), a(() => {
|
|
22
|
+
se(e, s), o !== void 0 && cancelAnimationFrame(o);
|
|
21
23
|
});
|
|
22
24
|
});
|
|
23
25
|
}
|
|
24
26
|
var w = /* @__PURE__ */ new Map();
|
|
25
|
-
function
|
|
27
|
+
function oe(e, t, n) {
|
|
26
28
|
if (e && t) {
|
|
27
29
|
if (w.has(e)) w.get(e).listeners.push(t);
|
|
28
30
|
else {
|
|
@@ -36,16 +38,16 @@ function se(e, t, n) {
|
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
|
-
function
|
|
41
|
+
function se(e, t) {
|
|
40
42
|
if (!e || !t || !w.has(e)) return;
|
|
41
43
|
let { listeners: n, ro: r } = w.get(e), i = n.indexOf(t);
|
|
42
44
|
i > -1 && (n.splice(i, 1), n.length === 0 && (r.disconnect(), w.delete(e)));
|
|
43
45
|
}
|
|
44
46
|
// composables/useChart.ts
|
|
45
|
-
x([
|
|
47
|
+
x([y]);
|
|
46
48
|
var T = { text: "加载中..." };
|
|
47
49
|
function E(e, t) {
|
|
48
|
-
let n = () => typeof t == "function" ? t() : t, r = h(), i = h(), a = h(), o = c(() => g(e).autoResize ?? !0), s = c(() => g(e).group), l = c(() => g(e).initOption), u = c(() => g(e).loading), d = c(() => g(e).setOptionOpts), f = c(() => g(e).theme ?? "seer"), m = [],
|
|
50
|
+
let n = () => typeof t == "function" ? t() : t, r = h(), i = h(), a = h(), o = c(() => g(e).autoResize ?? !0), s = c(() => g(e).group), l = c(() => g(e).initOption), u = c(() => g(e).loading), d = c(() => g(e).setOptionOpts), f = c(() => g(e).theme ?? "seer"), m = [], y = (e, t) => {
|
|
49
51
|
m = m.filter((n) => {
|
|
50
52
|
let r = t.some(([e, t, r]) => e === n.name && t === n.handler && r === n.once);
|
|
51
53
|
return r || e.off(n.name, n.wrapped), r;
|
|
@@ -61,45 +63,45 @@ function E(e, t) {
|
|
|
61
63
|
wrapped: i
|
|
62
64
|
}), e.on(t, i);
|
|
63
65
|
});
|
|
64
|
-
},
|
|
66
|
+
}, b = () => {
|
|
65
67
|
let t = r.value;
|
|
66
68
|
if (!t) return;
|
|
67
|
-
let o =
|
|
68
|
-
o.setOption(c, d.value), a.value = S(c),
|
|
69
|
+
let o = ne(t, f.value, l.value), s = g(e), { restOptions: c, events: u } = D(s, n(), !1);
|
|
70
|
+
o.setOption(c, d.value), a.value = S(c), y(o, u);
|
|
69
71
|
let p = s.onReady || n()?.ready;
|
|
70
72
|
p && p(o), i.value = o;
|
|
71
|
-
},
|
|
73
|
+
}, x = () => {
|
|
72
74
|
i.value && (i.value.dispose(), i.value = void 0, m = []);
|
|
73
75
|
};
|
|
74
|
-
return ee(() =>
|
|
75
|
-
i.value &&
|
|
76
|
+
return ee(() => b()), p(() => x()), te(() => {
|
|
77
|
+
i.value && y(i.value, D(g(e), n(), !1).events);
|
|
76
78
|
}), _(() => g(e), (e) => {
|
|
77
79
|
let t = i.value;
|
|
78
80
|
if (!t) return;
|
|
79
81
|
let { restOptions: r, events: o } = D(e, n(), !1);
|
|
80
|
-
|
|
82
|
+
y(t, o), C(r, a.value) || (t.setOption(r, d.value), a.value = S(r));
|
|
81
83
|
}, { deep: !0 }), _([() => S(f.value), () => S(l.value)], ([e, t], [n, r]) => {
|
|
82
|
-
C(e, n) && C(t, r) || (
|
|
83
|
-
}),
|
|
84
|
+
C(e, n) && C(t, r) || (x(), b());
|
|
85
|
+
}), v(() => {
|
|
84
86
|
let e = s.value;
|
|
85
87
|
i.value && (i.value.group = e ?? "");
|
|
86
|
-
}),
|
|
88
|
+
}), v(() => {
|
|
87
89
|
let e = i.value;
|
|
88
90
|
if (!e) return;
|
|
89
91
|
let t = u.value;
|
|
90
|
-
t ? e.showLoading(
|
|
92
|
+
t ? e.showLoading(re(t) ? T : {
|
|
91
93
|
...T,
|
|
92
94
|
...t
|
|
93
95
|
}) : e.hideLoading();
|
|
94
|
-
}),
|
|
96
|
+
}), ae(r, i, o), {
|
|
95
97
|
containerRef: r,
|
|
96
98
|
chartRef: i
|
|
97
99
|
};
|
|
98
100
|
}
|
|
99
|
-
function
|
|
101
|
+
function ce(e) {
|
|
100
102
|
return /^on[^a-z]/.test(e);
|
|
101
103
|
}
|
|
102
|
-
var
|
|
104
|
+
var le = [
|
|
103
105
|
"class",
|
|
104
106
|
"style",
|
|
105
107
|
"autoResize",
|
|
@@ -113,8 +115,8 @@ var ue = [
|
|
|
113
115
|
function D(e, t = {}, n = !0) {
|
|
114
116
|
let r = {}, i = [];
|
|
115
117
|
return Object.keys(e).forEach((t) => {
|
|
116
|
-
if (!
|
|
117
|
-
if (
|
|
118
|
+
if (!le.includes(t)) {
|
|
119
|
+
if (ce(t)) {
|
|
118
120
|
if (n) return;
|
|
119
121
|
let r = e[t];
|
|
120
122
|
if (r) {
|
|
@@ -180,7 +182,7 @@ function k({ data: e = [], color: t = "", offset: n = [0, 0], rotate: r = -20, s
|
|
|
180
182
|
animationEasing: "elasticOut"
|
|
181
183
|
};
|
|
182
184
|
}
|
|
183
|
-
function
|
|
185
|
+
function ue(e) {
|
|
184
186
|
return {
|
|
185
187
|
axisPointer: { lineStyle: { opacity: .6 } },
|
|
186
188
|
formatter: function(t) {
|
|
@@ -194,7 +196,7 @@ function de(e) {
|
|
|
194
196
|
}
|
|
195
197
|
};
|
|
196
198
|
}
|
|
197
|
-
function
|
|
199
|
+
function de({ series: e, color: t, offset: n = [0, 0], rotate: r, size: i }) {
|
|
198
200
|
return [{
|
|
199
201
|
type: "bar",
|
|
200
202
|
z: 0,
|
|
@@ -207,7 +209,7 @@ function fe({ series: e, color: t, offset: n = [0, 0], rotate: r, size: i }) {
|
|
|
207
209
|
size: i
|
|
208
210
|
})];
|
|
209
211
|
}
|
|
210
|
-
function
|
|
212
|
+
function fe() {
|
|
211
213
|
return { aria: {
|
|
212
214
|
enabled: !0,
|
|
213
215
|
decal: {
|
|
@@ -223,13 +225,13 @@ function pe() {
|
|
|
223
225
|
} };
|
|
224
226
|
}
|
|
225
227
|
// composables/useReactiveAttrs.ts
|
|
226
|
-
var
|
|
228
|
+
var pe = {
|
|
227
229
|
"auto-resize": "autoResize",
|
|
228
230
|
"init-option": "initOption",
|
|
229
231
|
"set-option-opts": "setOptionOpts"
|
|
230
232
|
};
|
|
231
233
|
function A(e) {
|
|
232
|
-
let t = u()?.proxy, n = () => Object.fromEntries(Object.entries(f && t ? t.$attrs : e).map(([e, t]) => [
|
|
234
|
+
let t = u()?.proxy, n = () => Object.fromEntries(Object.entries(f && t ? t.$attrs : e).map(([e, t]) => [pe[e] ?? e, t]));
|
|
233
235
|
if (f && t) return c(n);
|
|
234
236
|
let r = h(n());
|
|
235
237
|
return m(() => {
|
|
@@ -242,7 +244,7 @@ function j() {
|
|
|
242
244
|
return (e) => e;
|
|
243
245
|
}
|
|
244
246
|
// components/Chart.ts
|
|
245
|
-
var
|
|
247
|
+
var me = j()(l({
|
|
246
248
|
name: "IxChart",
|
|
247
249
|
inheritAttrs: !1,
|
|
248
250
|
setup(e, t) {
|
|
@@ -264,14 +266,14 @@ var he = j()(l({
|
|
|
264
266
|
}));
|
|
265
267
|
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/util.js
|
|
266
268
|
function M(e, t) {
|
|
267
|
-
|
|
269
|
+
he(e) && (e = "100%");
|
|
268
270
|
let n = P(e);
|
|
269
271
|
return e = t === 360 ? parseFloat(e) : Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(String(e * t), 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : (e = t === 360 ? (e < 0 ? e % t + t : e % t) / t : e % t / t, e);
|
|
270
272
|
}
|
|
271
273
|
function N(e) {
|
|
272
274
|
return Math.min(1, Math.max(0, e));
|
|
273
275
|
}
|
|
274
|
-
function
|
|
276
|
+
function he(e) {
|
|
275
277
|
return typeof e == "string" && e.indexOf(".") !== -1 && !P(e) && parseFloat(e) === 1;
|
|
276
278
|
}
|
|
277
279
|
function P(e) {
|
|
@@ -280,19 +282,19 @@ function P(e) {
|
|
|
280
282
|
function F(e) {
|
|
281
283
|
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
282
284
|
}
|
|
283
|
-
function
|
|
285
|
+
function ge(e) {
|
|
284
286
|
return Number(e) <= 1 ? `${Number(e) * 100}%` : e;
|
|
285
287
|
}
|
|
286
288
|
function I(e) {
|
|
287
|
-
if (typeof e != "number" || !(e <= 1)) return
|
|
289
|
+
if (typeof e != "number" || !(e <= 1)) return ge(e);
|
|
288
290
|
let t = Math.min(100, Math.max(0, e * 100)) * 100;
|
|
289
291
|
return (t >= 1e-6 ? Math.trunc(t) : parseInt(String(t), 10)) / 100;
|
|
290
292
|
}
|
|
291
|
-
function
|
|
293
|
+
function _e(e) {
|
|
292
294
|
return e.length === 1 ? "0" + e : String(e);
|
|
293
295
|
}
|
|
294
296
|
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/conversion.js
|
|
295
|
-
function
|
|
297
|
+
function ve(e, t, n) {
|
|
296
298
|
return {
|
|
297
299
|
r: M(e, 255) * 255,
|
|
298
300
|
g: M(t, 255) * 255,
|
|
@@ -325,7 +327,7 @@ function L(e, t, n) {
|
|
|
325
327
|
function R(e, t, n) {
|
|
326
328
|
return n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * (6 * n) : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
327
329
|
}
|
|
328
|
-
function
|
|
330
|
+
function ye(e, t, n) {
|
|
329
331
|
let r, i, a;
|
|
330
332
|
if (e = M(e, 360), t = M(t, 100), n = M(n, 100), t === 0) i = n, a = n, r = n;
|
|
331
333
|
else {
|
|
@@ -360,7 +362,7 @@ function z(e, t, n) {
|
|
|
360
362
|
v: o
|
|
361
363
|
};
|
|
362
364
|
}
|
|
363
|
-
function
|
|
365
|
+
function be(e, t, n) {
|
|
364
366
|
e = M(e, 360) * 6, t = M(t, 100), n = M(n, 100);
|
|
365
367
|
let r = Math.floor(e), i = e - r, a = n * (1 - t), o = n * (1 - i * t), s = n * (1 - (1 - i) * t), c = r % 6, l = [
|
|
366
368
|
n,
|
|
@@ -395,20 +397,20 @@ function B(e) {
|
|
|
395
397
|
}
|
|
396
398
|
function V(e) {
|
|
397
399
|
let t = Math.round(e);
|
|
398
|
-
return t >= 0 && t <= 255 ? String.fromCharCode(B(t >> 4), B(t & 15)) :
|
|
400
|
+
return t >= 0 && t <= 255 ? String.fromCharCode(B(t >> 4), B(t & 15)) : _e(t.toString(16));
|
|
399
401
|
}
|
|
400
|
-
function
|
|
402
|
+
function xe(e) {
|
|
401
403
|
return V(parseFloat(e) * 255);
|
|
402
404
|
}
|
|
403
405
|
function H(e, t, n, r) {
|
|
404
406
|
let i = V(e), a = V(t), o = V(n);
|
|
405
407
|
return r && i.startsWith(i.charAt(1)) && a.startsWith(a.charAt(1)) && o.startsWith(o.charAt(1)) ? i.charAt(0) + a.charAt(0) + o.charAt(0) : i + a + o;
|
|
406
408
|
}
|
|
407
|
-
function
|
|
408
|
-
let a = V(e), o = V(t), s = V(n), c =
|
|
409
|
+
function Se(e, t, n, r, i) {
|
|
410
|
+
let a = V(e), o = V(t), s = V(n), c = xe(r);
|
|
409
411
|
return i && a.startsWith(a.charAt(1)) && o.startsWith(o.charAt(1)) && s.startsWith(s.charAt(1)) && c.startsWith(c.charAt(1)) ? a.charAt(0) + o.charAt(0) + s.charAt(0) + c.charAt(0) : a + o + s + c;
|
|
410
412
|
}
|
|
411
|
-
function
|
|
413
|
+
function Ce(e, t, n, r) {
|
|
412
414
|
let i = e / 100, a = t / 100, o = n / 100, s = r / 100;
|
|
413
415
|
return {
|
|
414
416
|
r: 255 * (1 - i) * (1 - s),
|
|
@@ -425,7 +427,7 @@ function U(e, t, n) {
|
|
|
425
427
|
k: Math.round(o)
|
|
426
428
|
};
|
|
427
429
|
}
|
|
428
|
-
function
|
|
430
|
+
function we(e) {
|
|
429
431
|
return {
|
|
430
432
|
r: e >> 16,
|
|
431
433
|
g: (e & 65280) >> 8,
|
|
@@ -584,24 +586,24 @@ var W = {
|
|
|
584
586
|
yellowgreen: "#9acd32"
|
|
585
587
|
};
|
|
586
588
|
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/format-input.js
|
|
587
|
-
function
|
|
589
|
+
function Te(e) {
|
|
588
590
|
let t = {
|
|
589
591
|
r: 0,
|
|
590
592
|
g: 0,
|
|
591
593
|
b: 0
|
|
592
594
|
}, n = 1, r = !1, i = !1;
|
|
593
|
-
if (typeof e == "string" && (e =
|
|
595
|
+
if (typeof e == "string" && (e = Ee(e)), typeof e == "object") {
|
|
594
596
|
if (X(e.r) && X(e.g) && X(e.b)) {
|
|
595
|
-
t =
|
|
597
|
+
t = ve(e.r, e.g, e.b), r = !0;
|
|
596
598
|
let { r: n } = e;
|
|
597
599
|
i = typeof n != "number" && String(n).endsWith("%") ? "prgb" : "rgb";
|
|
598
600
|
} else if (X(e.h) && X(e.s) && X(e.v)) {
|
|
599
601
|
let n = I(e.s), a = I(e.v);
|
|
600
|
-
t =
|
|
602
|
+
t = be(e.h, n, a), r = !0, i = "hsv";
|
|
601
603
|
} else if (X(e.h) && X(e.s) && X(e.l)) {
|
|
602
604
|
let n = I(e.s), a = I(e.l);
|
|
603
|
-
t =
|
|
604
|
-
} else X(e.c) && X(e.m) && X(e.y) && X(e.k) && (t =
|
|
605
|
+
t = ye(e.h, n, a), r = !0, i = "hsl";
|
|
606
|
+
} else X(e.c) && X(e.m) && X(e.y) && X(e.k) && (t = Ce(e.c, e.m, e.y, e.k), r = !0, i = "cmyk");
|
|
605
607
|
Object.prototype.hasOwnProperty.call(e, "a") && (n = e.a);
|
|
606
608
|
}
|
|
607
609
|
return n = F(n), {
|
|
@@ -623,7 +625,7 @@ var G = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)", K = "[\\s|\\(]+(" + G + ")
|
|
|
623
625
|
hsva: RegExp("hsva" + q),
|
|
624
626
|
cmyk: RegExp("cmyk" + q)
|
|
625
627
|
};
|
|
626
|
-
function
|
|
628
|
+
function Ee(e) {
|
|
627
629
|
if (e = e.trim().toLowerCase(), e.length === 0) return !1;
|
|
628
630
|
let t = !1;
|
|
629
631
|
if (W[e]) e = W[e], t = !0;
|
|
@@ -635,7 +637,7 @@ function De(e) {
|
|
|
635
637
|
format: "name"
|
|
636
638
|
};
|
|
637
639
|
if (typeof e == "string" && e.length <= 9) {
|
|
638
|
-
let n =
|
|
640
|
+
let n = De(e, t);
|
|
639
641
|
if (n) return n;
|
|
640
642
|
}
|
|
641
643
|
let n = J.rgb.exec(e);
|
|
@@ -673,7 +675,7 @@ function De(e) {
|
|
|
673
675
|
k: n[4]
|
|
674
676
|
} : !1))))));
|
|
675
677
|
}
|
|
676
|
-
function
|
|
678
|
+
function De(e, t) {
|
|
677
679
|
let n = +!!e.startsWith("#"), r = e.length - n;
|
|
678
680
|
if (r === 6 || r === 8) {
|
|
679
681
|
let i = Y(e, n) * 16 + Y(e, n + 1), a = Y(e, n + 2) * 16 + Y(e, n + 3), o = Y(e, n + 4) * 16 + Y(e, n + 5);
|
|
@@ -718,11 +720,11 @@ function X(e) {
|
|
|
718
720
|
return typeof e == "number" ? !Number.isNaN(e) : e !== void 0 && J.CSS_UNIT.test(e);
|
|
719
721
|
}
|
|
720
722
|
// ../../node_modules/.pnpm/@ctrl+tinycolor@4.2.2/node_modules/@ctrl/tinycolor/dist/module/index.js
|
|
721
|
-
var
|
|
723
|
+
var Oe = class e {
|
|
722
724
|
constructor(t = "", n = {}) {
|
|
723
725
|
if (t instanceof e) return t;
|
|
724
|
-
typeof t == "number" && (t =
|
|
725
|
-
let r =
|
|
726
|
+
typeof t == "number" && (t = we(t)), this.originalInput = t;
|
|
727
|
+
let r = Te(t);
|
|
726
728
|
this.originalInput = t, this.r = r.r, this.g = r.g, this.b = r.b, this.a = r.a, this.roundA = Math.round(100 * this.a) / 100, this.format = n.format ?? r.format, this.gradientType = n.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = r.ok;
|
|
727
729
|
}
|
|
728
730
|
isDark() {
|
|
@@ -782,7 +784,7 @@ var ke = class e {
|
|
|
782
784
|
return "#" + this.toHex(e);
|
|
783
785
|
}
|
|
784
786
|
toHex8(e = !1) {
|
|
785
|
-
return
|
|
787
|
+
return Se(this.r, this.g, this.b, this.a, e);
|
|
786
788
|
}
|
|
787
789
|
toHex8String(e = !1) {
|
|
788
790
|
return "#" + this.toHex8(e);
|
|
@@ -957,7 +959,7 @@ var ke = class e {
|
|
|
957
959
|
"#F587B3",
|
|
958
960
|
"#8352CC",
|
|
959
961
|
"#65779B"
|
|
960
|
-
],
|
|
962
|
+
], ke = [
|
|
961
963
|
"#458FFF",
|
|
962
964
|
"#C8DEFF",
|
|
963
965
|
"#45D9A3",
|
|
@@ -980,7 +982,7 @@ var ke = class e {
|
|
|
980
982
|
"#FCDBE8",
|
|
981
983
|
"#65779B",
|
|
982
984
|
"#65779B"
|
|
983
|
-
],
|
|
985
|
+
], Ae = [
|
|
984
986
|
"#8C1604",
|
|
985
987
|
"#DB4C35",
|
|
986
988
|
"#FF9245",
|
|
@@ -1086,29 +1088,29 @@ var ke = class e {
|
|
|
1086
1088
|
dataZoom: { height: 16 }
|
|
1087
1089
|
};
|
|
1088
1090
|
// utils/index.ts
|
|
1089
|
-
function
|
|
1091
|
+
function je(e) {
|
|
1090
1092
|
return !!(e && e.xAxis && e.xAxis.data);
|
|
1091
1093
|
}
|
|
1092
|
-
function
|
|
1094
|
+
function Me(e, t) {
|
|
1093
1095
|
return f ? {
|
|
1094
1096
|
attrs: { ...e },
|
|
1095
1097
|
on: { ...t }
|
|
1096
1098
|
} : { ...e };
|
|
1097
1099
|
}
|
|
1098
|
-
function
|
|
1100
|
+
function Ne(e) {
|
|
1099
1101
|
return Object.entries(e).reduce((e, [t, n]) => (n !== void 0 && (e[t] = n), e), {});
|
|
1100
1102
|
}
|
|
1101
|
-
function
|
|
1102
|
-
return
|
|
1103
|
+
function Pe(e) {
|
|
1104
|
+
return ie(e) ? [] : Array.isArray(e) ? e : [e];
|
|
1103
1105
|
}
|
|
1104
|
-
var
|
|
1106
|
+
var Fe = (e, t) => new Oe(e).setAlpha(t).toRgbString();
|
|
1105
1107
|
function $(e, t) {
|
|
1106
|
-
return x(t),
|
|
1108
|
+
return x(t), b("seer", Q), e.install = (t) => {
|
|
1107
1109
|
t.component(e.name, e);
|
|
1108
1110
|
}, e;
|
|
1109
1111
|
}
|
|
1110
1112
|
// components/index.ts
|
|
1111
|
-
var
|
|
1113
|
+
var Ie = $(me, [
|
|
1112
1114
|
e,
|
|
1113
1115
|
n,
|
|
1114
1116
|
t,
|
|
@@ -1118,4 +1120,4 @@ var Le = $(he, [
|
|
|
1118
1120
|
o,
|
|
1119
1121
|
s
|
|
1120
1122
|
]);
|
|
1121
|
-
export {
|
|
1123
|
+
export { Ie as IxChart, Pe as convertArray, $ as createInstall, Ne as filterEmptyProps, Fe as getAlphaColor, je as isVertical, Me as mergeAttrs, Z as seerColors, ke as seerColorsForMore, Ae as seerColorsForRisk, Q as seerTheme, E as useChart, A as useReactiveAttrs, k as useStripe, fe as useStripeArea, de as useStripeBarSeries, ue as useStripeBarTooltip, O as useTooltipsFormatter, j as withChartProps };
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("echarts/components"),require("echarts/features"),require("echarts/renderers"),require("vue-demi"),require("echarts/charts"),require("echarts/core"),require("lodash-es")):typeof define==`function`&&define.amd?define([`exports`,`echarts/components`,`echarts/features`,`echarts/renderers`,`vue-demi`,`echarts/charts`,`echarts/core`,`lodash-es`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.IduxChartsCore={},e.echarts,e.echarts,e.echarts,e.VueDemi,e.echarts,e.echarts,e._))})(this,function(e,t,n,r,i,a,o,s){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function c(e,t,n){(0,i.watch)([e,t,n],([e,n,r],i,a)=>{if(!e||!n||!r)return;let s=(0
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("echarts/components"),require("echarts/features"),require("echarts/renderers"),require("vue-demi"),require("echarts/charts"),require("echarts/core"),require("lodash-es")):typeof define==`function`&&define.amd?define([`exports`,`echarts/components`,`echarts/features`,`echarts/renderers`,`vue-demi`,`echarts/charts`,`echarts/core`,`lodash-es`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.IduxChartsCore={},e.echarts,e.echarts,e.echarts,e.VueDemi,e.echarts,e.echarts,e._))})(this,function(e,t,n,r,i,a,o,s){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function c(e,t,n){(0,i.watch)([e,t,n],([e,n,r],i,a)=>{if(!e||!n||!r)return;let o,s=()=>{o===void 0&&(o=requestAnimationFrame(()=>{o=void 0,t.value===n&&n.resize()}))};u(e,s),a(()=>{d(e,s),o!==void 0&&cancelAnimationFrame(o)})})}var l=new Map;function u(e,t,n){if(e&&t){if(l.has(e))l.get(e).listeners.push(t);else{let r=[t],i=new ResizeObserver(e=>{e.forEach(e=>r.forEach(t=>t(e)))});i.observe(e,n),l.set(e,{listeners:r,ro:i})}}}function d(e,t){if(!e||!t||!l.has(e))return;let{listeners:n,ro:r}=l.get(e),i=n.indexOf(t);i>-1&&(n.splice(i,1),n.length===0&&(r.disconnect(),l.delete(e)))}(0,o.use)([a.PictorialBarChart]);var f={text:`加载中...`};function p(e,t){let n=()=>typeof t==`function`?t():t,r=(0,i.shallowRef)(),a=(0,i.shallowRef)(),l=(0,i.shallowRef)(),u=(0,i.computed)(()=>(0,i.unref)(e).autoResize??!0),d=(0,i.computed)(()=>(0,i.unref)(e).group),p=(0,i.computed)(()=>(0,i.unref)(e).initOption),m=(0,i.computed)(()=>(0,i.unref)(e).loading),h=(0,i.computed)(()=>(0,i.unref)(e).setOptionOpts),_=(0,i.computed)(()=>(0,i.unref)(e).theme??`seer`),v=[],y=(e,t)=>{v=v.filter(n=>{let r=t.some(([e,t,r])=>e===n.name&&t===n.handler&&r===n.once);return r||e.off(n.name,n.wrapped),r}),t.forEach(([t,n,r])=>{if(v.some(e=>e.name===t&&e.handler===n&&e.once===r))return;let i=(...a)=>{r&&e.off(t,i),n(...a)};v.push({name:t,handler:n,once:r,wrapped:i}),e.on(t,i)})},b=()=>{let t=r.value;if(!t)return;let c=(0,o.init)(t,_.value,p.value),u=(0,i.unref)(e),{restOptions:d,events:f}=g(u,n(),!1);c.setOption(d,h.value),l.value=(0,s.cloneDeep)(d),y(c,f);let m=u.onReady||n()?.ready;m&&m(c),a.value=c},x=()=>{a.value&&(a.value.dispose(),a.value=void 0,v=[])};return(0,i.onMounted)(()=>b()),(0,i.onBeforeUnmount)(()=>x()),(0,i.onUpdated)(()=>{a.value&&y(a.value,g((0,i.unref)(e),n(),!1).events)}),(0,i.watch)(()=>(0,i.unref)(e),e=>{let t=a.value;if(!t)return;let{restOptions:r,events:i}=g(e,n(),!1);y(t,i),(0,s.isEqual)(r,l.value)||(t.setOption(r,h.value),l.value=(0,s.cloneDeep)(r))},{deep:!0}),(0,i.watch)([()=>(0,s.cloneDeep)(_.value),()=>(0,s.cloneDeep)(p.value)],([e,t],[n,r])=>{(0,s.isEqual)(e,n)&&(0,s.isEqual)(t,r)||(x(),b())}),(0,i.watchEffect)(()=>{let e=d.value;a.value&&(a.value.group=e??``)}),(0,i.watchEffect)(()=>{let e=a.value;if(!e)return;let t=m.value;t?e.showLoading((0,s.isBoolean)(t)?f:{...f,...t}):e.hideLoading()}),c(r,a,u),{containerRef:r,chartRef:a}}function m(e){return/^on[^a-z]/.test(e)}var h=[`class`,`style`,`autoResize`,`initOption`,`group`,`loading`,`setOptionOpts`,`theme`,`onReady`];function g(e,t={},n=!0){let r={},a=[];return Object.keys(e).forEach(t=>{if(!h.includes(t)){if(m(t)){if(n)return;let r=e[t];if(r){let e=t.endsWith(`Once`),n=e?t.length-4:void 0,i=t.charAt(2).toLowerCase()+t.substring(3,n);a.push([i,r,e])}}else r[t]=e[t]}}),i.isVue2&&!n&&Object.keys(t).forEach(e=>{if(e===`ready`||e===`~ready`)return;let n=t[e];if(n){let t=e.startsWith(`~`),r=+!!t,i=e.substring(r);a.push([i,n,t])}}),{restOptions:r,events:a}}function _(e,t){return`
|
|
2
2
|
<div class="charts-tooltips">
|
|
3
3
|
<div class="charts-tooltips-title">${e}</div>
|
|
4
4
|
${t.map(e=>`
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BarSeriesOption, LineSeriesOption, PieSeriesOption } from 'echarts/charts';
|
|
2
|
-
import { DatasetComponentOption, DataZoomComponentOption, GridComponentOption, LegendComponentOption, TitleComponentOption, TooltipComponentOption } from 'echarts/components';
|
|
1
|
+
import { BarSeriesOption, LineSeriesOption, PieSeriesOption, RadarSeriesOption, GaugeSeriesOption, CustomSeriesOption } from 'echarts/charts';
|
|
2
|
+
import { RadarComponentOption, GraphicComponentOption, DatasetComponentOption, DataZoomComponentOption, GridComponentOption, LegendComponentOption, TitleComponentOption, TooltipComponentOption } from 'echarts/components';
|
|
3
3
|
import { ComposeOption, EChartsType, init, SetOptionOpts } from 'echarts/core';
|
|
4
4
|
export type ChartInitParameters = Parameters<typeof init>;
|
|
5
5
|
export type ChartTheme = NonNullable<ChartInitParameters[1]>;
|
|
@@ -47,8 +47,9 @@ interface ComponentOption {
|
|
|
47
47
|
z?: number;
|
|
48
48
|
zlevel?: number;
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
export type
|
|
50
|
+
type CommonComponentOption = GraphicComponentOption | DatasetComponentOption | DataZoomComponentOption | GridComponentOption | LegendComponentOption | TitleComponentOption | TooltipComponentOption;
|
|
51
|
+
export type BaseChartOption<T extends ComponentOption> = ComposeOption<CommonComponentOption | T>;
|
|
52
|
+
export type ChartOption = BaseChartOption<RadarComponentOption | RadarSeriesOption | GaugeSeriesOption | CustomSeriesOption | BarSeriesOption | PieSeriesOption | LineSeriesOption>;
|
|
52
53
|
export interface ChartProps extends ChartOption, AdditionalChartOption {
|
|
53
54
|
}
|
|
54
55
|
/** Named caller-facing props for component declarations; defaults are not resolved. */
|