drizzle-cube 0.1.56 → 0.1.58
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/client/charts.js +1 -1
- package/dist/client/chunks/{charts-0DGM88kv.js → charts-P7xq59Tl.js} +865 -813
- package/dist/client/chunks/charts-P7xq59Tl.js.map +1 -0
- package/dist/client/chunks/{components-B3Y4OD_S.js → components-B00q0yJH.js} +7067 -6900
- package/dist/client/chunks/components-B00q0yJH.js.map +1 -0
- package/dist/client/chunks/{providers-aaWIe5KD.js → providers-DONuYrGH.js} +65 -61
- package/dist/client/chunks/providers-DONuYrGH.js.map +1 -0
- package/dist/client/client/BatchCoordinator.d.ts +7 -4
- package/dist/client/components.js +2 -2
- package/dist/client/hooks.js +2 -2
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +27 -25
- package/dist/client/providers/CubeProvider.d.ts +2 -0
- package/dist/client/providers/ScrollContainerContext.d.ts +19 -0
- package/dist/client/providers.js +1 -1
- package/dist/client/styles.css +1 -1
- package/dist/client-bundle-stats.html +1 -1
- package/package.json +2 -1
- package/dist/client/chunks/charts-0DGM88kv.js.map +0 -1
- package/dist/client/chunks/components-B3Y4OD_S.js.map +0 -1
- package/dist/client/chunks/providers-aaWIe5KD.js.map +0 -1
|
@@ -1,32 +1,84 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { ResponsiveContainer as He, Tooltip as lt, ComposedChart as ot, CartesianGrid as ve, XAxis as be, YAxis as Ne, Legend as Y, Bar as
|
|
4
|
-
import { u as X } from "./providers-
|
|
1
|
+
import { jsx as s, jsxs as b, Fragment as Ee } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as bt, useState as H, useLayoutEffect as Nt, useMemo as wt } from "react";
|
|
3
|
+
import { ResponsiveContainer as He, Tooltip as lt, ComposedChart as ot, CartesianGrid as ve, XAxis as be, YAxis as Ne, Legend as Y, Bar as At, Cell as je, Line as W, LineChart as St, Area as kt, PieChart as Mt, Pie as $t, ScatterChart as Lt, Scatter as Ge, RadarChart as Tt, PolarGrid as Ft, PolarAngleAxis as Et, PolarRadiusAxis as jt, Radar as zt, RadialBarChart as Dt, RadialBar as Rt, Treemap as Vt } from "recharts";
|
|
4
|
+
import { u as X } from "./providers-DONuYrGH.js";
|
|
5
5
|
function B({ children: e, height: t = "100%" }) {
|
|
6
|
+
const n = bt(null), [r, i] = H(!1), [a, l] = H({ width: 0, height: 0 });
|
|
7
|
+
Nt(() => {
|
|
8
|
+
let o = !0, d = null;
|
|
9
|
+
const c = () => {
|
|
10
|
+
if (!o || !n.current) return;
|
|
11
|
+
const u = n.current.getBoundingClientRect(), f = Math.max(n.current.clientWidth, u.width), m = Math.max(n.current.clientHeight, u.height);
|
|
12
|
+
f > 0 && m > 0 && (l({ width: f, height: m }), i(!0));
|
|
13
|
+
};
|
|
14
|
+
return d = new ResizeObserver((u) => {
|
|
15
|
+
for (const f of u) {
|
|
16
|
+
const { width: m, height: p } = f.contentRect;
|
|
17
|
+
m > 0 && p > 0 && (l({ width: m, height: p }), r || i(!0));
|
|
18
|
+
}
|
|
19
|
+
}), n.current && (d.observe(n.current), c()), () => {
|
|
20
|
+
o = !1, d?.disconnect();
|
|
21
|
+
};
|
|
22
|
+
}, [r]);
|
|
6
23
|
try {
|
|
7
24
|
if (t === "100%")
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
|
|
25
|
+
return /* @__PURE__ */ s(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
ref: n,
|
|
29
|
+
className: "w-full h-full flex-1 flex flex-col relative",
|
|
30
|
+
style: { minHeight: "250px", minWidth: "100px", overflow: "hidden" },
|
|
31
|
+
children: r && a.width > 0 && a.height > 0 ? /* @__PURE__ */ s(
|
|
32
|
+
He,
|
|
33
|
+
{
|
|
34
|
+
width: a.width,
|
|
35
|
+
height: a.height - 16,
|
|
36
|
+
debounce: 100,
|
|
37
|
+
style: { marginTop: "16px" },
|
|
38
|
+
children: e
|
|
39
|
+
}
|
|
40
|
+
) : /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ s("div", { className: "animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500" }) })
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
const o = {
|
|
10
44
|
height: typeof t == "number" ? `${t}px` : t,
|
|
11
45
|
width: "100%",
|
|
12
|
-
minHeight: "200px"
|
|
46
|
+
minHeight: "200px",
|
|
47
|
+
minWidth: "100px"
|
|
13
48
|
};
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
49
|
+
return /* @__PURE__ */ s(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
ref: n,
|
|
53
|
+
className: "w-full flex flex-col relative",
|
|
54
|
+
style: { ...o, overflow: "hidden" },
|
|
55
|
+
children: r && a.width > 0 && a.height > 0 ? /* @__PURE__ */ s(
|
|
56
|
+
He,
|
|
57
|
+
{
|
|
58
|
+
width: a.width,
|
|
59
|
+
height: a.height - 16,
|
|
60
|
+
debounce: 100,
|
|
61
|
+
style: { marginTop: "16px" },
|
|
62
|
+
children: e
|
|
63
|
+
}
|
|
64
|
+
) : /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full h-full", children: /* @__PURE__ */ s("div", { className: "animate-spin rounded-full h-6 w-6 border-b-2 border-blue-500" }) })
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
} catch (o) {
|
|
16
68
|
return /* @__PURE__ */ b(
|
|
17
69
|
"div",
|
|
18
70
|
{
|
|
19
71
|
className: "flex flex-col items-center justify-center w-full h-full p-4 text-center border border-dashed rounded-lg",
|
|
20
72
|
style: { height: t, borderColor: "var(--dc-border)", backgroundColor: "var(--dc-surface)" },
|
|
21
73
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1 text-dc-text-muted", children: "Unable to display chart" }),
|
|
75
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: o instanceof Error ? o.message : "Failed to create responsive container" })
|
|
24
76
|
]
|
|
25
77
|
}
|
|
26
78
|
);
|
|
27
79
|
}
|
|
28
80
|
}
|
|
29
|
-
function
|
|
81
|
+
function ke(e) {
|
|
30
82
|
return e != null && !isNaN(Number(e));
|
|
31
83
|
}
|
|
32
84
|
function te(e) {
|
|
@@ -34,7 +86,7 @@ function te(e) {
|
|
|
34
86
|
const t = typeof e == "string" ? parseFloat(e) : Number(e);
|
|
35
87
|
return isNaN(t) ? null : t;
|
|
36
88
|
}
|
|
37
|
-
function
|
|
89
|
+
function q(e) {
|
|
38
90
|
if (e == null) return "No data";
|
|
39
91
|
const t = typeof e == "number" ? e : parseFloat(e);
|
|
40
92
|
return isNaN(t) ? String(e) : Number.isInteger(t) ? t.toLocaleString() : parseFloat(t.toFixed(2)).toLocaleString();
|
|
@@ -48,44 +100,44 @@ function R(e, t) {
|
|
|
48
100
|
if (n.match(/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}/)) {
|
|
49
101
|
let r = n;
|
|
50
102
|
n.includes(" ") && (r = n.replace(" ", "T").replace("+00", "Z").replace(/\+\d{2}:\d{2}$/, "Z")), !r.endsWith("Z") && !r.includes("+") && (r = r + "Z");
|
|
51
|
-
const
|
|
52
|
-
if (isNaN(
|
|
103
|
+
const i = new Date(r);
|
|
104
|
+
if (isNaN(i.getTime()))
|
|
53
105
|
return n;
|
|
54
|
-
const
|
|
106
|
+
const a = i.getUTCFullYear(), l = String(i.getUTCMonth() + 1).padStart(2, "0"), o = String(i.getUTCDate()).padStart(2, "0"), d = i.getUTCHours(), c = i.getUTCMinutes();
|
|
55
107
|
if (t)
|
|
56
108
|
switch (t.toLowerCase()) {
|
|
57
109
|
case "year":
|
|
58
|
-
return `${
|
|
110
|
+
return `${a}`;
|
|
59
111
|
case "quarter":
|
|
60
|
-
const m = Math.floor(
|
|
61
|
-
return `${
|
|
112
|
+
const m = Math.floor(i.getUTCMonth() / 3) + 1;
|
|
113
|
+
return `${a}-Q${m}`;
|
|
62
114
|
case "month":
|
|
63
|
-
return `${
|
|
115
|
+
return `${a}-${l}`;
|
|
64
116
|
case "week":
|
|
65
|
-
return `${
|
|
117
|
+
return `${a}-${l}-${o}`;
|
|
66
118
|
case "day":
|
|
67
|
-
return `${
|
|
119
|
+
return `${a}-${l}-${o}`;
|
|
68
120
|
case "hour":
|
|
69
|
-
return `${
|
|
121
|
+
return `${a}-${l}-${o} ${String(d).padStart(2, "0")}:00`;
|
|
70
122
|
case "minute":
|
|
71
|
-
return `${
|
|
123
|
+
return `${a}-${l}-${o} ${String(d).padStart(2, "0")}:${String(c).padStart(2, "0")}`;
|
|
72
124
|
}
|
|
73
|
-
const u =
|
|
74
|
-
if (
|
|
75
|
-
if (
|
|
76
|
-
const m = Math.floor(
|
|
77
|
-
return `${
|
|
125
|
+
const u = i.getUTCSeconds(), f = i.getUTCMilliseconds();
|
|
126
|
+
if (o === "01" && d === 0 && c === 0 && u === 0 && f === 0) {
|
|
127
|
+
if (l === "01" || l === "04" || l === "07" || l === "10") {
|
|
128
|
+
const m = Math.floor(i.getUTCMonth() / 3) + 1;
|
|
129
|
+
return `${a}-Q${m}`;
|
|
78
130
|
}
|
|
79
|
-
return `${
|
|
131
|
+
return `${a}-${l}`;
|
|
80
132
|
}
|
|
81
|
-
return d === 0 &&
|
|
133
|
+
return d === 0 && c === 0 && u === 0 && f === 0 ? `${a}-${l}-${o}` : c === 0 && u === 0 && f === 0 ? `${a}-${l}-${o} ${String(d).padStart(2, "0")}:00` : `${a}-${l}-${o} ${String(d).padStart(2, "0")}:${String(c).padStart(2, "0")}`;
|
|
82
134
|
}
|
|
83
135
|
return n;
|
|
84
136
|
}
|
|
85
|
-
function
|
|
137
|
+
function O(e, t) {
|
|
86
138
|
try {
|
|
87
139
|
if (e?.timeDimensions) {
|
|
88
|
-
const r = e.timeDimensions.find((
|
|
140
|
+
const r = e.timeDimensions.find((i) => t === i.dimension || t.startsWith(i.dimension.replace(".", "_")) || t === `${i.dimension}_${i.granularity}`);
|
|
89
141
|
if (r?.granularity)
|
|
90
142
|
return r.granularity;
|
|
91
143
|
}
|
|
@@ -100,53 +152,53 @@ function _(e, t) {
|
|
|
100
152
|
return;
|
|
101
153
|
}
|
|
102
154
|
}
|
|
103
|
-
function
|
|
155
|
+
function It(e, t, n, r, i = {}) {
|
|
104
156
|
if (!e || e.length === 0) return [];
|
|
105
|
-
const
|
|
106
|
-
return e.map((
|
|
107
|
-
const
|
|
108
|
-
name: R(
|
|
157
|
+
const a = O(r, t);
|
|
158
|
+
return e.map((l) => {
|
|
159
|
+
const o = {
|
|
160
|
+
name: R(l[t], a) || l[t] || "Unknown"
|
|
109
161
|
};
|
|
110
162
|
return n.forEach((d) => {
|
|
111
|
-
const
|
|
112
|
-
c
|
|
113
|
-
}),
|
|
163
|
+
const c = Me(d, i);
|
|
164
|
+
o[c] = te(l[d]);
|
|
165
|
+
}), o;
|
|
114
166
|
});
|
|
115
167
|
}
|
|
116
|
-
function
|
|
168
|
+
function se(e, t, n, r, i, a = {}) {
|
|
117
169
|
if (!e || e.length === 0)
|
|
118
170
|
return { data: [], seriesKeys: [], hasDimensions: !1 };
|
|
119
|
-
const
|
|
120
|
-
...
|
|
121
|
-
...
|
|
122
|
-
], d =
|
|
171
|
+
const l = r || {}, o = [
|
|
172
|
+
...l.dimensions || [],
|
|
173
|
+
...l.timeDimensions?.map((p) => p.dimension) || []
|
|
174
|
+
], d = l.measures || [], c = n.filter((p) => d.includes(p)), u = (i || []).filter((p) => o.includes(p));
|
|
123
175
|
if (u.length > 0) {
|
|
124
|
-
const
|
|
176
|
+
const p = {};
|
|
125
177
|
e.forEach((h) => {
|
|
126
|
-
const M =
|
|
127
|
-
|
|
128
|
-
const A = Me(v,
|
|
129
|
-
if (
|
|
130
|
-
const x =
|
|
131
|
-
|
|
132
|
-
} else A in
|
|
178
|
+
const M = O(r, t), F = R(h[t], M) || h[t] || "Unknown";
|
|
179
|
+
p[F] || (p[F] = { name: String(F) }), c.forEach((v) => {
|
|
180
|
+
const A = Me(v, a), S = te(h[v]);
|
|
181
|
+
if (S !== null) {
|
|
182
|
+
const x = p[F][A];
|
|
183
|
+
p[F][A] = x == null ? S : x + S;
|
|
184
|
+
} else A in p[F] || (p[F][A] = null);
|
|
133
185
|
}), u.forEach((v) => {
|
|
134
186
|
const A = h[v];
|
|
135
187
|
if (A != null) {
|
|
136
|
-
const
|
|
188
|
+
const S = String(A), x = c[0] || d.find(
|
|
137
189
|
(y) => y.includes("totalCost") || y.includes("count") || y.includes("sum")
|
|
138
190
|
) || d[0];
|
|
139
191
|
if (x) {
|
|
140
192
|
const y = te(h[x]);
|
|
141
193
|
if (y !== null) {
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
} else
|
|
194
|
+
const k = p[F][S];
|
|
195
|
+
p[F][S] = k == null ? y : k + y;
|
|
196
|
+
} else S in p[F] || (p[F][S] = null);
|
|
145
197
|
}
|
|
146
198
|
}
|
|
147
199
|
});
|
|
148
200
|
});
|
|
149
|
-
const N = Object.values(
|
|
201
|
+
const N = Object.values(p), g = Array.from(new Set(
|
|
150
202
|
e.flatMap(
|
|
151
203
|
(h) => u.map((M) => {
|
|
152
204
|
const F = h[M];
|
|
@@ -156,23 +208,23 @@ function ie(e, t, n, r, s, l = {}) {
|
|
|
156
208
|
));
|
|
157
209
|
return {
|
|
158
210
|
data: N,
|
|
159
|
-
seriesKeys:
|
|
211
|
+
seriesKeys: g,
|
|
160
212
|
hasDimensions: !0
|
|
161
213
|
};
|
|
162
214
|
}
|
|
163
|
-
const f =
|
|
215
|
+
const f = It(e, t, n, r, a), m = n.map((p) => Me(p, a));
|
|
164
216
|
return {
|
|
165
217
|
data: f,
|
|
166
218
|
seriesKeys: m,
|
|
167
219
|
hasDimensions: !1
|
|
168
220
|
};
|
|
169
221
|
}
|
|
170
|
-
const
|
|
222
|
+
const Ot = (e, t) => e == null ? ["No data", t] : [q(e), t];
|
|
171
223
|
function Q({ formatter: e, labelFormatter: t }) {
|
|
172
|
-
return /* @__PURE__ */
|
|
224
|
+
return /* @__PURE__ */ s(
|
|
173
225
|
lt,
|
|
174
226
|
{
|
|
175
|
-
formatter: e ||
|
|
227
|
+
formatter: e || Ot,
|
|
176
228
|
labelFormatter: t,
|
|
177
229
|
contentStyle: {
|
|
178
230
|
backgroundColor: "white",
|
|
@@ -186,7 +238,7 @@ function Q({ formatter: e, labelFormatter: t }) {
|
|
|
186
238
|
}
|
|
187
239
|
);
|
|
188
240
|
}
|
|
189
|
-
const
|
|
241
|
+
const j = [
|
|
190
242
|
"#3b82f6",
|
|
191
243
|
// blue
|
|
192
244
|
"#10b981",
|
|
@@ -216,13 +268,13 @@ const E = [
|
|
|
216
268
|
// green
|
|
217
269
|
"#fde725"
|
|
218
270
|
// yellow
|
|
219
|
-
], Ue = "#10b981",
|
|
271
|
+
], Ue = "#10b981", _t = "#ef4444", we = {
|
|
220
272
|
top: 5,
|
|
221
273
|
right: 30,
|
|
222
274
|
left: 20,
|
|
223
275
|
bottom: 5
|
|
224
276
|
};
|
|
225
|
-
function
|
|
277
|
+
function ze(e) {
|
|
226
278
|
if (!e || typeof e != "string")
|
|
227
279
|
return [];
|
|
228
280
|
const t = e.trim();
|
|
@@ -230,100 +282,100 @@ function je(e) {
|
|
|
230
282
|
return [];
|
|
231
283
|
try {
|
|
232
284
|
const n = t.split(",").map((r) => r.trim()).filter((r) => r !== "").map((r) => {
|
|
233
|
-
const
|
|
234
|
-
if (isNaN(
|
|
285
|
+
const i = parseFloat(r);
|
|
286
|
+
if (isNaN(i))
|
|
235
287
|
throw new Error(`Invalid numeric value: ${r}`);
|
|
236
|
-
return
|
|
288
|
+
return i;
|
|
237
289
|
});
|
|
238
290
|
return n.length > 0 ? n : [];
|
|
239
291
|
} catch (n) {
|
|
240
292
|
return console.warn("Failed to parse target values:", n), [];
|
|
241
293
|
}
|
|
242
294
|
}
|
|
243
|
-
function
|
|
295
|
+
function De(e, t) {
|
|
244
296
|
if (e.length === 0 || t <= 0)
|
|
245
297
|
return [];
|
|
246
298
|
if (e.length === 1)
|
|
247
299
|
return new Array(t).fill(e[0]);
|
|
248
|
-
const n = [], r = Math.floor(t / e.length),
|
|
249
|
-
let
|
|
250
|
-
for (let
|
|
251
|
-
const
|
|
252
|
-
for (let d = 0; d <
|
|
253
|
-
n[
|
|
300
|
+
const n = [], r = Math.floor(t / e.length), i = t % e.length;
|
|
301
|
+
let a = 0;
|
|
302
|
+
for (let l = 0; l < e.length; l++) {
|
|
303
|
+
const o = r + (l < i ? 1 : 0);
|
|
304
|
+
for (let d = 0; d < o; d++)
|
|
305
|
+
n[a++] = e[l];
|
|
254
306
|
}
|
|
255
307
|
return n;
|
|
256
308
|
}
|
|
257
|
-
function
|
|
309
|
+
function Qn(e, t) {
|
|
258
310
|
return t === 0 ? e === 0 ? 0 : e > 0 ? 100 : -100 : (e - t) / t * 100;
|
|
259
311
|
}
|
|
260
|
-
function
|
|
312
|
+
function Zn(e, t = 1) {
|
|
261
313
|
return `${e >= 0 ? "+" : ""}${e.toFixed(t)}%`;
|
|
262
314
|
}
|
|
263
|
-
function
|
|
315
|
+
function Jn({
|
|
264
316
|
data: e,
|
|
265
317
|
chartConfig: t,
|
|
266
318
|
displayConfig: n = {},
|
|
267
319
|
queryObject: r,
|
|
268
|
-
height:
|
|
269
|
-
colorPalette:
|
|
320
|
+
height: i = "100%",
|
|
321
|
+
colorPalette: a
|
|
270
322
|
}) {
|
|
271
|
-
const [
|
|
323
|
+
const [l, o] = H(null), { labelMap: d, getFieldLabel: c } = X();
|
|
272
324
|
try {
|
|
273
|
-
const u = n?.stackType ?? (n?.stacked ? "normal" : "none"), f = u !== "none", m = u === "percent",
|
|
325
|
+
const u = n?.stackType ?? (n?.stacked ? "normal" : "none"), f = u !== "none", m = u === "percent", p = {
|
|
274
326
|
showLegend: n?.showLegend ?? !0,
|
|
275
327
|
showGrid: n?.showGrid ?? !0,
|
|
276
328
|
showTooltip: n?.showTooltip ?? !0
|
|
277
329
|
};
|
|
278
330
|
if (!e || e.length === 0)
|
|
279
|
-
return /* @__PURE__ */
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
/* @__PURE__ */
|
|
331
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
332
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
333
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in bar chart" })
|
|
282
334
|
] }) });
|
|
283
|
-
let N,
|
|
335
|
+
let N, g, h = [];
|
|
284
336
|
if (t?.xAxis && t?.yAxis)
|
|
285
|
-
N = Array.isArray(t.xAxis) ? t.xAxis[0] : t.xAxis,
|
|
337
|
+
N = Array.isArray(t.xAxis) ? t.xAxis[0] : t.xAxis, g = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], h = t.series || [];
|
|
286
338
|
else if (t?.x && t?.y)
|
|
287
|
-
N = t.x,
|
|
339
|
+
N = t.x, g = Array.isArray(t.y) ? t.y : [t.y];
|
|
288
340
|
else
|
|
289
|
-
return /* @__PURE__ */
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
/* @__PURE__ */
|
|
341
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
342
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
343
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
|
|
292
344
|
] }) });
|
|
293
|
-
if (!N || !
|
|
294
|
-
return /* @__PURE__ */
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
-
/* @__PURE__ */
|
|
345
|
+
if (!N || !g || g.length === 0)
|
|
346
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
347
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
348
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
|
|
297
349
|
] }) });
|
|
298
|
-
const { data: M, seriesKeys: F } =
|
|
350
|
+
const { data: M, seriesKeys: F } = se(
|
|
299
351
|
e,
|
|
300
352
|
N,
|
|
301
|
-
|
|
353
|
+
g,
|
|
302
354
|
r,
|
|
303
355
|
h,
|
|
304
356
|
d
|
|
305
|
-
), { chartData: v, skippedCount: A } =
|
|
306
|
-
const L = M.filter((
|
|
307
|
-
return { chartData: L, skippedCount:
|
|
308
|
-
}, [M, F]),
|
|
309
|
-
const
|
|
310
|
-
return typeof
|
|
311
|
-
}), y =
|
|
357
|
+
), { chartData: v, skippedCount: A } = wt(() => {
|
|
358
|
+
const L = M.filter((D) => F.some((V) => ke(D[V]))), E = M.length - L.length;
|
|
359
|
+
return { chartData: L, skippedCount: E };
|
|
360
|
+
}, [M, F]), S = m ? "expand" : void 0, x = F.length === 1 && v.some((L) => {
|
|
361
|
+
const E = L[F[0]];
|
|
362
|
+
return typeof E == "number" && E < 0;
|
|
363
|
+
}), y = p.showLegend, k = {
|
|
312
364
|
...we,
|
|
313
365
|
left: 40
|
|
314
366
|
// Increased from 20 to 40 for Y-axis label space
|
|
315
|
-
}, w =
|
|
367
|
+
}, w = ze(n?.target || ""), T = De(w, v.length);
|
|
316
368
|
let $ = v;
|
|
317
|
-
return T.length > 0 && ($ = v.map((L,
|
|
369
|
+
return T.length > 0 && ($ = v.map((L, E) => ({
|
|
318
370
|
...L,
|
|
319
|
-
__target: T[
|
|
320
|
-
}))), !v || v.length === 0 ? /* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
] }) }) : /* @__PURE__ */ b("div", { className: "relative w-full", style: { height:
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
|
|
326
|
-
/* @__PURE__ */
|
|
371
|
+
__target: T[E] || null
|
|
372
|
+
}))), !v || v.length === 0 ? /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
373
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
374
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for bar chart after transformation" })
|
|
375
|
+
] }) }) : /* @__PURE__ */ b("div", { className: "relative w-full", style: { height: i }, children: [
|
|
376
|
+
/* @__PURE__ */ s(B, { height: A > 0 ? "calc(100% - 20px)" : "100%", children: /* @__PURE__ */ b(ot, { data: $, margin: k, stackOffset: S, children: [
|
|
377
|
+
p.showGrid && /* @__PURE__ */ s(ve, { strokeDasharray: "3 3" }),
|
|
378
|
+
/* @__PURE__ */ s(
|
|
327
379
|
be,
|
|
328
380
|
{
|
|
329
381
|
dataKey: "name",
|
|
@@ -333,22 +385,22 @@ function Qn({
|
|
|
333
385
|
height: 60
|
|
334
386
|
}
|
|
335
387
|
),
|
|
336
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ s(
|
|
337
389
|
Ne,
|
|
338
390
|
{
|
|
339
391
|
tick: { fontSize: 12 },
|
|
340
392
|
tickFormatter: m ? (L) => `${(L * 100).toFixed(0)}%` : void 0,
|
|
341
393
|
domain: m ? [0, 1] : void 0,
|
|
342
|
-
label: m ? void 0 : { value:
|
|
394
|
+
label: m ? void 0 : { value: c(g[0]), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
|
|
343
395
|
}
|
|
344
396
|
),
|
|
345
|
-
|
|
397
|
+
p.showTooltip && /* @__PURE__ */ s(
|
|
346
398
|
Q,
|
|
347
399
|
{
|
|
348
|
-
formatter: (L,
|
|
400
|
+
formatter: (L, E) => L == null ? ["No data", E] : E === "Target" ? [q(L), "Target Value"] : m && typeof L == "number" ? [`${(L * 100).toFixed(1)}%`, E] : [q(L), E]
|
|
349
401
|
}
|
|
350
402
|
),
|
|
351
|
-
y && /* @__PURE__ */
|
|
403
|
+
y && /* @__PURE__ */ s(
|
|
352
404
|
Y,
|
|
353
405
|
{
|
|
354
406
|
wrapperStyle: { fontSize: "12px", paddingTop: "25px" },
|
|
@@ -357,24 +409,24 @@ function Qn({
|
|
|
357
409
|
layout: "horizontal",
|
|
358
410
|
align: "center",
|
|
359
411
|
verticalAlign: "bottom",
|
|
360
|
-
onMouseEnter: (L) =>
|
|
361
|
-
onMouseLeave: () =>
|
|
412
|
+
onMouseEnter: (L) => o(String(L.dataKey || "")),
|
|
413
|
+
onMouseLeave: () => o(null)
|
|
362
414
|
}
|
|
363
415
|
),
|
|
364
|
-
F.map((L,
|
|
365
|
-
|
|
416
|
+
F.map((L, E) => /* @__PURE__ */ s(
|
|
417
|
+
At,
|
|
366
418
|
{
|
|
367
419
|
dataKey: L,
|
|
368
420
|
stackId: f ? "stack" : void 0,
|
|
369
|
-
fill: x ? Ue :
|
|
370
|
-
fillOpacity:
|
|
371
|
-
children: x && v.map((
|
|
372
|
-
const
|
|
373
|
-
return /* @__PURE__ */
|
|
374
|
-
|
|
421
|
+
fill: x ? Ue : a?.colors && a.colors[E % a.colors.length] || j[E % j.length],
|
|
422
|
+
fillOpacity: l ? l === L ? 1 : 0.3 : 1,
|
|
423
|
+
children: x && v.map((D, V) => {
|
|
424
|
+
const G = D[L], Z = typeof G == "number" && G < 0 ? _t : Ue;
|
|
425
|
+
return /* @__PURE__ */ s(
|
|
426
|
+
je,
|
|
375
427
|
{
|
|
376
428
|
fill: Z,
|
|
377
|
-
fillOpacity:
|
|
429
|
+
fillOpacity: l ? l === L ? 1 : 0.3 : 1
|
|
378
430
|
},
|
|
379
431
|
`cell-${V}`
|
|
380
432
|
);
|
|
@@ -382,8 +434,8 @@ function Qn({
|
|
|
382
434
|
},
|
|
383
435
|
L
|
|
384
436
|
)),
|
|
385
|
-
T.length > 0 && /* @__PURE__ */ b(
|
|
386
|
-
/* @__PURE__ */
|
|
437
|
+
T.length > 0 && /* @__PURE__ */ b(Ee, { children: [
|
|
438
|
+
/* @__PURE__ */ s(
|
|
387
439
|
W,
|
|
388
440
|
{
|
|
389
441
|
type: "monotone",
|
|
@@ -395,7 +447,7 @@ function Qn({
|
|
|
395
447
|
connectNulls: !1
|
|
396
448
|
}
|
|
397
449
|
),
|
|
398
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ s(
|
|
399
451
|
W,
|
|
400
452
|
{
|
|
401
453
|
type: "monotone",
|
|
@@ -419,22 +471,22 @@ function Qn({
|
|
|
419
471
|
] })
|
|
420
472
|
] });
|
|
421
473
|
} catch (u) {
|
|
422
|
-
return /* @__PURE__ */
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
-
/* @__PURE__ */
|
|
425
|
-
/* @__PURE__ */
|
|
474
|
+
return /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
475
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Bar Chart Error" }),
|
|
476
|
+
/* @__PURE__ */ s("div", { className: "text-xs mb-2", children: u instanceof Error ? u.message : "Unknown rendering error" }),
|
|
477
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-muted", children: "Check the data and configuration" })
|
|
426
478
|
] }) });
|
|
427
479
|
}
|
|
428
480
|
}
|
|
429
|
-
function
|
|
481
|
+
function Pn({
|
|
430
482
|
data: e,
|
|
431
483
|
chartConfig: t,
|
|
432
484
|
displayConfig: n = {},
|
|
433
485
|
queryObject: r,
|
|
434
|
-
height:
|
|
435
|
-
colorPalette:
|
|
486
|
+
height: i = "100%",
|
|
487
|
+
colorPalette: a
|
|
436
488
|
}) {
|
|
437
|
-
const [
|
|
489
|
+
const [l, o] = H(null), { labelMap: d, getFieldLabel: c } = X();
|
|
438
490
|
try {
|
|
439
491
|
const u = {
|
|
440
492
|
showLegend: n?.showLegend ?? !0,
|
|
@@ -443,47 +495,47 @@ function Zn({
|
|
|
443
495
|
connectNulls: n?.connectNulls ?? !1
|
|
444
496
|
};
|
|
445
497
|
if (!e || e.length === 0)
|
|
446
|
-
return /* @__PURE__ */
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
/* @__PURE__ */
|
|
498
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
499
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
500
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in line chart" })
|
|
449
501
|
] }) });
|
|
450
|
-
let f, m,
|
|
502
|
+
let f, m, p = [];
|
|
451
503
|
if (t?.xAxis && t?.yAxis)
|
|
452
|
-
f = Array.isArray(t.xAxis) ? t.xAxis[0] : t.xAxis, m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis],
|
|
504
|
+
f = Array.isArray(t.xAxis) ? t.xAxis[0] : t.xAxis, m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], p = t.series || [];
|
|
453
505
|
else if (t?.x && t?.y)
|
|
454
506
|
f = t.x, m = Array.isArray(t.y) ? t.y : [t.y];
|
|
455
507
|
else
|
|
456
|
-
return /* @__PURE__ */
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
/* @__PURE__ */
|
|
508
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
509
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
510
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
|
|
459
511
|
] }) });
|
|
460
512
|
if (!f || !m || m.length === 0)
|
|
461
|
-
return /* @__PURE__ */
|
|
462
|
-
/* @__PURE__ */
|
|
463
|
-
/* @__PURE__ */
|
|
513
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
514
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
515
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
|
|
464
516
|
] }) });
|
|
465
|
-
const { data: N, seriesKeys:
|
|
517
|
+
const { data: N, seriesKeys: g } = se(
|
|
466
518
|
e,
|
|
467
519
|
f,
|
|
468
520
|
m,
|
|
469
521
|
r,
|
|
470
|
-
|
|
522
|
+
p,
|
|
471
523
|
d
|
|
472
524
|
), h = u.showLegend, M = {
|
|
473
525
|
...we,
|
|
474
526
|
left: 40
|
|
475
527
|
// Increased from 20 to 40 for Y-axis label space
|
|
476
|
-
}, F =
|
|
528
|
+
}, F = ze(n?.target || ""), v = De(F, N.length);
|
|
477
529
|
let A = N;
|
|
478
|
-
return v.length > 0 && (A = N.map((
|
|
479
|
-
...
|
|
530
|
+
return v.length > 0 && (A = N.map((S, x) => ({
|
|
531
|
+
...S,
|
|
480
532
|
__target: v[x] || null
|
|
481
|
-
}))), !N || N.length === 0 ? /* @__PURE__ */
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
/* @__PURE__ */
|
|
484
|
-
] }) }) : /* @__PURE__ */
|
|
485
|
-
u.showGrid && /* @__PURE__ */
|
|
486
|
-
/* @__PURE__ */
|
|
533
|
+
}))), !N || N.length === 0 ? /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
534
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
535
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for line chart after transformation" })
|
|
536
|
+
] }) }) : /* @__PURE__ */ s(B, { height: i, children: /* @__PURE__ */ b(St, { data: A, margin: M, children: [
|
|
537
|
+
u.showGrid && /* @__PURE__ */ s(ve, { strokeDasharray: "3 3" }),
|
|
538
|
+
/* @__PURE__ */ s(
|
|
487
539
|
be,
|
|
488
540
|
{
|
|
489
541
|
dataKey: "name",
|
|
@@ -493,20 +545,20 @@ function Zn({
|
|
|
493
545
|
height: 60
|
|
494
546
|
}
|
|
495
547
|
),
|
|
496
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ s(
|
|
497
549
|
Ne,
|
|
498
550
|
{
|
|
499
551
|
tick: { fontSize: 12 },
|
|
500
|
-
label: { value:
|
|
552
|
+
label: { value: c(m[0]), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
|
|
501
553
|
}
|
|
502
554
|
),
|
|
503
|
-
u.showTooltip && /* @__PURE__ */
|
|
555
|
+
u.showTooltip && /* @__PURE__ */ s(
|
|
504
556
|
Q,
|
|
505
557
|
{
|
|
506
|
-
formatter: (
|
|
558
|
+
formatter: (S, x) => S == null ? ["No data", x] : x === "Target" ? [q(S), "Target Value"] : [q(S), x]
|
|
507
559
|
}
|
|
508
560
|
),
|
|
509
|
-
h && /* @__PURE__ */
|
|
561
|
+
h && /* @__PURE__ */ s(
|
|
510
562
|
Y,
|
|
511
563
|
{
|
|
512
564
|
wrapperStyle: { fontSize: "12px", paddingTop: "25px" },
|
|
@@ -515,26 +567,26 @@ function Zn({
|
|
|
515
567
|
layout: "horizontal",
|
|
516
568
|
align: "center",
|
|
517
569
|
verticalAlign: "bottom",
|
|
518
|
-
onMouseEnter: (
|
|
519
|
-
onMouseLeave: () =>
|
|
570
|
+
onMouseEnter: (S) => o(String(S.dataKey || "")),
|
|
571
|
+
onMouseLeave: () => o(null)
|
|
520
572
|
}
|
|
521
573
|
),
|
|
522
|
-
|
|
574
|
+
g.map((S, x) => /* @__PURE__ */ s(
|
|
523
575
|
W,
|
|
524
576
|
{
|
|
525
577
|
type: "monotone",
|
|
526
|
-
dataKey:
|
|
527
|
-
stroke:
|
|
578
|
+
dataKey: S,
|
|
579
|
+
stroke: a?.colors && a.colors[x % a.colors.length] || j[x % j.length],
|
|
528
580
|
strokeWidth: 2,
|
|
529
581
|
dot: { r: 3 },
|
|
530
582
|
activeDot: { r: 5 },
|
|
531
|
-
strokeOpacity:
|
|
583
|
+
strokeOpacity: l ? l === S ? 1 : 0.3 : 1,
|
|
532
584
|
connectNulls: u.connectNulls
|
|
533
585
|
},
|
|
534
|
-
|
|
586
|
+
S
|
|
535
587
|
)),
|
|
536
|
-
v.length > 0 && /* @__PURE__ */ b(
|
|
537
|
-
/* @__PURE__ */
|
|
588
|
+
v.length > 0 && /* @__PURE__ */ b(Ee, { children: [
|
|
589
|
+
/* @__PURE__ */ s(
|
|
538
590
|
W,
|
|
539
591
|
{
|
|
540
592
|
type: "monotone",
|
|
@@ -546,7 +598,7 @@ function Zn({
|
|
|
546
598
|
connectNulls: !1
|
|
547
599
|
}
|
|
548
600
|
),
|
|
549
|
-
/* @__PURE__ */
|
|
601
|
+
/* @__PURE__ */ s(
|
|
550
602
|
W,
|
|
551
603
|
{
|
|
552
604
|
type: "monotone",
|
|
@@ -563,71 +615,71 @@ function Zn({
|
|
|
563
615
|
] })
|
|
564
616
|
] }) });
|
|
565
617
|
} catch (u) {
|
|
566
|
-
return /* @__PURE__ */
|
|
567
|
-
/* @__PURE__ */
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
-
/* @__PURE__ */
|
|
618
|
+
return /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
619
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Line Chart Error" }),
|
|
620
|
+
/* @__PURE__ */ s("div", { className: "text-xs mb-2", children: u instanceof Error ? u.message : "Unknown rendering error" }),
|
|
621
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-muted", children: "Check the data and configuration" })
|
|
570
622
|
] }) });
|
|
571
623
|
}
|
|
572
624
|
}
|
|
573
|
-
function
|
|
625
|
+
function er({
|
|
574
626
|
data: e,
|
|
575
627
|
chartConfig: t,
|
|
576
628
|
displayConfig: n = {},
|
|
577
629
|
queryObject: r,
|
|
578
|
-
height:
|
|
579
|
-
colorPalette:
|
|
630
|
+
height: i = "100%",
|
|
631
|
+
colorPalette: a
|
|
580
632
|
}) {
|
|
581
|
-
const [
|
|
633
|
+
const [l, o] = H(null), { labelMap: d, getFieldLabel: c } = X();
|
|
582
634
|
try {
|
|
583
|
-
const u = n?.stackType ?? (n?.stacked ? "normal" : "none"), f = u !== "none", m = u === "percent",
|
|
635
|
+
const u = n?.stackType ?? (n?.stacked ? "normal" : "none"), f = u !== "none", m = u === "percent", p = {
|
|
584
636
|
showLegend: n?.showLegend ?? !0,
|
|
585
637
|
showGrid: n?.showGrid ?? !0,
|
|
586
638
|
showTooltip: n?.showTooltip ?? !0,
|
|
587
639
|
connectNulls: n?.connectNulls ?? !1
|
|
588
640
|
};
|
|
589
641
|
if (!e || e.length === 0)
|
|
590
|
-
return /* @__PURE__ */
|
|
591
|
-
/* @__PURE__ */
|
|
592
|
-
/* @__PURE__ */
|
|
642
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
643
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
644
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in area chart" })
|
|
593
645
|
] }) });
|
|
594
|
-
let N,
|
|
646
|
+
let N, g, h = [];
|
|
595
647
|
if (t?.xAxis && t?.yAxis)
|
|
596
|
-
N = Array.isArray(t.xAxis) ? t.xAxis[0] : t.xAxis,
|
|
648
|
+
N = Array.isArray(t.xAxis) ? t.xAxis[0] : t.xAxis, g = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], h = t.series || [];
|
|
597
649
|
else if (t?.x && t?.y)
|
|
598
|
-
N = t.x,
|
|
650
|
+
N = t.x, g = Array.isArray(t.y) ? t.y : [t.y];
|
|
599
651
|
else
|
|
600
|
-
return /* @__PURE__ */
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
/* @__PURE__ */
|
|
652
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
653
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
654
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
|
|
603
655
|
] }) });
|
|
604
|
-
if (!N || !
|
|
605
|
-
return /* @__PURE__ */
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
/* @__PURE__ */
|
|
656
|
+
if (!N || !g || g.length === 0)
|
|
657
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
658
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
659
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
|
|
608
660
|
] }) });
|
|
609
|
-
const { data: M, seriesKeys: F } =
|
|
661
|
+
const { data: M, seriesKeys: F } = se(
|
|
610
662
|
e,
|
|
611
663
|
N,
|
|
612
|
-
|
|
664
|
+
g,
|
|
613
665
|
r,
|
|
614
666
|
h,
|
|
615
667
|
d
|
|
616
|
-
), v =
|
|
668
|
+
), v = p.showLegend, A = {
|
|
617
669
|
...we,
|
|
618
670
|
left: 40
|
|
619
671
|
// Increased from 20 to 40 for Y-axis label space
|
|
620
|
-
},
|
|
672
|
+
}, S = ze(n?.target || ""), x = De(S, M.length);
|
|
621
673
|
let y = M;
|
|
622
674
|
return x.length > 0 && (y = M.map((w, T) => ({
|
|
623
675
|
...w,
|
|
624
676
|
__target: x[T] || null
|
|
625
|
-
}))), !M || M.length === 0 ? /* @__PURE__ */
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
] }) }) : /* @__PURE__ */
|
|
629
|
-
|
|
630
|
-
/* @__PURE__ */
|
|
677
|
+
}))), !M || M.length === 0 ? /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
678
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
679
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for area chart after transformation" })
|
|
680
|
+
] }) }) : /* @__PURE__ */ s(B, { height: i, children: /* @__PURE__ */ b(ot, { data: y, margin: A, stackOffset: m ? "expand" : void 0, children: [
|
|
681
|
+
p.showGrid && /* @__PURE__ */ s(ve, { strokeDasharray: "3 3" }),
|
|
682
|
+
/* @__PURE__ */ s(
|
|
631
683
|
be,
|
|
632
684
|
{
|
|
633
685
|
dataKey: "name",
|
|
@@ -637,22 +689,22 @@ function Jn({
|
|
|
637
689
|
height: 60
|
|
638
690
|
}
|
|
639
691
|
),
|
|
640
|
-
/* @__PURE__ */
|
|
692
|
+
/* @__PURE__ */ s(
|
|
641
693
|
Ne,
|
|
642
694
|
{
|
|
643
695
|
tick: { fontSize: 12 },
|
|
644
696
|
tickFormatter: m ? (w) => `${(w * 100).toFixed(0)}%` : void 0,
|
|
645
697
|
domain: m ? [0, 1] : void 0,
|
|
646
|
-
label: m ? void 0 : { value:
|
|
698
|
+
label: m ? void 0 : { value: c(g[0]), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
|
|
647
699
|
}
|
|
648
700
|
),
|
|
649
|
-
|
|
701
|
+
p.showTooltip && /* @__PURE__ */ s(
|
|
650
702
|
Q,
|
|
651
703
|
{
|
|
652
|
-
formatter: (w, T) => w == null ? ["No data", T] : T === "Target" ? [
|
|
704
|
+
formatter: (w, T) => w == null ? ["No data", T] : T === "Target" ? [q(w), "Target Value"] : m && typeof w == "number" ? [`${(w * 100).toFixed(1)}%`, T] : [q(w), T]
|
|
653
705
|
}
|
|
654
706
|
),
|
|
655
|
-
v && /* @__PURE__ */
|
|
707
|
+
v && /* @__PURE__ */ s(
|
|
656
708
|
Y,
|
|
657
709
|
{
|
|
658
710
|
wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
|
|
@@ -661,27 +713,27 @@ function Jn({
|
|
|
661
713
|
layout: "horizontal",
|
|
662
714
|
align: "center",
|
|
663
715
|
verticalAlign: "bottom",
|
|
664
|
-
onMouseEnter: (w) =>
|
|
665
|
-
onMouseLeave: () =>
|
|
716
|
+
onMouseEnter: (w) => o(String(w.dataKey || "")),
|
|
717
|
+
onMouseLeave: () => o(null)
|
|
666
718
|
}
|
|
667
719
|
),
|
|
668
|
-
F.map((w, T) => /* @__PURE__ */
|
|
669
|
-
|
|
720
|
+
F.map((w, T) => /* @__PURE__ */ s(
|
|
721
|
+
kt,
|
|
670
722
|
{
|
|
671
723
|
type: "monotone",
|
|
672
724
|
dataKey: w,
|
|
673
725
|
stackId: f ? "stack" : void 0,
|
|
674
|
-
stroke:
|
|
675
|
-
fill:
|
|
676
|
-
fillOpacity:
|
|
726
|
+
stroke: a?.colors && a.colors[T % a.colors.length] || j[T % j.length],
|
|
727
|
+
fill: a?.colors && a.colors[T % a.colors.length] || j[T % j.length],
|
|
728
|
+
fillOpacity: l ? l === w ? 0.6 : 0.1 : 0.3,
|
|
677
729
|
strokeWidth: 2,
|
|
678
|
-
strokeOpacity:
|
|
679
|
-
connectNulls:
|
|
730
|
+
strokeOpacity: l ? l === w ? 1 : 0.3 : 1,
|
|
731
|
+
connectNulls: p.connectNulls
|
|
680
732
|
},
|
|
681
733
|
w
|
|
682
734
|
)),
|
|
683
|
-
x.length > 0 && /* @__PURE__ */ b(
|
|
684
|
-
/* @__PURE__ */
|
|
735
|
+
x.length > 0 && /* @__PURE__ */ b(Ee, { children: [
|
|
736
|
+
/* @__PURE__ */ s(
|
|
685
737
|
W,
|
|
686
738
|
{
|
|
687
739
|
type: "monotone",
|
|
@@ -693,7 +745,7 @@ function Jn({
|
|
|
693
745
|
connectNulls: !1
|
|
694
746
|
}
|
|
695
747
|
),
|
|
696
|
-
/* @__PURE__ */
|
|
748
|
+
/* @__PURE__ */ s(
|
|
697
749
|
W,
|
|
698
750
|
{
|
|
699
751
|
type: "monotone",
|
|
@@ -710,58 +762,58 @@ function Jn({
|
|
|
710
762
|
] })
|
|
711
763
|
] }) });
|
|
712
764
|
} catch (u) {
|
|
713
|
-
return /* @__PURE__ */
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
-
/* @__PURE__ */
|
|
716
|
-
/* @__PURE__ */
|
|
765
|
+
return /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
766
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Area Chart Error" }),
|
|
767
|
+
/* @__PURE__ */ s("div", { className: "text-xs mb-2", children: u instanceof Error ? u.message : "Unknown rendering error" }),
|
|
768
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-muted", children: "Check the data and configuration" })
|
|
717
769
|
] }) });
|
|
718
770
|
}
|
|
719
771
|
}
|
|
720
|
-
function
|
|
772
|
+
function tr({
|
|
721
773
|
data: e,
|
|
722
774
|
chartConfig: t,
|
|
723
775
|
displayConfig: n = {},
|
|
724
776
|
queryObject: r,
|
|
725
|
-
height:
|
|
726
|
-
colorPalette:
|
|
777
|
+
height: i = "100%",
|
|
778
|
+
colorPalette: a
|
|
727
779
|
}) {
|
|
728
|
-
const [
|
|
780
|
+
const [l, o] = H(null), { labelMap: d } = X();
|
|
729
781
|
try {
|
|
730
|
-
const
|
|
782
|
+
const c = {
|
|
731
783
|
showLegend: n?.showLegend ?? !0,
|
|
732
784
|
showTooltip: n?.showTooltip ?? !0
|
|
733
785
|
};
|
|
734
786
|
if (!e || e.length === 0)
|
|
735
|
-
return /* @__PURE__ */
|
|
736
|
-
/* @__PURE__ */
|
|
737
|
-
/* @__PURE__ */
|
|
787
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
788
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
789
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in pie chart" })
|
|
738
790
|
] }) });
|
|
739
|
-
let u, f, m,
|
|
791
|
+
let u, f, m, p = [];
|
|
740
792
|
if (t?.xAxis && t?.yAxis)
|
|
741
|
-
f = Array.isArray(t.xAxis) ? t.xAxis[0] : t.xAxis, m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis],
|
|
793
|
+
f = Array.isArray(t.xAxis) ? t.xAxis[0] : t.xAxis, m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], p = t.series || [];
|
|
742
794
|
else if (t?.x && t?.y)
|
|
743
795
|
f = t.x, m = Array.isArray(t.y) ? t.y : [t.y];
|
|
744
796
|
else
|
|
745
|
-
return /* @__PURE__ */
|
|
746
|
-
/* @__PURE__ */
|
|
747
|
-
/* @__PURE__ */
|
|
797
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
798
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
799
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: "chartConfig.x/y or chartConfig.xAxis/yAxis required for pie chart" })
|
|
748
800
|
] }) });
|
|
749
801
|
if (!f || !m || m.length === 0)
|
|
750
|
-
return /* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */
|
|
752
|
-
/* @__PURE__ */
|
|
802
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
803
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
804
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
|
|
753
805
|
] }) });
|
|
754
|
-
if (
|
|
755
|
-
const { data:
|
|
806
|
+
if (p.length > 0) {
|
|
807
|
+
const { data: g } = se(
|
|
756
808
|
e,
|
|
757
809
|
f,
|
|
758
810
|
m,
|
|
759
811
|
r,
|
|
760
|
-
|
|
812
|
+
p,
|
|
761
813
|
d
|
|
762
814
|
);
|
|
763
|
-
if (u = [],
|
|
764
|
-
const h =
|
|
815
|
+
if (u = [], g.length > 0) {
|
|
816
|
+
const h = g[0];
|
|
765
817
|
Object.keys(h).forEach((M) => {
|
|
766
818
|
M !== "name" && typeof h[M] == "number" && u.push({
|
|
767
819
|
name: String(M),
|
|
@@ -770,9 +822,9 @@ function Pn({
|
|
|
770
822
|
});
|
|
771
823
|
}
|
|
772
824
|
} else {
|
|
773
|
-
const
|
|
825
|
+
const g = O(r, f);
|
|
774
826
|
u = e.map((h) => {
|
|
775
|
-
let M = R(h[f],
|
|
827
|
+
let M = R(h[f], g) || String(h[f]) || "Unknown";
|
|
776
828
|
return typeof h[f] == "boolean" ? M = h[f] ? "Active" : "Inactive" : (M === "true" || M === "false") && (M = M === "true" ? "Active" : "Inactive"), {
|
|
777
829
|
name: M,
|
|
778
830
|
value: typeof h[m[0]] == "string" ? parseFloat(h[m[0]]) : h[m[0]] || 0
|
|
@@ -781,32 +833,32 @@ function Pn({
|
|
|
781
833
|
}
|
|
782
834
|
const N = u.length;
|
|
783
835
|
return u = u.filter(
|
|
784
|
-
(
|
|
785
|
-
), u.length === 0 ? /* @__PURE__ */
|
|
786
|
-
/* @__PURE__ */
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
] }) }) : /* @__PURE__ */
|
|
789
|
-
/* @__PURE__ */
|
|
790
|
-
|
|
836
|
+
(g) => g.value != null && !isNaN(g.value) && g.value !== 0 && g.value > 0
|
|
837
|
+
), u.length === 0 ? /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
838
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
839
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: N > 0 ? `Filtered out ${N} data points (zero or invalid values)` : "No data points to display in pie chart" })
|
|
840
|
+
] }) }) : /* @__PURE__ */ s(B, { height: i, children: /* @__PURE__ */ b(Mt, { children: [
|
|
841
|
+
/* @__PURE__ */ s(
|
|
842
|
+
$t,
|
|
791
843
|
{
|
|
792
844
|
data: u,
|
|
793
845
|
cx: "50%",
|
|
794
846
|
cy: "50%",
|
|
795
847
|
outerRadius: "70%",
|
|
796
848
|
dataKey: "value",
|
|
797
|
-
label:
|
|
798
|
-
children: u.map((
|
|
799
|
-
|
|
849
|
+
label: c.showLegend ? void 0 : ({ name: g, percent: h }) => `${g} ${((h || 0) * 100).toFixed(0)}%`,
|
|
850
|
+
children: u.map((g, h) => /* @__PURE__ */ s(
|
|
851
|
+
je,
|
|
800
852
|
{
|
|
801
|
-
fill:
|
|
802
|
-
fillOpacity:
|
|
853
|
+
fill: a?.colors && a.colors[h % a.colors.length] || j[h % j.length],
|
|
854
|
+
fillOpacity: l ? l === u[h].name ? 1 : 0.3 : 1
|
|
803
855
|
},
|
|
804
856
|
`cell-${h}`
|
|
805
857
|
))
|
|
806
858
|
}
|
|
807
859
|
),
|
|
808
|
-
|
|
809
|
-
|
|
860
|
+
c.showTooltip && /* @__PURE__ */ s(Q, {}),
|
|
861
|
+
c.showLegend && /* @__PURE__ */ s(
|
|
810
862
|
Y,
|
|
811
863
|
{
|
|
812
864
|
wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
|
|
@@ -815,38 +867,38 @@ function Pn({
|
|
|
815
867
|
layout: "horizontal",
|
|
816
868
|
align: "center",
|
|
817
869
|
verticalAlign: "bottom",
|
|
818
|
-
onMouseEnter: (
|
|
819
|
-
onMouseLeave: () =>
|
|
870
|
+
onMouseEnter: (g) => o(String(g.value || "")),
|
|
871
|
+
onMouseLeave: () => o(null)
|
|
820
872
|
}
|
|
821
873
|
)
|
|
822
874
|
] }) });
|
|
823
|
-
} catch (
|
|
824
|
-
return /* @__PURE__ */
|
|
825
|
-
/* @__PURE__ */
|
|
826
|
-
/* @__PURE__ */
|
|
827
|
-
/* @__PURE__ */
|
|
875
|
+
} catch (c) {
|
|
876
|
+
return /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
877
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Pie Chart Error" }),
|
|
878
|
+
/* @__PURE__ */ s("div", { className: "text-xs mb-2", children: c instanceof Error ? c.message : "Unknown rendering error" }),
|
|
879
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-muted", children: "Check the data and configuration" })
|
|
828
880
|
] }) });
|
|
829
881
|
}
|
|
830
882
|
}
|
|
831
|
-
function
|
|
883
|
+
function nr({
|
|
832
884
|
data: e,
|
|
833
885
|
chartConfig: t,
|
|
834
886
|
displayConfig: n = {},
|
|
835
887
|
queryObject: r,
|
|
836
|
-
height:
|
|
837
|
-
colorPalette:
|
|
888
|
+
height: i = "100%",
|
|
889
|
+
colorPalette: a
|
|
838
890
|
}) {
|
|
839
|
-
const [
|
|
891
|
+
const [l, o] = H(null), { getFieldLabel: d } = X();
|
|
840
892
|
try {
|
|
841
|
-
const
|
|
893
|
+
const c = {
|
|
842
894
|
showLegend: n?.showLegend ?? !0,
|
|
843
895
|
showGrid: n?.showGrid ?? !0,
|
|
844
896
|
showTooltip: n?.showTooltip ?? !0
|
|
845
897
|
};
|
|
846
898
|
if (!e || e.length === 0)
|
|
847
|
-
return /* @__PURE__ */
|
|
848
|
-
/* @__PURE__ */
|
|
849
|
-
/* @__PURE__ */
|
|
899
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
900
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
901
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in scatter chart" })
|
|
850
902
|
] }) });
|
|
851
903
|
let u, f, m = [];
|
|
852
904
|
if (t?.xAxis && t?.yAxis) {
|
|
@@ -856,47 +908,47 @@ function er({
|
|
|
856
908
|
} else if (t?.x && t?.y)
|
|
857
909
|
u = t.x, f = Array.isArray(t.y) ? t.y[0] : t.y;
|
|
858
910
|
else
|
|
859
|
-
return /* @__PURE__ */
|
|
860
|
-
/* @__PURE__ */
|
|
861
|
-
/* @__PURE__ */
|
|
911
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
912
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
913
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
|
|
862
914
|
] }) });
|
|
863
915
|
if (!u || !f)
|
|
864
|
-
return /* @__PURE__ */
|
|
865
|
-
/* @__PURE__ */
|
|
866
|
-
/* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
917
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
918
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
|
|
867
919
|
] }) });
|
|
868
920
|
const N = (r?.timeDimensions || []).map((x) => x.dimension);
|
|
869
|
-
let
|
|
921
|
+
let g, h = {};
|
|
870
922
|
if (m.length > 0) {
|
|
871
923
|
const x = m[0];
|
|
872
|
-
e.forEach((
|
|
873
|
-
const w = String(
|
|
924
|
+
e.forEach((k) => {
|
|
925
|
+
const w = String(k[x] || "Default");
|
|
874
926
|
h[w] || (h[w] = []);
|
|
875
|
-
const T =
|
|
876
|
-
if (
|
|
877
|
-
const
|
|
927
|
+
const T = O(r, u), $ = R(k[u], T) || k[u], L = te(k[f]), E = typeof $ == "string" ? parseFloat($) : $;
|
|
928
|
+
if (ke(E) && L !== null) {
|
|
929
|
+
const D = {};
|
|
878
930
|
N.forEach((V) => {
|
|
879
|
-
if (
|
|
880
|
-
const
|
|
881
|
-
|
|
931
|
+
if (k[V]) {
|
|
932
|
+
const G = O(r, V);
|
|
933
|
+
D[V] = R(k[V], G);
|
|
882
934
|
}
|
|
883
935
|
}), h[w].push({
|
|
884
|
-
x:
|
|
936
|
+
x: E,
|
|
885
937
|
y: L,
|
|
886
938
|
name: w,
|
|
887
|
-
timeValues:
|
|
888
|
-
originalItem:
|
|
939
|
+
timeValues: D,
|
|
940
|
+
originalItem: k
|
|
889
941
|
});
|
|
890
942
|
}
|
|
891
|
-
}),
|
|
943
|
+
}), g = Object.keys(h).flatMap((k) => h[k]);
|
|
892
944
|
} else {
|
|
893
|
-
const x =
|
|
894
|
-
|
|
895
|
-
const
|
|
945
|
+
const x = O(r, u);
|
|
946
|
+
g = e.map((y) => {
|
|
947
|
+
const k = R(y[u], x) || y[u], w = te(y[f]), T = typeof k == "string" ? parseFloat(k) : k, $ = {};
|
|
896
948
|
return N.forEach((L) => {
|
|
897
949
|
if (y[L]) {
|
|
898
|
-
const
|
|
899
|
-
$[L] = R(y[L],
|
|
950
|
+
const E = O(r, L);
|
|
951
|
+
$[L] = R(y[L], E);
|
|
900
952
|
}
|
|
901
953
|
}), {
|
|
902
954
|
x: T,
|
|
@@ -904,23 +956,23 @@ function er({
|
|
|
904
956
|
name: "Point",
|
|
905
957
|
timeValues: $,
|
|
906
958
|
originalItem: y,
|
|
907
|
-
isValid:
|
|
959
|
+
isValid: ke(T) && w !== null
|
|
908
960
|
};
|
|
909
961
|
}).filter((y) => y.isValid);
|
|
910
962
|
}
|
|
911
|
-
if (!
|
|
912
|
-
return /* @__PURE__ */
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
/* @__PURE__ */
|
|
963
|
+
if (!g || g.length === 0)
|
|
964
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
965
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
966
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for scatter chart after transformation" })
|
|
915
967
|
] }) });
|
|
916
|
-
const M = Object.keys(h), v = M.length > 1 && M.length <= 20, A =
|
|
968
|
+
const M = Object.keys(h), v = M.length > 1 && M.length <= 20, A = c.showLegend && v, S = {
|
|
917
969
|
...we,
|
|
918
970
|
left: 40
|
|
919
971
|
// Increased from 20 to 40 for Y-axis label space
|
|
920
972
|
};
|
|
921
|
-
return /* @__PURE__ */
|
|
922
|
-
|
|
923
|
-
/* @__PURE__ */
|
|
973
|
+
return /* @__PURE__ */ s(B, { height: i, children: /* @__PURE__ */ b(Lt, { margin: S, children: [
|
|
974
|
+
c.showGrid && /* @__PURE__ */ s(ve, { strokeDasharray: "3 3" }),
|
|
975
|
+
/* @__PURE__ */ s(
|
|
924
976
|
be,
|
|
925
977
|
{
|
|
926
978
|
type: "number",
|
|
@@ -929,7 +981,7 @@ function er({
|
|
|
929
981
|
tick: { fontSize: 12 }
|
|
930
982
|
}
|
|
931
983
|
),
|
|
932
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ s(
|
|
933
985
|
Ne,
|
|
934
986
|
{
|
|
935
987
|
type: "number",
|
|
@@ -939,14 +991,14 @@ function er({
|
|
|
939
991
|
label: { value: d(f), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
|
|
940
992
|
}
|
|
941
993
|
),
|
|
942
|
-
|
|
994
|
+
c.showTooltip && /* @__PURE__ */ s(
|
|
943
995
|
lt,
|
|
944
996
|
{
|
|
945
997
|
cursor: { strokeDasharray: "3 3" },
|
|
946
998
|
content: ({ active: x, payload: y }) => {
|
|
947
999
|
if (!x || !y || y.length === 0) return null;
|
|
948
|
-
const
|
|
949
|
-
return
|
|
1000
|
+
const k = y[0]?.payload;
|
|
1001
|
+
return k ? /* @__PURE__ */ b("div", { style: {
|
|
950
1002
|
backgroundColor: "white",
|
|
951
1003
|
border: "1px solid #e5e7eb",
|
|
952
1004
|
borderRadius: "0.5rem",
|
|
@@ -955,8 +1007,8 @@ function er({
|
|
|
955
1007
|
boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
|
|
956
1008
|
padding: "8px 12px"
|
|
957
1009
|
}, children: [
|
|
958
|
-
/* @__PURE__ */
|
|
959
|
-
|
|
1010
|
+
/* @__PURE__ */ s("div", { style: { fontWeight: 600, marginBottom: "4px" }, children: k.name }),
|
|
1011
|
+
k.timeValues && Object.keys(k.timeValues).length > 0 && /* @__PURE__ */ s("div", { style: { marginBottom: "4px", color: "#6b7280" }, children: Object.entries(k.timeValues).map(([w, T]) => /* @__PURE__ */ b("div", { children: [
|
|
960
1012
|
d(w),
|
|
961
1013
|
": ",
|
|
962
1014
|
T
|
|
@@ -964,18 +1016,18 @@ function er({
|
|
|
964
1016
|
/* @__PURE__ */ b("div", { children: [
|
|
965
1017
|
d(u),
|
|
966
1018
|
": ",
|
|
967
|
-
|
|
1019
|
+
q(k.x)
|
|
968
1020
|
] }),
|
|
969
1021
|
/* @__PURE__ */ b("div", { children: [
|
|
970
1022
|
d(f),
|
|
971
1023
|
": ",
|
|
972
|
-
|
|
1024
|
+
q(k.y)
|
|
973
1025
|
] })
|
|
974
1026
|
] }) : null;
|
|
975
1027
|
}
|
|
976
1028
|
}
|
|
977
1029
|
),
|
|
978
|
-
A && /* @__PURE__ */
|
|
1030
|
+
A && /* @__PURE__ */ s(
|
|
979
1031
|
Y,
|
|
980
1032
|
{
|
|
981
1033
|
wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
|
|
@@ -984,51 +1036,51 @@ function er({
|
|
|
984
1036
|
layout: "horizontal",
|
|
985
1037
|
align: "center",
|
|
986
1038
|
verticalAlign: "bottom",
|
|
987
|
-
onMouseEnter: (x) =>
|
|
988
|
-
onMouseLeave: () =>
|
|
1039
|
+
onMouseEnter: (x) => o(String(x.dataKey || "")),
|
|
1040
|
+
onMouseLeave: () => o(null)
|
|
989
1041
|
}
|
|
990
1042
|
),
|
|
991
1043
|
v ? (
|
|
992
1044
|
// Multiple series
|
|
993
|
-
M.map((x, y) => /* @__PURE__ */
|
|
1045
|
+
M.map((x, y) => /* @__PURE__ */ s(
|
|
994
1046
|
Ge,
|
|
995
1047
|
{
|
|
996
1048
|
name: x,
|
|
997
1049
|
data: h[x],
|
|
998
|
-
fill:
|
|
999
|
-
fillOpacity:
|
|
1050
|
+
fill: a?.colors && a.colors[y % a.colors.length] || j[y % j.length],
|
|
1051
|
+
fillOpacity: l ? l === x ? 1 : 0.3 : 1
|
|
1000
1052
|
},
|
|
1001
1053
|
x
|
|
1002
1054
|
))
|
|
1003
1055
|
) : (
|
|
1004
1056
|
// Single series
|
|
1005
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ s(
|
|
1006
1058
|
Ge,
|
|
1007
1059
|
{
|
|
1008
1060
|
name: "Data",
|
|
1009
|
-
data:
|
|
1010
|
-
fill:
|
|
1061
|
+
data: g,
|
|
1062
|
+
fill: a?.colors && a.colors[0] || j[0]
|
|
1011
1063
|
}
|
|
1012
1064
|
)
|
|
1013
1065
|
)
|
|
1014
1066
|
] }) });
|
|
1015
|
-
} catch (
|
|
1016
|
-
return /* @__PURE__ */
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
/* @__PURE__ */
|
|
1067
|
+
} catch (c) {
|
|
1068
|
+
return /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
1069
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Scatter Chart Error" }),
|
|
1070
|
+
/* @__PURE__ */ s("div", { className: "text-xs mb-2", children: c instanceof Error ? c.message : "Unknown rendering error" }),
|
|
1071
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-muted", children: "Check the data and configuration" })
|
|
1020
1072
|
] }) });
|
|
1021
1073
|
}
|
|
1022
1074
|
}
|
|
1023
|
-
function
|
|
1075
|
+
function rr({
|
|
1024
1076
|
data: e,
|
|
1025
1077
|
chartConfig: t,
|
|
1026
1078
|
displayConfig: n = {},
|
|
1027
1079
|
queryObject: r,
|
|
1028
|
-
height:
|
|
1029
|
-
colorPalette:
|
|
1080
|
+
height: i = "100%",
|
|
1081
|
+
colorPalette: a
|
|
1030
1082
|
}) {
|
|
1031
|
-
const [
|
|
1083
|
+
const [l, o] = H(null);
|
|
1032
1084
|
try {
|
|
1033
1085
|
const d = {
|
|
1034
1086
|
showLegend: n?.showLegend ?? !0,
|
|
@@ -1036,36 +1088,36 @@ function tr({
|
|
|
1036
1088
|
showGrid: n?.showGrid ?? !0
|
|
1037
1089
|
};
|
|
1038
1090
|
if (!e || e.length === 0)
|
|
1039
|
-
return /* @__PURE__ */
|
|
1040
|
-
/* @__PURE__ */
|
|
1041
|
-
/* @__PURE__ */
|
|
1091
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
1092
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
1093
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in radar chart" })
|
|
1042
1094
|
] }) });
|
|
1043
|
-
let
|
|
1095
|
+
let c, u = [];
|
|
1044
1096
|
if (t?.xAxis && t?.yAxis) {
|
|
1045
|
-
const f = Array.isArray(t.xAxis) ? t.xAxis[0] : t.xAxis, m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis],
|
|
1097
|
+
const f = Array.isArray(t.xAxis) ? t.xAxis[0] : t.xAxis, m = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], p = t.series || [], { data: N, seriesKeys: g } = se(
|
|
1046
1098
|
e,
|
|
1047
1099
|
f,
|
|
1048
1100
|
m,
|
|
1049
1101
|
r,
|
|
1050
|
-
|
|
1102
|
+
p
|
|
1051
1103
|
);
|
|
1052
|
-
|
|
1104
|
+
c = N, u = g;
|
|
1053
1105
|
} else {
|
|
1054
|
-
const f = e[0], m = Object.keys(f),
|
|
1055
|
-
(
|
|
1106
|
+
const f = e[0], m = Object.keys(f), p = m.find(
|
|
1107
|
+
(g) => typeof f[g] == "string" || g.toLowerCase().includes("subject") || g.toLowerCase().includes("name") || g.toLowerCase().includes("category")
|
|
1056
1108
|
) || m[0], N = m.filter(
|
|
1057
|
-
(
|
|
1109
|
+
(g) => typeof f[g] == "number" && g !== p
|
|
1058
1110
|
);
|
|
1059
1111
|
if (N.length === 0)
|
|
1060
|
-
return /* @__PURE__ */
|
|
1061
|
-
/* @__PURE__ */
|
|
1062
|
-
/* @__PURE__ */
|
|
1112
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
1113
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
1114
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: "No numeric fields found for radar chart values" })
|
|
1063
1115
|
] }) });
|
|
1064
|
-
if (
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1116
|
+
if (p) {
|
|
1117
|
+
const g = O(r, p);
|
|
1118
|
+
c = e.map((h) => {
|
|
1067
1119
|
const M = {
|
|
1068
|
-
name: R(h[
|
|
1120
|
+
name: R(h[p], g) || String(h[p]) || "Unknown"
|
|
1069
1121
|
};
|
|
1070
1122
|
return N.forEach((F) => {
|
|
1071
1123
|
const v = F.split(".").pop() || F;
|
|
@@ -1073,33 +1125,33 @@ function tr({
|
|
|
1073
1125
|
}), M;
|
|
1074
1126
|
}), u = N.map((h) => h.split(".").pop() || h);
|
|
1075
1127
|
} else
|
|
1076
|
-
|
|
1077
|
-
name: String(
|
|
1078
|
-
value: typeof
|
|
1128
|
+
c = e.map((g) => ({
|
|
1129
|
+
name: String(g[m[0]] || "Unknown"),
|
|
1130
|
+
value: typeof g[N[0]] == "string" ? parseFloat(g[N[0]]) : g[N[0]] || 0
|
|
1079
1131
|
})), u = ["value"];
|
|
1080
1132
|
}
|
|
1081
|
-
return !
|
|
1082
|
-
/* @__PURE__ */
|
|
1083
|
-
/* @__PURE__ */
|
|
1084
|
-
] }) }) : /* @__PURE__ */
|
|
1085
|
-
d.showGrid && /* @__PURE__ */
|
|
1086
|
-
/* @__PURE__ */
|
|
1087
|
-
|
|
1133
|
+
return !c || c.length === 0 ? /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
1134
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
1135
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for radar chart after transformation" })
|
|
1136
|
+
] }) }) : /* @__PURE__ */ s(B, { height: i, children: /* @__PURE__ */ b(Tt, { data: c, margin: { top: 20, right: 80, bottom: 20, left: 80 }, children: [
|
|
1137
|
+
d.showGrid && /* @__PURE__ */ s(Ft, {}),
|
|
1138
|
+
/* @__PURE__ */ s(
|
|
1139
|
+
Et,
|
|
1088
1140
|
{
|
|
1089
1141
|
dataKey: "name",
|
|
1090
1142
|
tick: { fontSize: 12 },
|
|
1091
1143
|
className: "text-dc-text-muted"
|
|
1092
1144
|
}
|
|
1093
1145
|
),
|
|
1094
|
-
/* @__PURE__ */
|
|
1095
|
-
|
|
1146
|
+
/* @__PURE__ */ s(
|
|
1147
|
+
jt,
|
|
1096
1148
|
{
|
|
1097
1149
|
tick: { fontSize: 10 },
|
|
1098
1150
|
className: "text-dc-text-muted"
|
|
1099
1151
|
}
|
|
1100
1152
|
),
|
|
1101
|
-
d.showTooltip && /* @__PURE__ */
|
|
1102
|
-
d.showLegend && u.length > 1 && /* @__PURE__ */
|
|
1153
|
+
d.showTooltip && /* @__PURE__ */ s(Q, {}),
|
|
1154
|
+
d.showLegend && u.length > 1 && /* @__PURE__ */ s(
|
|
1103
1155
|
Y,
|
|
1104
1156
|
{
|
|
1105
1157
|
wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
|
|
@@ -1108,92 +1160,92 @@ function tr({
|
|
|
1108
1160
|
layout: "horizontal",
|
|
1109
1161
|
align: "center",
|
|
1110
1162
|
verticalAlign: "bottom",
|
|
1111
|
-
onMouseEnter: (f) =>
|
|
1112
|
-
onMouseLeave: () =>
|
|
1163
|
+
onMouseEnter: (f) => o(String(f.dataKey || "")),
|
|
1164
|
+
onMouseLeave: () => o(null)
|
|
1113
1165
|
}
|
|
1114
1166
|
),
|
|
1115
|
-
u.map((f, m) => /* @__PURE__ */
|
|
1116
|
-
|
|
1167
|
+
u.map((f, m) => /* @__PURE__ */ s(
|
|
1168
|
+
zt,
|
|
1117
1169
|
{
|
|
1118
1170
|
name: f,
|
|
1119
1171
|
dataKey: f,
|
|
1120
|
-
stroke:
|
|
1121
|
-
fill:
|
|
1122
|
-
fillOpacity:
|
|
1123
|
-
strokeOpacity:
|
|
1172
|
+
stroke: a?.colors && a.colors[m % a.colors.length] || j[m % j.length],
|
|
1173
|
+
fill: a?.colors && a.colors[m % a.colors.length] || j[m % j.length],
|
|
1174
|
+
fillOpacity: l ? l === f ? 0.6 : 0.1 : 0.3,
|
|
1175
|
+
strokeOpacity: l ? l === f ? 1 : 0.3 : 1,
|
|
1124
1176
|
strokeWidth: 2
|
|
1125
1177
|
},
|
|
1126
1178
|
f
|
|
1127
1179
|
))
|
|
1128
1180
|
] }) });
|
|
1129
1181
|
} catch (d) {
|
|
1130
|
-
return /* @__PURE__ */
|
|
1131
|
-
/* @__PURE__ */
|
|
1132
|
-
/* @__PURE__ */
|
|
1133
|
-
/* @__PURE__ */
|
|
1182
|
+
return /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
1183
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Radar Chart Error" }),
|
|
1184
|
+
/* @__PURE__ */ s("div", { className: "text-xs mb-2", children: d instanceof Error ? d.message : "Unknown rendering error" }),
|
|
1185
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-muted", children: "Check the data and configuration" })
|
|
1134
1186
|
] }) });
|
|
1135
1187
|
}
|
|
1136
1188
|
}
|
|
1137
|
-
function
|
|
1189
|
+
function ir({
|
|
1138
1190
|
data: e,
|
|
1139
1191
|
chartConfig: t,
|
|
1140
1192
|
displayConfig: n = {},
|
|
1141
1193
|
queryObject: r,
|
|
1142
|
-
height:
|
|
1143
|
-
colorPalette:
|
|
1194
|
+
height: i = "100%",
|
|
1195
|
+
colorPalette: a
|
|
1144
1196
|
}) {
|
|
1145
|
-
const [
|
|
1197
|
+
const [l, o] = H(null);
|
|
1146
1198
|
try {
|
|
1147
1199
|
const d = {
|
|
1148
1200
|
showLegend: n?.showLegend ?? !0,
|
|
1149
1201
|
showTooltip: n?.showTooltip ?? !0
|
|
1150
1202
|
};
|
|
1151
1203
|
if (!e || e.length === 0)
|
|
1152
|
-
return /* @__PURE__ */
|
|
1153
|
-
/* @__PURE__ */
|
|
1154
|
-
/* @__PURE__ */
|
|
1204
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
1205
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
1206
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in radial bar chart" })
|
|
1155
1207
|
] }) });
|
|
1156
|
-
let
|
|
1208
|
+
let c;
|
|
1157
1209
|
if (t?.xAxis && t?.yAxis) {
|
|
1158
|
-
const u = Array.isArray(t.xAxis) ? t.xAxis[0] : t.xAxis, f = Array.isArray(t.yAxis) ? t.yAxis[0] : t.yAxis, m =
|
|
1159
|
-
|
|
1160
|
-
name: R(
|
|
1161
|
-
value: typeof
|
|
1162
|
-
fill:
|
|
1210
|
+
const u = Array.isArray(t.xAxis) ? t.xAxis[0] : t.xAxis, f = Array.isArray(t.yAxis) ? t.yAxis[0] : t.yAxis, m = O(r, u);
|
|
1211
|
+
c = e.map((p, N) => ({
|
|
1212
|
+
name: R(p[u], m) || String(p[u]) || "Unknown",
|
|
1213
|
+
value: typeof p[f] == "string" ? parseFloat(p[f]) : p[f] || 0,
|
|
1214
|
+
fill: a?.colors && a.colors[N % a.colors.length] || j[N % j.length]
|
|
1163
1215
|
}));
|
|
1164
1216
|
} else {
|
|
1165
1217
|
const u = e[0], f = Object.keys(u), m = f.find(
|
|
1166
1218
|
(N) => typeof u[N] == "string" || N.toLowerCase().includes("name") || N.toLowerCase().includes("label") || N.toLowerCase().includes("category")
|
|
1167
|
-
) || f[0],
|
|
1219
|
+
) || f[0], p = f.find(
|
|
1168
1220
|
(N) => typeof u[N] == "number" && N !== m
|
|
1169
1221
|
) || f[1];
|
|
1170
|
-
if (!
|
|
1171
|
-
return /* @__PURE__ */
|
|
1172
|
-
/* @__PURE__ */
|
|
1173
|
-
/* @__PURE__ */
|
|
1222
|
+
if (!p)
|
|
1223
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
1224
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
1225
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: "No numeric field found for radial bar chart values" })
|
|
1174
1226
|
] }) });
|
|
1175
|
-
|
|
1227
|
+
c = e.map((N, g) => {
|
|
1176
1228
|
let h = N[m];
|
|
1177
1229
|
return typeof h == "boolean" ? h = h ? "Active" : "Inactive" : h === "true" || h === "false" ? h = h === "true" ? "Active" : "Inactive" : h = String(h), {
|
|
1178
1230
|
name: h,
|
|
1179
|
-
value: typeof N[
|
|
1180
|
-
fill:
|
|
1231
|
+
value: typeof N[p] == "string" ? parseFloat(N[p]) : N[p] || 0,
|
|
1232
|
+
fill: a?.colors && a.colors[g % a.colors.length] || j[g % j.length]
|
|
1181
1233
|
};
|
|
1182
1234
|
});
|
|
1183
1235
|
}
|
|
1184
|
-
return
|
|
1185
|
-
/* @__PURE__ */
|
|
1186
|
-
/* @__PURE__ */
|
|
1187
|
-
] }) }) : /* @__PURE__ */
|
|
1188
|
-
|
|
1236
|
+
return c = c.filter((u) => u.value != null && u.value !== 0), c.length === 0 ? /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
1237
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
1238
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for radial bar chart after transformation" })
|
|
1239
|
+
] }) }) : /* @__PURE__ */ s(B, { height: i, children: /* @__PURE__ */ b(
|
|
1240
|
+
Dt,
|
|
1189
1241
|
{
|
|
1190
|
-
data:
|
|
1242
|
+
data: c,
|
|
1191
1243
|
innerRadius: "10%",
|
|
1192
1244
|
outerRadius: "80%",
|
|
1193
1245
|
margin: { top: 20, right: 30, bottom: 20, left: 30 },
|
|
1194
1246
|
children: [
|
|
1195
|
-
d.showTooltip && /* @__PURE__ */
|
|
1196
|
-
d.showLegend && /* @__PURE__ */
|
|
1247
|
+
d.showTooltip && /* @__PURE__ */ s(Q, {}),
|
|
1248
|
+
d.showLegend && /* @__PURE__ */ s(
|
|
1197
1249
|
Y,
|
|
1198
1250
|
{
|
|
1199
1251
|
wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
|
|
@@ -1202,21 +1254,21 @@ function nr({
|
|
|
1202
1254
|
layout: "horizontal",
|
|
1203
1255
|
align: "center",
|
|
1204
1256
|
verticalAlign: "bottom",
|
|
1205
|
-
onMouseEnter: (u) =>
|
|
1206
|
-
onMouseLeave: () =>
|
|
1257
|
+
onMouseEnter: (u) => o(String(u.value || "")),
|
|
1258
|
+
onMouseLeave: () => o(null)
|
|
1207
1259
|
}
|
|
1208
1260
|
),
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
|
|
1261
|
+
/* @__PURE__ */ s(
|
|
1262
|
+
Rt,
|
|
1211
1263
|
{
|
|
1212
1264
|
dataKey: "value",
|
|
1213
1265
|
cornerRadius: 4,
|
|
1214
1266
|
label: { position: "insideStart", fill: "#fff", fontSize: 12 },
|
|
1215
|
-
children:
|
|
1216
|
-
|
|
1267
|
+
children: c.map((u, f) => /* @__PURE__ */ s(
|
|
1268
|
+
je,
|
|
1217
1269
|
{
|
|
1218
1270
|
fill: u.fill,
|
|
1219
|
-
fillOpacity:
|
|
1271
|
+
fillOpacity: l ? l === u.name ? 1 : 0.3 : 1
|
|
1220
1272
|
},
|
|
1221
1273
|
`cell-${f}`
|
|
1222
1274
|
))
|
|
@@ -1226,59 +1278,59 @@ function nr({
|
|
|
1226
1278
|
}
|
|
1227
1279
|
) });
|
|
1228
1280
|
} catch (d) {
|
|
1229
|
-
return /* @__PURE__ */
|
|
1230
|
-
/* @__PURE__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
/* @__PURE__ */
|
|
1281
|
+
return /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
1282
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Radial Bar Chart Error" }),
|
|
1283
|
+
/* @__PURE__ */ s("div", { className: "text-xs mb-2", children: d instanceof Error ? d.message : "Unknown rendering error" }),
|
|
1284
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-muted", children: "Check the data and configuration" })
|
|
1233
1285
|
] }) });
|
|
1234
1286
|
}
|
|
1235
1287
|
}
|
|
1236
1288
|
function fe(e, t) {
|
|
1237
1289
|
return e == null || t == null ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
|
|
1238
1290
|
}
|
|
1239
|
-
function
|
|
1291
|
+
function Ht(e, t) {
|
|
1240
1292
|
return e == null || t == null ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
|
|
1241
1293
|
}
|
|
1242
1294
|
function ct(e) {
|
|
1243
1295
|
let t, n, r;
|
|
1244
|
-
e.length !== 2 ? (t = fe, n = (
|
|
1245
|
-
function
|
|
1246
|
-
if (
|
|
1296
|
+
e.length !== 2 ? (t = fe, n = (o, d) => fe(e(o), d), r = (o, d) => e(o) - d) : (t = e === fe || e === Ht ? e : Gt, n = e, r = e);
|
|
1297
|
+
function i(o, d, c = 0, u = o.length) {
|
|
1298
|
+
if (c < u) {
|
|
1247
1299
|
if (t(d, d) !== 0) return u;
|
|
1248
1300
|
do {
|
|
1249
|
-
const f =
|
|
1250
|
-
n(
|
|
1251
|
-
} while (
|
|
1301
|
+
const f = c + u >>> 1;
|
|
1302
|
+
n(o[f], d) < 0 ? c = f + 1 : u = f;
|
|
1303
|
+
} while (c < u);
|
|
1252
1304
|
}
|
|
1253
|
-
return
|
|
1305
|
+
return c;
|
|
1254
1306
|
}
|
|
1255
|
-
function
|
|
1256
|
-
if (
|
|
1307
|
+
function a(o, d, c = 0, u = o.length) {
|
|
1308
|
+
if (c < u) {
|
|
1257
1309
|
if (t(d, d) !== 0) return u;
|
|
1258
1310
|
do {
|
|
1259
|
-
const f =
|
|
1260
|
-
n(
|
|
1261
|
-
} while (
|
|
1311
|
+
const f = c + u >>> 1;
|
|
1312
|
+
n(o[f], d) <= 0 ? c = f + 1 : u = f;
|
|
1313
|
+
} while (c < u);
|
|
1262
1314
|
}
|
|
1263
|
-
return
|
|
1315
|
+
return c;
|
|
1264
1316
|
}
|
|
1265
|
-
function
|
|
1266
|
-
const f =
|
|
1267
|
-
return f >
|
|
1317
|
+
function l(o, d, c = 0, u = o.length) {
|
|
1318
|
+
const f = i(o, d, c, u - 1);
|
|
1319
|
+
return f > c && r(o[f - 1], d) > -r(o[f], d) ? f - 1 : f;
|
|
1268
1320
|
}
|
|
1269
|
-
return { left:
|
|
1321
|
+
return { left: i, center: l, right: a };
|
|
1270
1322
|
}
|
|
1271
|
-
function
|
|
1323
|
+
function Gt() {
|
|
1272
1324
|
return 0;
|
|
1273
1325
|
}
|
|
1274
|
-
function
|
|
1326
|
+
function Ut(e) {
|
|
1275
1327
|
return e === null ? NaN : +e;
|
|
1276
1328
|
}
|
|
1277
|
-
const
|
|
1278
|
-
ct(
|
|
1329
|
+
const qt = ct(fe), dt = qt.right;
|
|
1330
|
+
ct(Ut).center;
|
|
1279
1331
|
class qe extends Map {
|
|
1280
|
-
constructor(t, n =
|
|
1281
|
-
if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: n } }), t != null) for (const [r,
|
|
1332
|
+
constructor(t, n = Wt) {
|
|
1333
|
+
if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: n } }), t != null) for (const [r, i] of t) this.set(r, i);
|
|
1282
1334
|
}
|
|
1283
1335
|
get(t) {
|
|
1284
1336
|
return super.get(Be(this, t));
|
|
@@ -1287,53 +1339,53 @@ class qe extends Map {
|
|
|
1287
1339
|
return super.has(Be(this, t));
|
|
1288
1340
|
}
|
|
1289
1341
|
set(t, n) {
|
|
1290
|
-
return super.set(
|
|
1342
|
+
return super.set(Bt(this, t), n);
|
|
1291
1343
|
}
|
|
1292
1344
|
delete(t) {
|
|
1293
|
-
return super.delete(
|
|
1345
|
+
return super.delete(Kt(this, t));
|
|
1294
1346
|
}
|
|
1295
1347
|
}
|
|
1296
1348
|
function Be({ _intern: e, _key: t }, n) {
|
|
1297
1349
|
const r = t(n);
|
|
1298
1350
|
return e.has(r) ? e.get(r) : n;
|
|
1299
1351
|
}
|
|
1300
|
-
function
|
|
1352
|
+
function Bt({ _intern: e, _key: t }, n) {
|
|
1301
1353
|
const r = t(n);
|
|
1302
1354
|
return e.has(r) ? e.get(r) : (e.set(r, n), n);
|
|
1303
1355
|
}
|
|
1304
|
-
function
|
|
1356
|
+
function Kt({ _intern: e, _key: t }, n) {
|
|
1305
1357
|
const r = t(n);
|
|
1306
1358
|
return e.has(r) && (n = e.get(r), e.delete(r)), n;
|
|
1307
1359
|
}
|
|
1308
|
-
function
|
|
1360
|
+
function Wt(e) {
|
|
1309
1361
|
return e !== null && typeof e == "object" ? e.valueOf() : e;
|
|
1310
1362
|
}
|
|
1311
|
-
const
|
|
1363
|
+
const Ct = Math.sqrt(50), Yt = Math.sqrt(10), Xt = Math.sqrt(2);
|
|
1312
1364
|
function me(e, t, n) {
|
|
1313
|
-
const r = (t - e) / Math.max(0, n),
|
|
1314
|
-
let
|
|
1315
|
-
return
|
|
1365
|
+
const r = (t - e) / Math.max(0, n), i = Math.floor(Math.log10(r)), a = r / Math.pow(10, i), l = a >= Ct ? 10 : a >= Yt ? 5 : a >= Xt ? 2 : 1;
|
|
1366
|
+
let o, d, c;
|
|
1367
|
+
return i < 0 ? (c = Math.pow(10, -i) / l, o = Math.round(e * c), d = Math.round(t * c), o / c < e && ++o, d / c > t && --d, c = -c) : (c = Math.pow(10, i) * l, o = Math.round(e / c), d = Math.round(t / c), o * c < e && ++o, d * c > t && --d), d < o && 0.5 <= n && n < 2 ? me(e, t, n * 2) : [o, d, c];
|
|
1316
1368
|
}
|
|
1317
|
-
function
|
|
1369
|
+
function Qt(e, t, n) {
|
|
1318
1370
|
if (t = +t, e = +e, n = +n, !(n > 0)) return [];
|
|
1319
1371
|
if (e === t) return [e];
|
|
1320
|
-
const r = t < e, [
|
|
1321
|
-
if (!(
|
|
1322
|
-
const
|
|
1372
|
+
const r = t < e, [i, a, l] = r ? me(t, e, n) : me(e, t, n);
|
|
1373
|
+
if (!(a >= i)) return [];
|
|
1374
|
+
const o = a - i + 1, d = new Array(o);
|
|
1323
1375
|
if (r)
|
|
1324
|
-
if (
|
|
1325
|
-
else for (let
|
|
1326
|
-
else if (
|
|
1327
|
-
else for (let
|
|
1376
|
+
if (l < 0) for (let c = 0; c < o; ++c) d[c] = (a - c) / -l;
|
|
1377
|
+
else for (let c = 0; c < o; ++c) d[c] = (a - c) * l;
|
|
1378
|
+
else if (l < 0) for (let c = 0; c < o; ++c) d[c] = (i + c) / -l;
|
|
1379
|
+
else for (let c = 0; c < o; ++c) d[c] = (i + c) * l;
|
|
1328
1380
|
return d;
|
|
1329
1381
|
}
|
|
1330
1382
|
function $e(e, t, n) {
|
|
1331
1383
|
return t = +t, e = +e, n = +n, me(e, t, n)[2];
|
|
1332
1384
|
}
|
|
1333
|
-
function
|
|
1385
|
+
function Zt(e, t, n) {
|
|
1334
1386
|
t = +t, e = +e, n = +n;
|
|
1335
|
-
const r = t < e,
|
|
1336
|
-
return (r ? -1 : 1) * (
|
|
1387
|
+
const r = t < e, i = r ? $e(t, e, n) : $e(e, t, n);
|
|
1388
|
+
return (r ? -1 : 1) * (i < 0 ? 1 / -i : i);
|
|
1337
1389
|
}
|
|
1338
1390
|
function Re(e, t, n) {
|
|
1339
1391
|
e.prototype = t.prototype = n, n.constructor = e;
|
|
@@ -1345,7 +1397,7 @@ function ut(e, t) {
|
|
|
1345
1397
|
}
|
|
1346
1398
|
function ae() {
|
|
1347
1399
|
}
|
|
1348
|
-
var ne = 0.7, xe = 1 / ne, P = "\\s*([+-]?\\d+)\\s*", re = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",
|
|
1400
|
+
var ne = 0.7, xe = 1 / ne, P = "\\s*([+-]?\\d+)\\s*", re = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", _ = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", Jt = /^#([0-9a-f]{3,8})$/, Pt = new RegExp(`^rgb\\(${P},${P},${P}\\)$`), en = new RegExp(`^rgb\\(${_},${_},${_}\\)$`), tn = new RegExp(`^rgba\\(${P},${P},${P},${re}\\)$`), nn = new RegExp(`^rgba\\(${_},${_},${_},${re}\\)$`), rn = new RegExp(`^hsl\\(${re},${_},${_}\\)$`), sn = new RegExp(`^hsla\\(${re},${_},${_},${re}\\)$`), Ke = {
|
|
1349
1401
|
aliceblue: 15792383,
|
|
1350
1402
|
antiquewhite: 16444375,
|
|
1351
1403
|
aqua: 65535,
|
|
@@ -1495,7 +1547,7 @@ var ne = 0.7, xe = 1 / ne, P = "\\s*([+-]?\\d+)\\s*", re = "\\s*([+-]?(?:\\d*\\.
|
|
|
1495
1547
|
yellow: 16776960,
|
|
1496
1548
|
yellowgreen: 10145074
|
|
1497
1549
|
};
|
|
1498
|
-
Re(ae,
|
|
1550
|
+
Re(ae, ie, {
|
|
1499
1551
|
copy(e) {
|
|
1500
1552
|
return Object.assign(new this.constructor(), this, e);
|
|
1501
1553
|
},
|
|
@@ -1505,54 +1557,54 @@ Re(ae, se, {
|
|
|
1505
1557
|
hex: We,
|
|
1506
1558
|
// Deprecated! Use color.formatHex.
|
|
1507
1559
|
formatHex: We,
|
|
1508
|
-
formatHex8:
|
|
1509
|
-
formatHsl:
|
|
1560
|
+
formatHex8: an,
|
|
1561
|
+
formatHsl: ln,
|
|
1510
1562
|
formatRgb: Ce,
|
|
1511
1563
|
toString: Ce
|
|
1512
1564
|
});
|
|
1513
1565
|
function We() {
|
|
1514
1566
|
return this.rgb().formatHex();
|
|
1515
1567
|
}
|
|
1516
|
-
function
|
|
1568
|
+
function an() {
|
|
1517
1569
|
return this.rgb().formatHex8();
|
|
1518
1570
|
}
|
|
1519
|
-
function
|
|
1571
|
+
function ln() {
|
|
1520
1572
|
return ft(this).formatHsl();
|
|
1521
1573
|
}
|
|
1522
1574
|
function Ce() {
|
|
1523
1575
|
return this.rgb().formatRgb();
|
|
1524
1576
|
}
|
|
1525
|
-
function
|
|
1577
|
+
function ie(e) {
|
|
1526
1578
|
var t, n;
|
|
1527
|
-
return e = (e + "").trim().toLowerCase(), (t =
|
|
1579
|
+
return e = (e + "").trim().toLowerCase(), (t = Jt.exec(e)) ? (n = t[1].length, t = parseInt(t[1], 16), n === 6 ? Ye(t) : n === 3 ? new z(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : n === 8 ? ce(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : n === 4 ? ce(t >> 12 & 15 | t >> 8 & 240, t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, ((t & 15) << 4 | t & 15) / 255) : null) : (t = Pt.exec(e)) ? new z(t[1], t[2], t[3], 1) : (t = en.exec(e)) ? new z(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = tn.exec(e)) ? ce(t[1], t[2], t[3], t[4]) : (t = nn.exec(e)) ? ce(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = rn.exec(e)) ? Ze(t[1], t[2] / 100, t[3] / 100, 1) : (t = sn.exec(e)) ? Ze(t[1], t[2] / 100, t[3] / 100, t[4]) : Ke.hasOwnProperty(e) ? Ye(Ke[e]) : e === "transparent" ? new z(NaN, NaN, NaN, 0) : null;
|
|
1528
1580
|
}
|
|
1529
1581
|
function Ye(e) {
|
|
1530
|
-
return new
|
|
1582
|
+
return new z(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
|
|
1531
1583
|
}
|
|
1532
1584
|
function ce(e, t, n, r) {
|
|
1533
|
-
return r <= 0 && (e = t = n = NaN), new
|
|
1585
|
+
return r <= 0 && (e = t = n = NaN), new z(e, t, n, r);
|
|
1534
1586
|
}
|
|
1535
|
-
function
|
|
1536
|
-
return e instanceof ae || (e =
|
|
1587
|
+
function on(e) {
|
|
1588
|
+
return e instanceof ae || (e = ie(e)), e ? (e = e.rgb(), new z(e.r, e.g, e.b, e.opacity)) : new z();
|
|
1537
1589
|
}
|
|
1538
1590
|
function Le(e, t, n, r) {
|
|
1539
|
-
return arguments.length === 1 ?
|
|
1591
|
+
return arguments.length === 1 ? on(e) : new z(e, t, n, r ?? 1);
|
|
1540
1592
|
}
|
|
1541
|
-
function
|
|
1593
|
+
function z(e, t, n, r) {
|
|
1542
1594
|
this.r = +e, this.g = +t, this.b = +n, this.opacity = +r;
|
|
1543
1595
|
}
|
|
1544
|
-
Re(
|
|
1596
|
+
Re(z, Le, ut(ae, {
|
|
1545
1597
|
brighter(e) {
|
|
1546
|
-
return e = e == null ? xe : Math.pow(xe, e), new
|
|
1598
|
+
return e = e == null ? xe : Math.pow(xe, e), new z(this.r * e, this.g * e, this.b * e, this.opacity);
|
|
1547
1599
|
},
|
|
1548
1600
|
darker(e) {
|
|
1549
|
-
return e = e == null ? ne : Math.pow(ne, e), new
|
|
1601
|
+
return e = e == null ? ne : Math.pow(ne, e), new z(this.r * e, this.g * e, this.b * e, this.opacity);
|
|
1550
1602
|
},
|
|
1551
1603
|
rgb() {
|
|
1552
1604
|
return this;
|
|
1553
1605
|
},
|
|
1554
1606
|
clamp() {
|
|
1555
|
-
return new
|
|
1607
|
+
return new z(C(this.r), C(this.g), C(this.b), he(this.opacity));
|
|
1556
1608
|
},
|
|
1557
1609
|
displayable() {
|
|
1558
1610
|
return -0.5 <= this.r && this.r < 255.5 && -0.5 <= this.g && this.g < 255.5 && -0.5 <= this.b && this.b < 255.5 && 0 <= this.opacity && this.opacity <= 1;
|
|
@@ -1560,14 +1612,14 @@ Re(j, Le, ut(ae, {
|
|
|
1560
1612
|
hex: Xe,
|
|
1561
1613
|
// Deprecated! Use color.formatHex.
|
|
1562
1614
|
formatHex: Xe,
|
|
1563
|
-
formatHex8:
|
|
1615
|
+
formatHex8: cn,
|
|
1564
1616
|
formatRgb: Qe,
|
|
1565
1617
|
toString: Qe
|
|
1566
1618
|
}));
|
|
1567
1619
|
function Xe() {
|
|
1568
1620
|
return `#${K(this.r)}${K(this.g)}${K(this.b)}`;
|
|
1569
1621
|
}
|
|
1570
|
-
function
|
|
1622
|
+
function cn() {
|
|
1571
1623
|
return `#${K(this.r)}${K(this.g)}${K(this.b)}${K((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
1572
1624
|
}
|
|
1573
1625
|
function Qe() {
|
|
@@ -1588,19 +1640,19 @@ function Ze(e, t, n, r) {
|
|
|
1588
1640
|
}
|
|
1589
1641
|
function ft(e) {
|
|
1590
1642
|
if (e instanceof I) return new I(e.h, e.s, e.l, e.opacity);
|
|
1591
|
-
if (e instanceof ae || (e =
|
|
1643
|
+
if (e instanceof ae || (e = ie(e)), !e) return new I();
|
|
1592
1644
|
if (e instanceof I) return e;
|
|
1593
1645
|
e = e.rgb();
|
|
1594
|
-
var t = e.r / 255, n = e.g / 255, r = e.b / 255,
|
|
1595
|
-
return
|
|
1646
|
+
var t = e.r / 255, n = e.g / 255, r = e.b / 255, i = Math.min(t, n, r), a = Math.max(t, n, r), l = NaN, o = a - i, d = (a + i) / 2;
|
|
1647
|
+
return o ? (t === a ? l = (n - r) / o + (n < r) * 6 : n === a ? l = (r - t) / o + 2 : l = (t - n) / o + 4, o /= d < 0.5 ? a + i : 2 - a - i, l *= 60) : o = d > 0 && d < 1 ? 0 : l, new I(l, o, d, e.opacity);
|
|
1596
1648
|
}
|
|
1597
|
-
function
|
|
1649
|
+
function dn(e, t, n, r) {
|
|
1598
1650
|
return arguments.length === 1 ? ft(e) : new I(e, t, n, r ?? 1);
|
|
1599
1651
|
}
|
|
1600
1652
|
function I(e, t, n, r) {
|
|
1601
1653
|
this.h = +e, this.s = +t, this.l = +n, this.opacity = +r;
|
|
1602
1654
|
}
|
|
1603
|
-
Re(I,
|
|
1655
|
+
Re(I, dn, ut(ae, {
|
|
1604
1656
|
brighter(e) {
|
|
1605
1657
|
return e = e == null ? xe : Math.pow(xe, e), new I(this.h, this.s, this.l * e, this.opacity);
|
|
1606
1658
|
},
|
|
@@ -1608,11 +1660,11 @@ Re(I, on, ut(ae, {
|
|
|
1608
1660
|
return e = e == null ? ne : Math.pow(ne, e), new I(this.h, this.s, this.l * e, this.opacity);
|
|
1609
1661
|
},
|
|
1610
1662
|
rgb() {
|
|
1611
|
-
var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * t,
|
|
1612
|
-
return new
|
|
1613
|
-
Ae(e >= 240 ? e - 240 : e + 120,
|
|
1614
|
-
Ae(e,
|
|
1615
|
-
Ae(e < 120 ? e + 240 : e - 120,
|
|
1663
|
+
var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, n = this.l, r = n + (n < 0.5 ? n : 1 - n) * t, i = 2 * n - r;
|
|
1664
|
+
return new z(
|
|
1665
|
+
Ae(e >= 240 ? e - 240 : e + 120, i, r),
|
|
1666
|
+
Ae(e, i, r),
|
|
1667
|
+
Ae(e < 120 ? e + 240 : e - 120, i, r),
|
|
1616
1668
|
this.opacity
|
|
1617
1669
|
);
|
|
1618
1670
|
},
|
|
@@ -1637,56 +1689,56 @@ function Ae(e, t, n) {
|
|
|
1637
1689
|
return (e < 60 ? t + (n - t) * e / 60 : e < 180 ? n : e < 240 ? t + (n - t) * (240 - e) / 60 : t) * 255;
|
|
1638
1690
|
}
|
|
1639
1691
|
const Ve = (e) => () => e;
|
|
1640
|
-
function
|
|
1692
|
+
function un(e, t) {
|
|
1641
1693
|
return function(n) {
|
|
1642
1694
|
return e + n * t;
|
|
1643
1695
|
};
|
|
1644
1696
|
}
|
|
1645
|
-
function
|
|
1697
|
+
function fn(e, t, n) {
|
|
1646
1698
|
return e = Math.pow(e, n), t = Math.pow(t, n) - e, n = 1 / n, function(r) {
|
|
1647
1699
|
return Math.pow(e + r * t, n);
|
|
1648
1700
|
};
|
|
1649
1701
|
}
|
|
1650
|
-
function
|
|
1702
|
+
function mn(e) {
|
|
1651
1703
|
return (e = +e) == 1 ? mt : function(t, n) {
|
|
1652
|
-
return n - t ?
|
|
1704
|
+
return n - t ? fn(t, n, e) : Ve(isNaN(t) ? n : t);
|
|
1653
1705
|
};
|
|
1654
1706
|
}
|
|
1655
1707
|
function mt(e, t) {
|
|
1656
1708
|
var n = t - e;
|
|
1657
|
-
return n ?
|
|
1709
|
+
return n ? un(e, n) : Ve(isNaN(e) ? t : e);
|
|
1658
1710
|
}
|
|
1659
1711
|
const Pe = (function e(t) {
|
|
1660
|
-
var n =
|
|
1661
|
-
function r(
|
|
1662
|
-
var
|
|
1712
|
+
var n = mn(t);
|
|
1713
|
+
function r(i, a) {
|
|
1714
|
+
var l = n((i = Le(i)).r, (a = Le(a)).r), o = n(i.g, a.g), d = n(i.b, a.b), c = mt(i.opacity, a.opacity);
|
|
1663
1715
|
return function(u) {
|
|
1664
|
-
return
|
|
1716
|
+
return i.r = l(u), i.g = o(u), i.b = d(u), i.opacity = c(u), i + "";
|
|
1665
1717
|
};
|
|
1666
1718
|
}
|
|
1667
1719
|
return r.gamma = e, r;
|
|
1668
1720
|
})(1);
|
|
1669
|
-
function
|
|
1721
|
+
function xn(e, t) {
|
|
1670
1722
|
t || (t = []);
|
|
1671
|
-
var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(),
|
|
1672
|
-
return function(
|
|
1673
|
-
for (
|
|
1723
|
+
var n = e ? Math.min(t.length, e.length) : 0, r = t.slice(), i;
|
|
1724
|
+
return function(a) {
|
|
1725
|
+
for (i = 0; i < n; ++i) r[i] = e[i] * (1 - a) + t[i] * a;
|
|
1674
1726
|
return r;
|
|
1675
1727
|
};
|
|
1676
1728
|
}
|
|
1677
|
-
function
|
|
1729
|
+
function hn(e) {
|
|
1678
1730
|
return ArrayBuffer.isView(e) && !(e instanceof DataView);
|
|
1679
1731
|
}
|
|
1680
|
-
function
|
|
1681
|
-
var n = t ? t.length : 0, r = e ? Math.min(n, e.length) : 0,
|
|
1682
|
-
for (
|
|
1683
|
-
for (;
|
|
1684
|
-
return function(
|
|
1685
|
-
for (
|
|
1686
|
-
return
|
|
1732
|
+
function yn(e, t) {
|
|
1733
|
+
var n = t ? t.length : 0, r = e ? Math.min(n, e.length) : 0, i = new Array(r), a = new Array(n), l;
|
|
1734
|
+
for (l = 0; l < r; ++l) i[l] = Ie(e[l], t[l]);
|
|
1735
|
+
for (; l < n; ++l) a[l] = t[l];
|
|
1736
|
+
return function(o) {
|
|
1737
|
+
for (l = 0; l < r; ++l) a[l] = i[l](o);
|
|
1738
|
+
return a;
|
|
1687
1739
|
};
|
|
1688
1740
|
}
|
|
1689
|
-
function
|
|
1741
|
+
function pn(e, t) {
|
|
1690
1742
|
var n = /* @__PURE__ */ new Date();
|
|
1691
1743
|
return e = +e, t = +t, function(r) {
|
|
1692
1744
|
return n.setTime(e * (1 - r) + t * r), n;
|
|
@@ -1697,46 +1749,46 @@ function ye(e, t) {
|
|
|
1697
1749
|
return e * (1 - n) + t * n;
|
|
1698
1750
|
};
|
|
1699
1751
|
}
|
|
1700
|
-
function
|
|
1701
|
-
var n = {}, r = {},
|
|
1752
|
+
function gn(e, t) {
|
|
1753
|
+
var n = {}, r = {}, i;
|
|
1702
1754
|
(e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {});
|
|
1703
|
-
for (
|
|
1704
|
-
|
|
1705
|
-
return function(
|
|
1706
|
-
for (
|
|
1755
|
+
for (i in t)
|
|
1756
|
+
i in e ? n[i] = Ie(e[i], t[i]) : r[i] = t[i];
|
|
1757
|
+
return function(a) {
|
|
1758
|
+
for (i in n) r[i] = n[i](a);
|
|
1707
1759
|
return r;
|
|
1708
1760
|
};
|
|
1709
1761
|
}
|
|
1710
|
-
var Te = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
|
|
1711
|
-
function
|
|
1762
|
+
var Te = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, Se = new RegExp(Te.source, "g");
|
|
1763
|
+
function vn(e) {
|
|
1712
1764
|
return function() {
|
|
1713
1765
|
return e;
|
|
1714
1766
|
};
|
|
1715
1767
|
}
|
|
1716
|
-
function
|
|
1768
|
+
function bn(e) {
|
|
1717
1769
|
return function(t) {
|
|
1718
1770
|
return e(t) + "";
|
|
1719
1771
|
};
|
|
1720
1772
|
}
|
|
1721
|
-
function
|
|
1722
|
-
var n = Te.lastIndex =
|
|
1723
|
-
for (e = e + "", t = t + ""; (r = Te.exec(e)) && (
|
|
1724
|
-
(
|
|
1725
|
-
return n < t.length && (
|
|
1726
|
-
for (var u = 0, f; u < t; ++u)
|
|
1727
|
-
return
|
|
1773
|
+
function Nn(e, t) {
|
|
1774
|
+
var n = Te.lastIndex = Se.lastIndex = 0, r, i, a, l = -1, o = [], d = [];
|
|
1775
|
+
for (e = e + "", t = t + ""; (r = Te.exec(e)) && (i = Se.exec(t)); )
|
|
1776
|
+
(a = i.index) > n && (a = t.slice(n, a), o[l] ? o[l] += a : o[++l] = a), (r = r[0]) === (i = i[0]) ? o[l] ? o[l] += i : o[++l] = i : (o[++l] = null, d.push({ i: l, x: ye(r, i) })), n = Se.lastIndex;
|
|
1777
|
+
return n < t.length && (a = t.slice(n), o[l] ? o[l] += a : o[++l] = a), o.length < 2 ? d[0] ? bn(d[0].x) : vn(t) : (t = d.length, function(c) {
|
|
1778
|
+
for (var u = 0, f; u < t; ++u) o[(f = d[u]).i] = f.x(c);
|
|
1779
|
+
return o.join("");
|
|
1728
1780
|
});
|
|
1729
1781
|
}
|
|
1730
1782
|
function Ie(e, t) {
|
|
1731
1783
|
var n = typeof t, r;
|
|
1732
|
-
return t == null || n === "boolean" ? Ve(t) : (n === "number" ? ye : n === "string" ? (r =
|
|
1784
|
+
return t == null || n === "boolean" ? Ve(t) : (n === "number" ? ye : n === "string" ? (r = ie(t)) ? (t = r, Pe) : Nn : t instanceof ie ? Pe : t instanceof Date ? pn : hn(t) ? xn : Array.isArray(t) ? yn : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? gn : ye)(e, t);
|
|
1733
1785
|
}
|
|
1734
|
-
function
|
|
1786
|
+
function wn(e, t) {
|
|
1735
1787
|
return e = +e, t = +t, function(n) {
|
|
1736
1788
|
return Math.round(e * (1 - n) + t * n);
|
|
1737
1789
|
};
|
|
1738
1790
|
}
|
|
1739
|
-
function
|
|
1791
|
+
function An(e) {
|
|
1740
1792
|
return Math.abs(e = Math.round(e)) >= 1e21 ? e.toLocaleString("en").replace(/,/g, "") : e.toString(10);
|
|
1741
1793
|
}
|
|
1742
1794
|
function pe(e, t) {
|
|
@@ -1750,25 +1802,25 @@ function pe(e, t) {
|
|
|
1750
1802
|
function ee(e) {
|
|
1751
1803
|
return e = pe(Math.abs(e)), e ? e[1] : NaN;
|
|
1752
1804
|
}
|
|
1753
|
-
function
|
|
1805
|
+
function Sn(e, t) {
|
|
1754
1806
|
return function(n, r) {
|
|
1755
|
-
for (var
|
|
1756
|
-
|
|
1757
|
-
return
|
|
1807
|
+
for (var i = n.length, a = [], l = 0, o = e[0], d = 0; i > 0 && o > 0 && (d + o + 1 > r && (o = Math.max(1, r - d)), a.push(n.substring(i -= o, i + o)), !((d += o + 1) > r)); )
|
|
1808
|
+
o = e[l = (l + 1) % e.length];
|
|
1809
|
+
return a.reverse().join(t);
|
|
1758
1810
|
};
|
|
1759
1811
|
}
|
|
1760
|
-
function
|
|
1812
|
+
function kn(e) {
|
|
1761
1813
|
return function(t) {
|
|
1762
1814
|
return t.replace(/[0-9]/g, function(n) {
|
|
1763
1815
|
return e[+n];
|
|
1764
1816
|
});
|
|
1765
1817
|
};
|
|
1766
1818
|
}
|
|
1767
|
-
var
|
|
1819
|
+
var Mn = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
|
|
1768
1820
|
function ge(e) {
|
|
1769
|
-
if (!(t =
|
|
1821
|
+
if (!(t = Mn.exec(e))) throw new Error("invalid format: " + e);
|
|
1770
1822
|
var t;
|
|
1771
|
-
return new
|
|
1823
|
+
return new Oe({
|
|
1772
1824
|
fill: t[1],
|
|
1773
1825
|
align: t[2],
|
|
1774
1826
|
sign: t[3],
|
|
@@ -1781,136 +1833,136 @@ function ge(e) {
|
|
|
1781
1833
|
type: t[10]
|
|
1782
1834
|
});
|
|
1783
1835
|
}
|
|
1784
|
-
ge.prototype =
|
|
1785
|
-
function
|
|
1836
|
+
ge.prototype = Oe.prototype;
|
|
1837
|
+
function Oe(e) {
|
|
1786
1838
|
this.fill = e.fill === void 0 ? " " : e.fill + "", this.align = e.align === void 0 ? ">" : e.align + "", this.sign = e.sign === void 0 ? "-" : e.sign + "", this.symbol = e.symbol === void 0 ? "" : e.symbol + "", this.zero = !!e.zero, this.width = e.width === void 0 ? void 0 : +e.width, this.comma = !!e.comma, this.precision = e.precision === void 0 ? void 0 : +e.precision, this.trim = !!e.trim, this.type = e.type === void 0 ? "" : e.type + "";
|
|
1787
1839
|
}
|
|
1788
|
-
|
|
1840
|
+
Oe.prototype.toString = function() {
|
|
1789
1841
|
return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
|
|
1790
1842
|
};
|
|
1791
|
-
function
|
|
1792
|
-
e: for (var t = e.length, n = 1, r = -1,
|
|
1843
|
+
function $n(e) {
|
|
1844
|
+
e: for (var t = e.length, n = 1, r = -1, i; n < t; ++n)
|
|
1793
1845
|
switch (e[n]) {
|
|
1794
1846
|
case ".":
|
|
1795
|
-
r =
|
|
1847
|
+
r = i = n;
|
|
1796
1848
|
break;
|
|
1797
1849
|
case "0":
|
|
1798
|
-
r === 0 && (r = n),
|
|
1850
|
+
r === 0 && (r = n), i = n;
|
|
1799
1851
|
break;
|
|
1800
1852
|
default:
|
|
1801
1853
|
if (!+e[n]) break e;
|
|
1802
1854
|
r > 0 && (r = 0);
|
|
1803
1855
|
break;
|
|
1804
1856
|
}
|
|
1805
|
-
return r > 0 ? e.slice(0, r) + e.slice(
|
|
1857
|
+
return r > 0 ? e.slice(0, r) + e.slice(i + 1) : e;
|
|
1806
1858
|
}
|
|
1807
1859
|
var xt;
|
|
1808
|
-
function
|
|
1860
|
+
function Ln(e, t) {
|
|
1809
1861
|
var n = pe(e, t);
|
|
1810
1862
|
if (!n) return e + "";
|
|
1811
|
-
var r = n[0],
|
|
1812
|
-
return
|
|
1863
|
+
var r = n[0], i = n[1], a = i - (xt = Math.max(-8, Math.min(8, Math.floor(i / 3))) * 3) + 1, l = r.length;
|
|
1864
|
+
return a === l ? r : a > l ? r + new Array(a - l + 1).join("0") : a > 0 ? r.slice(0, a) + "." + r.slice(a) : "0." + new Array(1 - a).join("0") + pe(e, Math.max(0, t + a - 1))[0];
|
|
1813
1865
|
}
|
|
1814
1866
|
function et(e, t) {
|
|
1815
1867
|
var n = pe(e, t);
|
|
1816
1868
|
if (!n) return e + "";
|
|
1817
|
-
var r = n[0],
|
|
1818
|
-
return
|
|
1869
|
+
var r = n[0], i = n[1];
|
|
1870
|
+
return i < 0 ? "0." + new Array(-i).join("0") + r : r.length > i + 1 ? r.slice(0, i + 1) + "." + r.slice(i + 1) : r + new Array(i - r.length + 2).join("0");
|
|
1819
1871
|
}
|
|
1820
1872
|
const tt = {
|
|
1821
1873
|
"%": (e, t) => (e * 100).toFixed(t),
|
|
1822
1874
|
b: (e) => Math.round(e).toString(2),
|
|
1823
1875
|
c: (e) => e + "",
|
|
1824
|
-
d:
|
|
1876
|
+
d: An,
|
|
1825
1877
|
e: (e, t) => e.toExponential(t),
|
|
1826
1878
|
f: (e, t) => e.toFixed(t),
|
|
1827
1879
|
g: (e, t) => e.toPrecision(t),
|
|
1828
1880
|
o: (e) => Math.round(e).toString(8),
|
|
1829
1881
|
p: (e, t) => et(e * 100, t),
|
|
1830
1882
|
r: et,
|
|
1831
|
-
s:
|
|
1883
|
+
s: Ln,
|
|
1832
1884
|
X: (e) => Math.round(e).toString(16).toUpperCase(),
|
|
1833
1885
|
x: (e) => Math.round(e).toString(16)
|
|
1834
1886
|
};
|
|
1835
1887
|
function nt(e) {
|
|
1836
1888
|
return e;
|
|
1837
1889
|
}
|
|
1838
|
-
var rt = Array.prototype.map,
|
|
1839
|
-
function
|
|
1840
|
-
var t = e.grouping === void 0 || e.thousands === void 0 ? nt :
|
|
1841
|
-
function
|
|
1890
|
+
var rt = Array.prototype.map, it = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
|
|
1891
|
+
function Tn(e) {
|
|
1892
|
+
var t = e.grouping === void 0 || e.thousands === void 0 ? nt : Sn(rt.call(e.grouping, Number), e.thousands + ""), n = e.currency === void 0 ? "" : e.currency[0] + "", r = e.currency === void 0 ? "" : e.currency[1] + "", i = e.decimal === void 0 ? "." : e.decimal + "", a = e.numerals === void 0 ? nt : kn(rt.call(e.numerals, String)), l = e.percent === void 0 ? "%" : e.percent + "", o = e.minus === void 0 ? "−" : e.minus + "", d = e.nan === void 0 ? "NaN" : e.nan + "";
|
|
1893
|
+
function c(f) {
|
|
1842
1894
|
f = ge(f);
|
|
1843
|
-
var m = f.fill,
|
|
1844
|
-
|
|
1845
|
-
var x =
|
|
1846
|
-
v = v === void 0 ? 6 : /[gprs]/.test(
|
|
1895
|
+
var m = f.fill, p = f.align, N = f.sign, g = f.symbol, h = f.zero, M = f.width, F = f.comma, v = f.precision, A = f.trim, S = f.type;
|
|
1896
|
+
S === "n" ? (F = !0, S = "g") : tt[S] || (v === void 0 && (v = 12), A = !0, S = "g"), (h || m === "0" && p === "=") && (h = !0, m = "0", p = "=");
|
|
1897
|
+
var x = g === "$" ? n : g === "#" && /[boxX]/.test(S) ? "0" + S.toLowerCase() : "", y = g === "$" ? r : /[%p]/.test(S) ? l : "", k = tt[S], w = /[defgprs%]/.test(S);
|
|
1898
|
+
v = v === void 0 ? 6 : /[gprs]/.test(S) ? Math.max(1, Math.min(21, v)) : Math.max(0, Math.min(20, v));
|
|
1847
1899
|
function T($) {
|
|
1848
|
-
var L = x,
|
|
1849
|
-
if (
|
|
1850
|
-
|
|
1900
|
+
var L = x, E = y, D, V, G;
|
|
1901
|
+
if (S === "c")
|
|
1902
|
+
E = k($) + E, $ = "";
|
|
1851
1903
|
else {
|
|
1852
1904
|
$ = +$;
|
|
1853
1905
|
var Z = $ < 0 || 1 / $ < 0;
|
|
1854
|
-
if ($ = isNaN($) ? d :
|
|
1855
|
-
for (
|
|
1856
|
-
if (
|
|
1857
|
-
|
|
1906
|
+
if ($ = isNaN($) ? d : k(Math.abs($), v), A && ($ = $n($)), Z && +$ == 0 && N !== "+" && (Z = !1), L = (Z ? N === "(" ? N : o : N === "-" || N === "(" ? "" : N) + L, E = (S === "s" ? it[8 + xt / 3] : "") + E + (Z && N === "(" ? ")" : ""), w) {
|
|
1907
|
+
for (D = -1, V = $.length; ++D < V; )
|
|
1908
|
+
if (G = $.charCodeAt(D), 48 > G || G > 57) {
|
|
1909
|
+
E = (G === 46 ? i + $.slice(D + 1) : $.slice(D)) + E, $ = $.slice(0, D);
|
|
1858
1910
|
break;
|
|
1859
1911
|
}
|
|
1860
1912
|
}
|
|
1861
1913
|
}
|
|
1862
1914
|
F && !h && ($ = t($, 1 / 0));
|
|
1863
|
-
var le = L.length + $.length +
|
|
1864
|
-
switch (F && h && ($ = t(
|
|
1915
|
+
var le = L.length + $.length + E.length, U = le < M ? new Array(M - le + 1).join(m) : "";
|
|
1916
|
+
switch (F && h && ($ = t(U + $, U.length ? M - E.length : 1 / 0), U = ""), p) {
|
|
1865
1917
|
case "<":
|
|
1866
|
-
$ = L + $ +
|
|
1918
|
+
$ = L + $ + E + U;
|
|
1867
1919
|
break;
|
|
1868
1920
|
case "=":
|
|
1869
|
-
$ = L +
|
|
1921
|
+
$ = L + U + $ + E;
|
|
1870
1922
|
break;
|
|
1871
1923
|
case "^":
|
|
1872
|
-
$ =
|
|
1924
|
+
$ = U.slice(0, le = U.length >> 1) + L + $ + E + U.slice(le);
|
|
1873
1925
|
break;
|
|
1874
1926
|
default:
|
|
1875
|
-
$ =
|
|
1927
|
+
$ = U + L + $ + E;
|
|
1876
1928
|
break;
|
|
1877
1929
|
}
|
|
1878
|
-
return
|
|
1930
|
+
return a($);
|
|
1879
1931
|
}
|
|
1880
1932
|
return T.toString = function() {
|
|
1881
1933
|
return f + "";
|
|
1882
1934
|
}, T;
|
|
1883
1935
|
}
|
|
1884
1936
|
function u(f, m) {
|
|
1885
|
-
var
|
|
1937
|
+
var p = c((f = ge(f), f.type = "f", f)), N = Math.max(-8, Math.min(8, Math.floor(ee(m) / 3))) * 3, g = Math.pow(10, -N), h = it[8 + N / 3];
|
|
1886
1938
|
return function(M) {
|
|
1887
|
-
return g
|
|
1939
|
+
return p(g * M) + h;
|
|
1888
1940
|
};
|
|
1889
1941
|
}
|
|
1890
1942
|
return {
|
|
1891
|
-
format:
|
|
1943
|
+
format: c,
|
|
1892
1944
|
formatPrefix: u
|
|
1893
1945
|
};
|
|
1894
1946
|
}
|
|
1895
1947
|
var ue, ht, yt;
|
|
1896
|
-
|
|
1948
|
+
Fn({
|
|
1897
1949
|
thousands: ",",
|
|
1898
1950
|
grouping: [3],
|
|
1899
1951
|
currency: ["$", ""]
|
|
1900
1952
|
});
|
|
1901
|
-
function
|
|
1902
|
-
return ue =
|
|
1953
|
+
function Fn(e) {
|
|
1954
|
+
return ue = Tn(e), ht = ue.format, yt = ue.formatPrefix, ue;
|
|
1903
1955
|
}
|
|
1904
|
-
function
|
|
1956
|
+
function En(e) {
|
|
1905
1957
|
return Math.max(0, -ee(Math.abs(e)));
|
|
1906
1958
|
}
|
|
1907
|
-
function
|
|
1959
|
+
function jn(e, t) {
|
|
1908
1960
|
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(ee(t) / 3))) * 3 - ee(Math.abs(e)));
|
|
1909
1961
|
}
|
|
1910
|
-
function
|
|
1962
|
+
function zn(e, t) {
|
|
1911
1963
|
return e = Math.abs(e), t = Math.abs(t) - e, Math.max(0, ee(t) - ee(e)) + 1;
|
|
1912
1964
|
}
|
|
1913
|
-
function
|
|
1965
|
+
function _e(e, t) {
|
|
1914
1966
|
switch (arguments.length) {
|
|
1915
1967
|
case 0:
|
|
1916
1968
|
break;
|
|
@@ -1923,37 +1975,37 @@ function Oe(e, t) {
|
|
|
1923
1975
|
}
|
|
1924
1976
|
return this;
|
|
1925
1977
|
}
|
|
1926
|
-
const
|
|
1978
|
+
const st = Symbol("implicit");
|
|
1927
1979
|
function pt() {
|
|
1928
|
-
var e = new qe(), t = [], n = [], r =
|
|
1929
|
-
function
|
|
1930
|
-
let
|
|
1931
|
-
if (
|
|
1932
|
-
if (r !==
|
|
1933
|
-
e.set(
|
|
1980
|
+
var e = new qe(), t = [], n = [], r = st;
|
|
1981
|
+
function i(a) {
|
|
1982
|
+
let l = e.get(a);
|
|
1983
|
+
if (l === void 0) {
|
|
1984
|
+
if (r !== st) return r;
|
|
1985
|
+
e.set(a, l = t.push(a) - 1);
|
|
1934
1986
|
}
|
|
1935
|
-
return n[
|
|
1987
|
+
return n[l % n.length];
|
|
1936
1988
|
}
|
|
1937
|
-
return
|
|
1989
|
+
return i.domain = function(a) {
|
|
1938
1990
|
if (!arguments.length) return t.slice();
|
|
1939
1991
|
t = [], e = new qe();
|
|
1940
|
-
for (const
|
|
1941
|
-
e.has(
|
|
1942
|
-
return
|
|
1943
|
-
},
|
|
1944
|
-
return arguments.length ? (n = Array.from(
|
|
1945
|
-
},
|
|
1946
|
-
return arguments.length ? (r =
|
|
1947
|
-
},
|
|
1992
|
+
for (const l of a)
|
|
1993
|
+
e.has(l) || e.set(l, t.push(l) - 1);
|
|
1994
|
+
return i;
|
|
1995
|
+
}, i.range = function(a) {
|
|
1996
|
+
return arguments.length ? (n = Array.from(a), i) : n.slice();
|
|
1997
|
+
}, i.unknown = function(a) {
|
|
1998
|
+
return arguments.length ? (r = a, i) : r;
|
|
1999
|
+
}, i.copy = function() {
|
|
1948
2000
|
return pt(t, n).unknown(r);
|
|
1949
|
-
},
|
|
2001
|
+
}, _e.apply(i, arguments), i;
|
|
1950
2002
|
}
|
|
1951
|
-
function
|
|
2003
|
+
function Dn(e) {
|
|
1952
2004
|
return function() {
|
|
1953
2005
|
return e;
|
|
1954
2006
|
};
|
|
1955
2007
|
}
|
|
1956
|
-
function
|
|
2008
|
+
function Rn(e) {
|
|
1957
2009
|
return +e;
|
|
1958
2010
|
}
|
|
1959
2011
|
var at = [0, 1];
|
|
@@ -1963,80 +2015,80 @@ function J(e) {
|
|
|
1963
2015
|
function Fe(e, t) {
|
|
1964
2016
|
return (t -= e = +e) ? function(n) {
|
|
1965
2017
|
return (n - e) / t;
|
|
1966
|
-
} :
|
|
2018
|
+
} : Dn(isNaN(t) ? NaN : 0.5);
|
|
1967
2019
|
}
|
|
1968
|
-
function
|
|
2020
|
+
function Vn(e, t) {
|
|
1969
2021
|
var n;
|
|
1970
2022
|
return e > t && (n = e, e = t, t = n), function(r) {
|
|
1971
2023
|
return Math.max(e, Math.min(t, r));
|
|
1972
2024
|
};
|
|
1973
2025
|
}
|
|
1974
|
-
function
|
|
1975
|
-
var r = e[0],
|
|
1976
|
-
return
|
|
1977
|
-
return
|
|
2026
|
+
function In(e, t, n) {
|
|
2027
|
+
var r = e[0], i = e[1], a = t[0], l = t[1];
|
|
2028
|
+
return i < r ? (r = Fe(i, r), a = n(l, a)) : (r = Fe(r, i), a = n(a, l)), function(o) {
|
|
2029
|
+
return a(r(o));
|
|
1978
2030
|
};
|
|
1979
2031
|
}
|
|
1980
|
-
function
|
|
1981
|
-
var r = Math.min(e.length, t.length) - 1,
|
|
1982
|
-
for (e[r] < e[0] && (e = e.slice().reverse(), t = t.slice().reverse()); ++
|
|
1983
|
-
|
|
1984
|
-
return function(
|
|
1985
|
-
var d = dt(e,
|
|
1986
|
-
return
|
|
2032
|
+
function On(e, t, n) {
|
|
2033
|
+
var r = Math.min(e.length, t.length) - 1, i = new Array(r), a = new Array(r), l = -1;
|
|
2034
|
+
for (e[r] < e[0] && (e = e.slice().reverse(), t = t.slice().reverse()); ++l < r; )
|
|
2035
|
+
i[l] = Fe(e[l], e[l + 1]), a[l] = n(t[l], t[l + 1]);
|
|
2036
|
+
return function(o) {
|
|
2037
|
+
var d = dt(e, o, 1, r) - 1;
|
|
2038
|
+
return a[d](i[d](o));
|
|
1987
2039
|
};
|
|
1988
2040
|
}
|
|
1989
|
-
function
|
|
2041
|
+
function _n(e, t) {
|
|
1990
2042
|
return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());
|
|
1991
2043
|
}
|
|
1992
|
-
function
|
|
1993
|
-
var e = at, t = at, n = Ie, r,
|
|
2044
|
+
function Hn() {
|
|
2045
|
+
var e = at, t = at, n = Ie, r, i, a, l = J, o, d, c;
|
|
1994
2046
|
function u() {
|
|
1995
2047
|
var m = Math.min(e.length, t.length);
|
|
1996
|
-
return
|
|
2048
|
+
return l !== J && (l = Vn(e[0], e[m - 1])), o = m > 2 ? On : In, d = c = null, f;
|
|
1997
2049
|
}
|
|
1998
2050
|
function f(m) {
|
|
1999
|
-
return m == null || isNaN(m = +m) ?
|
|
2051
|
+
return m == null || isNaN(m = +m) ? a : (d || (d = o(e.map(r), t, n)))(r(l(m)));
|
|
2000
2052
|
}
|
|
2001
2053
|
return f.invert = function(m) {
|
|
2002
|
-
return
|
|
2054
|
+
return l(i((c || (c = o(t, e.map(r), ye)))(m)));
|
|
2003
2055
|
}, f.domain = function(m) {
|
|
2004
|
-
return arguments.length ? (e = Array.from(m,
|
|
2056
|
+
return arguments.length ? (e = Array.from(m, Rn), u()) : e.slice();
|
|
2005
2057
|
}, f.range = function(m) {
|
|
2006
2058
|
return arguments.length ? (t = Array.from(m), u()) : t.slice();
|
|
2007
2059
|
}, f.rangeRound = function(m) {
|
|
2008
|
-
return t = Array.from(m), n =
|
|
2060
|
+
return t = Array.from(m), n = wn, u();
|
|
2009
2061
|
}, f.clamp = function(m) {
|
|
2010
|
-
return arguments.length ? (
|
|
2062
|
+
return arguments.length ? (l = m ? !0 : J, u()) : l !== J;
|
|
2011
2063
|
}, f.interpolate = function(m) {
|
|
2012
2064
|
return arguments.length ? (n = m, u()) : n;
|
|
2013
2065
|
}, f.unknown = function(m) {
|
|
2014
|
-
return arguments.length ? (
|
|
2015
|
-
}, function(m,
|
|
2016
|
-
return r = m,
|
|
2066
|
+
return arguments.length ? (a = m, f) : a;
|
|
2067
|
+
}, function(m, p) {
|
|
2068
|
+
return r = m, i = p, u();
|
|
2017
2069
|
};
|
|
2018
2070
|
}
|
|
2019
|
-
function
|
|
2020
|
-
return
|
|
2071
|
+
function Gn() {
|
|
2072
|
+
return Hn()(J, J);
|
|
2021
2073
|
}
|
|
2022
|
-
function
|
|
2023
|
-
var
|
|
2074
|
+
function Un(e, t, n, r) {
|
|
2075
|
+
var i = Zt(e, t, n), a;
|
|
2024
2076
|
switch (r = ge(r ?? ",f"), r.type) {
|
|
2025
2077
|
case "s": {
|
|
2026
|
-
var
|
|
2027
|
-
return r.precision == null && !isNaN(
|
|
2078
|
+
var l = Math.max(Math.abs(e), Math.abs(t));
|
|
2079
|
+
return r.precision == null && !isNaN(a = jn(i, l)) && (r.precision = a), yt(r, l);
|
|
2028
2080
|
}
|
|
2029
2081
|
case "":
|
|
2030
2082
|
case "e":
|
|
2031
2083
|
case "g":
|
|
2032
2084
|
case "p":
|
|
2033
2085
|
case "r": {
|
|
2034
|
-
r.precision == null && !isNaN(
|
|
2086
|
+
r.precision == null && !isNaN(a = zn(i, Math.max(Math.abs(e), Math.abs(t)))) && (r.precision = a - (r.type === "e"));
|
|
2035
2087
|
break;
|
|
2036
2088
|
}
|
|
2037
2089
|
case "f":
|
|
2038
2090
|
case "%": {
|
|
2039
|
-
r.precision == null && !isNaN(
|
|
2091
|
+
r.precision == null && !isNaN(a = En(i)) && (r.precision = a - (r.type === "%") * 2);
|
|
2040
2092
|
break;
|
|
2041
2093
|
}
|
|
2042
2094
|
}
|
|
@@ -2046,164 +2098,164 @@ function gt(e) {
|
|
|
2046
2098
|
var t = e.domain;
|
|
2047
2099
|
return e.ticks = function(n) {
|
|
2048
2100
|
var r = t();
|
|
2049
|
-
return
|
|
2101
|
+
return Qt(r[0], r[r.length - 1], n ?? 10);
|
|
2050
2102
|
}, e.tickFormat = function(n, r) {
|
|
2051
|
-
var
|
|
2052
|
-
return
|
|
2103
|
+
var i = t();
|
|
2104
|
+
return Un(i[0], i[i.length - 1], n ?? 10, r);
|
|
2053
2105
|
}, e.nice = function(n) {
|
|
2054
2106
|
n == null && (n = 10);
|
|
2055
|
-
var r = t(),
|
|
2056
|
-
for (
|
|
2057
|
-
if (
|
|
2058
|
-
return r[
|
|
2059
|
-
if (
|
|
2060
|
-
|
|
2061
|
-
else if (
|
|
2062
|
-
|
|
2107
|
+
var r = t(), i = 0, a = r.length - 1, l = r[i], o = r[a], d, c, u = 10;
|
|
2108
|
+
for (o < l && (c = l, l = o, o = c, c = i, i = a, a = c); u-- > 0; ) {
|
|
2109
|
+
if (c = $e(l, o, n), c === d)
|
|
2110
|
+
return r[i] = l, r[a] = o, t(r);
|
|
2111
|
+
if (c > 0)
|
|
2112
|
+
l = Math.floor(l / c) * c, o = Math.ceil(o / c) * c;
|
|
2113
|
+
else if (c < 0)
|
|
2114
|
+
l = Math.ceil(l * c) / c, o = Math.floor(o * c) / c;
|
|
2063
2115
|
else
|
|
2064
2116
|
break;
|
|
2065
|
-
d =
|
|
2117
|
+
d = c;
|
|
2066
2118
|
}
|
|
2067
2119
|
return e;
|
|
2068
2120
|
}, e;
|
|
2069
2121
|
}
|
|
2070
|
-
function
|
|
2071
|
-
var e =
|
|
2122
|
+
function qn() {
|
|
2123
|
+
var e = Gn();
|
|
2072
2124
|
return e.copy = function() {
|
|
2073
|
-
return
|
|
2074
|
-
},
|
|
2125
|
+
return _n(e, qn());
|
|
2126
|
+
}, _e.apply(e, arguments), gt(e);
|
|
2075
2127
|
}
|
|
2076
2128
|
function vt() {
|
|
2077
|
-
var e = 0, t = 1, n = 1, r = [0.5],
|
|
2078
|
-
function
|
|
2079
|
-
return d != null && d <= d ?
|
|
2129
|
+
var e = 0, t = 1, n = 1, r = [0.5], i = [0, 1], a;
|
|
2130
|
+
function l(d) {
|
|
2131
|
+
return d != null && d <= d ? i[dt(r, d, 0, n)] : a;
|
|
2080
2132
|
}
|
|
2081
|
-
function
|
|
2133
|
+
function o() {
|
|
2082
2134
|
var d = -1;
|
|
2083
2135
|
for (r = new Array(n); ++d < n; ) r[d] = ((d + 1) * t - (d - n) * e) / (n + 1);
|
|
2084
|
-
return
|
|
2136
|
+
return l;
|
|
2085
2137
|
}
|
|
2086
|
-
return
|
|
2087
|
-
return arguments.length ? ([e, t] = d, e = +e, t = +t,
|
|
2088
|
-
},
|
|
2089
|
-
return arguments.length ? (n = (
|
|
2090
|
-
},
|
|
2091
|
-
var
|
|
2092
|
-
return
|
|
2093
|
-
},
|
|
2094
|
-
return arguments.length && (
|
|
2095
|
-
},
|
|
2138
|
+
return l.domain = function(d) {
|
|
2139
|
+
return arguments.length ? ([e, t] = d, e = +e, t = +t, o()) : [e, t];
|
|
2140
|
+
}, l.range = function(d) {
|
|
2141
|
+
return arguments.length ? (n = (i = Array.from(d)).length - 1, o()) : i.slice();
|
|
2142
|
+
}, l.invertExtent = function(d) {
|
|
2143
|
+
var c = i.indexOf(d);
|
|
2144
|
+
return c < 0 ? [NaN, NaN] : c < 1 ? [e, r[0]] : c >= n ? [r[n - 1], t] : [r[c - 1], r[c]];
|
|
2145
|
+
}, l.unknown = function(d) {
|
|
2146
|
+
return arguments.length && (a = d), l;
|
|
2147
|
+
}, l.thresholds = function() {
|
|
2096
2148
|
return r.slice();
|
|
2097
|
-
},
|
|
2098
|
-
return vt().domain([e, t]).range(
|
|
2099
|
-
},
|
|
2149
|
+
}, l.copy = function() {
|
|
2150
|
+
return vt().domain([e, t]).range(i).unknown(a);
|
|
2151
|
+
}, _e.apply(gt(l), arguments);
|
|
2100
2152
|
}
|
|
2101
|
-
function
|
|
2153
|
+
function sr({
|
|
2102
2154
|
data: e,
|
|
2103
2155
|
chartConfig: t,
|
|
2104
2156
|
displayConfig: n = {},
|
|
2105
2157
|
queryObject: r,
|
|
2106
|
-
height:
|
|
2107
|
-
colorPalette:
|
|
2158
|
+
height: i = "100%",
|
|
2159
|
+
colorPalette: a
|
|
2108
2160
|
}) {
|
|
2109
|
-
const [
|
|
2161
|
+
const [l, o] = H(null), { getFieldLabel: d } = X();
|
|
2110
2162
|
try {
|
|
2111
|
-
const
|
|
2163
|
+
const c = {
|
|
2112
2164
|
showTooltip: n?.showTooltip ?? !0,
|
|
2113
2165
|
showLegend: n?.showLegend ?? !0
|
|
2114
2166
|
};
|
|
2115
2167
|
if (!e || e.length === 0)
|
|
2116
|
-
return /* @__PURE__ */
|
|
2117
|
-
/* @__PURE__ */
|
|
2118
|
-
/* @__PURE__ */
|
|
2168
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
2169
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
2170
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No data points to display in treemap chart" })
|
|
2119
2171
|
] }) });
|
|
2120
2172
|
let u, f = !1, m;
|
|
2121
2173
|
if (t?.xAxis && t?.yAxis) {
|
|
2122
2174
|
const v = Array.isArray(t.xAxis) ? t.xAxis[0] : t.xAxis, A = Array.isArray(t.yAxis) ? t.yAxis[0] : t.yAxis;
|
|
2123
2175
|
m = Array.isArray(t.series) ? t.series[0] : t.series;
|
|
2124
|
-
const
|
|
2176
|
+
const S = O(r, v);
|
|
2125
2177
|
if (m) {
|
|
2126
2178
|
const x = e.map((y) => {
|
|
2127
|
-
const
|
|
2128
|
-
return typeof
|
|
2179
|
+
const k = y[m];
|
|
2180
|
+
return typeof k == "string" ? parseFloat(k) : k;
|
|
2129
2181
|
}).filter((y) => !isNaN(y));
|
|
2130
2182
|
if (f = x.length === e.length && x.every((y) => typeof y == "number"), f) {
|
|
2131
|
-
const y = Math.min(...x),
|
|
2183
|
+
const y = Math.min(...x), k = Math.max(...x), w = vt().domain([y, k]).range(oe);
|
|
2132
2184
|
u = e.map((T) => {
|
|
2133
2185
|
const $ = typeof T[m] == "string" ? parseFloat(T[m]) : T[m], L = w($);
|
|
2134
2186
|
return {
|
|
2135
|
-
name: R(T[v],
|
|
2187
|
+
name: R(T[v], S) || String(T[v]) || "Unknown",
|
|
2136
2188
|
size: typeof T[A] == "string" ? parseFloat(T[A]) : T[A] || 0,
|
|
2137
2189
|
fill: L,
|
|
2138
2190
|
series: String(T[m])
|
|
2139
2191
|
};
|
|
2140
2192
|
});
|
|
2141
2193
|
} else {
|
|
2142
|
-
const y = [...new Set(e.map((w) => String(w[m])))],
|
|
2194
|
+
const y = [...new Set(e.map((w) => String(w[m])))], k = pt().domain(y).range(a?.colors || j);
|
|
2143
2195
|
u = e.map((w) => ({
|
|
2144
|
-
name: R(w[v],
|
|
2196
|
+
name: R(w[v], S) || String(w[v]) || "Unknown",
|
|
2145
2197
|
size: typeof w[A] == "string" ? parseFloat(w[A]) : w[A] || 0,
|
|
2146
|
-
fill:
|
|
2198
|
+
fill: k(String(w[m])),
|
|
2147
2199
|
series: String(w[m])
|
|
2148
2200
|
}));
|
|
2149
2201
|
}
|
|
2150
2202
|
} else
|
|
2151
2203
|
u = e.map((x, y) => ({
|
|
2152
|
-
name: R(x[v],
|
|
2204
|
+
name: R(x[v], S) || String(x[v]) || "Unknown",
|
|
2153
2205
|
size: typeof x[A] == "string" ? parseFloat(x[A]) : x[A] || 0,
|
|
2154
|
-
fill:
|
|
2206
|
+
fill: a?.colors && a.colors[y % a.colors.length] || j[y % j.length]
|
|
2155
2207
|
}));
|
|
2156
2208
|
} else {
|
|
2157
|
-
const v = e[0], A = Object.keys(v),
|
|
2209
|
+
const v = e[0], A = Object.keys(v), S = A.find(
|
|
2158
2210
|
(y) => typeof v[y] == "string" || y.toLowerCase().includes("name") || y.toLowerCase().includes("label") || y.toLowerCase().includes("category")
|
|
2159
2211
|
) || A[0], x = A.find((y) => y.toLowerCase().includes("size")) || A.find(
|
|
2160
|
-
(y) => typeof v[y] == "number" && y !==
|
|
2212
|
+
(y) => typeof v[y] == "number" && y !== S
|
|
2161
2213
|
) || A[1];
|
|
2162
2214
|
if (!x)
|
|
2163
|
-
return /* @__PURE__ */
|
|
2164
|
-
/* @__PURE__ */
|
|
2165
|
-
/* @__PURE__ */
|
|
2215
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
2216
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
2217
|
+
/* @__PURE__ */ s("div", { className: "text-xs", children: "No numeric field found for treemap chart size" })
|
|
2166
2218
|
] }) });
|
|
2167
|
-
u = e.map((y,
|
|
2168
|
-
let w = y[
|
|
2219
|
+
u = e.map((y, k) => {
|
|
2220
|
+
let w = y[S];
|
|
2169
2221
|
return typeof w == "boolean" ? w = w ? "Active" : "Inactive" : w === "true" || w === "false" ? w = w === "true" ? "Active" : "Inactive" : w = String(w), {
|
|
2170
2222
|
name: w,
|
|
2171
2223
|
size: typeof y[x] == "string" ? parseFloat(y[x]) : y[x] || 0,
|
|
2172
|
-
fill:
|
|
2224
|
+
fill: a?.colors && a.colors[k % a.colors.length] || j[k % j.length]
|
|
2173
2225
|
};
|
|
2174
2226
|
});
|
|
2175
2227
|
}
|
|
2176
2228
|
if (u = u.filter((v) => v.size != null && v.size > 0), u.length === 0)
|
|
2177
|
-
return /* @__PURE__ */
|
|
2178
|
-
/* @__PURE__ */
|
|
2179
|
-
/* @__PURE__ */
|
|
2229
|
+
return /* @__PURE__ */ s("div", { className: "flex items-center justify-center w-full text-dc-text-muted", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
2230
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
2231
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No valid data points for treemap chart after transformation" })
|
|
2180
2232
|
] }) });
|
|
2181
|
-
const
|
|
2182
|
-
const { x: A, y:
|
|
2233
|
+
const p = (v) => {
|
|
2234
|
+
const { x: A, y: S, width: x, height: y, index: k, name: w, size: T } = v;
|
|
2183
2235
|
return x < 20 || y < 20 ? null : /* @__PURE__ */ b("g", { children: [
|
|
2184
|
-
/* @__PURE__ */
|
|
2236
|
+
/* @__PURE__ */ s(
|
|
2185
2237
|
"rect",
|
|
2186
2238
|
{
|
|
2187
2239
|
x: A,
|
|
2188
|
-
y:
|
|
2240
|
+
y: S,
|
|
2189
2241
|
width: x,
|
|
2190
2242
|
height: y,
|
|
2191
2243
|
style: {
|
|
2192
|
-
fill: u[
|
|
2193
|
-
fillOpacity:
|
|
2244
|
+
fill: u[k]?.fill || a?.colors && a.colors[k % a.colors.length] || j[k % j.length],
|
|
2245
|
+
fillOpacity: l !== null ? l === k ? 1 : 0.6 : 0.8,
|
|
2194
2246
|
stroke: "#fff",
|
|
2195
2247
|
strokeWidth: 2,
|
|
2196
2248
|
cursor: "pointer"
|
|
2197
2249
|
},
|
|
2198
|
-
onMouseEnter: () =>
|
|
2199
|
-
onMouseLeave: () =>
|
|
2250
|
+
onMouseEnter: () => o(k),
|
|
2251
|
+
onMouseLeave: () => o(null)
|
|
2200
2252
|
}
|
|
2201
2253
|
),
|
|
2202
|
-
/* @__PURE__ */
|
|
2254
|
+
/* @__PURE__ */ s(
|
|
2203
2255
|
"foreignObject",
|
|
2204
2256
|
{
|
|
2205
2257
|
x: A,
|
|
2206
|
-
y:
|
|
2258
|
+
y: S,
|
|
2207
2259
|
width: x,
|
|
2208
2260
|
height: y,
|
|
2209
2261
|
style: { pointerEvents: "none", overflow: "visible" },
|
|
@@ -2225,7 +2277,7 @@ function rr({
|
|
|
2225
2277
|
overflow: "hidden"
|
|
2226
2278
|
},
|
|
2227
2279
|
children: [
|
|
2228
|
-
x > 40 && y > 30 && /* @__PURE__ */
|
|
2280
|
+
x > 40 && y > 30 && /* @__PURE__ */ s(
|
|
2229
2281
|
"div",
|
|
2230
2282
|
{
|
|
2231
2283
|
style: {
|
|
@@ -2240,7 +2292,7 @@ function rr({
|
|
|
2240
2292
|
children: w
|
|
2241
2293
|
}
|
|
2242
2294
|
),
|
|
2243
|
-
x > 60 && y > 45 && /* @__PURE__ */
|
|
2295
|
+
x > 60 && y > 45 && /* @__PURE__ */ s(
|
|
2244
2296
|
"div",
|
|
2245
2297
|
{
|
|
2246
2298
|
style: {
|
|
@@ -2257,53 +2309,53 @@ function rr({
|
|
|
2257
2309
|
}
|
|
2258
2310
|
)
|
|
2259
2311
|
] });
|
|
2260
|
-
},
|
|
2312
|
+
}, g = u.some((v) => "series" in v) ? [...new Set(u.map((v) => v.series).filter(Boolean))] : [];
|
|
2261
2313
|
let h = [];
|
|
2262
|
-
if (
|
|
2314
|
+
if (c.showLegend && m)
|
|
2263
2315
|
if (f) {
|
|
2264
|
-
const v = Math.min(...e.map((
|
|
2265
|
-
const x =
|
|
2316
|
+
const v = Math.min(...e.map((S) => {
|
|
2317
|
+
const x = S[m];
|
|
2266
2318
|
return typeof x == "string" ? parseFloat(x) : x;
|
|
2267
|
-
})), A = Math.max(...e.map((
|
|
2268
|
-
const x =
|
|
2319
|
+
})), A = Math.max(...e.map((S) => {
|
|
2320
|
+
const x = S[m];
|
|
2269
2321
|
return typeof x == "string" ? parseFloat(x) : x;
|
|
2270
2322
|
}));
|
|
2271
|
-
h = oe.map((
|
|
2323
|
+
h = oe.map((S, x) => {
|
|
2272
2324
|
const y = x / (oe.length - 1);
|
|
2273
2325
|
return {
|
|
2274
2326
|
value: (v + (A - v) * y).toFixed(2),
|
|
2275
2327
|
type: "rect",
|
|
2276
|
-
color:
|
|
2328
|
+
color: S
|
|
2277
2329
|
};
|
|
2278
2330
|
});
|
|
2279
|
-
} else
|
|
2331
|
+
} else g.length > 1 && (h = g.map((v, A) => ({
|
|
2280
2332
|
value: v,
|
|
2281
2333
|
type: "rect",
|
|
2282
|
-
color:
|
|
2334
|
+
color: j[A % j.length]
|
|
2283
2335
|
})));
|
|
2284
|
-
const M =
|
|
2336
|
+
const M = c.showLegend && h.length > 0, F = M ? typeof i == "string" && i.includes("%") ? i : typeof i == "number" ? i + 60 : `calc(${i} + 60px)` : i;
|
|
2285
2337
|
return /* @__PURE__ */ b("div", { className: "w-full", style: { height: F }, children: [
|
|
2286
|
-
/* @__PURE__ */
|
|
2287
|
-
|
|
2338
|
+
/* @__PURE__ */ s(B, { height: M ? "calc(100% - 50px)" : "100%", children: /* @__PURE__ */ s(
|
|
2339
|
+
Vt,
|
|
2288
2340
|
{
|
|
2289
2341
|
data: u,
|
|
2290
2342
|
dataKey: "size",
|
|
2291
2343
|
aspectRatio: 4 / 3,
|
|
2292
2344
|
stroke: "#fff",
|
|
2293
|
-
content: /* @__PURE__ */
|
|
2294
|
-
children:
|
|
2345
|
+
content: /* @__PURE__ */ s(p, {}),
|
|
2346
|
+
children: c.showTooltip && /* @__PURE__ */ s(Q, {})
|
|
2295
2347
|
}
|
|
2296
2348
|
) }),
|
|
2297
|
-
M && /* @__PURE__ */
|
|
2349
|
+
M && /* @__PURE__ */ s("div", { className: "flex justify-center items-center mt-4 pb-2", children: f ? (
|
|
2298
2350
|
// Gradient legend for numeric series
|
|
2299
2351
|
/* @__PURE__ */ b("div", { className: "flex flex-col items-center", children: [
|
|
2300
|
-
/* @__PURE__ */
|
|
2352
|
+
/* @__PURE__ */ s("div", { className: "text-xs font-semibold text-dc-text-primary mb-2", children: m ? d(m) : "" }),
|
|
2301
2353
|
/* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
|
|
2302
|
-
/* @__PURE__ */
|
|
2354
|
+
/* @__PURE__ */ s("span", { className: "text-xs text-dc-text-muted", children: Math.min(...e.map((v) => {
|
|
2303
2355
|
const A = v[m];
|
|
2304
2356
|
return typeof A == "string" ? parseFloat(A) : A;
|
|
2305
2357
|
})).toFixed(2) }),
|
|
2306
|
-
/* @__PURE__ */
|
|
2358
|
+
/* @__PURE__ */ s(
|
|
2307
2359
|
"div",
|
|
2308
2360
|
{
|
|
2309
2361
|
className: "h-4 rounded-sm",
|
|
@@ -2313,7 +2365,7 @@ function rr({
|
|
|
2313
2365
|
}
|
|
2314
2366
|
}
|
|
2315
2367
|
),
|
|
2316
|
-
/* @__PURE__ */
|
|
2368
|
+
/* @__PURE__ */ s("span", { className: "text-xs text-dc-text-muted", children: Math.max(...e.map((v) => {
|
|
2317
2369
|
const A = v[m];
|
|
2318
2370
|
return typeof A == "string" ? parseFloat(A) : A;
|
|
2319
2371
|
})).toFixed(2) })
|
|
@@ -2321,85 +2373,85 @@ function rr({
|
|
|
2321
2373
|
] })
|
|
2322
2374
|
) : (
|
|
2323
2375
|
// Discrete legend for categorical series
|
|
2324
|
-
/* @__PURE__ */
|
|
2325
|
-
/* @__PURE__ */
|
|
2376
|
+
/* @__PURE__ */ s("div", { className: "flex flex-wrap justify-center gap-4", children: h.map((v, A) => /* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
|
|
2377
|
+
/* @__PURE__ */ s(
|
|
2326
2378
|
"div",
|
|
2327
2379
|
{
|
|
2328
2380
|
className: "w-3 h-3 rounded-xs",
|
|
2329
2381
|
style: { backgroundColor: v.color }
|
|
2330
2382
|
}
|
|
2331
2383
|
),
|
|
2332
|
-
/* @__PURE__ */
|
|
2384
|
+
/* @__PURE__ */ s("span", { className: "text-xs text-dc-text-muted", children: v.value })
|
|
2333
2385
|
] }, A)) })
|
|
2334
2386
|
) })
|
|
2335
2387
|
] });
|
|
2336
|
-
} catch (
|
|
2337
|
-
return /* @__PURE__ */
|
|
2338
|
-
/* @__PURE__ */
|
|
2339
|
-
/* @__PURE__ */
|
|
2340
|
-
/* @__PURE__ */
|
|
2388
|
+
} catch (c) {
|
|
2389
|
+
return /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: i }, children: /* @__PURE__ */ b("div", { className: "text-center", children: [
|
|
2390
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "TreeMap Chart Error" }),
|
|
2391
|
+
/* @__PURE__ */ s("div", { className: "text-xs mb-2", children: c instanceof Error ? c.message : "Unknown rendering error" }),
|
|
2392
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-muted", children: "Check the data and configuration" })
|
|
2341
2393
|
] }) });
|
|
2342
2394
|
}
|
|
2343
2395
|
}
|
|
2344
|
-
function
|
|
2396
|
+
function ar({
|
|
2345
2397
|
data: e,
|
|
2346
2398
|
chartConfig: t,
|
|
2347
2399
|
height: n = 300
|
|
2348
2400
|
}) {
|
|
2349
2401
|
const { getFieldLabel: r } = X();
|
|
2350
2402
|
if (!e || e.length === 0)
|
|
2351
|
-
return /* @__PURE__ */
|
|
2403
|
+
return /* @__PURE__ */ s(
|
|
2352
2404
|
"div",
|
|
2353
2405
|
{
|
|
2354
2406
|
className: "flex items-center justify-center w-full",
|
|
2355
2407
|
style: { height: n },
|
|
2356
2408
|
children: /* @__PURE__ */ b("div", { className: "text-center text-dc-text-muted", children: [
|
|
2357
|
-
/* @__PURE__ */
|
|
2358
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
2410
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "No data to display in table" })
|
|
2359
2411
|
] })
|
|
2360
2412
|
}
|
|
2361
2413
|
);
|
|
2362
|
-
const
|
|
2363
|
-
return
|
|
2414
|
+
const i = Object.keys(e[0] || {}), a = t?.xAxis && t.xAxis.length > 0 ? t.xAxis.filter((l) => i.includes(l)) : i;
|
|
2415
|
+
return a.length === 0 ? /* @__PURE__ */ s(
|
|
2364
2416
|
"div",
|
|
2365
2417
|
{
|
|
2366
2418
|
className: "flex items-center justify-center w-full",
|
|
2367
2419
|
style: { height: n },
|
|
2368
2420
|
children: /* @__PURE__ */ b("div", { className: "text-center text-dc-text-muted", children: [
|
|
2369
|
-
/* @__PURE__ */
|
|
2370
|
-
/* @__PURE__ */
|
|
2421
|
+
/* @__PURE__ */ s("div", { className: "text-sm font-semibold mb-1", children: "No columns available" }),
|
|
2422
|
+
/* @__PURE__ */ s("div", { className: "text-xs text-dc-text-secondary", children: "Data structure is invalid" })
|
|
2371
2423
|
] })
|
|
2372
2424
|
}
|
|
2373
|
-
) : /* @__PURE__ */
|
|
2374
|
-
/* @__PURE__ */
|
|
2425
|
+
) : /* @__PURE__ */ s("div", { className: "w-full overflow-auto", style: { height: n }, children: /* @__PURE__ */ b("table", { className: "min-w-full divide-y border-dc-border", children: [
|
|
2426
|
+
/* @__PURE__ */ s("thead", { className: "bg-dc-surface-secondary sticky top-0", children: /* @__PURE__ */ s("tr", { children: a.map((l) => /* @__PURE__ */ s(
|
|
2375
2427
|
"th",
|
|
2376
2428
|
{
|
|
2377
2429
|
className: "px-3 py-2 text-left text-xs font-medium text-dc-text-muted uppercase tracking-wider",
|
|
2378
|
-
children: r(
|
|
2430
|
+
children: r(l)
|
|
2379
2431
|
},
|
|
2380
|
-
|
|
2432
|
+
l
|
|
2381
2433
|
)) }) }),
|
|
2382
|
-
/* @__PURE__ */
|
|
2434
|
+
/* @__PURE__ */ s("tbody", { className: "bg-dc-surface divide-y border-dc-border", children: e.map((l, o) => /* @__PURE__ */ s("tr", { className: "hover:bg-dc-surface-secondary", children: a.map((d) => /* @__PURE__ */ s(
|
|
2383
2435
|
"td",
|
|
2384
2436
|
{
|
|
2385
2437
|
className: "px-3 py-2 whitespace-nowrap text-sm text-dc-text",
|
|
2386
|
-
children:
|
|
2438
|
+
children: Bn(l[d])
|
|
2387
2439
|
},
|
|
2388
2440
|
d
|
|
2389
|
-
)) },
|
|
2441
|
+
)) }, o)) })
|
|
2390
2442
|
] }) });
|
|
2391
2443
|
}
|
|
2392
|
-
function
|
|
2444
|
+
function Bn(e) {
|
|
2393
2445
|
return e == null ? "" : typeof e == "number" ? e.toLocaleString() : typeof e == "boolean" ? e ? "Yes" : "No" : String(e);
|
|
2394
2446
|
}
|
|
2395
|
-
function
|
|
2396
|
-
const t =
|
|
2447
|
+
function lr(e) {
|
|
2448
|
+
const t = Kn(e);
|
|
2397
2449
|
return {
|
|
2398
2450
|
portlets: e,
|
|
2399
2451
|
layouts: t
|
|
2400
2452
|
};
|
|
2401
2453
|
}
|
|
2402
|
-
function
|
|
2454
|
+
function Kn(e) {
|
|
2403
2455
|
const t = e.map((n) => ({
|
|
2404
2456
|
i: n.id,
|
|
2405
2457
|
x: n.x,
|
|
@@ -2417,22 +2469,22 @@ function qn(e) {
|
|
|
2417
2469
|
xxs: t.map((n) => ({ ...n, w: 2 }))
|
|
2418
2470
|
};
|
|
2419
2471
|
}
|
|
2420
|
-
function
|
|
2472
|
+
function or(e, t = {}) {
|
|
2421
2473
|
const { formatNumbers: n = !0, precision: r = 2 } = t;
|
|
2422
|
-
return n ? e.map((
|
|
2423
|
-
const
|
|
2424
|
-
for (const [
|
|
2425
|
-
typeof
|
|
2426
|
-
return
|
|
2474
|
+
return n ? e.map((i) => {
|
|
2475
|
+
const a = {};
|
|
2476
|
+
for (const [l, o] of Object.entries(i))
|
|
2477
|
+
typeof o == "number" ? a[l] = Number(o.toFixed(r)) : a[l] = o;
|
|
2478
|
+
return a;
|
|
2427
2479
|
}) : e;
|
|
2428
2480
|
}
|
|
2429
|
-
function
|
|
2481
|
+
function cr() {
|
|
2430
2482
|
return `portlet-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2431
2483
|
}
|
|
2432
|
-
function
|
|
2433
|
-
return e.length === 0 ? { x: 0, y: 0 } : { x: 0, y: Math.max(...e.map((
|
|
2484
|
+
function dr(e, t = 6, n = 4) {
|
|
2485
|
+
return e.length === 0 ? { x: 0, y: 0 } : { x: 0, y: Math.max(...e.map((i) => i.y + i.h)) };
|
|
2434
2486
|
}
|
|
2435
|
-
function
|
|
2487
|
+
function ur(e) {
|
|
2436
2488
|
try {
|
|
2437
2489
|
const t = JSON.parse(e);
|
|
2438
2490
|
return typeof t != "object" || t === null ? { valid: !1, error: "Query must be a JSON object" } : !t.measures && !t.dimensions ? { valid: !1, error: "Query must have at least measures or dimensions" } : { valid: !0, query: t };
|
|
@@ -2440,7 +2492,7 @@ function cr(e) {
|
|
|
2440
2492
|
return { valid: !1, error: "Invalid JSON format" };
|
|
2441
2493
|
}
|
|
2442
2494
|
}
|
|
2443
|
-
function
|
|
2495
|
+
function fr() {
|
|
2444
2496
|
return {
|
|
2445
2497
|
title: "Sample Chart",
|
|
2446
2498
|
query: JSON.stringify({
|
|
@@ -2464,45 +2516,45 @@ function dr() {
|
|
|
2464
2516
|
};
|
|
2465
2517
|
}
|
|
2466
2518
|
export {
|
|
2467
|
-
|
|
2468
|
-
|
|
2519
|
+
er as A,
|
|
2520
|
+
Jn as B,
|
|
2469
2521
|
we as C,
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2522
|
+
ar as D,
|
|
2523
|
+
dr as E,
|
|
2524
|
+
ur as F,
|
|
2525
|
+
fr as G,
|
|
2474
2526
|
Ue as H,
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2527
|
+
Pn as L,
|
|
2528
|
+
_t as N,
|
|
2529
|
+
tr as P,
|
|
2530
|
+
rr as R,
|
|
2531
|
+
nr as S,
|
|
2532
|
+
sr as T,
|
|
2533
|
+
ir as a,
|
|
2482
2534
|
Pe as b,
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2535
|
+
lr as c,
|
|
2536
|
+
Nn as d,
|
|
2537
|
+
ie as e,
|
|
2538
|
+
or as f,
|
|
2539
|
+
_n as g,
|
|
2540
|
+
_e as h,
|
|
2489
2541
|
ye as i,
|
|
2490
2542
|
J as j,
|
|
2491
|
-
|
|
2543
|
+
O as k,
|
|
2492
2544
|
gt as l,
|
|
2493
2545
|
R as m,
|
|
2494
|
-
|
|
2495
|
-
|
|
2546
|
+
ke as n,
|
|
2547
|
+
qn as o,
|
|
2496
2548
|
te as p,
|
|
2497
2549
|
vt as q,
|
|
2498
2550
|
oe as r,
|
|
2499
2551
|
pt as s,
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2552
|
+
Hn as t,
|
|
2553
|
+
j as u,
|
|
2554
|
+
ze as v,
|
|
2555
|
+
Zn as w,
|
|
2556
|
+
Qn as x,
|
|
2557
|
+
Kn as y,
|
|
2558
|
+
cr as z
|
|
2507
2559
|
};
|
|
2508
|
-
//# sourceMappingURL=charts-
|
|
2560
|
+
//# sourceMappingURL=charts-P7xq59Tl.js.map
|