@object-ui/plugin-charts 7.0.0 → 7.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 +50 -0
- package/dist/AdvancedChartImpl.d.ts +23 -1
- package/dist/ChartRenderer.d.ts +8 -0
- package/dist/index.js +516 -433
- package/dist/index.umd.cjs +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { ComponentRegistry as e, buildChartSeries as t,
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { Area as
|
|
7
|
-
import { SchemaRenderer as
|
|
8
|
-
import { AlertCircle as
|
|
9
|
-
import { useSafeFieldLabel as
|
|
1
|
+
import { ComponentRegistry as e, buildChartSeries as t, buildOptionColorMap as n, compareToTrendLabelKey as r, computeDrillFilter as i, extractRecords as a, isDrillEnabled as o, resolveDateMacros as s, resolveDrillTitle as c, shiftFilterByCompareTo as l } from "@object-ui/core";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import d, { Suspense as f, useCallback as p, useContext as m, useEffect as h, useMemo as g, useRef as ee, useState as _ } from "react";
|
|
4
|
+
import { Button as te, Dialog as ne, DialogContent as re, DialogHeader as ie, DialogTitle as ae, RefreshIndicator as oe, Sheet as se, SheetContent as ce, SheetHeader as le, SheetTitle as v, Skeleton as y } from "@object-ui/components";
|
|
5
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
6
|
+
import { Area as C, AreaChart as ue, Bar as de, BarChart as w, CartesianGrid as T, Cell as E, Funnel as fe, FunnelChart as pe, LabelList as me, Legend as D, Line as O, LineChart as k, Pie as he, PieChart as A, PolarAngleAxis as j, PolarGrid as ge, PolarRadiusAxis as _e, Radar as M, RadarChart as ve, ResponsiveContainer as N, Sankey as ye, Scatter as be, ScatterChart as P, Tooltip as F, Treemap as I, XAxis as L, YAxis as R, ZAxis as xe } from "recharts";
|
|
7
|
+
import { SchemaRenderer as Se, SchemaRendererContext as Ce, useDataScope as z, useDrillNavigation as we } from "@object-ui/react";
|
|
8
|
+
import { AlertCircle as Te, ArrowUpRight as B } from "lucide-react";
|
|
9
|
+
import { useSafeFieldLabel as Ee, useSafeTranslate as De } from "@object-ui/i18n";
|
|
10
10
|
//#region \0rolldown/runtime.js
|
|
11
|
-
var
|
|
11
|
+
var V = Object.defineProperty, H = (e, t) => () => (e && (t = e(e = 0)), t), Oe = (e, t) => {
|
|
12
12
|
let n = {};
|
|
13
|
-
for (var r in e)
|
|
13
|
+
for (var r in e) V(n, r, {
|
|
14
14
|
get: e[r],
|
|
15
15
|
enumerable: !0
|
|
16
16
|
});
|
|
17
|
-
return t ||
|
|
18
|
-
},
|
|
19
|
-
function
|
|
17
|
+
return t || V(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
18
|
+
}, ke = /* @__PURE__ */ Oe({ default: () => Me });
|
|
19
|
+
function Ae(e, t = 14) {
|
|
20
20
|
return e.length > t ? `${e.slice(0, t - 1)}…` : e;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
let r = String(n?.value ?? ""), i =
|
|
24
|
-
return /* @__PURE__ */
|
|
22
|
+
function je({ x: e, y: t, payload: n }) {
|
|
23
|
+
let r = String(n?.value ?? ""), i = Ae(r);
|
|
24
|
+
return /* @__PURE__ */ x("g", {
|
|
25
25
|
transform: `translate(${e},${t})`,
|
|
26
|
-
children: /* @__PURE__ */
|
|
26
|
+
children: /* @__PURE__ */ S("text", {
|
|
27
27
|
dy: 10,
|
|
28
28
|
textAnchor: "end",
|
|
29
29
|
transform: "rotate(-32)",
|
|
30
30
|
fill: "hsl(var(--muted-foreground))",
|
|
31
31
|
fontSize: 11,
|
|
32
32
|
fontFamily: "monospace",
|
|
33
|
-
children: [r !== i && /* @__PURE__ */
|
|
33
|
+
children: [r !== i && /* @__PURE__ */ x("title", { children: r }), i]
|
|
34
34
|
})
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Me({ data: e = [], dataKey: t = "value", xAxisKey: n = "name", height: r = 400, className: i = "", color: a = "hsl(var(--primary))" }) {
|
|
38
38
|
let o = e.map((e) => String(e?.[n] ?? "")), s = o.length > 4 || o.some((e) => e.length > 8);
|
|
39
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ x("div", {
|
|
40
40
|
className: `p-2 sm:p-3 md:p-4 rounded-xl border border-border bg-card/40 backdrop-blur-sm shadow-lg shadow-background/5 ${i}`,
|
|
41
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ x(N, {
|
|
42
42
|
width: "100%",
|
|
43
43
|
height: r,
|
|
44
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ S(w, {
|
|
45
45
|
data: e,
|
|
46
46
|
margin: {
|
|
47
47
|
top: 10,
|
|
@@ -50,66 +50,66 @@ function Ae({ data: e = [], dataKey: t = "value", xAxisKey: n = "name", height:
|
|
|
50
50
|
bottom: s ? 24 : 5
|
|
51
51
|
},
|
|
52
52
|
children: [
|
|
53
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ S("defs", { children: [/* @__PURE__ */ S("linearGradient", {
|
|
54
54
|
id: "barGradient",
|
|
55
55
|
x1: "0",
|
|
56
56
|
y1: "0",
|
|
57
57
|
x2: "0",
|
|
58
58
|
y2: "1",
|
|
59
59
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ x("stop", {
|
|
61
61
|
offset: "0%",
|
|
62
62
|
stopColor: a,
|
|
63
63
|
stopOpacity: 1
|
|
64
64
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ x("stop", {
|
|
66
66
|
offset: "90%",
|
|
67
67
|
stopColor: a,
|
|
68
68
|
stopOpacity: .6
|
|
69
69
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ x("stop", {
|
|
71
71
|
offset: "100%",
|
|
72
72
|
stopColor: a,
|
|
73
73
|
stopOpacity: .3
|
|
74
74
|
})
|
|
75
75
|
]
|
|
76
|
-
}), /* @__PURE__ */
|
|
76
|
+
}), /* @__PURE__ */ S("filter", {
|
|
77
77
|
id: "glow",
|
|
78
78
|
height: "130%",
|
|
79
79
|
children: [
|
|
80
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ x("feGaussianBlur", {
|
|
81
81
|
in: "SourceAlpha",
|
|
82
82
|
stdDeviation: "3",
|
|
83
83
|
result: "blur"
|
|
84
84
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ x("feOffset", {
|
|
86
86
|
in: "blur",
|
|
87
87
|
dx: "0",
|
|
88
88
|
dy: "0",
|
|
89
89
|
result: "offsetBlur"
|
|
90
90
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ x("feFlood", {
|
|
92
92
|
floodColor: a,
|
|
93
93
|
floodOpacity: "0.5",
|
|
94
94
|
result: "offsetColor"
|
|
95
95
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ x("feComposite", {
|
|
97
97
|
in: "offsetColor",
|
|
98
98
|
in2: "offsetBlur",
|
|
99
99
|
operator: "in",
|
|
100
100
|
result: "offsetBlur"
|
|
101
101
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ S("feMerge", { children: [/* @__PURE__ */ x("feMergeNode", { in: "offsetBlur" }), /* @__PURE__ */ x("feMergeNode", { in: "SourceGraphic" })] })
|
|
103
103
|
]
|
|
104
104
|
})] }),
|
|
105
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ x(T, {
|
|
106
106
|
strokeDasharray: "3 3",
|
|
107
107
|
stroke: "hsl(var(--border))",
|
|
108
108
|
vertical: !1
|
|
109
109
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ x(L, {
|
|
111
111
|
dataKey: n,
|
|
112
|
-
tick: s ? /* @__PURE__ */
|
|
112
|
+
tick: s ? /* @__PURE__ */ x(je, {}) : {
|
|
113
113
|
fill: "hsl(var(--muted-foreground))",
|
|
114
114
|
fontSize: 12,
|
|
115
115
|
fontFamily: "monospace"
|
|
@@ -120,7 +120,7 @@ function Ae({ data: e = [], dataKey: t = "value", xAxisKey: n = "name", height:
|
|
|
120
120
|
height: s ? 56 : void 0,
|
|
121
121
|
dy: s ? void 0 : 10
|
|
122
122
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ x(R, {
|
|
124
124
|
tick: {
|
|
125
125
|
fill: "hsl(var(--muted-foreground))",
|
|
126
126
|
fontSize: 12,
|
|
@@ -129,7 +129,7 @@ function Ae({ data: e = [], dataKey: t = "value", xAxisKey: n = "name", height:
|
|
|
129
129
|
tickLine: !1,
|
|
130
130
|
axisLine: !1
|
|
131
131
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ x(F, {
|
|
133
133
|
cursor: {
|
|
134
134
|
fill: "hsl(var(--muted))",
|
|
135
135
|
opacity: .2
|
|
@@ -144,11 +144,11 @@ function Ae({ data: e = [], dataKey: t = "value", xAxisKey: n = "name", height:
|
|
|
144
144
|
},
|
|
145
145
|
itemStyle: { color: "hsl(var(--primary))" }
|
|
146
146
|
}),
|
|
147
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ x(D, { wrapperStyle: {
|
|
148
148
|
paddingTop: "20px",
|
|
149
149
|
fontFamily: "monospace"
|
|
150
150
|
} }),
|
|
151
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ x(de, {
|
|
152
152
|
dataKey: t,
|
|
153
153
|
fill: "url(#barGradient)",
|
|
154
154
|
radius: [
|
|
@@ -165,32 +165,32 @@ function Ae({ data: e = [], dataKey: t = "value", xAxisKey: n = "name", height:
|
|
|
165
165
|
})
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
|
-
var
|
|
168
|
+
var Ne = H((() => {}));
|
|
169
169
|
//#endregion
|
|
170
170
|
//#region src/ChartContainerImpl.tsx
|
|
171
|
-
function
|
|
172
|
-
let e =
|
|
171
|
+
function Pe() {
|
|
172
|
+
let e = u.useContext(Le);
|
|
173
173
|
if (!e) throw Error("useChart must be used within a <ChartContainer />");
|
|
174
174
|
return e;
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
let a =
|
|
178
|
-
return /* @__PURE__ */
|
|
176
|
+
function U({ id: e, className: t, children: n, config: r, ...i }) {
|
|
177
|
+
let a = u.useId(), o = `chart-${e || a.replace(/:/g, "")}`;
|
|
178
|
+
return /* @__PURE__ */ x(Le.Provider, {
|
|
179
179
|
value: { config: r },
|
|
180
|
-
children: /* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ S("div", {
|
|
181
181
|
"data-slot": "chart",
|
|
182
182
|
"data-chart": o,
|
|
183
|
-
className:
|
|
183
|
+
className: K("block w-full h-[350px] text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground", t),
|
|
184
184
|
style: {
|
|
185
185
|
minHeight: 280,
|
|
186
186
|
minWidth: 0,
|
|
187
187
|
...i.style
|
|
188
188
|
},
|
|
189
189
|
...i,
|
|
190
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ x(Re, {
|
|
191
191
|
id: o,
|
|
192
192
|
config: r
|
|
193
|
-
}), /* @__PURE__ */
|
|
193
|
+
}), /* @__PURE__ */ x(N, {
|
|
194
194
|
width: "100%",
|
|
195
195
|
height: "100%",
|
|
196
196
|
children: n
|
|
@@ -198,15 +198,15 @@ function W({ id: e, className: t, children: n, config: r, ...i }) {
|
|
|
198
198
|
})
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
|
-
function
|
|
202
|
-
let { config: m } =
|
|
201
|
+
function W({ active: e, payload: t, className: n, indicator: r = "dot", hideLabel: i = !1, hideIndicator: a = !1, label: o, labelFormatter: s, labelClassName: c, formatter: l, color: d, nameKey: f, labelKey: p }) {
|
|
202
|
+
let { config: m } = Pe(), h = u.useMemo(() => {
|
|
203
203
|
if (i || !t?.length) return null;
|
|
204
|
-
let [e] = t, n =
|
|
205
|
-
return s ? /* @__PURE__ */
|
|
206
|
-
className:
|
|
204
|
+
let [e] = t, n = Fe(m, e, `${p || e?.dataKey || e?.name || "value"}`), r = !p && typeof o == "string" ? m[o]?.label || o : n?.label;
|
|
205
|
+
return s ? /* @__PURE__ */ x("div", {
|
|
206
|
+
className: K("font-medium", c),
|
|
207
207
|
children: s(r, t)
|
|
208
|
-
}) : r ? /* @__PURE__ */
|
|
209
|
-
className:
|
|
208
|
+
}) : r ? /* @__PURE__ */ x("div", {
|
|
209
|
+
className: K("font-medium", c),
|
|
210
210
|
children: r
|
|
211
211
|
}) : null;
|
|
212
212
|
}, [
|
|
@@ -220,29 +220,29 @@ function G({ active: e, payload: t, className: n, indicator: r = "dot", hideLabe
|
|
|
220
220
|
]);
|
|
221
221
|
if (!e || !t?.length) return null;
|
|
222
222
|
let g = t.length === 1 && r !== "dot";
|
|
223
|
-
return /* @__PURE__ */
|
|
224
|
-
className:
|
|
225
|
-
children: [g ? null : h, /* @__PURE__ */
|
|
223
|
+
return /* @__PURE__ */ S("div", {
|
|
224
|
+
className: K("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl", n),
|
|
225
|
+
children: [g ? null : h, /* @__PURE__ */ x("div", {
|
|
226
226
|
className: "grid gap-1.5",
|
|
227
227
|
children: t.filter((e) => e.type !== "none").map((e, t) => {
|
|
228
|
-
let n =
|
|
229
|
-
return /* @__PURE__ */
|
|
230
|
-
className:
|
|
231
|
-
children:
|
|
232
|
-
className:
|
|
228
|
+
let n = Fe(m, e, `${f || e.name || e.dataKey || "value"}`), i = d || e.payload.fill || e.color;
|
|
229
|
+
return /* @__PURE__ */ x("div", {
|
|
230
|
+
className: K("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5", r === "dot" ? "items-center" : ""),
|
|
231
|
+
children: l && e?.value !== void 0 && e.name ? l(e.value, e.name, e, t, e.payload) : /* @__PURE__ */ S(b, { children: [n?.icon ? /* @__PURE__ */ x(n.icon, {}) : !a && /* @__PURE__ */ x("div", {
|
|
232
|
+
className: K("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", r === "dot" ? "h-2.5 w-2.5" : "", r === "line" ? "w-1" : "", r === "dashed" ? "w-0 border-[1.5px] border-dashed bg-transparent" : "", g && r === "dashed" ? "my-0.5" : ""),
|
|
233
233
|
style: {
|
|
234
234
|
"--color-bg": i,
|
|
235
235
|
"--color-border": i
|
|
236
236
|
}
|
|
237
|
-
}), /* @__PURE__ */
|
|
238
|
-
className:
|
|
239
|
-
children: [/* @__PURE__ */
|
|
237
|
+
}), /* @__PURE__ */ S("div", {
|
|
238
|
+
className: K("flex flex-1 justify-between leading-none", g ? "items-end" : "items-center"),
|
|
239
|
+
children: [/* @__PURE__ */ S("div", {
|
|
240
240
|
className: "grid gap-1.5",
|
|
241
|
-
children: [g ? h : null, /* @__PURE__ */
|
|
241
|
+
children: [g ? h : null, /* @__PURE__ */ x("span", {
|
|
242
242
|
className: "text-muted-foreground",
|
|
243
243
|
children: n?.label || e.name
|
|
244
244
|
})]
|
|
245
|
-
}), e.value && /* @__PURE__ */
|
|
245
|
+
}), e.value && /* @__PURE__ */ x("span", {
|
|
246
246
|
className: "text-foreground font-mono font-medium tabular-nums",
|
|
247
247
|
children: e.value.toLocaleString()
|
|
248
248
|
})]
|
|
@@ -252,15 +252,15 @@ function G({ active: e, payload: t, className: n, indicator: r = "dot", hideLabe
|
|
|
252
252
|
})]
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
function
|
|
256
|
-
let { config: a } =
|
|
257
|
-
return n?.length ? /* @__PURE__ */
|
|
258
|
-
className:
|
|
255
|
+
function G({ className: e, hideIcon: t = !1, payload: n, verticalAlign: r = "bottom", nameKey: i }) {
|
|
256
|
+
let { config: a } = Pe();
|
|
257
|
+
return n?.length ? /* @__PURE__ */ x("div", {
|
|
258
|
+
className: K("flex items-center justify-center gap-4", r === "top" ? "pb-3" : "pt-3", e),
|
|
259
259
|
children: n.filter((e) => e.type !== "none").map((e) => {
|
|
260
|
-
let n =
|
|
261
|
-
return /* @__PURE__ */
|
|
262
|
-
className:
|
|
263
|
-
children: [n?.icon && !t ? /* @__PURE__ */
|
|
260
|
+
let n = Fe(a, e, `${i || e.dataKey || "value"}`);
|
|
261
|
+
return /* @__PURE__ */ S("div", {
|
|
262
|
+
className: K("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"),
|
|
263
|
+
children: [n?.icon && !t ? /* @__PURE__ */ x(n.icon, {}) : /* @__PURE__ */ x("div", {
|
|
264
264
|
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
265
265
|
style: { backgroundColor: e.color }
|
|
266
266
|
}), n?.label]
|
|
@@ -268,18 +268,18 @@ function K({ className: e, hideIcon: t = !1, payload: n, verticalAlign: r = "bot
|
|
|
268
268
|
})
|
|
269
269
|
}) : null;
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function Fe(e, t, n) {
|
|
272
272
|
if (typeof t != "object" || !t) return;
|
|
273
273
|
let r = "payload" in t && typeof t.payload == "object" && t.payload !== null ? t.payload : void 0, i = n;
|
|
274
274
|
return n in t && typeof t[n] == "string" ? i = t[n] : r && n in r && typeof r[n] == "string" && (i = r[n]), i in e ? e[i] : e[n];
|
|
275
275
|
}
|
|
276
|
-
var
|
|
277
|
-
|
|
276
|
+
var K, Ie, Le, Re, q, J, ze = H((() => {
|
|
277
|
+
K = (...e) => e.filter(Boolean).join(" "), Ie = {
|
|
278
278
|
light: "",
|
|
279
279
|
dark: ".dark"
|
|
280
|
-
},
|
|
280
|
+
}, Le = u.createContext(null), Re = ({ id: e, config: t }) => {
|
|
281
281
|
let n = Object.entries(t).filter(([, e]) => e.theme || e.color);
|
|
282
|
-
return n.length ? /* @__PURE__ */
|
|
282
|
+
return n.length ? /* @__PURE__ */ x("style", { dangerouslySetInnerHTML: { __html: Object.entries(Ie).map(([t, r]) => `
|
|
283
283
|
${r} [data-chart=${e}] {
|
|
284
284
|
${n.map(([e, n]) => {
|
|
285
285
|
let r = n.theme?.[t] || n.color;
|
|
@@ -287,122 +287,122 @@ ${n.map(([e, n]) => {
|
|
|
287
287
|
}).join("\n")}
|
|
288
288
|
}
|
|
289
289
|
`).join("\n") } }) : null;
|
|
290
|
-
},
|
|
290
|
+
}, q = F, J = D;
|
|
291
291
|
}));
|
|
292
292
|
//#endregion
|
|
293
293
|
//#region src/chartDrillEvents.ts
|
|
294
|
-
function
|
|
294
|
+
function Be(e) {
|
|
295
295
|
return e?.[0]?.dataKey || "value";
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function Ve(e, t, n) {
|
|
298
298
|
if (!e) return null;
|
|
299
299
|
let r = e.payload ?? e, i = r?.[t];
|
|
300
300
|
if (i == null) return null;
|
|
301
|
-
let a =
|
|
301
|
+
let a = Be(n);
|
|
302
302
|
return {
|
|
303
303
|
category: String(i),
|
|
304
304
|
series: a,
|
|
305
305
|
value: typeof r?.[a] == "number" ? r[a] : void 0
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function He(e, t) {
|
|
309
309
|
if (!e) return null;
|
|
310
310
|
let n = e.name ?? e.payload?.name ?? e.root?.name;
|
|
311
311
|
if (n == null) return null;
|
|
312
312
|
let r = e.value ?? e.size ?? e.payload?.size;
|
|
313
313
|
return {
|
|
314
314
|
category: String(n),
|
|
315
|
-
series:
|
|
315
|
+
series: Be(t),
|
|
316
316
|
value: typeof r == "number" ? r : void 0
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function Ue(e, t) {
|
|
320
320
|
if (!e) return null;
|
|
321
321
|
let n = e.payload ?? e, r = n?.name;
|
|
322
322
|
return r == null || n?.depth === 0 ? null : {
|
|
323
323
|
category: String(r),
|
|
324
|
-
series:
|
|
324
|
+
series: Be(t),
|
|
325
325
|
value: typeof n?.value == "number" ? n.value : void 0
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
|
-
var
|
|
329
|
-
function
|
|
330
|
-
let
|
|
331
|
-
if (!
|
|
328
|
+
var We = H((() => {})), Ge = /* @__PURE__ */ Oe({ default: () => Ke });
|
|
329
|
+
function Ke({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r = "name", series: i = [], className: a = "", colors: o, categoryColors: s, onChartClick: c, isAnimationActive: l }) {
|
|
330
|
+
let d = e === "column" ? "bar" : e, f = Array.isArray(t) ? t : [], p = l === !1 ? { isAnimationActive: !1 } : {}, [m, h] = u.useState(!1), g = u.useCallback((e) => {
|
|
331
|
+
if (!c || !e) return;
|
|
332
332
|
let t = Array.isArray(e.activePayload) ? e.activePayload[0] : void 0;
|
|
333
|
-
|
|
333
|
+
c({
|
|
334
334
|
category: e.activeLabel == null ? void 0 : String(e.activeLabel),
|
|
335
335
|
series: t?.dataKey ? String(t.dataKey) : void 0,
|
|
336
336
|
value: typeof t?.value == "number" ? t.value : void 0
|
|
337
337
|
});
|
|
338
|
-
}, [
|
|
339
|
-
if (!
|
|
338
|
+
}, [c]), ee = u.useCallback((e) => {
|
|
339
|
+
if (!c || !e) return;
|
|
340
340
|
let t = e.payload?.[r], n = i[0]?.dataKey || "value";
|
|
341
|
-
|
|
341
|
+
c({
|
|
342
342
|
category: t == null ? void 0 : String(t),
|
|
343
343
|
series: n,
|
|
344
344
|
value: typeof e.payload?.[n] == "number" ? e.payload[n] : void 0
|
|
345
345
|
});
|
|
346
346
|
}, [
|
|
347
|
-
|
|
347
|
+
c,
|
|
348
348
|
r,
|
|
349
349
|
i
|
|
350
|
-
]),
|
|
351
|
-
onClick:
|
|
350
|
+
]), _ = c ? {
|
|
351
|
+
onClick: g,
|
|
352
352
|
style: { cursor: "pointer" }
|
|
353
|
-
} : {},
|
|
354
|
-
onClick:
|
|
353
|
+
} : {}, te = c ? {
|
|
354
|
+
onClick: ee,
|
|
355
355
|
style: { cursor: "pointer" }
|
|
356
|
-
} : {},
|
|
357
|
-
if (!
|
|
358
|
-
let t =
|
|
359
|
-
t &&
|
|
356
|
+
} : {}, ne = u.useCallback((e, t, n) => s && s[e == null ? "" : String(e)] || n[t % n.length], [s]), re = u.useCallback((e) => {
|
|
357
|
+
if (!c) return;
|
|
358
|
+
let t = Ve(e, r, i);
|
|
359
|
+
t && c(t);
|
|
360
360
|
}, [
|
|
361
|
-
|
|
361
|
+
c,
|
|
362
362
|
r,
|
|
363
363
|
i
|
|
364
|
-
]),
|
|
365
|
-
if (!
|
|
366
|
-
let t =
|
|
367
|
-
t &&
|
|
368
|
-
}, [
|
|
369
|
-
if (!
|
|
370
|
-
let t =
|
|
371
|
-
t &&
|
|
372
|
-
}, [
|
|
373
|
-
onClick:
|
|
364
|
+
]), ie = u.useCallback((e) => {
|
|
365
|
+
if (!c) return;
|
|
366
|
+
let t = He(e, i);
|
|
367
|
+
t && c(t);
|
|
368
|
+
}, [c, i]), ae = u.useCallback((e) => {
|
|
369
|
+
if (!c) return;
|
|
370
|
+
let t = Ue(e, i);
|
|
371
|
+
t && c(t);
|
|
372
|
+
}, [c, i]), oe = c ? {
|
|
373
|
+
onClick: re,
|
|
374
374
|
cursor: "pointer"
|
|
375
|
-
} : {},
|
|
376
|
-
onClick:
|
|
375
|
+
} : {}, se = c ? {
|
|
376
|
+
onClick: ie,
|
|
377
377
|
style: { cursor: "pointer" }
|
|
378
|
-
} : {},
|
|
379
|
-
onClick:
|
|
378
|
+
} : {}, ce = c ? {
|
|
379
|
+
onClick: ae,
|
|
380
380
|
style: { cursor: "pointer" }
|
|
381
381
|
} : {};
|
|
382
|
-
|
|
383
|
-
let e = () =>
|
|
382
|
+
u.useEffect(() => {
|
|
383
|
+
let e = () => h(window.innerWidth < 640);
|
|
384
384
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
385
385
|
}, []);
|
|
386
|
-
let
|
|
387
|
-
bar:
|
|
388
|
-
"horizontal-bar":
|
|
389
|
-
line:
|
|
390
|
-
area:
|
|
391
|
-
pie:
|
|
392
|
-
donut:
|
|
393
|
-
radar:
|
|
394
|
-
scatter:
|
|
395
|
-
funnel:
|
|
396
|
-
combo:
|
|
397
|
-
treemap:
|
|
398
|
-
sankey:
|
|
399
|
-
}[
|
|
386
|
+
let le = {
|
|
387
|
+
bar: w,
|
|
388
|
+
"horizontal-bar": w,
|
|
389
|
+
line: k,
|
|
390
|
+
area: ue,
|
|
391
|
+
pie: A,
|
|
392
|
+
donut: A,
|
|
393
|
+
radar: ve,
|
|
394
|
+
scatter: P,
|
|
395
|
+
funnel: pe,
|
|
396
|
+
combo: w,
|
|
397
|
+
treemap: w,
|
|
398
|
+
sankey: w
|
|
399
|
+
}[d] || w, v = u.useCallback((e) => {
|
|
400
400
|
if (e == null || e === "") return "";
|
|
401
401
|
let t = typeof e == "string" ? e : String(e);
|
|
402
402
|
if (/^\d{4}-\d{2}-\d{2}/.test(t)) {
|
|
403
403
|
let e = new Date(t);
|
|
404
404
|
if (!Number.isNaN(e.getTime())) {
|
|
405
|
-
let t = (
|
|
405
|
+
let t = (f.length > 1 ? Math.abs(new Date(String(f[f.length - 1][r] ?? "")).getTime() - new Date(String(f[0][r] ?? "")).getTime()) : 0) / (1e3 * 60 * 60 * 24);
|
|
406
406
|
try {
|
|
407
407
|
return t <= 62 ? e.toLocaleDateString(void 0, {
|
|
408
408
|
month: "short",
|
|
@@ -416,18 +416,18 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
return
|
|
419
|
+
return m && t.length > 8 ? t.slice(0, 8) + "…" : t;
|
|
420
420
|
}, [
|
|
421
|
-
|
|
421
|
+
f,
|
|
422
422
|
r,
|
|
423
|
-
|
|
424
|
-
]),
|
|
423
|
+
m
|
|
424
|
+
]), y = u.useMemo(() => f.some((e) => String(e[r] || "").length > 5), [f, r]), D = () => Array.isArray(o) && o.length > 0 ? o : [
|
|
425
425
|
"hsl(var(--chart-1))",
|
|
426
426
|
"hsl(var(--chart-2))",
|
|
427
427
|
"hsl(var(--chart-3))",
|
|
428
428
|
"hsl(var(--chart-4))",
|
|
429
429
|
"hsl(var(--chart-5))"
|
|
430
|
-
],
|
|
430
|
+
], N = u.useCallback((e) => {
|
|
431
431
|
if (e == null || e === "") return "";
|
|
432
432
|
let t = typeof e == "number" ? e : Number(e);
|
|
433
433
|
if (!Number.isFinite(t)) return String(e);
|
|
@@ -439,62 +439,60 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
439
439
|
} catch {
|
|
440
440
|
return String(t);
|
|
441
441
|
}
|
|
442
|
-
}, []),
|
|
442
|
+
}, []), Se = u.useMemo(() => ({
|
|
443
443
|
tickLine: !1,
|
|
444
444
|
tickMargin: 10,
|
|
445
445
|
axisLine: !1,
|
|
446
446
|
interval: "preserveStartEnd",
|
|
447
|
-
minTickGap:
|
|
448
|
-
tickFormatter:
|
|
449
|
-
...!
|
|
447
|
+
minTickGap: m ? 32 : 48,
|
|
448
|
+
tickFormatter: v,
|
|
449
|
+
...!m && y && {
|
|
450
450
|
angle: -35,
|
|
451
451
|
textAnchor: "end",
|
|
452
452
|
height: 60
|
|
453
453
|
}
|
|
454
454
|
}), [
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
455
|
+
m,
|
|
456
|
+
y,
|
|
457
|
+
v
|
|
458
458
|
]);
|
|
459
|
-
if (
|
|
460
|
-
let e =
|
|
461
|
-
return
|
|
459
|
+
if (d === "pie" || d === "donut") {
|
|
460
|
+
let e = d === "donut" ? "52%" : 0, t = D(), o = { ...n };
|
|
461
|
+
return f.forEach((e, n) => {
|
|
462
462
|
let i = e?.[r];
|
|
463
463
|
if (i == null || i === "") return;
|
|
464
464
|
let a = String(i);
|
|
465
465
|
o[a] || (o[a] = {
|
|
466
466
|
label: a,
|
|
467
|
-
color:
|
|
467
|
+
color: ne(i, n, t)
|
|
468
468
|
});
|
|
469
|
-
}), /* @__PURE__ */
|
|
469
|
+
}), /* @__PURE__ */ x(U, {
|
|
470
470
|
config: o,
|
|
471
471
|
className: a,
|
|
472
|
-
children: /* @__PURE__ */
|
|
473
|
-
/* @__PURE__ */
|
|
472
|
+
children: /* @__PURE__ */ S(A, { children: [
|
|
473
|
+
/* @__PURE__ */ x(q, {
|
|
474
474
|
cursor: !1,
|
|
475
|
-
content: /* @__PURE__ */
|
|
475
|
+
content: /* @__PURE__ */ x(W, { hideLabel: !0 })
|
|
476
476
|
}),
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
data:
|
|
477
|
+
/* @__PURE__ */ x(he, {
|
|
478
|
+
data: f,
|
|
479
479
|
dataKey: i[0]?.dataKey || "value",
|
|
480
480
|
nameKey: r || "name",
|
|
481
481
|
innerRadius: e,
|
|
482
482
|
strokeWidth: 5,
|
|
483
483
|
paddingAngle: 2,
|
|
484
|
-
outerRadius:
|
|
485
|
-
...
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
return i ||= t[n % t.length], /* @__PURE__ */ S(O, { fill: X(i) }, `cell-${n}`);
|
|
489
|
-
})
|
|
484
|
+
outerRadius: "85%",
|
|
485
|
+
...p,
|
|
486
|
+
...te,
|
|
487
|
+
children: f.map((e, n) => /* @__PURE__ */ x(E, { fill: X(ne(e?.[r], n, t)) }, `cell-${n}`))
|
|
490
488
|
}),
|
|
491
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ x(J, {
|
|
492
490
|
verticalAlign: "bottom",
|
|
493
491
|
wrapperStyle: {
|
|
494
|
-
fontSize:
|
|
492
|
+
fontSize: m ? "11px" : "12px",
|
|
495
493
|
paddingTop: "8px"
|
|
496
494
|
},
|
|
497
|
-
content: /* @__PURE__ */
|
|
495
|
+
content: /* @__PURE__ */ x(G, {
|
|
498
496
|
nameKey: r,
|
|
499
497
|
className: "flex-wrap"
|
|
500
498
|
})
|
|
@@ -502,44 +500,44 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
502
500
|
] })
|
|
503
501
|
});
|
|
504
502
|
}
|
|
505
|
-
if (
|
|
506
|
-
let e = i[0]?.dataKey || "value", t =
|
|
507
|
-
t &&
|
|
503
|
+
if (d === "funnel") {
|
|
504
|
+
let e = i[0]?.dataKey || "value", t = D(), o = c ? (t) => {
|
|
505
|
+
t && c({
|
|
508
506
|
category: t?.payload?.[r] ?? t?.[r],
|
|
509
507
|
value: t?.payload?.[e] ?? t?.[e]
|
|
510
508
|
});
|
|
511
|
-
} : void 0,
|
|
512
|
-
onClick:
|
|
509
|
+
} : void 0, s = o ? {
|
|
510
|
+
onClick: o,
|
|
513
511
|
style: { cursor: "pointer" }
|
|
514
|
-
} : {},
|
|
512
|
+
} : {}, l = [...f].sort((t, n) => {
|
|
515
513
|
let r = Number(t?.[e] ?? 0);
|
|
516
514
|
return Number(n?.[e] ?? 0) - r;
|
|
517
515
|
});
|
|
518
|
-
return /* @__PURE__ */
|
|
516
|
+
return /* @__PURE__ */ x(U, {
|
|
519
517
|
config: n,
|
|
520
518
|
className: a,
|
|
521
|
-
children: /* @__PURE__ */
|
|
519
|
+
children: /* @__PURE__ */ S(pe, { children: [/* @__PURE__ */ x(q, { content: /* @__PURE__ */ x(W, {}) }), /* @__PURE__ */ S(fe, {
|
|
522
520
|
dataKey: e,
|
|
523
|
-
data:
|
|
521
|
+
data: l,
|
|
524
522
|
nameKey: r,
|
|
525
523
|
isAnimationActive: !0,
|
|
526
|
-
...
|
|
527
|
-
children: [/* @__PURE__ */
|
|
524
|
+
...s,
|
|
525
|
+
children: [/* @__PURE__ */ x(me, {
|
|
528
526
|
position: "right",
|
|
529
527
|
fill: "hsl(var(--foreground))",
|
|
530
528
|
stroke: "none",
|
|
531
529
|
dataKey: r
|
|
532
|
-
}),
|
|
530
|
+
}), l.map((e, n) => /* @__PURE__ */ x(E, { fill: X(t[n % t.length]) }, `funnel-cell-${n}`))]
|
|
533
531
|
})] })
|
|
534
532
|
});
|
|
535
533
|
}
|
|
536
|
-
if (
|
|
537
|
-
let e = i[0]?.dataKey || "value", t =
|
|
538
|
-
return /* @__PURE__ */
|
|
534
|
+
if (d === "treemap") {
|
|
535
|
+
let e = i[0]?.dataKey || "value", t = D();
|
|
536
|
+
return /* @__PURE__ */ x(U, {
|
|
539
537
|
config: n,
|
|
540
538
|
className: a,
|
|
541
|
-
children: /* @__PURE__ */
|
|
542
|
-
data:
|
|
539
|
+
children: /* @__PURE__ */ x(I, {
|
|
540
|
+
data: f.map((n, i) => ({
|
|
543
541
|
name: String(n?.[r] ?? ""),
|
|
544
542
|
size: Number(n?.[e]) || 0,
|
|
545
543
|
fill: X(t[i % t.length])
|
|
@@ -547,9 +545,9 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
547
545
|
dataKey: "size",
|
|
548
546
|
nameKey: "name",
|
|
549
547
|
isAnimationActive: !0,
|
|
550
|
-
content: /* @__PURE__ */
|
|
548
|
+
content: /* @__PURE__ */ x((e) => {
|
|
551
549
|
let { x: t, y: n, width: r, height: i, name: a, fill: o } = e;
|
|
552
|
-
return r <= 0 || i <= 0 ? null : /* @__PURE__ */
|
|
550
|
+
return r <= 0 || i <= 0 ? null : /* @__PURE__ */ S("g", { children: [/* @__PURE__ */ x("rect", {
|
|
553
551
|
x: t,
|
|
554
552
|
y: n,
|
|
555
553
|
width: r,
|
|
@@ -557,7 +555,7 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
557
555
|
fill: o,
|
|
558
556
|
stroke: "hsl(var(--background))",
|
|
559
557
|
strokeWidth: 2
|
|
560
|
-
}), r > 48 && i > 18 ? /* @__PURE__ */
|
|
558
|
+
}), r > 48 && i > 18 ? /* @__PURE__ */ x("text", {
|
|
561
559
|
x: t + 6,
|
|
562
560
|
y: n + 18,
|
|
563
561
|
fill: "#fff",
|
|
@@ -566,24 +564,24 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
566
564
|
children: a
|
|
567
565
|
}) : null] });
|
|
568
566
|
}, {}),
|
|
569
|
-
...
|
|
570
|
-
children: /* @__PURE__ */
|
|
567
|
+
...se,
|
|
568
|
+
children: /* @__PURE__ */ x(F, {})
|
|
571
569
|
})
|
|
572
570
|
});
|
|
573
571
|
}
|
|
574
|
-
if (
|
|
575
|
-
let e = i[0]?.dataKey || "value", t = i[0]?.label || e, o =
|
|
572
|
+
if (d === "sankey") {
|
|
573
|
+
let e = i[0]?.dataKey || "value", t = i[0]?.label || e, o = f.filter((t) => (Number(t?.[e]) || 0) > 0), s = [{ name: t }, ...o.map((e) => ({ name: String(e?.[r] ?? "") }))], c = o.map((t, n) => ({
|
|
576
574
|
source: 0,
|
|
577
575
|
target: n + 1,
|
|
578
576
|
value: Number(t?.[e]) || 0
|
|
579
577
|
}));
|
|
580
|
-
return
|
|
578
|
+
return c.length === 0 ? /* @__PURE__ */ x("div", { className: a }) : /* @__PURE__ */ x(U, {
|
|
581
579
|
config: n,
|
|
582
580
|
className: a,
|
|
583
|
-
children: /* @__PURE__ */
|
|
581
|
+
children: /* @__PURE__ */ x(ye, {
|
|
584
582
|
data: {
|
|
585
583
|
nodes: s,
|
|
586
|
-
links:
|
|
584
|
+
links: c
|
|
587
585
|
},
|
|
588
586
|
nodePadding: 24,
|
|
589
587
|
link: {
|
|
@@ -591,24 +589,24 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
591
589
|
strokeOpacity: .25
|
|
592
590
|
},
|
|
593
591
|
node: { fill: "hsl(var(--chart-1))" },
|
|
594
|
-
...
|
|
595
|
-
children: /* @__PURE__ */
|
|
592
|
+
...ce,
|
|
593
|
+
children: /* @__PURE__ */ x(F, {})
|
|
596
594
|
})
|
|
597
595
|
});
|
|
598
596
|
}
|
|
599
|
-
if (
|
|
597
|
+
if (d === "radar") return /* @__PURE__ */ x(U, {
|
|
600
598
|
config: n,
|
|
601
599
|
className: a,
|
|
602
|
-
children: /* @__PURE__ */
|
|
603
|
-
data:
|
|
600
|
+
children: /* @__PURE__ */ S(ve, {
|
|
601
|
+
data: f,
|
|
604
602
|
children: [
|
|
605
|
-
/* @__PURE__ */
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
/* @__PURE__ */
|
|
608
|
-
/* @__PURE__ */
|
|
609
|
-
/* @__PURE__ */
|
|
610
|
-
content: /* @__PURE__ */
|
|
611
|
-
...
|
|
603
|
+
/* @__PURE__ */ x(ge, {}),
|
|
604
|
+
/* @__PURE__ */ x(j, { dataKey: r }),
|
|
605
|
+
/* @__PURE__ */ x(_e, {}),
|
|
606
|
+
/* @__PURE__ */ x(q, { content: /* @__PURE__ */ x(W, {}) }),
|
|
607
|
+
/* @__PURE__ */ x(J, {
|
|
608
|
+
content: /* @__PURE__ */ x(G, {}),
|
|
609
|
+
...m && {
|
|
612
610
|
verticalAlign: "bottom",
|
|
613
611
|
wrapperStyle: {
|
|
614
612
|
fontSize: "11px",
|
|
@@ -617,8 +615,8 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
617
615
|
}
|
|
618
616
|
}),
|
|
619
617
|
i.map((e) => {
|
|
620
|
-
let t = X(n[e.dataKey]?.color ||
|
|
621
|
-
return /* @__PURE__ */
|
|
618
|
+
let t = X(n[e.dataKey]?.color || Y);
|
|
619
|
+
return /* @__PURE__ */ x(M, {
|
|
622
620
|
dataKey: e.dataKey,
|
|
623
621
|
stroke: t,
|
|
624
622
|
fill: t,
|
|
@@ -628,36 +626,36 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
628
626
|
]
|
|
629
627
|
})
|
|
630
628
|
});
|
|
631
|
-
if (
|
|
629
|
+
if (d === "scatter") return /* @__PURE__ */ x(U, {
|
|
632
630
|
config: n,
|
|
633
631
|
className: a,
|
|
634
|
-
children: /* @__PURE__ */
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
/* @__PURE__ */
|
|
632
|
+
children: /* @__PURE__ */ S(P, { children: [
|
|
633
|
+
/* @__PURE__ */ x(T, { vertical: !1 }),
|
|
634
|
+
/* @__PURE__ */ x(L, {
|
|
637
635
|
type: "number",
|
|
638
636
|
dataKey: r,
|
|
639
637
|
name: String(n[r]?.label || r),
|
|
640
638
|
tickLine: !1,
|
|
641
639
|
axisLine: !1,
|
|
642
|
-
minTickGap:
|
|
640
|
+
minTickGap: m ? 32 : 48
|
|
643
641
|
}),
|
|
644
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ x(R, {
|
|
645
643
|
type: "number",
|
|
646
644
|
dataKey: i[0]?.dataKey || "value",
|
|
647
645
|
name: String(n[i[0]?.dataKey]?.label || i[0]?.dataKey),
|
|
648
646
|
tickLine: !1,
|
|
649
647
|
axisLine: !1,
|
|
650
|
-
tickFormatter:
|
|
648
|
+
tickFormatter: N,
|
|
651
649
|
width: 48
|
|
652
650
|
}),
|
|
653
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ x(xe, {
|
|
654
652
|
type: "number",
|
|
655
653
|
range: [60, 400]
|
|
656
654
|
}),
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
-
/* @__PURE__ */
|
|
659
|
-
content: /* @__PURE__ */
|
|
660
|
-
...
|
|
655
|
+
/* @__PURE__ */ x(q, { content: /* @__PURE__ */ x(W, {}) }),
|
|
656
|
+
/* @__PURE__ */ x(J, {
|
|
657
|
+
content: /* @__PURE__ */ x(G, {}),
|
|
658
|
+
...m && {
|
|
661
659
|
verticalAlign: "bottom",
|
|
662
660
|
wrapperStyle: {
|
|
663
661
|
fontSize: "11px",
|
|
@@ -666,47 +664,47 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
666
664
|
}
|
|
667
665
|
}),
|
|
668
666
|
i.map((e, t) => {
|
|
669
|
-
let r =
|
|
670
|
-
return /* @__PURE__ */
|
|
667
|
+
let r = D(), i = X(n[e.dataKey]?.color || r[t % r.length]), a = Z(e, "scatter");
|
|
668
|
+
return /* @__PURE__ */ x(be, {
|
|
671
669
|
name: n[e.dataKey]?.label || e.dataKey,
|
|
672
|
-
data:
|
|
670
|
+
data: f,
|
|
673
671
|
fill: i,
|
|
674
672
|
fillOpacity: a?.fillOpacity,
|
|
675
|
-
...
|
|
673
|
+
...oe
|
|
676
674
|
}, e.dataKey);
|
|
677
675
|
})
|
|
678
676
|
] })
|
|
679
677
|
});
|
|
680
|
-
if (
|
|
678
|
+
if (d === "combo") return /* @__PURE__ */ x(U, {
|
|
681
679
|
config: n,
|
|
682
680
|
className: a,
|
|
683
|
-
children: /* @__PURE__ */
|
|
684
|
-
data:
|
|
681
|
+
children: /* @__PURE__ */ S(w, {
|
|
682
|
+
data: f,
|
|
685
683
|
children: [
|
|
686
|
-
/* @__PURE__ */
|
|
687
|
-
/* @__PURE__ */
|
|
684
|
+
/* @__PURE__ */ x(T, { vertical: !1 }),
|
|
685
|
+
/* @__PURE__ */ x(L, {
|
|
688
686
|
dataKey: r,
|
|
689
|
-
...
|
|
687
|
+
...Se
|
|
690
688
|
}),
|
|
691
|
-
/* @__PURE__ */
|
|
689
|
+
/* @__PURE__ */ x(R, {
|
|
692
690
|
yAxisId: "left",
|
|
693
691
|
tickLine: !1,
|
|
694
692
|
axisLine: !1,
|
|
695
|
-
tickFormatter:
|
|
693
|
+
tickFormatter: N,
|
|
696
694
|
width: 48
|
|
697
695
|
}),
|
|
698
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ x(R, {
|
|
699
697
|
yAxisId: "right",
|
|
700
698
|
orientation: "right",
|
|
701
699
|
tickLine: !1,
|
|
702
700
|
axisLine: !1,
|
|
703
|
-
tickFormatter:
|
|
701
|
+
tickFormatter: N,
|
|
704
702
|
width: 48
|
|
705
703
|
}),
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
-
/* @__PURE__ */
|
|
708
|
-
content: /* @__PURE__ */
|
|
709
|
-
...
|
|
704
|
+
/* @__PURE__ */ x(q, { content: /* @__PURE__ */ x(W, {}) }),
|
|
705
|
+
/* @__PURE__ */ x(J, {
|
|
706
|
+
content: /* @__PURE__ */ x(G, {}),
|
|
707
|
+
...m && {
|
|
710
708
|
verticalAlign: "bottom",
|
|
711
709
|
wrapperStyle: {
|
|
712
710
|
fontSize: "11px",
|
|
@@ -715,8 +713,8 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
715
713
|
}
|
|
716
714
|
}),
|
|
717
715
|
i.map((e, t) => {
|
|
718
|
-
let r = X(n[e.dataKey]?.color ||
|
|
719
|
-
return i === "line" ? /* @__PURE__ */
|
|
716
|
+
let r = X(n[e.dataKey]?.color || Y), i = e.chartType || (t === 0 ? "bar" : "line"), a = i === "bar" ? "left" : "right", o = Z(e, i);
|
|
717
|
+
return i === "line" ? /* @__PURE__ */ x(O, {
|
|
720
718
|
yAxisId: a,
|
|
721
719
|
type: "monotone",
|
|
722
720
|
dataKey: e.dataKey,
|
|
@@ -724,8 +722,9 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
724
722
|
strokeWidth: 2,
|
|
725
723
|
dot: !1,
|
|
726
724
|
strokeOpacity: o?.strokeOpacity,
|
|
727
|
-
strokeDasharray: o?.strokeDasharray
|
|
728
|
-
|
|
725
|
+
strokeDasharray: o?.strokeDasharray,
|
|
726
|
+
...p
|
|
727
|
+
}, e.dataKey) : i === "area" ? /* @__PURE__ */ x(C, {
|
|
729
728
|
yAxisId: a,
|
|
730
729
|
type: "monotone",
|
|
731
730
|
dataKey: e.dataKey,
|
|
@@ -733,53 +732,90 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
733
732
|
stroke: r,
|
|
734
733
|
fillOpacity: o?.fillOpacity ?? .4,
|
|
735
734
|
strokeOpacity: o?.strokeOpacity,
|
|
736
|
-
strokeDasharray: o?.strokeDasharray
|
|
737
|
-
|
|
735
|
+
strokeDasharray: o?.strokeDasharray,
|
|
736
|
+
...p
|
|
737
|
+
}, e.dataKey) : /* @__PURE__ */ x(de, {
|
|
738
738
|
yAxisId: a,
|
|
739
739
|
dataKey: e.dataKey,
|
|
740
740
|
fill: r,
|
|
741
741
|
radius: 4,
|
|
742
|
-
fillOpacity: o?.fillOpacity
|
|
742
|
+
fillOpacity: o?.fillOpacity,
|
|
743
|
+
...p
|
|
743
744
|
}, e.dataKey);
|
|
744
745
|
})
|
|
745
746
|
]
|
|
746
747
|
})
|
|
747
748
|
});
|
|
748
|
-
let
|
|
749
|
-
|
|
749
|
+
let Ce = d === "horizontal-bar", z = D(), we = s ? Object.values(s).map((e) => X(String(e))) : [], Te = Array.from(new Set([
|
|
750
|
+
...z,
|
|
751
|
+
...we,
|
|
752
|
+
...i.map((e, t) => X(n[e.dataKey]?.color || z[t % z.length] || Y))
|
|
753
|
+
])), B = (e) => "g" + e.replace(/[^a-zA-Z0-9]/g, "");
|
|
754
|
+
return /* @__PURE__ */ x(U, {
|
|
750
755
|
config: n,
|
|
751
756
|
className: a,
|
|
752
|
-
children: /* @__PURE__ */
|
|
753
|
-
data:
|
|
754
|
-
layout:
|
|
755
|
-
...
|
|
757
|
+
children: /* @__PURE__ */ S(le, {
|
|
758
|
+
data: f,
|
|
759
|
+
layout: Ce ? "vertical" : "horizontal",
|
|
760
|
+
..._,
|
|
756
761
|
children: [
|
|
757
|
-
/* @__PURE__ */ S(
|
|
758
|
-
|
|
762
|
+
/* @__PURE__ */ x("defs", { children: Te.map((e) => /* @__PURE__ */ S(u.Fragment, { children: [/* @__PURE__ */ S("linearGradient", {
|
|
763
|
+
id: `bg-${B(e)}`,
|
|
764
|
+
x1: "0",
|
|
765
|
+
y1: "0",
|
|
766
|
+
x2: "0",
|
|
767
|
+
y2: "1",
|
|
768
|
+
children: [/* @__PURE__ */ x("stop", {
|
|
769
|
+
offset: "0%",
|
|
770
|
+
style: { stopColor: e },
|
|
771
|
+
stopOpacity: .95
|
|
772
|
+
}), /* @__PURE__ */ x("stop", {
|
|
773
|
+
offset: "100%",
|
|
774
|
+
style: { stopColor: e },
|
|
775
|
+
stopOpacity: .5
|
|
776
|
+
})]
|
|
777
|
+
}), /* @__PURE__ */ S("linearGradient", {
|
|
778
|
+
id: `ag-${B(e)}`,
|
|
779
|
+
x1: "0",
|
|
780
|
+
y1: "0",
|
|
781
|
+
x2: "0",
|
|
782
|
+
y2: "1",
|
|
783
|
+
children: [/* @__PURE__ */ x("stop", {
|
|
784
|
+
offset: "0%",
|
|
785
|
+
style: { stopColor: e },
|
|
786
|
+
stopOpacity: .5
|
|
787
|
+
}), /* @__PURE__ */ x("stop", {
|
|
788
|
+
offset: "95%",
|
|
789
|
+
style: { stopColor: e },
|
|
790
|
+
stopOpacity: .05
|
|
791
|
+
})]
|
|
792
|
+
})] }, B(e))) }),
|
|
793
|
+
/* @__PURE__ */ x(T, { vertical: !1 }),
|
|
794
|
+
Ce ? /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(L, {
|
|
759
795
|
type: "number",
|
|
760
796
|
tickLine: !1,
|
|
761
797
|
axisLine: !1,
|
|
762
|
-
tickFormatter:
|
|
763
|
-
}), /* @__PURE__ */
|
|
798
|
+
tickFormatter: N
|
|
799
|
+
}), /* @__PURE__ */ x(R, {
|
|
764
800
|
type: "category",
|
|
765
801
|
dataKey: r,
|
|
766
802
|
tickLine: !1,
|
|
767
803
|
axisLine: !1,
|
|
768
|
-
width: Math.min(140, Math.max(60, Math.max(...
|
|
769
|
-
tickFormatter:
|
|
770
|
-
})] }) : /* @__PURE__ */
|
|
804
|
+
width: Math.min(140, Math.max(60, Math.max(...f.map((e) => String(e[r] ?? "").length)) * 7)),
|
|
805
|
+
tickFormatter: v
|
|
806
|
+
})] }) : /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(L, {
|
|
771
807
|
dataKey: r,
|
|
772
|
-
...
|
|
773
|
-
}), /* @__PURE__ */
|
|
808
|
+
...Se
|
|
809
|
+
}), /* @__PURE__ */ x(R, {
|
|
774
810
|
tickLine: !1,
|
|
775
811
|
axisLine: !1,
|
|
776
|
-
tickFormatter:
|
|
812
|
+
tickFormatter: N,
|
|
777
813
|
width: 48
|
|
778
814
|
})] }),
|
|
779
|
-
/* @__PURE__ */
|
|
780
|
-
/* @__PURE__ */
|
|
781
|
-
content: /* @__PURE__ */
|
|
782
|
-
...
|
|
815
|
+
/* @__PURE__ */ x(q, { content: /* @__PURE__ */ x(W, {}) }),
|
|
816
|
+
/* @__PURE__ */ x(J, {
|
|
817
|
+
content: /* @__PURE__ */ x(G, {}),
|
|
818
|
+
...m && {
|
|
783
819
|
verticalAlign: "bottom",
|
|
784
820
|
wrapperStyle: {
|
|
785
821
|
fontSize: "11px",
|
|
@@ -788,39 +824,43 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
788
824
|
}
|
|
789
825
|
}),
|
|
790
826
|
i.map((e, t) => {
|
|
791
|
-
let
|
|
792
|
-
if (
|
|
793
|
-
let t = i.filter((e) => e.variant !== "comparison").length === 1 && !
|
|
794
|
-
return /* @__PURE__ */
|
|
827
|
+
let a = D(), o = e.variant === "comparison", s = o ? i.slice(0, t).find((e) => e.variant !== "comparison") || i[0] : e, c = o ? i.indexOf(s) : t, l = X(n[s.dataKey]?.color || a[c % a.length] || Y);
|
|
828
|
+
if (d === "bar" || d === "horizontal-bar") {
|
|
829
|
+
let t = i.filter((e) => e.variant !== "comparison").length === 1 && !o && i.length === 1 && f.length > 1, n = Z(e, "bar");
|
|
830
|
+
return /* @__PURE__ */ x(de, {
|
|
795
831
|
dataKey: e.dataKey,
|
|
796
|
-
fill:
|
|
832
|
+
fill: `url(#bg-${B(l)})`,
|
|
797
833
|
radius: 4,
|
|
798
834
|
fillOpacity: n?.fillOpacity,
|
|
799
|
-
|
|
835
|
+
...p,
|
|
836
|
+
children: t && f.map((e, t) => /* @__PURE__ */ x(E, { fill: `url(#bg-${B(X(ne(e?.[r], t, a)))})` }, `cell-${t}`))
|
|
800
837
|
}, e.dataKey);
|
|
801
838
|
}
|
|
802
|
-
if (
|
|
839
|
+
if (d === "line") {
|
|
803
840
|
let t = Z(e, "line");
|
|
804
|
-
return /* @__PURE__ */
|
|
841
|
+
return /* @__PURE__ */ x(O, {
|
|
805
842
|
type: "monotone",
|
|
806
843
|
dataKey: e.dataKey,
|
|
807
|
-
stroke:
|
|
844
|
+
stroke: l,
|
|
808
845
|
strokeWidth: 2,
|
|
809
846
|
dot: !1,
|
|
810
847
|
strokeOpacity: t?.strokeOpacity,
|
|
811
|
-
strokeDasharray: t?.strokeDasharray
|
|
848
|
+
strokeDasharray: t?.strokeDasharray,
|
|
849
|
+
...p
|
|
812
850
|
}, e.dataKey);
|
|
813
851
|
}
|
|
814
|
-
if (
|
|
852
|
+
if (d === "area") {
|
|
815
853
|
let t = Z(e, "area");
|
|
816
|
-
return /* @__PURE__ */
|
|
854
|
+
return /* @__PURE__ */ x(C, {
|
|
817
855
|
type: "monotone",
|
|
818
856
|
dataKey: e.dataKey,
|
|
819
|
-
fill:
|
|
820
|
-
stroke:
|
|
821
|
-
|
|
857
|
+
fill: `url(#ag-${B(l)})`,
|
|
858
|
+
stroke: l,
|
|
859
|
+
strokeWidth: 2,
|
|
860
|
+
fillOpacity: t?.fillOpacity ?? 1,
|
|
822
861
|
strokeOpacity: t?.strokeOpacity,
|
|
823
|
-
strokeDasharray: t?.strokeDasharray
|
|
862
|
+
strokeDasharray: t?.strokeDasharray,
|
|
863
|
+
...p
|
|
824
864
|
}, e.dataKey);
|
|
825
865
|
}
|
|
826
866
|
return null;
|
|
@@ -829,8 +869,8 @@ function We({ chartType: e = "bar", data: t = [], config: n = {}, xAxisKey: r =
|
|
|
829
869
|
})
|
|
830
870
|
});
|
|
831
871
|
}
|
|
832
|
-
var
|
|
833
|
-
|
|
872
|
+
var Y, qe, X, Z, Je = H((() => {
|
|
873
|
+
ze(), We(), Y = "hsl(var(--primary))", qe = {
|
|
834
874
|
slate: "#64748b",
|
|
835
875
|
gray: "#6b7280",
|
|
836
876
|
zinc: "#71717a",
|
|
@@ -853,14 +893,14 @@ var Ge, Ke, X, Z, qe = U((() => {
|
|
|
853
893
|
fuchsia: "#d946ef",
|
|
854
894
|
pink: "#ec4899",
|
|
855
895
|
rose: "#f43f5e"
|
|
856
|
-
}, X = (e) =>
|
|
896
|
+
}, X = (e) => qe[e] || e, Z = (e, t) => e?.variant === "comparison" ? {
|
|
857
897
|
strokeOpacity: typeof e.opacity == "number" ? e.opacity : t === "line" || t === "scatter" ? .5 : .6,
|
|
858
898
|
fillOpacity: typeof e.opacity == "number" ? e.opacity : t === "bar" ? .4 : t === "area" ? .2 : .5,
|
|
859
899
|
strokeDasharray: e.dashArray ?? (t === "line" || t === "area" ? "4 4" : void 0)
|
|
860
900
|
} : null;
|
|
861
|
-
})),
|
|
862
|
-
fallback: /* @__PURE__ */
|
|
863
|
-
children: /* @__PURE__ */
|
|
901
|
+
})), Ye = d.lazy(() => Promise.resolve().then(() => (Ne(), ke))), Xe = d.lazy(() => Promise.resolve().then(() => (Je(), Ge))), Ze = ({ schema: e }) => /* @__PURE__ */ x(f, {
|
|
902
|
+
fallback: /* @__PURE__ */ x(y, { className: "w-full h-48 sm:h-64 md:h-80 lg:h-[400px]" }),
|
|
903
|
+
children: /* @__PURE__ */ x(Ye, {
|
|
864
904
|
data: e.data,
|
|
865
905
|
dataKey: e.dataKey,
|
|
866
906
|
xAxisKey: e.xAxisKey,
|
|
@@ -869,7 +909,7 @@ var Ge, Ke, X, Z, qe = U((() => {
|
|
|
869
909
|
color: e.color
|
|
870
910
|
})
|
|
871
911
|
}), Q = ({ schema: e, onChartClick: t }) => {
|
|
872
|
-
let n =
|
|
912
|
+
let n = d.useMemo(() => {
|
|
873
913
|
let t = e.series, n = e.xAxisKey, r = e.config;
|
|
874
914
|
if (n || (e.index ? n = e.index : e.category && (n = e.category)), t || (e.categories ? t = e.categories.map((e) => ({ dataKey: e })) : e.value && (t = [{ dataKey: e.value }])), !r && t) {
|
|
875
915
|
let n = e.colors || [
|
|
@@ -893,15 +933,18 @@ var Ge, Ke, X, Z, qe = U((() => {
|
|
|
893
933
|
className: e.className
|
|
894
934
|
};
|
|
895
935
|
}, [e]);
|
|
896
|
-
return /* @__PURE__ */
|
|
897
|
-
fallback: /* @__PURE__ */
|
|
898
|
-
children: /* @__PURE__ */
|
|
936
|
+
return /* @__PURE__ */ x(f, {
|
|
937
|
+
fallback: /* @__PURE__ */ x(y, { className: "w-full h-48 sm:h-64 md:h-80 lg:h-[400px]" }),
|
|
938
|
+
children: /* @__PURE__ */ x(Xe, {
|
|
899
939
|
chartType: n.chartType,
|
|
900
940
|
data: n.data,
|
|
901
941
|
config: n.config,
|
|
902
942
|
xAxisKey: n.xAxisKey,
|
|
903
943
|
series: n.series,
|
|
904
944
|
className: n.className,
|
|
945
|
+
colors: Array.isArray(e.colors) ? e.colors : void 0,
|
|
946
|
+
categoryColors: e.categoryColors,
|
|
947
|
+
isAnimationActive: e.isAnimationActive,
|
|
905
948
|
onChartClick: t
|
|
906
949
|
})
|
|
907
950
|
});
|
|
@@ -911,7 +954,7 @@ var Ge, Ke, X, Z, qe = U((() => {
|
|
|
911
954
|
function $(e) {
|
|
912
955
|
return e.replace(/[_-]/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
913
956
|
}
|
|
914
|
-
function
|
|
957
|
+
function Qe(e, t) {
|
|
915
958
|
let { field: n, function: r, groupBy: i } = t, a = {};
|
|
916
959
|
for (let t of e) {
|
|
917
960
|
let e = String(t[i] ?? "Unknown");
|
|
@@ -942,9 +985,9 @@ function Ze(e, t) {
|
|
|
942
985
|
};
|
|
943
986
|
});
|
|
944
987
|
}
|
|
945
|
-
async function
|
|
988
|
+
async function $e(e, t, n, r, i) {
|
|
946
989
|
if (!e.length || !t) return e;
|
|
947
|
-
let o =
|
|
990
|
+
let o = i || ((e, t) => t), s = `__raw_${t}`, c = n?.fields?.[t];
|
|
948
991
|
if (!c) {
|
|
949
992
|
let n = /^\d{4}-\d{2}-\d{2}/;
|
|
950
993
|
return e.map((e) => {
|
|
@@ -984,16 +1027,16 @@ async function Qe(e, t, n, r, a) {
|
|
|
984
1027
|
...e,
|
|
985
1028
|
[s]: e[t]
|
|
986
1029
|
}));
|
|
987
|
-
let
|
|
988
|
-
if (
|
|
1030
|
+
let i = [...new Set(e.map((e) => e[t]).filter((e) => e != null))];
|
|
1031
|
+
if (i.length === 0) return e.map((e) => ({
|
|
989
1032
|
...e,
|
|
990
1033
|
[s]: e[t]
|
|
991
1034
|
}));
|
|
992
1035
|
let o = c.id_field || "id";
|
|
993
1036
|
try {
|
|
994
|
-
let l =
|
|
995
|
-
$filter: { [o]: { $in:
|
|
996
|
-
$top:
|
|
1037
|
+
let l = a(await r.find(n, {
|
|
1038
|
+
$filter: { [o]: { $in: i } },
|
|
1039
|
+
$top: i.length
|
|
997
1040
|
})), u = c.reference_field || c.display_field || "name", d = {};
|
|
998
1041
|
for (let e of l) {
|
|
999
1042
|
let t = String(e[o] ?? e.id ?? e._id ?? ""), n = e[u] || e.name || e.label || e.title || t;
|
|
@@ -1028,74 +1071,107 @@ async function Qe(e, t, n, r, a) {
|
|
|
1028
1071
|
};
|
|
1029
1072
|
});
|
|
1030
1073
|
}
|
|
1031
|
-
var
|
|
1032
|
-
let { schema:
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
}, [
|
|
1036
|
-
let [
|
|
1037
|
-
d:
|
|
1038
|
-
dim:
|
|
1039
|
-
val:
|
|
1074
|
+
var et = (e) => {
|
|
1075
|
+
let { schema: u } = e, d = e.onSegmentClick, f = m(Ce), y = e.dataSource || f?.dataSource, b = z(u.bind), { fieldOptionLabel: C } = Ee(), ue = ee(C);
|
|
1076
|
+
h(() => {
|
|
1077
|
+
ue.current = C;
|
|
1078
|
+
}, [C]);
|
|
1079
|
+
let [de, w] = _([]), [T, E] = _(() => !(Array.isArray(u.data) && u.data.length > 0) && (!!u.objectName || !!u.dataset)), [fe, pe] = _(null), [me, D] = _(null), [O, k] = _(null), { openRecordList: he } = we(), A = De(), j = g(() => u.aggregate ? JSON.stringify(u.aggregate) : "", [u.aggregate]), ge = g(() => u.filter ? JSON.stringify(u.filter) : "", [u.filter]), _e = g(() => u.compareTo ? JSON.stringify(u.compareTo) : "", [u.compareTo]), M = g(() => u.dataset ? JSON.stringify({
|
|
1080
|
+
d: u.dataset,
|
|
1081
|
+
dim: u.dimensions ?? [],
|
|
1082
|
+
val: u.values ?? []
|
|
1040
1083
|
}) : "", [
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
]),
|
|
1045
|
-
|
|
1046
|
-
|
|
1084
|
+
u.dataset,
|
|
1085
|
+
u.dimensions,
|
|
1086
|
+
u.values
|
|
1087
|
+
]), ve = (e) => e !== "pie" && e !== "donut" && e !== "funnel";
|
|
1088
|
+
h(() => {
|
|
1089
|
+
let e = !1;
|
|
1090
|
+
return (async () => {
|
|
1091
|
+
try {
|
|
1092
|
+
let t = {
|
|
1093
|
+
headers: { accept: "application/json" },
|
|
1094
|
+
credentials: "include"
|
|
1095
|
+
}, r = u.objectName, i, a = u.aggregate?.groupBy;
|
|
1096
|
+
if (r) i = a && typeof a == "object" && !Array.isArray(a) ? a.field : typeof a == "string" ? a : u.xAxisKey;
|
|
1097
|
+
else if (u.dataset) {
|
|
1098
|
+
let e = Array.isArray(u.dimensions) && u.dimensions.length ? u.dimensions[0] : void 0, n = await (await fetch(`/api/v1/meta/dataset/${encodeURIComponent(u.dataset)}`, t)).json().catch(() => null), a = n?.item ?? n?.data ?? n;
|
|
1099
|
+
r = a?.object, i = ((a?.dimensions || []).find((t) => t?.name === e) ?? (a?.dimensions || [])[0])?.field ?? e;
|
|
1100
|
+
}
|
|
1101
|
+
if (!r || !i) {
|
|
1102
|
+
e || k(null);
|
|
1103
|
+
return;
|
|
1104
|
+
}
|
|
1105
|
+
let o = await (await fetch(`/api/v1/meta/object/${encodeURIComponent(r)}`, t)).json().catch(() => null), s = n((o?.item ?? o?.data ?? o)?.fields?.[i]?.options);
|
|
1106
|
+
e || k(s);
|
|
1107
|
+
} catch {
|
|
1108
|
+
e || k(null);
|
|
1109
|
+
}
|
|
1110
|
+
})(), () => {
|
|
1111
|
+
e = !0;
|
|
1112
|
+
};
|
|
1113
|
+
}, [
|
|
1114
|
+
u.objectName,
|
|
1115
|
+
u.dataset,
|
|
1116
|
+
M,
|
|
1117
|
+
j,
|
|
1118
|
+
u.xAxisKey
|
|
1119
|
+
]);
|
|
1120
|
+
let N = p(async (e, t) => {
|
|
1121
|
+
if (u.aggregate && typeof e.aggregate == "function") {
|
|
1122
|
+
let n = u.aggregate.groupBy;
|
|
1047
1123
|
if (n && typeof n == "object" && !Array.isArray(n)) {
|
|
1048
|
-
let r =
|
|
1124
|
+
let r = u.aggregate.field, i = u.aggregate.function, a = {
|
|
1049
1125
|
function: i,
|
|
1050
1126
|
alias: r || i
|
|
1051
1127
|
};
|
|
1052
1128
|
i !== "count" && r && (a.field = r);
|
|
1053
|
-
let o = await e.aggregate(
|
|
1129
|
+
let o = await e.aggregate(u.objectName, {
|
|
1054
1130
|
groupBy: [n],
|
|
1055
1131
|
aggregations: [a],
|
|
1056
1132
|
where: t
|
|
1057
1133
|
});
|
|
1058
1134
|
return Array.isArray(o) ? o : [];
|
|
1059
1135
|
}
|
|
1060
|
-
let r = await e.aggregate(
|
|
1061
|
-
field:
|
|
1062
|
-
function:
|
|
1136
|
+
let r = await e.aggregate(u.objectName, {
|
|
1137
|
+
field: u.aggregate.field,
|
|
1138
|
+
function: u.aggregate.function,
|
|
1063
1139
|
groupBy: n,
|
|
1064
1140
|
filter: t
|
|
1065
1141
|
});
|
|
1066
1142
|
return Array.isArray(r) ? r : [];
|
|
1067
1143
|
}
|
|
1068
1144
|
if (typeof e.find == "function") {
|
|
1069
|
-
let n =
|
|
1070
|
-
return
|
|
1145
|
+
let n = a(await e.find(u.objectName, { $filter: t }));
|
|
1146
|
+
return u.aggregate && n.length > 0 && (n = Qe(n, u.aggregate)), n;
|
|
1071
1147
|
}
|
|
1072
1148
|
return [];
|
|
1073
|
-
}, [
|
|
1074
|
-
if (!e || !
|
|
1075
|
-
t.current &&
|
|
1149
|
+
}, [u.objectName, j]), ye = p(async (e, t) => {
|
|
1150
|
+
if (!e || !u.objectName && !u.dataset) {
|
|
1151
|
+
t.current && E(!1);
|
|
1076
1152
|
return;
|
|
1077
1153
|
}
|
|
1078
|
-
t.current && (
|
|
1154
|
+
t.current && (E(!0), pe(null));
|
|
1079
1155
|
try {
|
|
1080
|
-
if (
|
|
1081
|
-
let n =
|
|
1082
|
-
dimensions: Array.isArray(
|
|
1083
|
-
measures: Array.isArray(
|
|
1156
|
+
if (u.dataset && typeof e.queryDataset == "function") {
|
|
1157
|
+
let n = s(u.filter), r = await e.queryDataset(u.dataset, {
|
|
1158
|
+
dimensions: Array.isArray(u.dimensions) ? u.dimensions : [],
|
|
1159
|
+
measures: Array.isArray(u.values) ? u.values : [],
|
|
1084
1160
|
...n ? { runtimeFilter: n } : {}
|
|
1085
1161
|
});
|
|
1086
|
-
t.current &&
|
|
1162
|
+
t.current && w(Array.isArray(r?.rows) ? r.rows : []);
|
|
1087
1163
|
return;
|
|
1088
1164
|
}
|
|
1089
|
-
let n =
|
|
1090
|
-
if (i &&
|
|
1091
|
-
let e =
|
|
1165
|
+
let n = s(u.filter), r = u.compareTo, i = !!r && ve(u.chartType), a = i ? l(u.filter, r) : null, [o, c] = await Promise.all([N(e, n), a ? N(e, a) : Promise.resolve([])]), d = o, f = u.aggregate?.groupBy, p = f && typeof f == "object" && !Array.isArray(f) ? f.alias || f.field : f || u.xAxisKey;
|
|
1166
|
+
if (i && c.length > 0 && u.aggregate) {
|
|
1167
|
+
let e = u.aggregate.field, t = u.aggregate.function, n = (n) => {
|
|
1092
1168
|
if (n == null) return null;
|
|
1093
1169
|
let r = `${e}_${t}`;
|
|
1094
1170
|
return r in n ? Number(n[r]) : t === "count" && `${e}_count` in n ? Number(n[`${e}_count`]) : e in n ? Number(n[e]) : "value" in n ? Number(n.value) : "count" in n ? Number(n.count) : null;
|
|
1095
1171
|
}, r = `${e}__comparison`, i = p;
|
|
1096
|
-
if (i && d.some((e) => e[i] != null) &&
|
|
1172
|
+
if (i && d.some((e) => e[i] != null) && c.some((e) => e[i] != null)) {
|
|
1097
1173
|
let e = /* @__PURE__ */ new Map();
|
|
1098
|
-
for (let t of
|
|
1174
|
+
for (let t of c) {
|
|
1099
1175
|
let r = String(t[i] ?? "");
|
|
1100
1176
|
e.set(r, n(t));
|
|
1101
1177
|
}
|
|
@@ -1107,7 +1183,7 @@ var $e = (e) => {
|
|
|
1107
1183
|
};
|
|
1108
1184
|
});
|
|
1109
1185
|
let t = new Set(d.map((e) => String(e[i] ?? "")));
|
|
1110
|
-
for (let e of
|
|
1186
|
+
for (let e of c) {
|
|
1111
1187
|
let a = String(e[i] ?? "");
|
|
1112
1188
|
t.has(a) || d.push({
|
|
1113
1189
|
[i]: a,
|
|
@@ -1115,9 +1191,9 @@ var $e = (e) => {
|
|
|
1115
1191
|
});
|
|
1116
1192
|
}
|
|
1117
1193
|
} else {
|
|
1118
|
-
let e = Math.max(d.length,
|
|
1194
|
+
let e = Math.max(d.length, c.length), t = [];
|
|
1119
1195
|
for (let i = 0; i < e; i++) {
|
|
1120
|
-
let e = d[i] || {}, a =
|
|
1196
|
+
let e = d[i] || {}, a = c[i];
|
|
1121
1197
|
t.push(a ? {
|
|
1122
1198
|
...e,
|
|
1123
1199
|
[r]: n(a)
|
|
@@ -1127,139 +1203,146 @@ var $e = (e) => {
|
|
|
1127
1203
|
}
|
|
1128
1204
|
}
|
|
1129
1205
|
if (p && typeof e.getObjectSchema == "function") try {
|
|
1130
|
-
let t = await e.getObjectSchema(
|
|
1131
|
-
d = await
|
|
1206
|
+
let t = await e.getObjectSchema(u.objectName);
|
|
1207
|
+
d = await $e(d, p, t, e, (e, t) => ue.current(u.objectName, p, e, t));
|
|
1132
1208
|
} catch {}
|
|
1133
|
-
t.current &&
|
|
1209
|
+
t.current && w(d);
|
|
1134
1210
|
} catch (e) {
|
|
1135
|
-
console.error("[ObjectChart] Fetch error:", e), t.current &&
|
|
1211
|
+
console.error("[ObjectChart] Fetch error:", e), t.current && pe(e instanceof Error ? e.message : "Failed to load chart data");
|
|
1136
1212
|
} finally {
|
|
1137
|
-
t.current &&
|
|
1213
|
+
t.current && E(!1);
|
|
1138
1214
|
}
|
|
1139
1215
|
}, [
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
A,
|
|
1216
|
+
u.objectName,
|
|
1217
|
+
M,
|
|
1143
1218
|
j,
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1219
|
+
ge,
|
|
1220
|
+
_e,
|
|
1221
|
+
u.xAxisKey,
|
|
1222
|
+
u.chartType,
|
|
1223
|
+
N
|
|
1148
1224
|
]);
|
|
1149
|
-
|
|
1225
|
+
h(() => {
|
|
1150
1226
|
let e = { current: !0 };
|
|
1151
|
-
return (
|
|
1227
|
+
return (u.objectName || u.dataset) && !b && !u.data ? ye(y, e) : e.current && E(!1), () => {
|
|
1152
1228
|
e.current = !1;
|
|
1153
1229
|
};
|
|
1154
1230
|
}, [
|
|
1155
|
-
|
|
1156
|
-
|
|
1231
|
+
u.objectName,
|
|
1232
|
+
M,
|
|
1233
|
+
y,
|
|
1157
1234
|
b,
|
|
1158
|
-
|
|
1159
|
-
|
|
1235
|
+
u.data,
|
|
1236
|
+
ge,
|
|
1160
1237
|
j,
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
N
|
|
1238
|
+
_e,
|
|
1239
|
+
ye
|
|
1164
1240
|
]);
|
|
1165
|
-
let
|
|
1166
|
-
if (!
|
|
1167
|
-
let e = /* @__PURE__ */ new Map(), t = `__raw_${
|
|
1168
|
-
for (let n of
|
|
1169
|
-
let r = n?.[
|
|
1241
|
+
let be = b || u.data || de, P = Array.isArray(be) ? be : [], F = u.drillDown, I = u.aggregate?.groupBy || u.xAxisKey, L = g(() => {
|
|
1242
|
+
if (!I) return /* @__PURE__ */ new Map();
|
|
1243
|
+
let e = /* @__PURE__ */ new Map(), t = `__raw_${I}`;
|
|
1244
|
+
for (let n of P) {
|
|
1245
|
+
let r = n?.[I];
|
|
1170
1246
|
if (r == null) continue;
|
|
1171
1247
|
let i = t in (n || {}) ? n[t] : r;
|
|
1172
1248
|
e.set(String(r), i);
|
|
1173
1249
|
}
|
|
1174
1250
|
return e;
|
|
1175
|
-
}, [
|
|
1176
|
-
let e = Array.isArray(
|
|
1177
|
-
if (!
|
|
1178
|
-
let t = e || [{ dataKey:
|
|
1251
|
+
}, [P, I]), R = u.compareTo, xe = !!R && ve(u.chartType) && !!u.aggregate && P.some((e) => e[`${u.aggregate.field}__comparison`] != null), V = g(() => {
|
|
1252
|
+
let e = Array.isArray(u.series) ? u.series : null;
|
|
1253
|
+
if (!xe) return e;
|
|
1254
|
+
let t = e || [{ dataKey: u.aggregate.field }], n = {
|
|
1179
1255
|
vsLastWeek: "Previous week",
|
|
1180
1256
|
vsLastMonth: "Previous month",
|
|
1181
1257
|
vsLastQuarter: "Previous quarter",
|
|
1182
1258
|
vsLastYear: "Previous year",
|
|
1183
1259
|
vsYesterday: "Yesterday",
|
|
1184
1260
|
vsPreviousPeriod: "Previous period"
|
|
1185
|
-
}[
|
|
1261
|
+
}[r(R, u.filter)] || "Previous period";
|
|
1186
1262
|
return [...t.map((e) => ({
|
|
1187
1263
|
...e,
|
|
1188
1264
|
variant: e.variant || "current"
|
|
1189
1265
|
})), {
|
|
1190
|
-
dataKey: `${
|
|
1191
|
-
label:
|
|
1266
|
+
dataKey: `${u.aggregate.field}__comparison`,
|
|
1267
|
+
label: n,
|
|
1192
1268
|
variant: "comparison"
|
|
1193
1269
|
}];
|
|
1194
1270
|
}, [
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
]), H =
|
|
1201
|
-
...
|
|
1271
|
+
xe,
|
|
1272
|
+
u.series,
|
|
1273
|
+
u.aggregate,
|
|
1274
|
+
u.filter,
|
|
1275
|
+
R
|
|
1276
|
+
]), H = u.dataset ? t(P, u.dimensions, u.values) : null, Oe = H ? {
|
|
1277
|
+
...u,
|
|
1202
1278
|
data: H.data,
|
|
1203
1279
|
xAxisKey: H.xAxisKey,
|
|
1204
1280
|
series: H.series
|
|
1205
1281
|
} : {
|
|
1206
|
-
...
|
|
1207
|
-
data:
|
|
1282
|
+
...u,
|
|
1283
|
+
data: P,
|
|
1208
1284
|
...V ? { series: V } : {}
|
|
1285
|
+
}, ke = u.colors && !Array.isArray(u.colors) && typeof u.colors == "object" ? u.colors : null, Ae = Array.isArray(u.colors) ? u.colors : void 0, je = O || ke ? {
|
|
1286
|
+
...O || {},
|
|
1287
|
+
...ke || {}
|
|
1288
|
+
} : void 0, Me = {
|
|
1289
|
+
...Oe,
|
|
1290
|
+
colors: Ae,
|
|
1291
|
+
...je ? { categoryColors: je } : {}
|
|
1209
1292
|
};
|
|
1210
|
-
if (
|
|
1211
|
-
className: "flex items-center justify-center text-muted-foreground text-sm p-4 " + (
|
|
1293
|
+
if (T && P.length === 0) return /* @__PURE__ */ x("div", {
|
|
1294
|
+
className: "flex items-center justify-center text-muted-foreground text-sm p-4 " + (u.className || ""),
|
|
1212
1295
|
"data-testid": "chart-loading",
|
|
1213
1296
|
children: "Loading chart data…"
|
|
1214
1297
|
});
|
|
1215
|
-
if (
|
|
1216
|
-
className: "flex flex-col items-center justify-center gap-2 p-4 " + (
|
|
1298
|
+
if (fe) return /* @__PURE__ */ S("div", {
|
|
1299
|
+
className: "flex flex-col items-center justify-center gap-2 p-4 " + (u.className || ""),
|
|
1217
1300
|
"data-testid": "chart-error",
|
|
1218
1301
|
role: "alert",
|
|
1219
1302
|
children: [
|
|
1220
|
-
/* @__PURE__ */
|
|
1221
|
-
/* @__PURE__ */
|
|
1303
|
+
/* @__PURE__ */ x(Te, { className: "h-6 w-6 text-destructive opacity-60" }),
|
|
1304
|
+
/* @__PURE__ */ x("p", {
|
|
1222
1305
|
className: "text-xs text-destructive font-medium",
|
|
1223
1306
|
children: "Failed to load chart data"
|
|
1224
1307
|
}),
|
|
1225
|
-
/* @__PURE__ */
|
|
1308
|
+
/* @__PURE__ */ x("p", {
|
|
1226
1309
|
className: "text-xs text-muted-foreground max-w-xs text-center",
|
|
1227
|
-
children:
|
|
1310
|
+
children: fe
|
|
1228
1311
|
})
|
|
1229
1312
|
]
|
|
1230
1313
|
});
|
|
1231
|
-
if (!
|
|
1232
|
-
className: "flex items-center justify-center text-muted-foreground text-sm p-4 " + (
|
|
1314
|
+
if (!y && u.objectName && P.length === 0) return /* @__PURE__ */ S("div", {
|
|
1315
|
+
className: "flex items-center justify-center text-muted-foreground text-sm p-4 " + (u.className || ""),
|
|
1233
1316
|
"data-testid": "chart-no-datasource",
|
|
1234
1317
|
children: [
|
|
1235
1318
|
"No data source available for “",
|
|
1236
|
-
|
|
1319
|
+
u.objectName,
|
|
1237
1320
|
"”"
|
|
1238
1321
|
]
|
|
1239
1322
|
});
|
|
1240
|
-
let
|
|
1241
|
-
let t = e.category, n = t != null &&
|
|
1242
|
-
|
|
1323
|
+
let Ne = o(F) ? (e) => {
|
|
1324
|
+
let t = e.category, n = t != null && L.has(String(t)) ? L.get(String(t)) : t;
|
|
1325
|
+
D({
|
|
1243
1326
|
...e,
|
|
1244
1327
|
category: n,
|
|
1245
1328
|
categoryLabel: t,
|
|
1246
1329
|
scope: "cell"
|
|
1247
1330
|
});
|
|
1248
|
-
} : void 0,
|
|
1249
|
-
let e =
|
|
1250
|
-
...
|
|
1331
|
+
} : void 0, Pe = d ?? Ne, U = !d && me && u.objectName ? (() => {
|
|
1332
|
+
let e = i(F, me, { groupByField: I }), t = {
|
|
1333
|
+
...u.filter || {},
|
|
1251
1334
|
...e
|
|
1252
|
-
}, n =
|
|
1335
|
+
}, n = c(F, me, u.title || "Details"), r = F?.target ?? "drawer", a = /* @__PURE__ */ x("div", {
|
|
1253
1336
|
className: "overflow-auto",
|
|
1254
1337
|
"data-testid": "chart-drill-body",
|
|
1255
|
-
children: /* @__PURE__ */
|
|
1338
|
+
children: /* @__PURE__ */ x(Se, {
|
|
1256
1339
|
schema: {
|
|
1257
1340
|
type: "object-data-table",
|
|
1258
|
-
objectName:
|
|
1341
|
+
objectName: u.objectName,
|
|
1259
1342
|
filter: t,
|
|
1260
1343
|
pagination: !0,
|
|
1261
|
-
pageSize:
|
|
1262
|
-
columns:
|
|
1344
|
+
pageSize: F?.maxRows,
|
|
1345
|
+
columns: F?.columns?.map((e) => ({
|
|
1263
1346
|
accessorKey: e,
|
|
1264
1347
|
header: e
|
|
1265
1348
|
})),
|
|
@@ -1269,58 +1352,58 @@ var $e = (e) => {
|
|
|
1269
1352
|
target: "dialog"
|
|
1270
1353
|
}
|
|
1271
1354
|
},
|
|
1272
|
-
dataSource:
|
|
1355
|
+
dataSource: y
|
|
1273
1356
|
})
|
|
1274
|
-
}), o =
|
|
1357
|
+
}), o = he && u.objectName ? /* @__PURE__ */ S(te, {
|
|
1275
1358
|
type: "button",
|
|
1276
1359
|
variant: "ghost",
|
|
1277
1360
|
size: "sm",
|
|
1278
1361
|
"data-testid": "drill-open-in-list",
|
|
1279
1362
|
onClick: () => {
|
|
1280
|
-
|
|
1363
|
+
he(u.objectName, t), D(null);
|
|
1281
1364
|
},
|
|
1282
|
-
children: [
|
|
1365
|
+
children: [A("dashboard.openInList", "Open in list"), /* @__PURE__ */ x(B, { className: "ml-1 h-3.5 w-3.5" })]
|
|
1283
1366
|
}) : null;
|
|
1284
|
-
return
|
|
1367
|
+
return r === "dialog" ? /* @__PURE__ */ x(ne, {
|
|
1285
1368
|
open: !0,
|
|
1286
|
-
onOpenChange: (e) => !e &&
|
|
1287
|
-
children: /* @__PURE__ */
|
|
1369
|
+
onOpenChange: (e) => !e && D(null),
|
|
1370
|
+
children: /* @__PURE__ */ S(re, {
|
|
1288
1371
|
className: "max-w-4xl",
|
|
1289
|
-
children: [/* @__PURE__ */
|
|
1372
|
+
children: [/* @__PURE__ */ S(ie, {
|
|
1290
1373
|
className: "flex-row items-center justify-between gap-4 pr-8",
|
|
1291
|
-
children: [/* @__PURE__ */
|
|
1374
|
+
children: [/* @__PURE__ */ x(ae, { children: n }), o]
|
|
1292
1375
|
}), a]
|
|
1293
1376
|
})
|
|
1294
|
-
}) : /* @__PURE__ */
|
|
1377
|
+
}) : /* @__PURE__ */ x(se, {
|
|
1295
1378
|
open: !0,
|
|
1296
|
-
onOpenChange: (e) => !e &&
|
|
1297
|
-
children: /* @__PURE__ */
|
|
1379
|
+
onOpenChange: (e) => !e && D(null),
|
|
1380
|
+
children: /* @__PURE__ */ S(ce, {
|
|
1298
1381
|
side: "right",
|
|
1299
1382
|
className: "w-full sm:max-w-2xl md:max-w-3xl lg:max-w-4xl flex flex-col",
|
|
1300
|
-
children: [/* @__PURE__ */
|
|
1383
|
+
children: [/* @__PURE__ */ S(le, {
|
|
1301
1384
|
className: "flex-row items-center justify-between gap-4 pr-8",
|
|
1302
|
-
children: [/* @__PURE__ */
|
|
1303
|
-
}), /* @__PURE__ */
|
|
1385
|
+
children: [/* @__PURE__ */ x(v, { children: n }), o]
|
|
1386
|
+
}), /* @__PURE__ */ x("div", {
|
|
1304
1387
|
className: "flex-1 overflow-hidden mt-2",
|
|
1305
1388
|
children: a
|
|
1306
1389
|
})]
|
|
1307
1390
|
})
|
|
1308
1391
|
});
|
|
1309
1392
|
})() : null;
|
|
1310
|
-
return /* @__PURE__ */
|
|
1393
|
+
return /* @__PURE__ */ S("div", {
|
|
1311
1394
|
className: "relative",
|
|
1312
1395
|
children: [
|
|
1313
|
-
/* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1396
|
+
/* @__PURE__ */ x(oe, { active: T && P.length > 0 }),
|
|
1397
|
+
/* @__PURE__ */ x(Q, {
|
|
1315
1398
|
...e,
|
|
1316
|
-
schema:
|
|
1317
|
-
onChartClick:
|
|
1399
|
+
schema: Me,
|
|
1400
|
+
onChartClick: Pe
|
|
1318
1401
|
}),
|
|
1319
|
-
|
|
1402
|
+
U
|
|
1320
1403
|
]
|
|
1321
1404
|
});
|
|
1322
1405
|
};
|
|
1323
|
-
e.register("object-chart",
|
|
1406
|
+
e.register("object-chart", et, {
|
|
1324
1407
|
namespace: "plugin-charts",
|
|
1325
1408
|
label: "Object Chart",
|
|
1326
1409
|
category: "view",
|
|
@@ -1352,11 +1435,11 @@ e.register("object-chart", $e, {
|
|
|
1352
1435
|
});
|
|
1353
1436
|
//#endregion
|
|
1354
1437
|
//#region src/index.tsx
|
|
1355
|
-
var
|
|
1356
|
-
"bar-chart":
|
|
1438
|
+
var tt = {
|
|
1439
|
+
"bar-chart": Ze,
|
|
1357
1440
|
chart: Q
|
|
1358
1441
|
};
|
|
1359
|
-
e.register("bar-chart",
|
|
1442
|
+
e.register("bar-chart", Ze, {
|
|
1360
1443
|
namespace: "plugin-charts",
|
|
1361
1444
|
label: "Bar Chart",
|
|
1362
1445
|
category: "plugin",
|
|
@@ -1420,7 +1503,7 @@ e.register("bar-chart", Xe, {
|
|
|
1420
1503
|
height: 400,
|
|
1421
1504
|
color: "#8884d8"
|
|
1422
1505
|
}
|
|
1423
|
-
}), e.register("chart",
|
|
1506
|
+
}), e.register("chart", et, {
|
|
1424
1507
|
namespace: "view",
|
|
1425
1508
|
category: "view",
|
|
1426
1509
|
label: "Chart",
|
|
@@ -1586,4 +1669,4 @@ e.register("bar-chart", Xe, {
|
|
|
1586
1669
|
defaultProps: { chartType: "scatter" }
|
|
1587
1670
|
});
|
|
1588
1671
|
//#endregion
|
|
1589
|
-
export {
|
|
1672
|
+
export { Ze as ChartBarRenderer, Q as ChartRenderer, et as ObjectChart, tt as chartComponents };
|