@idux/charts-core 0.4.0 → 0.5.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 +12 -0
- package/dist/components/Chart.d.ts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/useChart.d.ts +1 -1
- package/dist/composables/useTooltips.d.ts +6 -0
- package/dist/index.js +133 -112
- package/dist/index.umd.cjs +10 -1
- package/dist/style.css +1 -0
- package/dist/themes/seer.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type HTMLAttributes } from 'vue-demi';
|
|
2
2
|
import { type ChartProps } from '../types';
|
|
3
|
-
declare const _default: import("vue-demi").DefineComponent<Omit<HTMLAttributes, keyof ChartProps> & ChartProps, {}, {}, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<Omit<HTMLAttributes, keyof ChartProps> & ChartProps>>, {}>;
|
|
3
|
+
declare const _default: import("vue-demi").DefineComponent<Omit<HTMLAttributes, keyof ChartProps> & ChartProps, {}, {}, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<Omit<HTMLAttributes, keyof ChartProps> & ChartProps>>, {}, {}>;
|
|
4
4
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const IxChart: import("vue").DefineComponent<Omit<import("vue").HTMLAttributes, keyof import("..").ChartProps> & import("..").ChartProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Omit<import("vue").HTMLAttributes, keyof import("..").ChartProps> & import("..").ChartProps>>, {}>;
|
|
1
|
+
declare const IxChart: import("vue").DefineComponent<Omit<import("vue").HTMLAttributes, keyof import("..").ChartProps> & import("..").ChartProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Omit<import("vue").HTMLAttributes, keyof import("..").ChartProps> & import("..").ChartProps>>, {}, {}>;
|
|
2
2
|
export { IxChart };
|
|
@@ -2,7 +2,7 @@ import { type Ref, type ShallowRef } from 'vue-demi';
|
|
|
2
2
|
import { type EChartsType } from 'echarts/core';
|
|
3
3
|
import { type ChartProps } from '../types';
|
|
4
4
|
export type MaybeRef<T> = T | Ref<T>;
|
|
5
|
-
export declare function useChart<U extends ChartProps>(options: MaybeRef<U>): {
|
|
5
|
+
export declare function useChart<U extends ChartProps>(options: MaybeRef<U>, listeners?: Record<string, Function>): {
|
|
6
6
|
containerRef: ShallowRef<HTMLDivElement | undefined>;
|
|
7
7
|
chartRef: ShallowRef<EChartsType | undefined>;
|
|
8
8
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,76 +1,78 @@
|
|
|
1
|
-
import { DataZoomComponent as
|
|
2
|
-
import { LabelLayout as V, UniversalTransition as
|
|
3
|
-
import { SVGRenderer as
|
|
4
|
-
import { watch as
|
|
5
|
-
import { throttle as
|
|
6
|
-
import { isEqual as
|
|
7
|
-
function
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
[e, o,
|
|
11
|
-
([n, a, l
|
|
12
|
-
!
|
|
1
|
+
import { DataZoomComponent as $, LegendComponent as G, GridComponent as j, TitleComponent as M, TooltipComponent as N } from "echarts/components";
|
|
2
|
+
import { LabelLayout as V, UniversalTransition as H } from "echarts/features";
|
|
3
|
+
import { SVGRenderer as P } from "echarts/renderers";
|
|
4
|
+
import { watch as v, shallowRef as g, computed as F, unref as u, onMounted as U, onBeforeUnmount as Z, watchEffect as y, isVue2 as L, defineComponent as _, h as q } from "vue-demi";
|
|
5
|
+
import { throttle as J, init as K, use as Q, registerTheme as X } from "echarts/core";
|
|
6
|
+
import { isEqual as Y, cloneDeep as R, isBoolean as k, isNil as ee } from "lodash-es";
|
|
7
|
+
function te(e, o, s) {
|
|
8
|
+
let t;
|
|
9
|
+
v(
|
|
10
|
+
[e, o, s],
|
|
11
|
+
([r, n, a], l, f) => {
|
|
12
|
+
!r || !n || (a ? (t ?? (t = J(() => n.resize(), 16)), oe(r, t)) : S(r, t), f(() => S(r, t)));
|
|
13
13
|
}
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
16
|
+
const h = /* @__PURE__ */ new Map();
|
|
17
|
+
function oe(e, o, s) {
|
|
18
18
|
if (!(!e || !o))
|
|
19
|
-
if (
|
|
20
|
-
|
|
19
|
+
if (h.has(e))
|
|
20
|
+
h.get(e).listeners.push(o);
|
|
21
21
|
else {
|
|
22
|
-
const
|
|
23
|
-
|
|
22
|
+
const t = [o], r = new ResizeObserver((n) => {
|
|
23
|
+
n.forEach((a) => t.forEach((l) => l(a)));
|
|
24
24
|
});
|
|
25
|
-
|
|
25
|
+
r.observe(e, s), h.set(e, { listeners: t, ro: r });
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
if (!e || !o || !
|
|
28
|
+
function S(e, o) {
|
|
29
|
+
if (!e || !o || !h.has(e))
|
|
30
30
|
return;
|
|
31
|
-
const { listeners:
|
|
32
|
-
|
|
31
|
+
const { listeners: s, ro: t } = h.get(e), r = s.indexOf(o);
|
|
32
|
+
r > -1 && (s.splice(r, 1), s.length === 0 && (t.disconnect(), h.delete(e)));
|
|
33
33
|
}
|
|
34
|
-
const
|
|
35
|
-
function
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
34
|
+
const w = { text: "加载中..." };
|
|
35
|
+
function se(e, o) {
|
|
36
|
+
const s = g(), t = g(), r = g(), n = F(() => u(e).autoResize ?? !0), a = F(() => u(e).group), l = F(() => u(e).initOption), f = F(() => u(e).loading), d = F(() => u(e).setOptionOpts), x = F(() => u(e).theme ?? "seer"), C = () => {
|
|
37
|
+
const c = s.value;
|
|
38
|
+
if (!c)
|
|
39
39
|
return;
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}),
|
|
46
|
-
})
|
|
47
|
-
|
|
40
|
+
const i = K(c, x.value, l.value), p = u(e), { restOptions: O, events: T } = B(p, o, !1);
|
|
41
|
+
i.setOption(O, d.value), r.value = R(O), T.forEach(([E, A, W]) => {
|
|
42
|
+
let m = A;
|
|
43
|
+
W && (m = (...I) => {
|
|
44
|
+
A(...I), i.off(E, m);
|
|
45
|
+
}), i.on(E, m);
|
|
46
|
+
});
|
|
47
|
+
const b = p.onReady || (o == null ? void 0 : o.ready);
|
|
48
|
+
b && b(i), t.value = i;
|
|
49
|
+
}, D = () => {
|
|
48
50
|
t.value && (t.value.dispose(), t.value = void 0);
|
|
49
51
|
};
|
|
50
|
-
return
|
|
51
|
-
() =>
|
|
52
|
-
(
|
|
53
|
-
const
|
|
54
|
-
if (!
|
|
52
|
+
return U(() => C()), Z(() => D()), v(
|
|
53
|
+
() => u(e),
|
|
54
|
+
(c) => {
|
|
55
|
+
const i = t.value;
|
|
56
|
+
if (!i)
|
|
55
57
|
return;
|
|
56
|
-
const { restOptions:
|
|
57
|
-
|
|
58
|
+
const { restOptions: p } = B(c);
|
|
59
|
+
Y(p, r.value) || (i.setOption(p, d.value), r.value = R(p));
|
|
58
60
|
},
|
|
59
61
|
{
|
|
60
62
|
deep: !0
|
|
61
63
|
}
|
|
62
|
-
),
|
|
63
|
-
|
|
64
|
-
}),
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
}),
|
|
68
|
-
const
|
|
69
|
-
if (!
|
|
64
|
+
), v([x, l], () => {
|
|
65
|
+
D(), C();
|
|
66
|
+
}), y(() => {
|
|
67
|
+
const c = a.value;
|
|
68
|
+
c && t.value && (t.value.group = c);
|
|
69
|
+
}), y(() => {
|
|
70
|
+
const c = t.value;
|
|
71
|
+
if (!c)
|
|
70
72
|
return;
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
}),
|
|
73
|
+
const i = f.value;
|
|
74
|
+
i ? c.showLoading(k(i) ? w : { ...w, ...i }) : c.hideLoading();
|
|
75
|
+
}), te(s, t, n), { containerRef: s, chartRef: t };
|
|
74
76
|
}
|
|
75
77
|
function ne(e) {
|
|
76
78
|
return /^on[^a-z]/.test(e);
|
|
@@ -85,25 +87,65 @@ const re = [
|
|
|
85
87
|
"theme",
|
|
86
88
|
"onReady"
|
|
87
89
|
];
|
|
88
|
-
function
|
|
90
|
+
function B(e, o = {}, s = !0) {
|
|
89
91
|
const t = {}, r = [];
|
|
90
92
|
return Object.keys(e).forEach((n) => {
|
|
91
93
|
if (!re.includes(n)) {
|
|
92
94
|
if (ne(n)) {
|
|
93
|
-
if (
|
|
95
|
+
if (s)
|
|
94
96
|
return;
|
|
95
97
|
const a = e[n];
|
|
96
98
|
if (a) {
|
|
97
|
-
const l = n.endsWith("Once"), f = l ? n.length - 4 : void 0,
|
|
98
|
-
r.push([
|
|
99
|
+
const l = n.endsWith("Once"), f = l ? n.length - 4 : void 0, d = n.charAt(2).toLowerCase() + n.substring(3, f);
|
|
100
|
+
r.push([d, a, l]);
|
|
99
101
|
}
|
|
100
102
|
return;
|
|
101
103
|
}
|
|
102
104
|
t[n] = e[n];
|
|
103
105
|
}
|
|
106
|
+
}), L && !s && Object.keys(o).forEach((n) => {
|
|
107
|
+
if (n !== "ready")
|
|
108
|
+
return;
|
|
109
|
+
const a = o[n];
|
|
110
|
+
if (a) {
|
|
111
|
+
const l = n.startsWith("~"), f = l ? 1 : 0, d = n.substring(f);
|
|
112
|
+
r.push([d, a, l]);
|
|
113
|
+
}
|
|
104
114
|
}), { restOptions: t, events: r };
|
|
105
115
|
}
|
|
106
|
-
|
|
116
|
+
function he(e, o) {
|
|
117
|
+
return `
|
|
118
|
+
<div class="ix-charts-tooltips">
|
|
119
|
+
<div class="ix-charts-tooltips-title">${e}</div>
|
|
120
|
+
${o.map((s) => `
|
|
121
|
+
<div class="ix-charts-tooltips-item">
|
|
122
|
+
<span class="ix-charts-tooltips-item-border" style="background: ${s.color}"></span>
|
|
123
|
+
<span class="ix-charts-tooltips-item-name">${s.name}</span>
|
|
124
|
+
<span class="ix-charts-tooltips-item-value">${s.value}</span>
|
|
125
|
+
</div>`).join("")}
|
|
126
|
+
</div>`;
|
|
127
|
+
}
|
|
128
|
+
const z = _({
|
|
129
|
+
name: "IxChart",
|
|
130
|
+
inheritAttrs: !1,
|
|
131
|
+
// @ts-ignore
|
|
132
|
+
setup(e, { attrs: o, listeners: s }) {
|
|
133
|
+
const { containerRef: t } = se(o, s);
|
|
134
|
+
return { containerRef: t };
|
|
135
|
+
},
|
|
136
|
+
render() {
|
|
137
|
+
const { class: e, style: o } = this.$attrs;
|
|
138
|
+
return q("div", {
|
|
139
|
+
ref: "containerRef",
|
|
140
|
+
class: e,
|
|
141
|
+
style: {
|
|
142
|
+
width: "100%",
|
|
143
|
+
height: "100%",
|
|
144
|
+
...o
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}), ie = [
|
|
107
149
|
"#458FFF",
|
|
108
150
|
"#45D9A3",
|
|
109
151
|
"#FFC145",
|
|
@@ -115,7 +157,7 @@ const se = [
|
|
|
115
157
|
"#F587B3",
|
|
116
158
|
"#8352CC",
|
|
117
159
|
"#65779B"
|
|
118
|
-
],
|
|
160
|
+
], me = [
|
|
119
161
|
"#458FFF",
|
|
120
162
|
"#C8DEFF",
|
|
121
163
|
"#45D9A3",
|
|
@@ -138,7 +180,7 @@ const se = [
|
|
|
138
180
|
"#FCDBE8",
|
|
139
181
|
"#65779B",
|
|
140
182
|
"#65779B"
|
|
141
|
-
],
|
|
183
|
+
], ge = [
|
|
142
184
|
"#8C1604",
|
|
143
185
|
"#DB4C35",
|
|
144
186
|
"#FF9245",
|
|
@@ -146,8 +188,8 @@ const se = [
|
|
|
146
188
|
"#689FFF",
|
|
147
189
|
"#45D9A3",
|
|
148
190
|
"#99ACD1"
|
|
149
|
-
],
|
|
150
|
-
color:
|
|
191
|
+
], ae = {
|
|
192
|
+
color: ie,
|
|
151
193
|
textStyle: {
|
|
152
194
|
color: "#2F3540",
|
|
153
195
|
fontSize: "12px"
|
|
@@ -203,6 +245,7 @@ const se = [
|
|
|
203
245
|
tooltip: {
|
|
204
246
|
borderWidth: 0,
|
|
205
247
|
padding: 12,
|
|
248
|
+
backgroundColor: "#FBFDFF",
|
|
206
249
|
textStyle: {
|
|
207
250
|
color: "#2F3540"
|
|
208
251
|
},
|
|
@@ -265,69 +308,47 @@ const se = [
|
|
|
265
308
|
height: 16
|
|
266
309
|
}
|
|
267
310
|
};
|
|
268
|
-
function
|
|
311
|
+
function ve(e) {
|
|
269
312
|
return !!(e && e.xAxis && e.xAxis.data);
|
|
270
313
|
}
|
|
271
|
-
function
|
|
272
|
-
|
|
273
|
-
...e,
|
|
274
|
-
...o
|
|
275
|
-
};
|
|
276
|
-
return U ? { attrs: t } : t;
|
|
314
|
+
function xe(e, o) {
|
|
315
|
+
return L ? { attrs: { ...e }, on: { ...o } } : { ...e };
|
|
277
316
|
}
|
|
278
317
|
function Ce(e) {
|
|
279
|
-
return Object.entries(e).reduce((o, [
|
|
318
|
+
return Object.entries(e).reduce((o, [s, t]) => (t !== void 0 && (o[s] = t), o), {});
|
|
280
319
|
}
|
|
281
|
-
function
|
|
282
|
-
return
|
|
320
|
+
function De(e) {
|
|
321
|
+
return ee(e) ? [] : Array.isArray(e) ? e : [e];
|
|
283
322
|
}
|
|
284
323
|
function le(e, o) {
|
|
285
|
-
|
|
286
|
-
const
|
|
287
|
-
|
|
324
|
+
Q(o), X("seer", ae);
|
|
325
|
+
const s = (t) => {
|
|
326
|
+
t.component(e.name, e);
|
|
288
327
|
};
|
|
289
|
-
e.install =
|
|
328
|
+
e.install = s;
|
|
290
329
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
inheritAttrs: !1,
|
|
294
|
-
setup(e, { attrs: o }) {
|
|
295
|
-
const { containerRef: t } = oe(o);
|
|
296
|
-
return { containerRef: t };
|
|
297
|
-
},
|
|
298
|
-
render() {
|
|
299
|
-
const { class: e, style: o } = this.$attrs, t = ae({
|
|
300
|
-
class: e,
|
|
301
|
-
style: _({
|
|
302
|
-
width: "100%",
|
|
303
|
-
height: "100%",
|
|
304
|
-
...o
|
|
305
|
-
})
|
|
306
|
-
});
|
|
307
|
-
return q("div", { ref: "containerRef", ...t });
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
le(w, [
|
|
311
|
-
T,
|
|
312
|
-
W,
|
|
313
|
-
I,
|
|
330
|
+
le(z, [
|
|
331
|
+
$,
|
|
314
332
|
G,
|
|
333
|
+
j,
|
|
315
334
|
M,
|
|
335
|
+
N,
|
|
316
336
|
V,
|
|
317
|
-
|
|
318
|
-
|
|
337
|
+
H,
|
|
338
|
+
P
|
|
319
339
|
]);
|
|
320
|
-
const
|
|
340
|
+
const Oe = z;
|
|
321
341
|
export {
|
|
322
|
-
|
|
323
|
-
|
|
342
|
+
Oe as IxChart,
|
|
343
|
+
De as convertArray,
|
|
324
344
|
le as createInstall,
|
|
325
345
|
Ce as filterEmptyProps,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
346
|
+
ve as isVertical,
|
|
347
|
+
xe as mergeAttrs,
|
|
348
|
+
ie as seerColors,
|
|
349
|
+
me as seerColorsForMore,
|
|
350
|
+
ge as seerColorsForRisk,
|
|
351
|
+
ae as seerTheme,
|
|
352
|
+
se as useChart,
|
|
353
|
+
he as useTooltipsFormatter
|
|
333
354
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(n,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("echarts/components"),require("echarts/features"),require("echarts/renderers"),require("vue-demi"),require("echarts/core"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","echarts/components","echarts/features","echarts/renderers","vue-demi","echarts/core","lodash-es"],d):(n=typeof globalThis<"u"?globalThis:n||self,d(n.IduxChartsCore={},n.echarts,n.echarts,n.echarts,n.VueDemi,n.echarts,n._))})(this,function(n,d,m,j,s,x,g){"use strict";function M(e,r,o){let t;s.watch([e,r,o],([a,i,l],f,h)=>{!a||!i||(l?(t??(t=x.throttle(()=>i.resize(),16)),V(a,t)):y(a,t),h(()=>y(a,t)))})}const F=new Map;function V(e,r,o){if(!(!e||!r))if(F.has(e))F.get(e).listeners.push(r);else{const t=[r],a=new ResizeObserver(i=>{i.forEach(l=>t.forEach(f=>f(l)))});a.observe(e,o),F.set(e,{listeners:t,ro:a})}}function y(e,r){if(!e||!r||!F.has(e))return;const{listeners:o,ro:t}=F.get(e),a=o.indexOf(r);a>-1&&(o.splice(a,1),o.length===0&&(t.disconnect(),F.delete(e)))}const b={text:"加载中..."};function A(e,r){const o=s.shallowRef(),t=s.shallowRef(),a=s.shallowRef(),i=s.computed(()=>s.unref(e).autoResize??!0),l=s.computed(()=>s.unref(e).group),f=s.computed(()=>s.unref(e).initOption),h=s.computed(()=>s.unref(e).loading),p=s.computed(()=>s.unref(e).setOptionOpts),L=s.computed(()=>s.unref(e).theme??"seer"),v=()=>{const u=o.value;if(!u)return;const c=x.init(u,L.value,f.value),C=s.unref(e),{restOptions:T,events:K}=w(C,r,!1);c.setOption(T,p.value),a.value=g.cloneDeep(T),K.forEach(([W,q,Q])=>{let O=q;Q&&(O=(...X)=>{q(...X),c.off(W,O)}),c.on(W,O)});const I=C.onReady||(r==null?void 0:r.ready);I&&I(c),t.value=c},z=()=>{t.value&&(t.value.dispose(),t.value=void 0)};return s.onMounted(()=>v()),s.onBeforeUnmount(()=>z()),s.watch(()=>s.unref(e),u=>{const c=t.value;if(!c)return;const{restOptions:C}=w(u);g.isEqual(C,a.value)||(c.setOption(C,p.value),a.value=g.cloneDeep(C))},{deep:!0}),s.watch([L,f],()=>{z(),v()}),s.watchEffect(()=>{const u=l.value;u&&t.value&&(t.value.group=u)}),s.watchEffect(()=>{const u=t.value;if(!u)return;const c=h.value;c?u.showLoading(g.isBoolean(c)?b:{...b,...c}):u.hideLoading()}),M(o,t,i),{containerRef:o,chartRef:t}}function $(e){return/^on[^a-z]/.test(e)}const G=["class","style","autoResize","group","loading","setOptionOpts","theme","onReady"];function w(e,r={},o=!0){const t={},a=[];return Object.keys(e).forEach(i=>{if(!G.includes(i)){if($(i)){if(o)return;const l=e[i];if(l){const f=i.endsWith("Once"),h=f?i.length-4:void 0,p=i.charAt(2).toLowerCase()+i.substring(3,h);a.push([p,l,f])}return}t[i]=e[i]}}),s.isVue2&&!o&&Object.keys(r).forEach(i=>{if(i!=="ready")return;const l=r[i];if(l){const f=i.startsWith("~"),h=f?1:0,p=i.substring(h);a.push([p,l,f])}}),{restOptions:t,events:a}}function P(e,r){return`
|
|
2
|
+
<div class="ix-charts-tooltips">
|
|
3
|
+
<div class="ix-charts-tooltips-title">${e}</div>
|
|
4
|
+
${r.map(o=>`
|
|
5
|
+
<div class="ix-charts-tooltips-item">
|
|
6
|
+
<span class="ix-charts-tooltips-item-border" style="background: ${o.color}"></span>
|
|
7
|
+
<span class="ix-charts-tooltips-item-name">${o.name}</span>
|
|
8
|
+
<span class="ix-charts-tooltips-item-value">${o.value}</span>
|
|
9
|
+
</div>`).join("")}
|
|
10
|
+
</div>`}const Y="",E=s.defineComponent({name:"IxChart",inheritAttrs:!1,setup(e,{attrs:r,listeners:o}){const{containerRef:t}=A(r,o);return{containerRef:t}},render(){const{class:e,style:r}=this.$attrs;return s.h("div",{ref:"containerRef",class:e,style:{width:"100%",height:"100%",...r}})}}),R=["#458FFF","#45D9A3","#FFC145","#F5654F","#6A6AFD","#6ED1FF","#008787","#FF9245","#F587B3","#8352CC","#65779B"],N=["#458FFF","#C8DEFF","#45D9A3","#C8F4E4","#FFC145","#FFEDC8","#F5654F","#FCD1CB","#6A6AFD","#D3D3FE","#6ED1FF","#D3D3FE","#008787","#B3DBDB","#FF9245","#FFDFC8","#F587B3","#FCDBE8","#8352CC","#FCDBE8","#65779B","#65779B"],_=["#8C1604","#DB4C35","#FF9245","#FFC145","#689FFF","#45D9A3","#99ACD1"],S={color:R,textStyle:{color:"#2F3540",fontSize:"12px"},bar:{barGap:.2,barWidth:10,label:{color:"#6F7785",position:"top"}},line:{label:{color:"#6F7785",position:"top"}},pie:{avoidLabelOverlap:!1,radius:["70%","80%"],itemStyle:{borderWidth:1,borderColor:"#fff"},label:{show:!1,color:"#2F3540",formatter:"{c}",position:"inside"}},legend:{itemWidth:12,itemHeight:12,textStyle:{color:"#6F7785",fontSize:"12px"}},title:{itemGap:4,textStyle:{color:"#2F3540",fontSize:"12px",fontWeight:500},subtextStyle:{color:"#6F7785",fontSize:"12px"}},tooltip:{borderWidth:0,padding:12,backgroundColor:"#FBFDFF",textStyle:{color:"#2F3540"},axisPointer:{z:1,lineStyle:{type:"solid",color:"#E1E5EB"}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:"#EDF1F7"}},axisTick:{show:!0,alignWithLabel:!0,lineStyle:{color:"#EDF1F7"}},axisLabel:{color:"#6F7785"},splitLine:{show:!1},splitArea:{show:!1}},valueAxis:{axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:"#6F7785"},splitLine:{lineStyle:{color:"#EDF1F7"}},splitArea:{show:!1},nameTextStyle:{color:"#6F7785",padding:[0,30,-4,0]}},dataZoom:{height:16}};function D(e){return!!(e&&e.xAxis&&e.xAxis.data)}function H(e,r){return s.isVue2?{attrs:{...e},on:{...r}}:{...e}}function U(e){return Object.entries(e).reduce((r,[o,t])=>(t!==void 0&&(r[o]=t),r),{})}function Z(e){return g.isNil(e)?[]:Array.isArray(e)?e:[e]}function B(e,r){x.use(r),x.registerTheme("seer",S);const o=t=>{t.component(e.name,e)};e.install=o}B(E,[d.DataZoomComponent,d.LegendComponent,d.GridComponent,d.TitleComponent,d.TooltipComponent,m.LabelLayout,m.UniversalTransition,j.SVGRenderer]);const J=E;n.IxChart=J,n.convertArray=Z,n.createInstall=B,n.filterEmptyProps=U,n.isVertical=D,n.mergeAttrs=H,n.seerColors=R,n.seerColorsForMore=N,n.seerColorsForRisk=_,n.seerTheme=S,n.useChart=A,n.useTooltipsFormatter=P,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ix-charts-tooltips{min-width:180px}.ix-charts-tooltips-title{font-weight:600;color:#2f3540;margin-bottom:8px}.ix-charts-tooltips-item{position:relative;display:flex;justify-content:space-between;height:32px;line-height:20px;color:#2f3540;background:#ffffff;box-shadow:0 4px 12px #0237b31a;padding:6px 12px;margin-bottom:4px}.ix-charts-tooltips-item-border{position:absolute;left:0;top:0;height:100%;width:2px;background:#458fff;box-shadow:0 2px 8px #e8f4ff}
|
package/dist/themes/seer.d.ts
CHANGED
package/dist/utils/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type Writeable<T> = {
|
|
|
3
3
|
-readonly [P in keyof T]: T[P];
|
|
4
4
|
};
|
|
5
5
|
export declare function isVertical(option: any): boolean;
|
|
6
|
-
export declare function mergeAttrs(props: any,
|
|
6
|
+
export declare function mergeAttrs(props: any, listeners?: Record<string, Function>): any;
|
|
7
7
|
export declare function filterEmptyProps<T extends object>(props: T): T;
|
|
8
8
|
export declare function convertArray<T>(value: T | undefined | null | Array<T | undefined | null>): T[];
|
|
9
9
|
export declare function convertArray<T>(value: T | readonly T[]): readonly T[];
|