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