@gpustack/core-ui 1.0.33 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts.d.ts +7 -0
- package/dist/charts.es.js +859 -0
- package/dist/{useIntl-ClqxSZNY.js → classnames-1RsQ5HaB.js} +12 -35
- package/dist/{editor-wrap-BYfIcvle.js → editor-wrap-DV6LD3QO.js} +1 -1
- package/dist/{excel-reader-Bgm6Gd2H.js → excel-reader-Dm-T5v37.js} +2 -2
- package/dist/excel.es.js +1 -1
- package/dist/file-readers.es.js +3 -3
- package/dist/{highlight-code-DrKwSNa-.js → highlight-code-DFrfrxgM.js} +78 -75
- package/dist/index.css +1 -1
- package/dist/index.es.js +5004 -5852
- package/dist/lib/components/form/wrapper/index.d.ts +5 -5
- package/dist/lib/components/index.d.ts +0 -7
- package/dist/lib/components/table/components/layout.d.ts +5 -5
- package/dist/lib-BIUIGY5e.js +2 -0
- package/dist/{mammoth-3bu5V8Au.js → mammoth-D6zSLJGM.js} +1 -1
- package/dist/markdown.es.js +8 -8
- package/dist/useCoreUIContext-_TAsecw_.js +29 -0
- package/dist/{utils-KsqXE63M.js → utils-B4OCyMbr.js} +523 -520
- package/dist/utils.es.js +4 -4
- package/dist/{word-reader-CSmNlWcx.js → word-reader-DZfu7nOd.js} +4 -4
- package/dist/yaml-editor.es.js +19 -19
- package/package.json +5 -1
- package/dist/lib-EFH8CfCi.js +0 -2
- /package/dist/{epubjs-DKV8rhQU.js → epubjs-DDuu_UAH.js} +0 -0
- /package/dist/{jszip-1lXK4oQn.js → jszip-CYj7myrF.js} +0 -0
- /package/dist/{lodash-i3XVVuwG.js → lodash-CFrt21kh.js} +0 -0
- /package/dist/{pdfjs-dist-DwiA-2_8.js → pdfjs-dist-CHJ4PZaN.js} +0 -0
- /package/dist/{xlsx-DLkyLHwb.js → xlsx-CkHo9SHP.js} +0 -0
|
@@ -0,0 +1,859 @@
|
|
|
1
|
+
import { o as e } from "./rolldown-runtime-BETGA6I9.js";
|
|
2
|
+
import { t } from "./lodash-CFrt21kh.js";
|
|
3
|
+
import { t as n } from "./useCoreUIContext-_TAsecw_.js";
|
|
4
|
+
import { a as r, c as i } from "./utils-B4OCyMbr.js";
|
|
5
|
+
import { forwardRef as a, useCallback as o, useEffect as s, useImperativeHandle as c, useMemo as l, useRef as u } from "react";
|
|
6
|
+
import { BarChart as d, GaugeChart as f, LineChart as p, PieChart as m, ScatterChart as h } from "echarts/charts";
|
|
7
|
+
import { DataZoomComponent as g, DatasetComponent as _, GridComponent as v, LegendComponent as y, TitleComponent as b, TooltipComponent as x, TransformComponent as S } from "echarts/components";
|
|
8
|
+
import * as C from "echarts/core";
|
|
9
|
+
import { LabelLayout as w, UniversalTransition as T } from "echarts/features";
|
|
10
|
+
import { CanvasRenderer as E } from "echarts/renderers";
|
|
11
|
+
import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
12
|
+
import { Empty as A, theme as j } from "antd";
|
|
13
|
+
//#region src/lib/components/echarts/index.ts
|
|
14
|
+
var M = /* @__PURE__ */ e(t(), 1);
|
|
15
|
+
C.use([
|
|
16
|
+
y,
|
|
17
|
+
b,
|
|
18
|
+
x,
|
|
19
|
+
v,
|
|
20
|
+
_,
|
|
21
|
+
S,
|
|
22
|
+
g,
|
|
23
|
+
d,
|
|
24
|
+
p,
|
|
25
|
+
h,
|
|
26
|
+
m,
|
|
27
|
+
f,
|
|
28
|
+
w,
|
|
29
|
+
T,
|
|
30
|
+
E
|
|
31
|
+
]);
|
|
32
|
+
var N = C, P = a(({ options: e, width: t, height: n, chartHeight: r }, i) => {
|
|
33
|
+
let a = u(null), o = u(), l = u(!1), d = u(), f = u(!1);
|
|
34
|
+
c(i, () => ({ chart: o.current }));
|
|
35
|
+
let p = () => {
|
|
36
|
+
a.current && (o.current?.clear(), o.current = N.init(a.current));
|
|
37
|
+
}, m = (e) => {
|
|
38
|
+
o.current && (o.current?.clear(), o.current?.setOption(e, {
|
|
39
|
+
notMerge: !0,
|
|
40
|
+
lazyUpdate: !0
|
|
41
|
+
}), Array.isArray(e.yAxis) && e.yAxis.length > 1 && o.current?.resize());
|
|
42
|
+
};
|
|
43
|
+
return s(() => {
|
|
44
|
+
let e = () => {
|
|
45
|
+
if (!o.current || f.current) return;
|
|
46
|
+
let e = o.current, t = e.getOption()?.yAxis;
|
|
47
|
+
if (!t || !Array.isArray(t) || t.length < 2) return;
|
|
48
|
+
let n = e.getModel(), r = [n.getComponent("yAxis", 0), n.getComponent("yAxis", 1)];
|
|
49
|
+
if (!r[0] || !r[1]) return;
|
|
50
|
+
let i = r.map((e) => e.axis), a = i.map((e) => e.scale.getInterval()), s = i.map((e) => e.scale.getTicks()).map((e) => e.length), c = Math.max(s[0], s[1]), l = a[0] * (c - 1), u = a[1] * (c - 1);
|
|
51
|
+
if (s[0] === s[1]) return;
|
|
52
|
+
let d = [{}, {}];
|
|
53
|
+
s[0] < c && (d[0].max = M.default.round(l, 2), d[0].interval = a[0], d[0].splitNumber = c), s[1] < c && (d[1].max = M.default.round(u, 2), d[1].interval = a[1], d[1].splitNumber = c), f.current = !0, e.setOption({ yAxis: d });
|
|
54
|
+
};
|
|
55
|
+
return a.current && (p(), o.current?.on("finished", e)), () => {
|
|
56
|
+
o.current?.off("finished", e), o.current?.dispose();
|
|
57
|
+
};
|
|
58
|
+
}, []), s(() => {
|
|
59
|
+
l.current = !1, f.current = !1, m(e), l.current = !0;
|
|
60
|
+
}, [e]), s(() => {
|
|
61
|
+
let e = (0, M.throttle)(() => {
|
|
62
|
+
l.current && o.current?.resize();
|
|
63
|
+
}, 100);
|
|
64
|
+
return a.current && (d.current = new ResizeObserver(e), d.current.observe(a.current)), () => {
|
|
65
|
+
d.current?.disconnect(), d.current = void 0;
|
|
66
|
+
};
|
|
67
|
+
}, []), /* @__PURE__ */ O("div", {
|
|
68
|
+
className: "chart-wrapper",
|
|
69
|
+
style: {
|
|
70
|
+
width: t,
|
|
71
|
+
height: n
|
|
72
|
+
},
|
|
73
|
+
children: /* @__PURE__ */ O("div", {
|
|
74
|
+
ref: a,
|
|
75
|
+
style: {
|
|
76
|
+
width: t,
|
|
77
|
+
height: r || n
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
}), F = {
|
|
82
|
+
left: 0,
|
|
83
|
+
right: 0,
|
|
84
|
+
bottom: 20,
|
|
85
|
+
containLabel: !0
|
|
86
|
+
};
|
|
87
|
+
function I() {
|
|
88
|
+
let { config: e } = n(), { isDarkTheme: t, theme: i } = e, { useToken: a } = j, { token: o } = a(), s = l(() => ({
|
|
89
|
+
titleColor: o.colorText,
|
|
90
|
+
splitLineColor: o.colorBorder,
|
|
91
|
+
tickLineColor: o.colorSplit,
|
|
92
|
+
axislabelColor: o.colorTextTertiary,
|
|
93
|
+
colorSecondary: o.colorTextSecondary,
|
|
94
|
+
colorTertiary: o.colorTextTertiary,
|
|
95
|
+
gaugeBgColor: o.colorFillSecondary,
|
|
96
|
+
gaugeSplitLineColor: t ? "rgba(255,255,255,.3)" : "rgba(255, 255, 255, 1)",
|
|
97
|
+
gaugeSplitLineColor2: t ? "rgba(255,255,255,.5)" : "rgba(255, 255, 255, 1)",
|
|
98
|
+
colorBgContainerHover: t ? "#424242" : "#fff"
|
|
99
|
+
}), [i, t]);
|
|
100
|
+
return {
|
|
101
|
+
token: o,
|
|
102
|
+
tooltip: {
|
|
103
|
+
trigger: "axis",
|
|
104
|
+
backgroundColor: s.colorBgContainerHover,
|
|
105
|
+
borderColor: "transparent",
|
|
106
|
+
formatter(e, t) {
|
|
107
|
+
let n = `<span class="tooltip-x-name">${e[0].axisValue}</span>`, r = 0;
|
|
108
|
+
return e.forEach((e) => {
|
|
109
|
+
let i = (0, M.isFunction)(t) ? t?.(e.data.value) : e.data?.value;
|
|
110
|
+
if (i == null) return;
|
|
111
|
+
r += 1;
|
|
112
|
+
let a = e.seriesType === "bar" ? "2px" : "8px";
|
|
113
|
+
n += `<span class="tooltip-item">
|
|
114
|
+
<span class="tooltip-item-name">
|
|
115
|
+
<span class="tooltip-item-dot" style="border-radius:${a};background-color:${e.color};"></span>
|
|
116
|
+
<span class="tooltip-item-title">${e.seriesName}</span>:
|
|
117
|
+
</span>
|
|
118
|
+
<span class="tooltip-value">${i}</span>
|
|
119
|
+
</span>`;
|
|
120
|
+
}), `<div class="${r >= 12 ? "tooltip-wrapper tooltip-grid" : "tooltip-wrapper"}">${n}</div>`;
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
grid: F,
|
|
124
|
+
legend: {
|
|
125
|
+
itemWidth: 8,
|
|
126
|
+
itemHeight: 8,
|
|
127
|
+
itemGap: 12,
|
|
128
|
+
textStyle: { color: s.axislabelColor }
|
|
129
|
+
},
|
|
130
|
+
xAxis: {
|
|
131
|
+
type: "category",
|
|
132
|
+
axisTick: {
|
|
133
|
+
show: !0,
|
|
134
|
+
lineStyle: { color: s.tickLineColor }
|
|
135
|
+
},
|
|
136
|
+
axisLabel: {
|
|
137
|
+
color: s.axislabelColor,
|
|
138
|
+
fontSize: 12
|
|
139
|
+
},
|
|
140
|
+
axisLine: { show: !1 }
|
|
141
|
+
},
|
|
142
|
+
yAxis: {
|
|
143
|
+
nameTextStyle: { padding: [
|
|
144
|
+
0,
|
|
145
|
+
0,
|
|
146
|
+
0,
|
|
147
|
+
-20
|
|
148
|
+
] },
|
|
149
|
+
splitLine: {
|
|
150
|
+
show: !0,
|
|
151
|
+
lineStyle: {
|
|
152
|
+
type: "dashed",
|
|
153
|
+
color: s.splitLineColor
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
axisLabel: {
|
|
157
|
+
color: s.axislabelColor,
|
|
158
|
+
fontSize: 12,
|
|
159
|
+
formatter: r
|
|
160
|
+
},
|
|
161
|
+
axisTick: { show: !1 },
|
|
162
|
+
type: "value"
|
|
163
|
+
},
|
|
164
|
+
title: {
|
|
165
|
+
show: !0,
|
|
166
|
+
left: "center",
|
|
167
|
+
textStyle: {
|
|
168
|
+
fontSize: 12,
|
|
169
|
+
color: s.titleColor
|
|
170
|
+
},
|
|
171
|
+
text: ""
|
|
172
|
+
},
|
|
173
|
+
chartColorMap: s,
|
|
174
|
+
barItemConfig: {
|
|
175
|
+
type: "bar",
|
|
176
|
+
barMaxWidth: 20,
|
|
177
|
+
barMinWidth: 8,
|
|
178
|
+
barGap: "30%",
|
|
179
|
+
barCategoryGap: "50%"
|
|
180
|
+
},
|
|
181
|
+
lineItemConfig: {
|
|
182
|
+
type: "line",
|
|
183
|
+
smooth: !0,
|
|
184
|
+
showSymbol: !1,
|
|
185
|
+
itemStyle: {},
|
|
186
|
+
lineStyle: {
|
|
187
|
+
width: 1.5,
|
|
188
|
+
opacity: .7
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
gaugeItemConfig: {
|
|
192
|
+
type: "gauge",
|
|
193
|
+
radius: "88%",
|
|
194
|
+
center: ["50%", "65%"],
|
|
195
|
+
startAngle: 190,
|
|
196
|
+
endAngle: -10,
|
|
197
|
+
min: 0,
|
|
198
|
+
max: 100,
|
|
199
|
+
splitNumber: 5,
|
|
200
|
+
progress: {
|
|
201
|
+
show: !0,
|
|
202
|
+
roundCap: !1,
|
|
203
|
+
width: 12
|
|
204
|
+
},
|
|
205
|
+
pointer: {
|
|
206
|
+
length: "80%",
|
|
207
|
+
width: 4,
|
|
208
|
+
itemStyle: { color: "auto" }
|
|
209
|
+
},
|
|
210
|
+
axisLine: {
|
|
211
|
+
roundCap: !1,
|
|
212
|
+
lineStyle: {
|
|
213
|
+
width: 12,
|
|
214
|
+
color: [
|
|
215
|
+
[.5, "rgba(84, 204, 152, 80%)"],
|
|
216
|
+
[.8, "rgba(250, 173, 20, 80%)"],
|
|
217
|
+
[1, "rgba(255, 77, 79, 80%)"]
|
|
218
|
+
]
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
axisTick: {
|
|
222
|
+
distance: -11,
|
|
223
|
+
length: 6,
|
|
224
|
+
splitNumber: 5,
|
|
225
|
+
lineStyle: {
|
|
226
|
+
width: 1.5,
|
|
227
|
+
color: s.gaugeSplitLineColor
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
splitLine: {
|
|
231
|
+
distance: -5,
|
|
232
|
+
length: 5,
|
|
233
|
+
lineStyle: {
|
|
234
|
+
width: 1.5,
|
|
235
|
+
color: s.gaugeSplitLineColor2
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
axisLabel: {
|
|
239
|
+
distance: 14,
|
|
240
|
+
color: s.axislabelColor,
|
|
241
|
+
fontSize: 12
|
|
242
|
+
},
|
|
243
|
+
detail: {
|
|
244
|
+
lineHeight: 40,
|
|
245
|
+
height: 40,
|
|
246
|
+
offsetCenter: [5, 30],
|
|
247
|
+
valueAnimation: !1,
|
|
248
|
+
fontSize: 20,
|
|
249
|
+
color: s.titleColor,
|
|
250
|
+
formatter(e) {
|
|
251
|
+
return "{value|" + e + "}{unit|%}";
|
|
252
|
+
},
|
|
253
|
+
rich: {
|
|
254
|
+
value: {
|
|
255
|
+
fontSize: 16,
|
|
256
|
+
fontWeight: 500,
|
|
257
|
+
color: s.titleColor
|
|
258
|
+
},
|
|
259
|
+
unit: {
|
|
260
|
+
fontSize: 14,
|
|
261
|
+
color: s.titleColor,
|
|
262
|
+
fontWeight: 500,
|
|
263
|
+
padding: [
|
|
264
|
+
0,
|
|
265
|
+
0,
|
|
266
|
+
0,
|
|
267
|
+
2
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
isDark: t
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region src/lib/components/empty-data/index.tsx
|
|
278
|
+
var L = ({ height: e, title: t }) => /* @__PURE__ */ k("div", {
|
|
279
|
+
style: {
|
|
280
|
+
width: "100%",
|
|
281
|
+
height: e || "100%"
|
|
282
|
+
},
|
|
283
|
+
className: "flex-center flex-column ",
|
|
284
|
+
children: [t && /* @__PURE__ */ O("h3", {
|
|
285
|
+
className: "justify-center font-size-12",
|
|
286
|
+
style: {
|
|
287
|
+
padding: "4px 0",
|
|
288
|
+
marginBottom: 0
|
|
289
|
+
},
|
|
290
|
+
children: t
|
|
291
|
+
}), /* @__PURE__ */ O("div", {
|
|
292
|
+
className: "flex-center justify-center flex-column",
|
|
293
|
+
style: { height: "100%" },
|
|
294
|
+
children: /* @__PURE__ */ O(A, { image: A.PRESENTED_IMAGE_SIMPLE })
|
|
295
|
+
})]
|
|
296
|
+
}), R = (e) => {
|
|
297
|
+
let { seriesData: t, xAxisData: n, height: r, width: i, labelFormatter: a, legendData: o, title: s, stack: c = "total" } = e, { barItemConfig: u, grid: d, legend: f, title: p, tooltip: m, xAxis: h, yAxis: g } = I(), _ = typeof s == "string" ? s : s?.text ?? "", v = l(() => {
|
|
298
|
+
let e = {
|
|
299
|
+
title: { text: "" },
|
|
300
|
+
grid: d,
|
|
301
|
+
tooltip: { ...m },
|
|
302
|
+
xAxis: {
|
|
303
|
+
...h,
|
|
304
|
+
axisLabel: {
|
|
305
|
+
...h.axisLabel,
|
|
306
|
+
formatter: a
|
|
307
|
+
},
|
|
308
|
+
data: []
|
|
309
|
+
},
|
|
310
|
+
yAxis: g,
|
|
311
|
+
legend: {
|
|
312
|
+
...f,
|
|
313
|
+
data: []
|
|
314
|
+
},
|
|
315
|
+
series: []
|
|
316
|
+
}, r = M.default.map(t, (e) => {
|
|
317
|
+
let { stack: t, ...n } = e, r = t ?? c;
|
|
318
|
+
return {
|
|
319
|
+
...n,
|
|
320
|
+
...u,
|
|
321
|
+
...r === !1 ? {} : { stack: r },
|
|
322
|
+
itemStyle: { color: e.color }
|
|
323
|
+
};
|
|
324
|
+
});
|
|
325
|
+
return {
|
|
326
|
+
...e,
|
|
327
|
+
animation: !1,
|
|
328
|
+
title: {
|
|
329
|
+
...p,
|
|
330
|
+
text: _
|
|
331
|
+
},
|
|
332
|
+
yAxis: { ...e.yAxis },
|
|
333
|
+
xAxis: {
|
|
334
|
+
...e.xAxis,
|
|
335
|
+
data: n
|
|
336
|
+
},
|
|
337
|
+
series: r
|
|
338
|
+
};
|
|
339
|
+
}, [
|
|
340
|
+
t,
|
|
341
|
+
n,
|
|
342
|
+
s,
|
|
343
|
+
a,
|
|
344
|
+
m,
|
|
345
|
+
d,
|
|
346
|
+
h,
|
|
347
|
+
g,
|
|
348
|
+
f,
|
|
349
|
+
u,
|
|
350
|
+
c
|
|
351
|
+
]);
|
|
352
|
+
return /* @__PURE__ */ O(D, { children: t.length ? /* @__PURE__ */ O(P, {
|
|
353
|
+
height: r,
|
|
354
|
+
options: v,
|
|
355
|
+
width: i || "100%"
|
|
356
|
+
}) : /* @__PURE__ */ O(L, {
|
|
357
|
+
height: r,
|
|
358
|
+
title: _
|
|
359
|
+
}) });
|
|
360
|
+
}, z = (e) => e <= 50 || e === void 0 ? "rgb(84, 204, 152, 80%)" : e <= 80 ? "rgba(250, 173, 20, 80%)" : "rgba(255, 77, 79, 80%)", B = (e) => {
|
|
361
|
+
let { gaugeItemConfig: t, title: n, chartColorMap: r } = I(), { value: i, height: a, width: o, labelFormatter: s, title: c, color: l, gaugeConfig: u } = e, d = typeof c == "string" ? c : c?.text;
|
|
362
|
+
return !i && i !== 0 ? /* @__PURE__ */ O(L, {
|
|
363
|
+
height: a,
|
|
364
|
+
title: d
|
|
365
|
+
}) : /* @__PURE__ */ O(P, {
|
|
366
|
+
height: a,
|
|
367
|
+
options: (() => {
|
|
368
|
+
let e = l || z(i), a = {
|
|
369
|
+
...t,
|
|
370
|
+
...u
|
|
371
|
+
};
|
|
372
|
+
return a.detail.rich.value.color = e, a.detail.rich.unit.color = e, {
|
|
373
|
+
title: {
|
|
374
|
+
...n,
|
|
375
|
+
text: d,
|
|
376
|
+
textStyle: {
|
|
377
|
+
fontSize: 12,
|
|
378
|
+
color: r.colorSecondary,
|
|
379
|
+
fontWeight: 400
|
|
380
|
+
},
|
|
381
|
+
top: 10,
|
|
382
|
+
left: "center",
|
|
383
|
+
...typeof c == "object" ? c : {}
|
|
384
|
+
},
|
|
385
|
+
series: [{
|
|
386
|
+
...a,
|
|
387
|
+
axisLine: {
|
|
388
|
+
...a.axisLine,
|
|
389
|
+
lineStyle: {
|
|
390
|
+
...a.axisLine.lineStyle,
|
|
391
|
+
color: [[i / 100, e], [1, r.gaugeBgColor]]
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
itemStyle: { color: "transparent" },
|
|
395
|
+
detail: {
|
|
396
|
+
...a.detail,
|
|
397
|
+
borderColor: e,
|
|
398
|
+
lineHeight: 20,
|
|
399
|
+
height: 18,
|
|
400
|
+
width: 50,
|
|
401
|
+
formatter: s || t.detail.formatter
|
|
402
|
+
},
|
|
403
|
+
data: [{ value: i }]
|
|
404
|
+
}]
|
|
405
|
+
};
|
|
406
|
+
})(),
|
|
407
|
+
width: o || "100%"
|
|
408
|
+
});
|
|
409
|
+
}, V = (e) => {
|
|
410
|
+
let { seriesData: t, xAxisData: n, height: r, width: i, labelFormatter: a, legendData: o, maxItems: s, barWidth: c = 20, title: u } = e, { token: d, grid: f, legend: p, title: m, tooltip: h, xAxis: g, yAxis: _ } = I(), v = typeof u == "string" ? u : u?.text ?? "", y = l(() => {
|
|
411
|
+
let e = {
|
|
412
|
+
title: {
|
|
413
|
+
...m,
|
|
414
|
+
left: "start"
|
|
415
|
+
},
|
|
416
|
+
grid: {
|
|
417
|
+
...f,
|
|
418
|
+
top: 0,
|
|
419
|
+
bottom: s ? `${1 / s * (s - n.length) * 100}%` : 0
|
|
420
|
+
},
|
|
421
|
+
tooltip: { ...h },
|
|
422
|
+
xAxis: {
|
|
423
|
+
...g,
|
|
424
|
+
axisLabel: { ...g.axisLabel }
|
|
425
|
+
},
|
|
426
|
+
yAxis: {
|
|
427
|
+
..._,
|
|
428
|
+
axisLabel: {
|
|
429
|
+
..._.axisLabel,
|
|
430
|
+
show: !0,
|
|
431
|
+
overflow: "truncate",
|
|
432
|
+
width: 75,
|
|
433
|
+
ellipsis: "...",
|
|
434
|
+
margin: 8,
|
|
435
|
+
formatter(e, t) {
|
|
436
|
+
return `{a|${t + 1}}`;
|
|
437
|
+
},
|
|
438
|
+
rich: { a: {
|
|
439
|
+
fontWeight: 500,
|
|
440
|
+
fontSize: 14,
|
|
441
|
+
color: d?.colorTextSecondary
|
|
442
|
+
} }
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
legend: {
|
|
446
|
+
...p,
|
|
447
|
+
data: []
|
|
448
|
+
},
|
|
449
|
+
series: []
|
|
450
|
+
}, r = M.default.map(t, (e) => ({
|
|
451
|
+
...e,
|
|
452
|
+
type: "bar",
|
|
453
|
+
barWidth: c,
|
|
454
|
+
stack: "Ad",
|
|
455
|
+
barGap: "20%",
|
|
456
|
+
label: {
|
|
457
|
+
show: !0,
|
|
458
|
+
formatter(e) {
|
|
459
|
+
return e.seriesIndex === 0 ? `{value|${e.name}}` : "";
|
|
460
|
+
},
|
|
461
|
+
position: "left",
|
|
462
|
+
align: "left",
|
|
463
|
+
offset: [5, 18],
|
|
464
|
+
rich: { value: {
|
|
465
|
+
textBorderWidth: 0,
|
|
466
|
+
fontSize: 11,
|
|
467
|
+
color: d?.colorTextTertiary
|
|
468
|
+
} }
|
|
469
|
+
},
|
|
470
|
+
itemStyle: { color: e.color }
|
|
471
|
+
}));
|
|
472
|
+
return {
|
|
473
|
+
...e,
|
|
474
|
+
animation: !1,
|
|
475
|
+
title: {
|
|
476
|
+
...e.title,
|
|
477
|
+
text: v
|
|
478
|
+
},
|
|
479
|
+
yAxis: {
|
|
480
|
+
...e.yAxis,
|
|
481
|
+
inverse: !0,
|
|
482
|
+
type: "category",
|
|
483
|
+
splitLine: { show: !1 },
|
|
484
|
+
data: n,
|
|
485
|
+
axisLine: { show: !1 },
|
|
486
|
+
axisTick: { show: !1 }
|
|
487
|
+
},
|
|
488
|
+
xAxis: {
|
|
489
|
+
...e.xAxis,
|
|
490
|
+
type: "value",
|
|
491
|
+
splitLine: { show: !1 },
|
|
492
|
+
axisLabel: { show: !1 },
|
|
493
|
+
axisTick: { show: !1 }
|
|
494
|
+
},
|
|
495
|
+
series: r
|
|
496
|
+
};
|
|
497
|
+
}, [
|
|
498
|
+
t,
|
|
499
|
+
n,
|
|
500
|
+
u,
|
|
501
|
+
a,
|
|
502
|
+
h,
|
|
503
|
+
f,
|
|
504
|
+
g,
|
|
505
|
+
_,
|
|
506
|
+
p,
|
|
507
|
+
c,
|
|
508
|
+
s
|
|
509
|
+
]);
|
|
510
|
+
return /* @__PURE__ */ O(D, { children: l(() => t?.every?.((e) => !e?.data?.length), [t]) ? /* @__PURE__ */ O(L, {
|
|
511
|
+
height: r,
|
|
512
|
+
title: v
|
|
513
|
+
}) : /* @__PURE__ */ O(P, {
|
|
514
|
+
height: r,
|
|
515
|
+
chartHeight: typeof r == "number" ? r - 10 : void 0,
|
|
516
|
+
options: y,
|
|
517
|
+
width: i || "100%"
|
|
518
|
+
}) });
|
|
519
|
+
}, H = N.graphic.LinearGradient, U = (e) => {
|
|
520
|
+
let { seriesData: t, xAxisData: n, yAxisName: r, height: a, width: o, labelFormatter: s, tooltipValueFormatter: c = null, legendData: u = [], smooth: d, title: f, legendOptions: p, gridOptions: m, titleOptions: h, showArea: g } = e, { grid: _, legend: v, lineItemConfig: y, title: b, tooltip: x, xAxis: S, yAxis: C } = I(), w = typeof f == "string" ? f : f?.text ?? "", T = (e, t) => s ? s(e, t) : t === n.length - 1 ? "" : e, E = {
|
|
521
|
+
title: { text: "" },
|
|
522
|
+
grid: {
|
|
523
|
+
..._,
|
|
524
|
+
...m
|
|
525
|
+
},
|
|
526
|
+
tooltip: {
|
|
527
|
+
...x,
|
|
528
|
+
formatter(e) {
|
|
529
|
+
return c ? x.formatter(e, c) : x.formatter(e);
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
xAxis: {
|
|
533
|
+
...S,
|
|
534
|
+
axisLabel: {
|
|
535
|
+
...S.axisLabel,
|
|
536
|
+
formatter: T
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
yAxis: C,
|
|
540
|
+
legend: {
|
|
541
|
+
...v,
|
|
542
|
+
...p,
|
|
543
|
+
data: u.map((e) => ({
|
|
544
|
+
name: e,
|
|
545
|
+
icon: "circle"
|
|
546
|
+
}))
|
|
547
|
+
},
|
|
548
|
+
series: []
|
|
549
|
+
}, k = l(() => {
|
|
550
|
+
let e = M.default.map(t, (e) => {
|
|
551
|
+
let t = i({
|
|
552
|
+
color: e.color,
|
|
553
|
+
alpha1: .25,
|
|
554
|
+
alpha2: .1
|
|
555
|
+
});
|
|
556
|
+
return {
|
|
557
|
+
...e,
|
|
558
|
+
...y,
|
|
559
|
+
smooth: d,
|
|
560
|
+
itemStyle: {
|
|
561
|
+
...y.itemStyle,
|
|
562
|
+
color: e.color
|
|
563
|
+
},
|
|
564
|
+
lineStyle: {
|
|
565
|
+
...y.lineStyle,
|
|
566
|
+
color: e.color
|
|
567
|
+
},
|
|
568
|
+
areaStyle: g ? { color: new H(0, 0, 0, 1, [{
|
|
569
|
+
offset: 0,
|
|
570
|
+
color: t[0]
|
|
571
|
+
}, {
|
|
572
|
+
offset: 1,
|
|
573
|
+
color: t[1]
|
|
574
|
+
}]) } : null
|
|
575
|
+
};
|
|
576
|
+
});
|
|
577
|
+
return {
|
|
578
|
+
...E,
|
|
579
|
+
animation: !1,
|
|
580
|
+
title: {
|
|
581
|
+
...b,
|
|
582
|
+
...h,
|
|
583
|
+
text: w
|
|
584
|
+
},
|
|
585
|
+
yAxis: {
|
|
586
|
+
...E.yAxis,
|
|
587
|
+
name: r,
|
|
588
|
+
nameTextStyle: {
|
|
589
|
+
fontSize: 12,
|
|
590
|
+
align: "right"
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
xAxis: {
|
|
594
|
+
...E.xAxis,
|
|
595
|
+
data: n
|
|
596
|
+
},
|
|
597
|
+
series: e
|
|
598
|
+
};
|
|
599
|
+
}, [
|
|
600
|
+
t,
|
|
601
|
+
n,
|
|
602
|
+
r,
|
|
603
|
+
f,
|
|
604
|
+
d,
|
|
605
|
+
h,
|
|
606
|
+
u,
|
|
607
|
+
E
|
|
608
|
+
]);
|
|
609
|
+
return /* @__PURE__ */ O(D, { children: t.length ? /* @__PURE__ */ O(P, {
|
|
610
|
+
height: a,
|
|
611
|
+
options: k,
|
|
612
|
+
width: o || "100%"
|
|
613
|
+
}) : /* @__PURE__ */ O(L, {
|
|
614
|
+
height: a,
|
|
615
|
+
title: w
|
|
616
|
+
}) });
|
|
617
|
+
};
|
|
618
|
+
//#endregion
|
|
619
|
+
//#region src/lib/components/echarts/mix-line-bar.tsx
|
|
620
|
+
N.graphic.LinearGradient;
|
|
621
|
+
var W = (e) => {
|
|
622
|
+
let { seriesData: t, xAxisData: n, yAxisName: r, height: a, width: o, labelFormatter: s, tooltipValueFormatter: c = null, legendData: u = [], smooth: d, title: f, chartData: p } = e, { grid: m, legend: h, lineItemConfig: g, barItemConfig: _, title: v, tooltip: y, xAxis: b, yAxis: x } = I(), S = typeof f == "string" ? f : f?.text ?? "", { line: C, bar: w } = p, T = {
|
|
623
|
+
title: { text: "" },
|
|
624
|
+
grid: {
|
|
625
|
+
...m,
|
|
626
|
+
right: 0,
|
|
627
|
+
top: 20,
|
|
628
|
+
bottom: 10
|
|
629
|
+
},
|
|
630
|
+
tooltip: {
|
|
631
|
+
...y,
|
|
632
|
+
formatter(e) {
|
|
633
|
+
return c ? y.formatter(e, c) : y.formatter(e);
|
|
634
|
+
}
|
|
635
|
+
},
|
|
636
|
+
xAxis: {
|
|
637
|
+
...b,
|
|
638
|
+
axisLabel: {
|
|
639
|
+
...b.axisLabel,
|
|
640
|
+
formatter: s
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
yAxis: x,
|
|
644
|
+
legend: {
|
|
645
|
+
...h,
|
|
646
|
+
data: u,
|
|
647
|
+
itemGap: 20,
|
|
648
|
+
bottom: 5,
|
|
649
|
+
show: !1
|
|
650
|
+
},
|
|
651
|
+
series: []
|
|
652
|
+
}, E = l(() => {
|
|
653
|
+
let e = M.default.map(C, (e) => (i({
|
|
654
|
+
color: e.color,
|
|
655
|
+
alpha1: .5,
|
|
656
|
+
alpha2: .1
|
|
657
|
+
}), {
|
|
658
|
+
...e,
|
|
659
|
+
...g,
|
|
660
|
+
smooth: d,
|
|
661
|
+
itemStyle: {
|
|
662
|
+
...g.itemStyle,
|
|
663
|
+
color: e.color
|
|
664
|
+
},
|
|
665
|
+
yAxisIndex: 1,
|
|
666
|
+
lineStyle: {
|
|
667
|
+
...g.lineStyle,
|
|
668
|
+
color: e.color
|
|
669
|
+
}
|
|
670
|
+
})), t = M.default.map(w, (e) => ({
|
|
671
|
+
...e,
|
|
672
|
+
..._,
|
|
673
|
+
stack: "total",
|
|
674
|
+
yAxisIndex: 0,
|
|
675
|
+
itemStyle: {
|
|
676
|
+
...e.itemStyle,
|
|
677
|
+
color: e.color
|
|
678
|
+
}
|
|
679
|
+
}));
|
|
680
|
+
return {
|
|
681
|
+
...T,
|
|
682
|
+
animation: !1,
|
|
683
|
+
title: {
|
|
684
|
+
...v,
|
|
685
|
+
text: S
|
|
686
|
+
},
|
|
687
|
+
yAxis: [{ ...T.yAxis }, {
|
|
688
|
+
...T.yAxis,
|
|
689
|
+
nameTextStyle: {
|
|
690
|
+
fontSize: 12,
|
|
691
|
+
align: "right"
|
|
692
|
+
}
|
|
693
|
+
}],
|
|
694
|
+
xAxis: {
|
|
695
|
+
...T.xAxis,
|
|
696
|
+
data: n
|
|
697
|
+
},
|
|
698
|
+
series: [...t, ...e]
|
|
699
|
+
};
|
|
700
|
+
}, [
|
|
701
|
+
t,
|
|
702
|
+
n,
|
|
703
|
+
r,
|
|
704
|
+
f,
|
|
705
|
+
d,
|
|
706
|
+
u,
|
|
707
|
+
T
|
|
708
|
+
]);
|
|
709
|
+
return /* @__PURE__ */ O(D, { children: !C.length && !w.length ? /* @__PURE__ */ O(L, {
|
|
710
|
+
height: a,
|
|
711
|
+
title: S
|
|
712
|
+
}) : /* @__PURE__ */ O(P, {
|
|
713
|
+
height: a,
|
|
714
|
+
options: E,
|
|
715
|
+
width: o || "100%"
|
|
716
|
+
}) });
|
|
717
|
+
}, G = (e) => {
|
|
718
|
+
let { grid: t, title: n, isDark: r, chartColorMap: i } = I(), { seriesData: a, xAxisData: s, height: c, width: d, showEmpty: f, title: p, xMax: m = 1, yMax: h = 1 } = e, g = typeof p == "string" ? p : p?.text ?? "", _ = u(null), v = l(() => {
|
|
719
|
+
let e = r ? {
|
|
720
|
+
split: i.splitLineColor,
|
|
721
|
+
axis: i.axislabelColor,
|
|
722
|
+
label: i.axislabelColor
|
|
723
|
+
} : {
|
|
724
|
+
split: "#F2F2F2",
|
|
725
|
+
axis: "#dcdcdc",
|
|
726
|
+
label: "#dcdcdc"
|
|
727
|
+
};
|
|
728
|
+
return {
|
|
729
|
+
animation: !1,
|
|
730
|
+
grid: {
|
|
731
|
+
...t,
|
|
732
|
+
right: 10,
|
|
733
|
+
top: 10,
|
|
734
|
+
bottom: 2,
|
|
735
|
+
left: 2,
|
|
736
|
+
containLabel: !0,
|
|
737
|
+
borderRadius: 4
|
|
738
|
+
},
|
|
739
|
+
xAxis: {
|
|
740
|
+
min: -m,
|
|
741
|
+
max: m,
|
|
742
|
+
scale: !1,
|
|
743
|
+
slient: !0,
|
|
744
|
+
splitNumber: 15,
|
|
745
|
+
splitLine: { lineStyle: { color: e.split } },
|
|
746
|
+
axisLine: {
|
|
747
|
+
show: !0,
|
|
748
|
+
lineStyle: { color: e.axis }
|
|
749
|
+
},
|
|
750
|
+
axisTick: { show: !1 },
|
|
751
|
+
axisLabel: {
|
|
752
|
+
show: !0,
|
|
753
|
+
color: e.label
|
|
754
|
+
},
|
|
755
|
+
boundaryGap: [.05, .05]
|
|
756
|
+
},
|
|
757
|
+
yAxis: {
|
|
758
|
+
min: -h,
|
|
759
|
+
max: h,
|
|
760
|
+
scale: !1,
|
|
761
|
+
slient: !0,
|
|
762
|
+
splitNumber: 10,
|
|
763
|
+
boundaryGap: [.05, .05],
|
|
764
|
+
splitLine: { lineStyle: { color: e.split } },
|
|
765
|
+
axisLine: {
|
|
766
|
+
show: !0,
|
|
767
|
+
lineStyle: { color: e.axis }
|
|
768
|
+
},
|
|
769
|
+
axisTick: { show: !1 },
|
|
770
|
+
axisLabel: {
|
|
771
|
+
show: !0,
|
|
772
|
+
color: e.label
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
symbol: "roundRect",
|
|
776
|
+
label: {
|
|
777
|
+
show: !0,
|
|
778
|
+
shadowColor: "none",
|
|
779
|
+
textBorderColor: "none",
|
|
780
|
+
formatter: (e) => e.name
|
|
781
|
+
},
|
|
782
|
+
series: []
|
|
783
|
+
};
|
|
784
|
+
}, [
|
|
785
|
+
r,
|
|
786
|
+
m,
|
|
787
|
+
h
|
|
788
|
+
]), y = o((e, t) => {
|
|
789
|
+
let n = [], [r, i] = _.current?.chart?.convertToPixel("grid", t.value) ?? [0, 0], a = e.map((e) => ({
|
|
790
|
+
...e,
|
|
791
|
+
value: _.current.chart?.convertToPixel("grid", e.value)
|
|
792
|
+
}));
|
|
793
|
+
for (let e = 0; e < a.length; e++) {
|
|
794
|
+
if (t.name === a[e].name) {
|
|
795
|
+
n.push({ ...a[e] });
|
|
796
|
+
continue;
|
|
797
|
+
}
|
|
798
|
+
let [o, s] = a[e].value;
|
|
799
|
+
Math.sqrt(M.default.round(o - r, 2) ** 2 + M.default.round(s - i, 2) ** 2) <= 16 && n.push({ ...a[e] });
|
|
800
|
+
}
|
|
801
|
+
return n;
|
|
802
|
+
}, []), b = o((e) => !e.length || e.length < 2 ? null : (e) => `<span class="tooltip-item-name">
|
|
803
|
+
<span style="display:flex;justify-content:center;align-items: center;color:#fff;
|
|
804
|
+
margin-right:0;border-radius:4px;width:14px;
|
|
805
|
+
height:14px;background-color:${e?.itemStyle?.color};"
|
|
806
|
+
>${e.name}</span>
|
|
807
|
+
</span>`, []), x = l(() => {
|
|
808
|
+
let e = a.map((e, t) => ({
|
|
809
|
+
...e,
|
|
810
|
+
itemStyle: { color: "#5470c6" },
|
|
811
|
+
symbolSize: 16
|
|
812
|
+
}));
|
|
813
|
+
return {
|
|
814
|
+
...v,
|
|
815
|
+
tooltip: {
|
|
816
|
+
trigger: "item",
|
|
817
|
+
borderWidth: 0,
|
|
818
|
+
backgroundColor: i.colorBgContainerHover,
|
|
819
|
+
borderColor: "transparent",
|
|
820
|
+
formatter(t, n) {
|
|
821
|
+
let r = y(e, t.data), i = "", a = b(r);
|
|
822
|
+
return r.forEach((e) => {
|
|
823
|
+
i += `
|
|
824
|
+
<span class="tooltip-item" style="justify-content: flex-start;">
|
|
825
|
+
${a ? a(e) : ""}
|
|
826
|
+
<span class="tooltip-value">${e.text}</span>
|
|
827
|
+
</span>`;
|
|
828
|
+
}), `<div class="tooltip-wrapper scatter">${i}</div>`;
|
|
829
|
+
}
|
|
830
|
+
},
|
|
831
|
+
title: {
|
|
832
|
+
...n,
|
|
833
|
+
text: g
|
|
834
|
+
},
|
|
835
|
+
series: {
|
|
836
|
+
type: "scatter",
|
|
837
|
+
labelLayout: { hideOverlap: !0 },
|
|
838
|
+
data: e
|
|
839
|
+
}
|
|
840
|
+
};
|
|
841
|
+
}, [
|
|
842
|
+
a,
|
|
843
|
+
s,
|
|
844
|
+
p,
|
|
845
|
+
v,
|
|
846
|
+
y
|
|
847
|
+
]);
|
|
848
|
+
return /* @__PURE__ */ O(D, { children: !a.length && f ? /* @__PURE__ */ O(L, {
|
|
849
|
+
height: c,
|
|
850
|
+
title: g
|
|
851
|
+
}) : /* @__PURE__ */ O(P, {
|
|
852
|
+
ref: _,
|
|
853
|
+
height: c,
|
|
854
|
+
options: x,
|
|
855
|
+
width: d || "100%"
|
|
856
|
+
}) });
|
|
857
|
+
};
|
|
858
|
+
//#endregion
|
|
859
|
+
export { R as BarChart, P as Chart, B as GaugeChart, V as HBarChart, U as LineChart, W as MixLineBarChart, G as ScatterChart };
|