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