drizzle-cube 0.1.21 → 0.1.24
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/adapters/{compiler-CPsEzFP2.js → compiler-CSr2Ti96.js} +553 -505
- package/dist/adapters/express/index.js +1 -1
- package/dist/adapters/fastify/index.js +1 -1
- package/dist/adapters/hono/index.js +1 -1
- package/dist/adapters/nextjs/index.js +50 -50
- package/dist/client/charts/chartConfigs.d.ts +31 -1
- package/dist/client/charts.d.ts +1 -0
- package/dist/client/charts.js +1 -1
- package/dist/client/chunks/charts-Dx3asDBi.js +2269 -0
- package/dist/client/chunks/charts-Dx3asDBi.js.map +1 -0
- package/dist/client/chunks/{icons-B5RVM-7b.js → icons-BMGOKdZb.js} +279 -239
- package/dist/client/chunks/icons-BMGOKdZb.js.map +1 -0
- package/dist/client/chunks/{providers-DI5zeeEU.js → providers-B7MVnAAt.js} +50 -50
- package/dist/client/chunks/providers-B7MVnAAt.js.map +1 -0
- package/dist/client/components/ChartConfigPanel.d.ts +3 -2
- package/dist/client/components/ColorPaletteSelector.d.ts +11 -0
- package/dist/client/components/DashboardGrid.d.ts +3 -1
- package/dist/client/components/DataHistogram.d.ts +23 -0
- package/dist/client/components/PortletEditModal.d.ts +3 -2
- package/dist/client/components/charts/ActivityGridChart.config.d.ts +5 -0
- package/dist/client/components/charts/ActivityGridChart.d.ts +2 -0
- package/dist/client/components/charts/AreaChart.d.ts +1 -1
- package/dist/client/components/charts/BarChart.d.ts +1 -1
- package/dist/client/components/charts/BubbleChart.d.ts +1 -1
- package/dist/client/components/charts/KpiNumber.config.d.ts +5 -0
- package/dist/client/components/charts/KpiNumber.d.ts +2 -0
- package/dist/client/components/charts/KpiText.config.d.ts +5 -0
- package/dist/client/components/charts/KpiText.d.ts +2 -0
- package/dist/client/components/charts/LineChart.d.ts +1 -1
- package/dist/client/components/charts/PieChart.d.ts +1 -1
- package/dist/client/components/charts/RadarChart.d.ts +1 -1
- package/dist/client/components/charts/RadialBarChart.d.ts +1 -1
- package/dist/client/components/charts/ScatterChart.d.ts +1 -1
- package/dist/client/components/charts/TreeMapChart.d.ts +1 -1
- package/dist/client/components/charts/index.d.ts +3 -0
- package/dist/client/components.js +5134 -2607
- package/dist/client/components.js.map +1 -1
- package/dist/client/hooks/useCubeMeta.d.ts +1 -0
- package/dist/client/hooks.js +62 -60
- package/dist/client/hooks.js.map +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/providers.js +1 -1
- package/dist/client/types.d.ts +17 -5
- package/dist/client/utils/colorPalettes.d.ts +35 -0
- package/dist/client-bundle-stats.html +1 -1
- package/dist/server/index.d.ts +3 -8
- package/dist/server/index.js +748 -700
- package/package.json +22 -1
- package/dist/client/chunks/charts-BadAUMmd.js +0 -2285
- package/dist/client/chunks/charts-BadAUMmd.js.map +0 -1
- package/dist/client/chunks/icons-B5RVM-7b.js.map +0 -1
- package/dist/client/chunks/providers-DI5zeeEU.js.map +0 -1
|
@@ -1,2285 +0,0 @@
|
|
|
1
|
-
import { jsx as a, jsxs as w } from "react/jsx-runtime";
|
|
2
|
-
import { useState as P } from "react";
|
|
3
|
-
import { ResponsiveContainer as ze, Tooltip as ut, BarChart as ft, CartesianGrid as he, XAxis as ye, YAxis as pe, Legend as B, Bar as mt, Cell as ke, LineChart as xt, Line as ht, AreaChart as yt, Area as pt, PieChart as vt, Pie as bt, ScatterChart as gt, Scatter as Re, RadarChart as wt, PolarGrid as Nt, PolarAngleAxis as At, PolarRadiusAxis as St, Radar as Mt, RadialBarChart as kt, RadialBar as $t, Treemap as Lt } from "recharts";
|
|
4
|
-
import { u as _ } from "./providers-DI5zeeEU.js";
|
|
5
|
-
function O({ children: e, height: t = "100%" }) {
|
|
6
|
-
try {
|
|
7
|
-
if (t === "100%")
|
|
8
|
-
return /* @__PURE__ */ a("div", { className: "w-full h-full flex-1 flex flex-col relative", style: { minHeight: "250px", overflow: "hidden" }, children: /* @__PURE__ */ a(ze, { width: "100%", height: "100%", debounce: 50, style: { marginTop: "16px" }, children: e }) });
|
|
9
|
-
const r = {
|
|
10
|
-
height: typeof t == "number" ? `${t}px` : t,
|
|
11
|
-
width: "100%",
|
|
12
|
-
minHeight: "200px"
|
|
13
|
-
};
|
|
14
|
-
return /* @__PURE__ */ a("div", { className: "w-full flex flex-col relative", style: { ...r, overflow: "hidden" }, children: /* @__PURE__ */ a(ze, { width: "100%", height: "100%", debounce: 50, style: { marginTop: "16px" }, children: e }) });
|
|
15
|
-
} catch (r) {
|
|
16
|
-
return console.error("ChartContainer ResponsiveContainer error:", r), /* @__PURE__ */ w(
|
|
17
|
-
"div",
|
|
18
|
-
{
|
|
19
|
-
className: "flex flex-col items-center justify-center w-full h-full p-4 text-center border-2 border-dashed border-yellow-300 rounded-lg bg-yellow-50",
|
|
20
|
-
style: { height: t },
|
|
21
|
-
children: [
|
|
22
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold text-yellow-600 mb-1", children: "Chart Container Error" }),
|
|
23
|
-
/* @__PURE__ */ a("div", { className: "text-xs text-gray-600", children: r instanceof Error ? r.message : "Failed to create responsive container" })
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function G({ formatter: e, labelFormatter: t }) {
|
|
30
|
-
return /* @__PURE__ */ a(
|
|
31
|
-
ut,
|
|
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 L = [
|
|
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
|
-
], se = [
|
|
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
|
-
], De = "#10b981", Tt = "#ef4444", ve = {
|
|
78
|
-
top: 5,
|
|
79
|
-
right: 30,
|
|
80
|
-
left: 20,
|
|
81
|
-
bottom: 5
|
|
82
|
-
};
|
|
83
|
-
function we(e, t) {
|
|
84
|
-
return t[e] || e;
|
|
85
|
-
}
|
|
86
|
-
function z(e, t) {
|
|
87
|
-
if (!e) return String(e || "Unknown");
|
|
88
|
-
const r = String(e);
|
|
89
|
-
if (r.match(/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}/)) {
|
|
90
|
-
let n = r;
|
|
91
|
-
r.includes(" ") && (n = r.replace(" ", "T").replace("+00", "Z").replace(/\+\d{2}:\d{2}$/, "Z")), !n.endsWith("Z") && !n.includes("+") && (n = n + "Z");
|
|
92
|
-
const s = new Date(n);
|
|
93
|
-
if (isNaN(s.getTime()))
|
|
94
|
-
return r;
|
|
95
|
-
const o = s.getUTCFullYear(), l = String(s.getUTCMonth() + 1).padStart(2, "0"), d = String(s.getUTCDate()).padStart(2, "0"), c = s.getUTCHours(), i = s.getUTCMinutes();
|
|
96
|
-
if (t)
|
|
97
|
-
switch (t.toLowerCase()) {
|
|
98
|
-
case "year":
|
|
99
|
-
return `${o}`;
|
|
100
|
-
case "quarter":
|
|
101
|
-
const h = Math.floor(s.getUTCMonth() / 3) + 1;
|
|
102
|
-
return `${o}-Q${h}`;
|
|
103
|
-
case "month":
|
|
104
|
-
return `${o}-${l}`;
|
|
105
|
-
case "week":
|
|
106
|
-
return `${o}-${l}-${d}`;
|
|
107
|
-
case "day":
|
|
108
|
-
return `${o}-${l}-${d}`;
|
|
109
|
-
case "hour":
|
|
110
|
-
return `${o}-${l}-${d} ${String(c).padStart(2, "0")}:00`;
|
|
111
|
-
case "minute":
|
|
112
|
-
return `${o}-${l}-${d} ${String(c).padStart(2, "0")}:${String(i).padStart(2, "0")}`;
|
|
113
|
-
}
|
|
114
|
-
const f = s.getUTCSeconds(), u = s.getUTCMilliseconds();
|
|
115
|
-
if (d === "01" && c === 0 && i === 0 && f === 0 && u === 0) {
|
|
116
|
-
if (l === "01" || l === "04" || l === "07" || l === "10") {
|
|
117
|
-
const h = Math.floor(s.getUTCMonth() / 3) + 1;
|
|
118
|
-
return `${o}-Q${h}`;
|
|
119
|
-
}
|
|
120
|
-
return `${o}-${l}`;
|
|
121
|
-
}
|
|
122
|
-
return c === 0 && i === 0 && f === 0 && u === 0 ? `${o}-${l}-${d}` : i === 0 && f === 0 && u === 0 ? `${o}-${l}-${d} ${String(c).padStart(2, "0")}:00` : `${o}-${l}-${d} ${String(c).padStart(2, "0")}:${String(i).padStart(2, "0")}`;
|
|
123
|
-
}
|
|
124
|
-
return r;
|
|
125
|
-
}
|
|
126
|
-
function I(e, t) {
|
|
127
|
-
try {
|
|
128
|
-
if (e != null && e.timeDimensions) {
|
|
129
|
-
const n = e.timeDimensions.find((s) => t === s.dimension || t.startsWith(s.dimension.replace(".", "_")) || t === `${s.dimension}_${s.granularity}`);
|
|
130
|
-
if (n != null && n.granularity)
|
|
131
|
-
return n.granularity;
|
|
132
|
-
}
|
|
133
|
-
const r = t.match(/_([a-z]+)$/);
|
|
134
|
-
if (r) {
|
|
135
|
-
const n = r[1];
|
|
136
|
-
if (["year", "quarter", "month", "week", "day", "hour", "minute", "second"].includes(n))
|
|
137
|
-
return n;
|
|
138
|
-
}
|
|
139
|
-
return;
|
|
140
|
-
} catch {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function Ft(e, t, r, n, s = {}) {
|
|
145
|
-
if (!e || e.length === 0) return [];
|
|
146
|
-
const o = I(n, t);
|
|
147
|
-
return e.map((l) => {
|
|
148
|
-
const d = {
|
|
149
|
-
name: z(l[t], o) || l[t] || "Unknown"
|
|
150
|
-
};
|
|
151
|
-
return r.forEach((c) => {
|
|
152
|
-
const i = we(c, s);
|
|
153
|
-
d[i] = typeof l[c] == "string" ? parseFloat(l[c]) : l[c] || 0;
|
|
154
|
-
}), d;
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
function C(e, t, r, n, s, o = {}) {
|
|
158
|
-
var p;
|
|
159
|
-
if (!e || e.length === 0)
|
|
160
|
-
return { data: [], seriesKeys: [], hasDimensions: !1 };
|
|
161
|
-
const l = n || {}, d = [
|
|
162
|
-
...l.dimensions || [],
|
|
163
|
-
...((p = l.timeDimensions) == null ? void 0 : p.map((m) => m.dimension)) || []
|
|
164
|
-
], c = l.measures || [], i = r.filter((m) => c.includes(m)), f = (s || []).filter((m) => d.includes(m));
|
|
165
|
-
if (f.length > 0) {
|
|
166
|
-
const m = {};
|
|
167
|
-
e.forEach((S) => {
|
|
168
|
-
const b = I(n, t), x = z(S[t], b) || S[t] || "Unknown";
|
|
169
|
-
m[x] || (m[x] = { name: String(x) }), i.forEach((N) => {
|
|
170
|
-
const y = we(N, o);
|
|
171
|
-
m[x][y] = (m[x][y] || 0) + (typeof S[N] == "string" ? parseFloat(S[N]) : S[N] || 0);
|
|
172
|
-
}), f.forEach((N) => {
|
|
173
|
-
const y = S[N];
|
|
174
|
-
if (y != null) {
|
|
175
|
-
const g = String(y), $ = i[0] || c.find(
|
|
176
|
-
(M) => M.includes("totalCost") || M.includes("count") || M.includes("sum")
|
|
177
|
-
) || c[0];
|
|
178
|
-
if ($) {
|
|
179
|
-
const M = typeof S[$] == "string" ? parseFloat(S[$]) : S[$] || 0;
|
|
180
|
-
m[x][g] = (m[x][g] || 0) + M;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
const v = Object.values(m), A = Array.from(new Set(
|
|
186
|
-
e.flatMap(
|
|
187
|
-
(S) => f.map((b) => {
|
|
188
|
-
const x = S[b];
|
|
189
|
-
return x != null ? String(x) : null;
|
|
190
|
-
}).filter((b) => b !== null)
|
|
191
|
-
)
|
|
192
|
-
));
|
|
193
|
-
return {
|
|
194
|
-
data: v,
|
|
195
|
-
seriesKeys: A,
|
|
196
|
-
hasDimensions: !0
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
const u = Ft(e, t, r, n, o), h = r.map((m) => we(m, o));
|
|
200
|
-
return {
|
|
201
|
-
data: u,
|
|
202
|
-
seriesKeys: h,
|
|
203
|
-
hasDimensions: !1
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
function Gr({
|
|
207
|
-
data: e,
|
|
208
|
-
chartConfig: t,
|
|
209
|
-
displayConfig: r = {},
|
|
210
|
-
queryObject: n,
|
|
211
|
-
height: s = "100%"
|
|
212
|
-
}) {
|
|
213
|
-
const [o, l] = P(null), { labelMap: d, getFieldLabel: c } = _();
|
|
214
|
-
try {
|
|
215
|
-
const i = {
|
|
216
|
-
showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
|
|
217
|
-
showGrid: (r == null ? void 0 : r.showGrid) ?? !0,
|
|
218
|
-
showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0,
|
|
219
|
-
stacked: (r == null ? void 0 : r.stacked) ?? !1
|
|
220
|
-
};
|
|
221
|
-
if (!e || e.length === 0)
|
|
222
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
223
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
224
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No data points to display in bar chart" })
|
|
225
|
-
] }) });
|
|
226
|
-
let f, u, h = [];
|
|
227
|
-
if (t != null && t.xAxis && (t != null && t.yAxis))
|
|
228
|
-
f = t.xAxis[0], u = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], h = t.series || [];
|
|
229
|
-
else if (t != null && t.x && (t != null && t.y))
|
|
230
|
-
f = t.x, u = Array.isArray(t.y) ? t.y : [t.y];
|
|
231
|
-
else
|
|
232
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
233
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
234
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
|
|
235
|
-
] }) });
|
|
236
|
-
if (!f || !u || u.length === 0)
|
|
237
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
238
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
239
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
|
|
240
|
-
] }) });
|
|
241
|
-
const { data: p, seriesKeys: m } = C(
|
|
242
|
-
e,
|
|
243
|
-
f,
|
|
244
|
-
u,
|
|
245
|
-
n,
|
|
246
|
-
h,
|
|
247
|
-
d
|
|
248
|
-
), v = i.stacked === !0, A = m.length === 1 && p.some((x) => {
|
|
249
|
-
const N = x[m[0]];
|
|
250
|
-
return typeof N == "number" && N < 0;
|
|
251
|
-
}), S = i.showLegend, b = {
|
|
252
|
-
...ve,
|
|
253
|
-
left: 40
|
|
254
|
-
// Increased from 20 to 40 for Y-axis label space
|
|
255
|
-
};
|
|
256
|
-
return !p || p.length === 0 ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
257
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
258
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No valid data points for bar chart after transformation" })
|
|
259
|
-
] }) }) : /* @__PURE__ */ a(O, { height: s, children: /* @__PURE__ */ w(ft, { data: p, margin: b, children: [
|
|
260
|
-
i.showGrid && /* @__PURE__ */ a(he, { strokeDasharray: "3 3" }),
|
|
261
|
-
/* @__PURE__ */ a(
|
|
262
|
-
ye,
|
|
263
|
-
{
|
|
264
|
-
dataKey: "name",
|
|
265
|
-
tick: { fontSize: 12 },
|
|
266
|
-
angle: -45,
|
|
267
|
-
textAnchor: "end",
|
|
268
|
-
height: 60
|
|
269
|
-
}
|
|
270
|
-
),
|
|
271
|
-
/* @__PURE__ */ a(
|
|
272
|
-
pe,
|
|
273
|
-
{
|
|
274
|
-
tick: { fontSize: 12 },
|
|
275
|
-
label: { value: c(u[0]), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
|
|
276
|
-
}
|
|
277
|
-
),
|
|
278
|
-
i.showTooltip && /* @__PURE__ */ a(G, {}),
|
|
279
|
-
S && /* @__PURE__ */ a(
|
|
280
|
-
B,
|
|
281
|
-
{
|
|
282
|
-
wrapperStyle: { fontSize: "12px", paddingTop: "25px" },
|
|
283
|
-
iconType: "rect",
|
|
284
|
-
iconSize: 8,
|
|
285
|
-
layout: "horizontal",
|
|
286
|
-
align: "center",
|
|
287
|
-
verticalAlign: "bottom",
|
|
288
|
-
onMouseEnter: (x) => l(String(x.dataKey || "")),
|
|
289
|
-
onMouseLeave: () => l(null)
|
|
290
|
-
}
|
|
291
|
-
),
|
|
292
|
-
m.map((x, N) => /* @__PURE__ */ a(
|
|
293
|
-
mt,
|
|
294
|
-
{
|
|
295
|
-
dataKey: x,
|
|
296
|
-
stackId: v ? "stack" : void 0,
|
|
297
|
-
fill: A ? De : L[N % L.length],
|
|
298
|
-
fillOpacity: o ? o === x ? 1 : 0.3 : 1,
|
|
299
|
-
children: A && p.map((y, g) => {
|
|
300
|
-
const $ = y[x], M = typeof $ == "number" && $ < 0 ? Tt : De;
|
|
301
|
-
return /* @__PURE__ */ a(
|
|
302
|
-
ke,
|
|
303
|
-
{
|
|
304
|
-
fill: M,
|
|
305
|
-
fillOpacity: o ? o === x ? 1 : 0.3 : 1
|
|
306
|
-
},
|
|
307
|
-
`cell-${g}`
|
|
308
|
-
);
|
|
309
|
-
})
|
|
310
|
-
},
|
|
311
|
-
x
|
|
312
|
-
))
|
|
313
|
-
] }) });
|
|
314
|
-
} catch (i) {
|
|
315
|
-
return console.error("BarChart rendering error:", i), /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
316
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Bar Chart Error" }),
|
|
317
|
-
/* @__PURE__ */ a("div", { className: "text-xs mb-2", children: i instanceof Error ? i.message : "Unknown rendering error" }),
|
|
318
|
-
/* @__PURE__ */ a("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
|
|
319
|
-
] }) });
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
function Ur({
|
|
323
|
-
data: e,
|
|
324
|
-
chartConfig: t,
|
|
325
|
-
displayConfig: r = {},
|
|
326
|
-
queryObject: n,
|
|
327
|
-
height: s = "100%"
|
|
328
|
-
}) {
|
|
329
|
-
const [o, l] = P(null), { labelMap: d, getFieldLabel: c } = _();
|
|
330
|
-
try {
|
|
331
|
-
const i = {
|
|
332
|
-
showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
|
|
333
|
-
showGrid: (r == null ? void 0 : r.showGrid) ?? !0,
|
|
334
|
-
showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0
|
|
335
|
-
};
|
|
336
|
-
if (!e || e.length === 0)
|
|
337
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
338
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
339
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No data points to display in line chart" })
|
|
340
|
-
] }) });
|
|
341
|
-
let f, u, h = [];
|
|
342
|
-
if (t != null && t.xAxis && (t != null && t.yAxis))
|
|
343
|
-
f = t.xAxis[0], u = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], h = t.series || [];
|
|
344
|
-
else if (t != null && t.x && (t != null && t.y))
|
|
345
|
-
f = t.x, u = Array.isArray(t.y) ? t.y : [t.y];
|
|
346
|
-
else
|
|
347
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
348
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
349
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
|
|
350
|
-
] }) });
|
|
351
|
-
if (!f || !u || u.length === 0)
|
|
352
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
353
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
354
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
|
|
355
|
-
] }) });
|
|
356
|
-
const { data: p, seriesKeys: m } = C(
|
|
357
|
-
e,
|
|
358
|
-
f,
|
|
359
|
-
u,
|
|
360
|
-
n,
|
|
361
|
-
h,
|
|
362
|
-
d
|
|
363
|
-
), v = i.showLegend, A = {
|
|
364
|
-
...ve,
|
|
365
|
-
left: 40
|
|
366
|
-
// Increased from 20 to 40 for Y-axis label space
|
|
367
|
-
};
|
|
368
|
-
return !p || p.length === 0 ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
369
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
370
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No valid data points for line chart after transformation" })
|
|
371
|
-
] }) }) : /* @__PURE__ */ a(O, { height: s, children: /* @__PURE__ */ w(xt, { data: p, margin: A, children: [
|
|
372
|
-
i.showGrid && /* @__PURE__ */ a(he, { strokeDasharray: "3 3" }),
|
|
373
|
-
/* @__PURE__ */ a(
|
|
374
|
-
ye,
|
|
375
|
-
{
|
|
376
|
-
dataKey: "name",
|
|
377
|
-
tick: { fontSize: 12 },
|
|
378
|
-
angle: -45,
|
|
379
|
-
textAnchor: "end",
|
|
380
|
-
height: 60
|
|
381
|
-
}
|
|
382
|
-
),
|
|
383
|
-
/* @__PURE__ */ a(
|
|
384
|
-
pe,
|
|
385
|
-
{
|
|
386
|
-
tick: { fontSize: 12 },
|
|
387
|
-
label: { value: c(u[0]), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
|
|
388
|
-
}
|
|
389
|
-
),
|
|
390
|
-
i.showTooltip && /* @__PURE__ */ a(G, {}),
|
|
391
|
-
v && /* @__PURE__ */ a(
|
|
392
|
-
B,
|
|
393
|
-
{
|
|
394
|
-
wrapperStyle: { fontSize: "12px", paddingTop: "25px" },
|
|
395
|
-
iconType: "line",
|
|
396
|
-
iconSize: 8,
|
|
397
|
-
layout: "horizontal",
|
|
398
|
-
align: "center",
|
|
399
|
-
verticalAlign: "bottom",
|
|
400
|
-
onMouseEnter: (S) => l(String(S.dataKey || "")),
|
|
401
|
-
onMouseLeave: () => l(null)
|
|
402
|
-
}
|
|
403
|
-
),
|
|
404
|
-
m.map((S, b) => {
|
|
405
|
-
var x;
|
|
406
|
-
return /* @__PURE__ */ a(
|
|
407
|
-
ht,
|
|
408
|
-
{
|
|
409
|
-
type: "monotone",
|
|
410
|
-
dataKey: S,
|
|
411
|
-
stroke: ((x = r.colors) == null ? void 0 : x[b]) || L[b % L.length],
|
|
412
|
-
strokeWidth: 2,
|
|
413
|
-
dot: { r: 3 },
|
|
414
|
-
activeDot: { r: 5 },
|
|
415
|
-
strokeOpacity: o ? o === S ? 1 : 0.3 : 1
|
|
416
|
-
},
|
|
417
|
-
S
|
|
418
|
-
);
|
|
419
|
-
})
|
|
420
|
-
] }) });
|
|
421
|
-
} catch (i) {
|
|
422
|
-
return console.error("LineChart rendering error:", i), /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
423
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Line Chart Error" }),
|
|
424
|
-
/* @__PURE__ */ a("div", { className: "text-xs mb-2", children: i instanceof Error ? i.message : "Unknown rendering error" }),
|
|
425
|
-
/* @__PURE__ */ a("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
|
|
426
|
-
] }) });
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
function Vr({
|
|
430
|
-
data: e,
|
|
431
|
-
chartConfig: t,
|
|
432
|
-
displayConfig: r = {},
|
|
433
|
-
queryObject: n,
|
|
434
|
-
height: s = "100%"
|
|
435
|
-
}) {
|
|
436
|
-
const [o, l] = P(null), { labelMap: d, getFieldLabel: c } = _();
|
|
437
|
-
try {
|
|
438
|
-
const i = {
|
|
439
|
-
showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
|
|
440
|
-
showGrid: (r == null ? void 0 : r.showGrid) ?? !0,
|
|
441
|
-
showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0,
|
|
442
|
-
stacked: (r == null ? void 0 : r.stacked) ?? !1
|
|
443
|
-
};
|
|
444
|
-
if (!e || e.length === 0)
|
|
445
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
446
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
447
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No data points to display in area chart" })
|
|
448
|
-
] }) });
|
|
449
|
-
let f, u, h = [];
|
|
450
|
-
if (t != null && t.xAxis && (t != null && t.yAxis))
|
|
451
|
-
f = t.xAxis[0], u = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], h = t.series || [];
|
|
452
|
-
else if (t != null && t.x && (t != null && t.y))
|
|
453
|
-
f = t.x, u = Array.isArray(t.y) ? t.y : [t.y];
|
|
454
|
-
else
|
|
455
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
456
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
457
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
|
|
458
|
-
] }) });
|
|
459
|
-
if (!f || !u || u.length === 0)
|
|
460
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
461
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
462
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
|
|
463
|
-
] }) });
|
|
464
|
-
const { data: p, seriesKeys: m } = C(
|
|
465
|
-
e,
|
|
466
|
-
f,
|
|
467
|
-
u,
|
|
468
|
-
n,
|
|
469
|
-
h,
|
|
470
|
-
d
|
|
471
|
-
), v = i.showLegend, A = {
|
|
472
|
-
...ve,
|
|
473
|
-
left: 40
|
|
474
|
-
// Increased from 20 to 40 for Y-axis label space
|
|
475
|
-
};
|
|
476
|
-
return !p || p.length === 0 ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
477
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
478
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No valid data points for area chart after transformation" })
|
|
479
|
-
] }) }) : /* @__PURE__ */ a(O, { height: s, children: /* @__PURE__ */ w(yt, { data: p, margin: A, children: [
|
|
480
|
-
i.showGrid && /* @__PURE__ */ a(he, { strokeDasharray: "3 3" }),
|
|
481
|
-
/* @__PURE__ */ a(
|
|
482
|
-
ye,
|
|
483
|
-
{
|
|
484
|
-
dataKey: "name",
|
|
485
|
-
tick: { fontSize: 12 },
|
|
486
|
-
angle: -45,
|
|
487
|
-
textAnchor: "end",
|
|
488
|
-
height: 60
|
|
489
|
-
}
|
|
490
|
-
),
|
|
491
|
-
/* @__PURE__ */ a(
|
|
492
|
-
pe,
|
|
493
|
-
{
|
|
494
|
-
tick: { fontSize: 12 },
|
|
495
|
-
label: { value: c(u[0]), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
|
|
496
|
-
}
|
|
497
|
-
),
|
|
498
|
-
i.showTooltip && /* @__PURE__ */ a(G, {}),
|
|
499
|
-
v && /* @__PURE__ */ a(
|
|
500
|
-
B,
|
|
501
|
-
{
|
|
502
|
-
wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
|
|
503
|
-
iconType: "rect",
|
|
504
|
-
iconSize: 8,
|
|
505
|
-
layout: "horizontal",
|
|
506
|
-
align: "center",
|
|
507
|
-
verticalAlign: "bottom",
|
|
508
|
-
onMouseEnter: (S) => l(String(S.dataKey || "")),
|
|
509
|
-
onMouseLeave: () => l(null)
|
|
510
|
-
}
|
|
511
|
-
),
|
|
512
|
-
m.map((S, b) => {
|
|
513
|
-
var x, N;
|
|
514
|
-
return /* @__PURE__ */ a(
|
|
515
|
-
pt,
|
|
516
|
-
{
|
|
517
|
-
type: "monotone",
|
|
518
|
-
dataKey: S,
|
|
519
|
-
stackId: i.stacked ? "stack" : void 0,
|
|
520
|
-
stroke: ((x = r.colors) == null ? void 0 : x[b]) || L[b % L.length],
|
|
521
|
-
fill: ((N = r.colors) == null ? void 0 : N[b]) || L[b % L.length],
|
|
522
|
-
fillOpacity: o ? o === S ? 0.6 : 0.1 : 0.3,
|
|
523
|
-
strokeWidth: 2,
|
|
524
|
-
strokeOpacity: o ? o === S ? 1 : 0.3 : 1
|
|
525
|
-
},
|
|
526
|
-
S
|
|
527
|
-
);
|
|
528
|
-
})
|
|
529
|
-
] }) });
|
|
530
|
-
} catch (i) {
|
|
531
|
-
return console.error("AreaChart rendering error:", i), /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
532
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Area Chart Error" }),
|
|
533
|
-
/* @__PURE__ */ a("div", { className: "text-xs mb-2", children: i instanceof Error ? i.message : "Unknown rendering error" }),
|
|
534
|
-
/* @__PURE__ */ a("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
|
|
535
|
-
] }) });
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
function qr({
|
|
539
|
-
data: e,
|
|
540
|
-
chartConfig: t,
|
|
541
|
-
displayConfig: r = {},
|
|
542
|
-
queryObject: n,
|
|
543
|
-
height: s = "100%"
|
|
544
|
-
}) {
|
|
545
|
-
const [o, l] = P(null), { labelMap: d } = _();
|
|
546
|
-
try {
|
|
547
|
-
const c = {
|
|
548
|
-
showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
|
|
549
|
-
showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0
|
|
550
|
-
};
|
|
551
|
-
if (!e || e.length === 0)
|
|
552
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
553
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
554
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No data points to display in pie chart" })
|
|
555
|
-
] }) });
|
|
556
|
-
let i, f, u, h = [];
|
|
557
|
-
if (t != null && t.xAxis && (t != null && t.yAxis))
|
|
558
|
-
f = t.xAxis[0], u = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], h = t.series || [];
|
|
559
|
-
else if (t != null && t.x && (t != null && t.y))
|
|
560
|
-
f = t.x, u = Array.isArray(t.y) ? t.y : [t.y];
|
|
561
|
-
else
|
|
562
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
563
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
564
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "chartConfig.x/y or chartConfig.xAxis/yAxis required for pie chart" })
|
|
565
|
-
] }) });
|
|
566
|
-
if (!f || !u || u.length === 0)
|
|
567
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
568
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
569
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
|
|
570
|
-
] }) });
|
|
571
|
-
if (h.length > 0) {
|
|
572
|
-
const { data: m } = C(
|
|
573
|
-
e,
|
|
574
|
-
f,
|
|
575
|
-
u,
|
|
576
|
-
n,
|
|
577
|
-
h,
|
|
578
|
-
d
|
|
579
|
-
);
|
|
580
|
-
if (i = [], m.length > 0) {
|
|
581
|
-
const v = m[0];
|
|
582
|
-
Object.keys(v).forEach((A) => {
|
|
583
|
-
A !== "name" && typeof v[A] == "number" && i.push({
|
|
584
|
-
name: String(A),
|
|
585
|
-
value: v[A]
|
|
586
|
-
});
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
} else {
|
|
590
|
-
const m = I(n, f);
|
|
591
|
-
i = e.map((v) => {
|
|
592
|
-
let A = z(v[f], m) || String(v[f]) || "Unknown";
|
|
593
|
-
return typeof v[f] == "boolean" ? A = v[f] ? "Active" : "Inactive" : (A === "true" || A === "false") && (A = A === "true" ? "Active" : "Inactive"), {
|
|
594
|
-
name: A,
|
|
595
|
-
value: typeof v[u[0]] == "string" ? parseFloat(v[u[0]]) : v[u[0]] || 0
|
|
596
|
-
};
|
|
597
|
-
});
|
|
598
|
-
}
|
|
599
|
-
const p = i.length;
|
|
600
|
-
return i = i.filter(
|
|
601
|
-
(m) => m.value != null && !isNaN(m.value) && m.value !== 0 && m.value > 0
|
|
602
|
-
), i.length === 0 ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
603
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
604
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: p > 0 ? `Filtered out ${p} data points (zero or invalid values)` : "No data points to display in pie chart" })
|
|
605
|
-
] }) }) : /* @__PURE__ */ a(O, { height: s, children: /* @__PURE__ */ w(vt, { children: [
|
|
606
|
-
/* @__PURE__ */ a(
|
|
607
|
-
bt,
|
|
608
|
-
{
|
|
609
|
-
data: i,
|
|
610
|
-
cx: "50%",
|
|
611
|
-
cy: "50%",
|
|
612
|
-
outerRadius: "70%",
|
|
613
|
-
dataKey: "value",
|
|
614
|
-
label: c.showLegend ? void 0 : ({ name: m, percent: v }) => `${m} ${(v * 100).toFixed(0)}%`,
|
|
615
|
-
children: i.map((m, v) => {
|
|
616
|
-
var A;
|
|
617
|
-
return /* @__PURE__ */ a(
|
|
618
|
-
ke,
|
|
619
|
-
{
|
|
620
|
-
fill: ((A = r.colors) == null ? void 0 : A[v]) || L[v % L.length],
|
|
621
|
-
fillOpacity: o ? o === i[v].name ? 1 : 0.3 : 1
|
|
622
|
-
},
|
|
623
|
-
`cell-${v}`
|
|
624
|
-
);
|
|
625
|
-
})
|
|
626
|
-
}
|
|
627
|
-
),
|
|
628
|
-
c.showTooltip && /* @__PURE__ */ a(G, {}),
|
|
629
|
-
c.showLegend && /* @__PURE__ */ a(
|
|
630
|
-
B,
|
|
631
|
-
{
|
|
632
|
-
wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
|
|
633
|
-
iconType: "circle",
|
|
634
|
-
iconSize: 8,
|
|
635
|
-
layout: "horizontal",
|
|
636
|
-
align: "center",
|
|
637
|
-
verticalAlign: "bottom",
|
|
638
|
-
onMouseEnter: (m) => l(String(m.value || "")),
|
|
639
|
-
onMouseLeave: () => l(null)
|
|
640
|
-
}
|
|
641
|
-
)
|
|
642
|
-
] }) });
|
|
643
|
-
} catch (c) {
|
|
644
|
-
return console.error("PieChart rendering error:", c), /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
645
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Pie Chart Error" }),
|
|
646
|
-
/* @__PURE__ */ a("div", { className: "text-xs mb-2", children: c instanceof Error ? c.message : "Unknown rendering error" }),
|
|
647
|
-
/* @__PURE__ */ a("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
|
|
648
|
-
] }) });
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
function Br({
|
|
652
|
-
data: e,
|
|
653
|
-
chartConfig: t,
|
|
654
|
-
displayConfig: r = {},
|
|
655
|
-
queryObject: n,
|
|
656
|
-
height: s = "100%"
|
|
657
|
-
}) {
|
|
658
|
-
var c;
|
|
659
|
-
const [o, l] = P(null), { getFieldLabel: d } = _();
|
|
660
|
-
try {
|
|
661
|
-
const i = {
|
|
662
|
-
showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
|
|
663
|
-
showGrid: (r == null ? void 0 : r.showGrid) ?? !0,
|
|
664
|
-
showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0
|
|
665
|
-
};
|
|
666
|
-
if (!e || e.length === 0)
|
|
667
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
668
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
669
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No data points to display in scatter chart" })
|
|
670
|
-
] }) });
|
|
671
|
-
let f, u, h = [];
|
|
672
|
-
if (t != null && t.xAxis && (t != null && t.yAxis))
|
|
673
|
-
f = t.xAxis[0], u = Array.isArray(t.yAxis) ? t.yAxis[0] : t.yAxis, h = t.series || [];
|
|
674
|
-
else if (t != null && t.x && (t != null && t.y))
|
|
675
|
-
f = t.x, u = Array.isArray(t.y) ? t.y[0] : t.y;
|
|
676
|
-
else
|
|
677
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
678
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
679
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "Invalid or missing chart axis configuration" })
|
|
680
|
-
] }) });
|
|
681
|
-
if (!f || !u)
|
|
682
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
683
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
684
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "Missing required X-axis or Y-axis fields" })
|
|
685
|
-
] }) });
|
|
686
|
-
let p, m = {};
|
|
687
|
-
if (h.length > 0) {
|
|
688
|
-
const x = h[0];
|
|
689
|
-
e.forEach((y) => {
|
|
690
|
-
const g = String(y[x] || "Default");
|
|
691
|
-
m[g] || (m[g] = []);
|
|
692
|
-
const $ = I(n, f), M = z(y[f], $) || y[f], T = typeof y[u] == "string" ? parseFloat(y[u]) : y[u] || 0;
|
|
693
|
-
m[g].push({
|
|
694
|
-
x: typeof M == "string" ? parseFloat(M) || 0 : M,
|
|
695
|
-
y: T,
|
|
696
|
-
name: `${g} (${M}, ${T})`
|
|
697
|
-
});
|
|
698
|
-
});
|
|
699
|
-
const N = Object.keys(m);
|
|
700
|
-
p = m[N[0]] || [];
|
|
701
|
-
} else {
|
|
702
|
-
const x = I(n, f);
|
|
703
|
-
p = e.map((N) => {
|
|
704
|
-
const y = z(N[f], x) || N[f], g = typeof N[u] == "string" ? parseFloat(N[u]) : N[u] || 0;
|
|
705
|
-
return {
|
|
706
|
-
x: typeof y == "string" ? parseFloat(y) || 0 : y,
|
|
707
|
-
y: g,
|
|
708
|
-
name: `(${y}, ${g})`
|
|
709
|
-
};
|
|
710
|
-
});
|
|
711
|
-
}
|
|
712
|
-
if (!p || p.length === 0)
|
|
713
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
714
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
715
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No valid data points for scatter chart after transformation" })
|
|
716
|
-
] }) });
|
|
717
|
-
const v = Object.keys(m), A = v.length > 1, S = i.showLegend && A, b = {
|
|
718
|
-
...ve,
|
|
719
|
-
left: 40
|
|
720
|
-
// Increased from 20 to 40 for Y-axis label space
|
|
721
|
-
};
|
|
722
|
-
return /* @__PURE__ */ a(O, { height: s, children: /* @__PURE__ */ w(gt, { data: p, margin: b, children: [
|
|
723
|
-
i.showGrid && /* @__PURE__ */ a(he, { strokeDasharray: "3 3" }),
|
|
724
|
-
/* @__PURE__ */ a(
|
|
725
|
-
ye,
|
|
726
|
-
{
|
|
727
|
-
type: "number",
|
|
728
|
-
dataKey: "x",
|
|
729
|
-
name: d(f),
|
|
730
|
-
tick: { fontSize: 12 }
|
|
731
|
-
}
|
|
732
|
-
),
|
|
733
|
-
/* @__PURE__ */ a(
|
|
734
|
-
pe,
|
|
735
|
-
{
|
|
736
|
-
type: "number",
|
|
737
|
-
dataKey: "y",
|
|
738
|
-
name: d(u),
|
|
739
|
-
tick: { fontSize: 12 },
|
|
740
|
-
label: { value: d(u), angle: -90, position: "left", style: { textAnchor: "middle", fontSize: "12px" } }
|
|
741
|
-
}
|
|
742
|
-
),
|
|
743
|
-
i.showTooltip && /* @__PURE__ */ a(G, {}),
|
|
744
|
-
S && /* @__PURE__ */ a(
|
|
745
|
-
B,
|
|
746
|
-
{
|
|
747
|
-
wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
|
|
748
|
-
iconType: "circle",
|
|
749
|
-
iconSize: 8,
|
|
750
|
-
layout: "horizontal",
|
|
751
|
-
align: "center",
|
|
752
|
-
verticalAlign: "bottom",
|
|
753
|
-
onMouseEnter: (x) => l(String(x.dataKey || "")),
|
|
754
|
-
onMouseLeave: () => l(null)
|
|
755
|
-
}
|
|
756
|
-
),
|
|
757
|
-
A ? (
|
|
758
|
-
// Multiple series
|
|
759
|
-
v.map((x, N) => {
|
|
760
|
-
var y;
|
|
761
|
-
return /* @__PURE__ */ a(
|
|
762
|
-
Re,
|
|
763
|
-
{
|
|
764
|
-
name: x,
|
|
765
|
-
data: m[x],
|
|
766
|
-
fill: ((y = r.colors) == null ? void 0 : y[N]) || L[N % L.length],
|
|
767
|
-
fillOpacity: o ? o === x ? 1 : 0.3 : 1
|
|
768
|
-
},
|
|
769
|
-
x
|
|
770
|
-
);
|
|
771
|
-
})
|
|
772
|
-
) : (
|
|
773
|
-
// Single series
|
|
774
|
-
/* @__PURE__ */ a(
|
|
775
|
-
Re,
|
|
776
|
-
{
|
|
777
|
-
name: "Data",
|
|
778
|
-
data: p,
|
|
779
|
-
fill: ((c = r.colors) == null ? void 0 : c[0]) || L[0]
|
|
780
|
-
}
|
|
781
|
-
)
|
|
782
|
-
)
|
|
783
|
-
] }) });
|
|
784
|
-
} catch (i) {
|
|
785
|
-
return console.error("ScatterChart rendering error:", i), /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
786
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Scatter Chart Error" }),
|
|
787
|
-
/* @__PURE__ */ a("div", { className: "text-xs mb-2", children: i instanceof Error ? i.message : "Unknown rendering error" }),
|
|
788
|
-
/* @__PURE__ */ a("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
|
|
789
|
-
] }) });
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
function _r({
|
|
793
|
-
data: e,
|
|
794
|
-
chartConfig: t,
|
|
795
|
-
displayConfig: r = {},
|
|
796
|
-
queryObject: n,
|
|
797
|
-
height: s = "100%"
|
|
798
|
-
}) {
|
|
799
|
-
const [o, l] = P(null);
|
|
800
|
-
try {
|
|
801
|
-
const d = {
|
|
802
|
-
showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
|
|
803
|
-
showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0,
|
|
804
|
-
showGrid: (r == null ? void 0 : r.showGrid) ?? !0
|
|
805
|
-
};
|
|
806
|
-
if (!e || e.length === 0)
|
|
807
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
808
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
809
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No data points to display in radar chart" })
|
|
810
|
-
] }) });
|
|
811
|
-
let c, i = [];
|
|
812
|
-
if (t != null && t.xAxis && (t != null && t.yAxis)) {
|
|
813
|
-
const f = t.xAxis[0], u = Array.isArray(t.yAxis) ? t.yAxis : [t.yAxis], h = t.series || [], { data: p, seriesKeys: m } = C(
|
|
814
|
-
e,
|
|
815
|
-
f,
|
|
816
|
-
u,
|
|
817
|
-
n,
|
|
818
|
-
h
|
|
819
|
-
);
|
|
820
|
-
c = p, i = m;
|
|
821
|
-
} else {
|
|
822
|
-
const f = e[0], u = Object.keys(f), h = u.find(
|
|
823
|
-
(m) => typeof f[m] == "string" || m.toLowerCase().includes("subject") || m.toLowerCase().includes("name") || m.toLowerCase().includes("category")
|
|
824
|
-
) || u[0], p = u.filter(
|
|
825
|
-
(m) => typeof f[m] == "number" && m !== h
|
|
826
|
-
);
|
|
827
|
-
if (p.length === 0)
|
|
828
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
829
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
830
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No numeric fields found for radar chart values" })
|
|
831
|
-
] }) });
|
|
832
|
-
if (h) {
|
|
833
|
-
const m = I(n, h);
|
|
834
|
-
c = e.map((v) => {
|
|
835
|
-
const A = {
|
|
836
|
-
name: z(v[h], m) || String(v[h]) || "Unknown"
|
|
837
|
-
};
|
|
838
|
-
return p.forEach((S) => {
|
|
839
|
-
const b = S.split(".").pop() || S;
|
|
840
|
-
A[b] = typeof v[S] == "string" ? parseFloat(v[S]) : v[S] || 0;
|
|
841
|
-
}), A;
|
|
842
|
-
}), i = p.map((v) => v.split(".").pop() || v);
|
|
843
|
-
} else
|
|
844
|
-
c = e.map((m) => ({
|
|
845
|
-
name: String(m[u[0]] || "Unknown"),
|
|
846
|
-
value: typeof m[p[0]] == "string" ? parseFloat(m[p[0]]) : m[p[0]] || 0
|
|
847
|
-
})), i = ["value"];
|
|
848
|
-
}
|
|
849
|
-
return !c || c.length === 0 ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
850
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
851
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No valid data points for radar chart after transformation" })
|
|
852
|
-
] }) }) : /* @__PURE__ */ a(O, { height: s, children: /* @__PURE__ */ w(wt, { data: c, margin: { top: 20, right: 80, bottom: 20, left: 80 }, children: [
|
|
853
|
-
d.showGrid && /* @__PURE__ */ a(Nt, {}),
|
|
854
|
-
/* @__PURE__ */ a(
|
|
855
|
-
At,
|
|
856
|
-
{
|
|
857
|
-
dataKey: "name",
|
|
858
|
-
tick: { fontSize: 12 },
|
|
859
|
-
className: "text-gray-600"
|
|
860
|
-
}
|
|
861
|
-
),
|
|
862
|
-
/* @__PURE__ */ a(
|
|
863
|
-
St,
|
|
864
|
-
{
|
|
865
|
-
tick: { fontSize: 10 },
|
|
866
|
-
className: "text-gray-600"
|
|
867
|
-
}
|
|
868
|
-
),
|
|
869
|
-
d.showTooltip && /* @__PURE__ */ a(G, {}),
|
|
870
|
-
d.showLegend && i.length > 1 && /* @__PURE__ */ a(
|
|
871
|
-
B,
|
|
872
|
-
{
|
|
873
|
-
wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
|
|
874
|
-
iconType: "rect",
|
|
875
|
-
iconSize: 8,
|
|
876
|
-
layout: "horizontal",
|
|
877
|
-
align: "center",
|
|
878
|
-
verticalAlign: "bottom",
|
|
879
|
-
onMouseEnter: (f) => l(String(f.dataKey || "")),
|
|
880
|
-
onMouseLeave: () => l(null)
|
|
881
|
-
}
|
|
882
|
-
),
|
|
883
|
-
i.map((f, u) => {
|
|
884
|
-
var h, p;
|
|
885
|
-
return /* @__PURE__ */ a(
|
|
886
|
-
Mt,
|
|
887
|
-
{
|
|
888
|
-
name: f,
|
|
889
|
-
dataKey: f,
|
|
890
|
-
stroke: ((h = r.colors) == null ? void 0 : h[u]) || L[u % L.length],
|
|
891
|
-
fill: ((p = r.colors) == null ? void 0 : p[u]) || L[u % L.length],
|
|
892
|
-
fillOpacity: o ? o === f ? 0.6 : 0.1 : 0.3,
|
|
893
|
-
strokeOpacity: o ? o === f ? 1 : 0.3 : 1,
|
|
894
|
-
strokeWidth: 2
|
|
895
|
-
},
|
|
896
|
-
f
|
|
897
|
-
);
|
|
898
|
-
})
|
|
899
|
-
] }) });
|
|
900
|
-
} catch (d) {
|
|
901
|
-
return console.error("RadarChart rendering error:", d), /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
902
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Radar Chart Error" }),
|
|
903
|
-
/* @__PURE__ */ a("div", { className: "text-xs mb-2", children: d instanceof Error ? d.message : "Unknown rendering error" }),
|
|
904
|
-
/* @__PURE__ */ a("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
|
|
905
|
-
] }) });
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
function Kr({
|
|
909
|
-
data: e,
|
|
910
|
-
chartConfig: t,
|
|
911
|
-
displayConfig: r = {},
|
|
912
|
-
queryObject: n,
|
|
913
|
-
height: s = "100%"
|
|
914
|
-
}) {
|
|
915
|
-
const [o, l] = P(null);
|
|
916
|
-
try {
|
|
917
|
-
const d = {
|
|
918
|
-
showLegend: (r == null ? void 0 : r.showLegend) ?? !0,
|
|
919
|
-
showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0
|
|
920
|
-
};
|
|
921
|
-
if (!e || e.length === 0)
|
|
922
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
923
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
924
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No data points to display in radial bar chart" })
|
|
925
|
-
] }) });
|
|
926
|
-
let c;
|
|
927
|
-
if (t != null && t.xAxis && (t != null && t.yAxis)) {
|
|
928
|
-
const i = t.xAxis[0], f = Array.isArray(t.yAxis) ? t.yAxis[0] : t.yAxis, u = I(n, i);
|
|
929
|
-
c = e.map((h, p) => {
|
|
930
|
-
var m;
|
|
931
|
-
return {
|
|
932
|
-
name: z(h[i], u) || String(h[i]) || "Unknown",
|
|
933
|
-
value: typeof h[f] == "string" ? parseFloat(h[f]) : h[f] || 0,
|
|
934
|
-
fill: ((m = r.colors) == null ? void 0 : m[p]) || L[p % L.length]
|
|
935
|
-
};
|
|
936
|
-
});
|
|
937
|
-
} else {
|
|
938
|
-
const i = e[0], f = Object.keys(i), u = f.find(
|
|
939
|
-
(p) => typeof i[p] == "string" || p.toLowerCase().includes("name") || p.toLowerCase().includes("label") || p.toLowerCase().includes("category")
|
|
940
|
-
) || f[0], h = f.find(
|
|
941
|
-
(p) => typeof i[p] == "number" && p !== u
|
|
942
|
-
) || f[1];
|
|
943
|
-
if (!h)
|
|
944
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
945
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
946
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No numeric field found for radial bar chart values" })
|
|
947
|
-
] }) });
|
|
948
|
-
c = e.map((p, m) => {
|
|
949
|
-
var A;
|
|
950
|
-
let v = p[u];
|
|
951
|
-
return typeof v == "boolean" ? v = v ? "Active" : "Inactive" : v === "true" || v === "false" ? v = v === "true" ? "Active" : "Inactive" : v = String(v), {
|
|
952
|
-
name: v,
|
|
953
|
-
value: typeof p[h] == "string" ? parseFloat(p[h]) : p[h] || 0,
|
|
954
|
-
fill: ((A = r.colors) == null ? void 0 : A[m]) || L[m % L.length]
|
|
955
|
-
};
|
|
956
|
-
});
|
|
957
|
-
}
|
|
958
|
-
return c = c.filter((i) => i.value != null && i.value !== 0), c.length === 0 ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
959
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
960
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No valid data points for radial bar chart after transformation" })
|
|
961
|
-
] }) }) : /* @__PURE__ */ a(O, { height: s, children: /* @__PURE__ */ w(
|
|
962
|
-
kt,
|
|
963
|
-
{
|
|
964
|
-
data: c,
|
|
965
|
-
innerRadius: "10%",
|
|
966
|
-
outerRadius: "80%",
|
|
967
|
-
margin: { top: 20, right: 30, bottom: 20, left: 30 },
|
|
968
|
-
children: [
|
|
969
|
-
d.showTooltip && /* @__PURE__ */ a(G, {}),
|
|
970
|
-
d.showLegend && /* @__PURE__ */ a(
|
|
971
|
-
B,
|
|
972
|
-
{
|
|
973
|
-
wrapperStyle: { fontSize: "12px", paddingTop: "10px" },
|
|
974
|
-
iconType: "circle",
|
|
975
|
-
iconSize: 8,
|
|
976
|
-
layout: "horizontal",
|
|
977
|
-
align: "center",
|
|
978
|
-
verticalAlign: "bottom",
|
|
979
|
-
onMouseEnter: (i) => l(String(i.value || "")),
|
|
980
|
-
onMouseLeave: () => l(null)
|
|
981
|
-
}
|
|
982
|
-
),
|
|
983
|
-
/* @__PURE__ */ a(
|
|
984
|
-
$t,
|
|
985
|
-
{
|
|
986
|
-
dataKey: "value",
|
|
987
|
-
cornerRadius: 4,
|
|
988
|
-
label: { position: "insideStart", fill: "#fff", fontSize: 12 },
|
|
989
|
-
children: c.map((i, f) => /* @__PURE__ */ a(
|
|
990
|
-
ke,
|
|
991
|
-
{
|
|
992
|
-
fill: i.fill,
|
|
993
|
-
fillOpacity: o ? o === i.name ? 1 : 0.3 : 1
|
|
994
|
-
},
|
|
995
|
-
`cell-${f}`
|
|
996
|
-
))
|
|
997
|
-
}
|
|
998
|
-
)
|
|
999
|
-
]
|
|
1000
|
-
}
|
|
1001
|
-
) });
|
|
1002
|
-
} catch (d) {
|
|
1003
|
-
return console.error("RadialBarChart rendering error:", d), /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
1004
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Radial Bar Chart Error" }),
|
|
1005
|
-
/* @__PURE__ */ a("div", { className: "text-xs mb-2", children: d instanceof Error ? d.message : "Unknown rendering error" }),
|
|
1006
|
-
/* @__PURE__ */ a("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
|
|
1007
|
-
] }) });
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
function oe(e, t) {
|
|
1011
|
-
return e == null || t == null ? NaN : e < t ? -1 : e > t ? 1 : e >= t ? 0 : NaN;
|
|
1012
|
-
}
|
|
1013
|
-
function jt(e, t) {
|
|
1014
|
-
return e == null || t == null ? NaN : t < e ? -1 : t > e ? 1 : t >= e ? 0 : NaN;
|
|
1015
|
-
}
|
|
1016
|
-
function et(e) {
|
|
1017
|
-
let t, r, n;
|
|
1018
|
-
e.length !== 2 ? (t = oe, r = (d, c) => oe(e(d), c), n = (d, c) => e(d) - c) : (t = e === oe || e === jt ? e : Et, r = e, n = e);
|
|
1019
|
-
function s(d, c, i = 0, f = d.length) {
|
|
1020
|
-
if (i < f) {
|
|
1021
|
-
if (t(c, c) !== 0) return f;
|
|
1022
|
-
do {
|
|
1023
|
-
const u = i + f >>> 1;
|
|
1024
|
-
r(d[u], c) < 0 ? i = u + 1 : f = u;
|
|
1025
|
-
} while (i < f);
|
|
1026
|
-
}
|
|
1027
|
-
return i;
|
|
1028
|
-
}
|
|
1029
|
-
function o(d, c, i = 0, f = d.length) {
|
|
1030
|
-
if (i < f) {
|
|
1031
|
-
if (t(c, c) !== 0) return f;
|
|
1032
|
-
do {
|
|
1033
|
-
const u = i + f >>> 1;
|
|
1034
|
-
r(d[u], c) <= 0 ? i = u + 1 : f = u;
|
|
1035
|
-
} while (i < f);
|
|
1036
|
-
}
|
|
1037
|
-
return i;
|
|
1038
|
-
}
|
|
1039
|
-
function l(d, c, i = 0, f = d.length) {
|
|
1040
|
-
const u = s(d, c, i, f - 1);
|
|
1041
|
-
return u > i && n(d[u - 1], c) > -n(d[u], c) ? u - 1 : u;
|
|
1042
|
-
}
|
|
1043
|
-
return { left: s, center: l, right: o };
|
|
1044
|
-
}
|
|
1045
|
-
function Et() {
|
|
1046
|
-
return 0;
|
|
1047
|
-
}
|
|
1048
|
-
function zt(e) {
|
|
1049
|
-
return e === null ? NaN : +e;
|
|
1050
|
-
}
|
|
1051
|
-
const Rt = et(oe), tt = Rt.right;
|
|
1052
|
-
et(zt).center;
|
|
1053
|
-
class He extends Map {
|
|
1054
|
-
constructor(t, r = It) {
|
|
1055
|
-
if (super(), Object.defineProperties(this, { _intern: { value: /* @__PURE__ */ new Map() }, _key: { value: r } }), t != null) for (const [n, s] of t) this.set(n, s);
|
|
1056
|
-
}
|
|
1057
|
-
get(t) {
|
|
1058
|
-
return super.get(Ie(this, t));
|
|
1059
|
-
}
|
|
1060
|
-
has(t) {
|
|
1061
|
-
return super.has(Ie(this, t));
|
|
1062
|
-
}
|
|
1063
|
-
set(t, r) {
|
|
1064
|
-
return super.set(Dt(this, t), r);
|
|
1065
|
-
}
|
|
1066
|
-
delete(t) {
|
|
1067
|
-
return super.delete(Ht(this, t));
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
function Ie({ _intern: e, _key: t }, r) {
|
|
1071
|
-
const n = t(r);
|
|
1072
|
-
return e.has(n) ? e.get(n) : r;
|
|
1073
|
-
}
|
|
1074
|
-
function Dt({ _intern: e, _key: t }, r) {
|
|
1075
|
-
const n = t(r);
|
|
1076
|
-
return e.has(n) ? e.get(n) : (e.set(n, r), r);
|
|
1077
|
-
}
|
|
1078
|
-
function Ht({ _intern: e, _key: t }, r) {
|
|
1079
|
-
const n = t(r);
|
|
1080
|
-
return e.has(n) && (r = e.get(n), e.delete(n)), r;
|
|
1081
|
-
}
|
|
1082
|
-
function It(e) {
|
|
1083
|
-
return e !== null && typeof e == "object" ? e.valueOf() : e;
|
|
1084
|
-
}
|
|
1085
|
-
const Pt = Math.sqrt(50), Ot = Math.sqrt(10), Gt = Math.sqrt(2);
|
|
1086
|
-
function ce(e, t, r) {
|
|
1087
|
-
const n = (t - e) / Math.max(0, r), s = Math.floor(Math.log10(n)), o = n / Math.pow(10, s), l = o >= Pt ? 10 : o >= Ot ? 5 : o >= Gt ? 2 : 1;
|
|
1088
|
-
let d, c, i;
|
|
1089
|
-
return s < 0 ? (i = Math.pow(10, -s) / l, d = Math.round(e * i), c = Math.round(t * i), d / i < e && ++d, c / i > t && --c, i = -i) : (i = Math.pow(10, s) * l, d = Math.round(e / i), c = Math.round(t / i), d * i < e && ++d, c * i > t && --c), c < d && 0.5 <= r && r < 2 ? ce(e, t, r * 2) : [d, c, i];
|
|
1090
|
-
}
|
|
1091
|
-
function Ut(e, t, r) {
|
|
1092
|
-
if (t = +t, e = +e, r = +r, !(r > 0)) return [];
|
|
1093
|
-
if (e === t) return [e];
|
|
1094
|
-
const n = t < e, [s, o, l] = n ? ce(t, e, r) : ce(e, t, r);
|
|
1095
|
-
if (!(o >= s)) return [];
|
|
1096
|
-
const d = o - s + 1, c = new Array(d);
|
|
1097
|
-
if (n)
|
|
1098
|
-
if (l < 0) for (let i = 0; i < d; ++i) c[i] = (o - i) / -l;
|
|
1099
|
-
else for (let i = 0; i < d; ++i) c[i] = (o - i) * l;
|
|
1100
|
-
else if (l < 0) for (let i = 0; i < d; ++i) c[i] = (s + i) / -l;
|
|
1101
|
-
else for (let i = 0; i < d; ++i) c[i] = (s + i) * l;
|
|
1102
|
-
return c;
|
|
1103
|
-
}
|
|
1104
|
-
function Ne(e, t, r) {
|
|
1105
|
-
return t = +t, e = +e, r = +r, ce(e, t, r)[2];
|
|
1106
|
-
}
|
|
1107
|
-
function Vt(e, t, r) {
|
|
1108
|
-
t = +t, e = +e, r = +r;
|
|
1109
|
-
const n = t < e, s = n ? Ne(t, e, r) : Ne(e, t, r);
|
|
1110
|
-
return (n ? -1 : 1) * (s < 0 ? 1 / -s : s);
|
|
1111
|
-
}
|
|
1112
|
-
function $e(e, t, r) {
|
|
1113
|
-
e.prototype = t.prototype = r, r.constructor = e;
|
|
1114
|
-
}
|
|
1115
|
-
function rt(e, t) {
|
|
1116
|
-
var r = Object.create(e.prototype);
|
|
1117
|
-
for (var n in t) r[n] = t[n];
|
|
1118
|
-
return r;
|
|
1119
|
-
}
|
|
1120
|
-
function ee() {
|
|
1121
|
-
}
|
|
1122
|
-
var Q = 0.7, de = 1 / Q, W = "\\s*([+-]?\\d+)\\s*", Z = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*", R = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*", qt = /^#([0-9a-f]{3,8})$/, Bt = new RegExp(`^rgb\\(${W},${W},${W}\\)$`), _t = new RegExp(`^rgb\\(${R},${R},${R}\\)$`), Kt = new RegExp(`^rgba\\(${W},${W},${W},${Z}\\)$`), Yt = new RegExp(`^rgba\\(${R},${R},${R},${Z}\\)$`), Wt = new RegExp(`^hsl\\(${Z},${R},${R}\\)$`), Xt = new RegExp(`^hsla\\(${Z},${R},${R},${Z}\\)$`), Pe = {
|
|
1123
|
-
aliceblue: 15792383,
|
|
1124
|
-
antiquewhite: 16444375,
|
|
1125
|
-
aqua: 65535,
|
|
1126
|
-
aquamarine: 8388564,
|
|
1127
|
-
azure: 15794175,
|
|
1128
|
-
beige: 16119260,
|
|
1129
|
-
bisque: 16770244,
|
|
1130
|
-
black: 0,
|
|
1131
|
-
blanchedalmond: 16772045,
|
|
1132
|
-
blue: 255,
|
|
1133
|
-
blueviolet: 9055202,
|
|
1134
|
-
brown: 10824234,
|
|
1135
|
-
burlywood: 14596231,
|
|
1136
|
-
cadetblue: 6266528,
|
|
1137
|
-
chartreuse: 8388352,
|
|
1138
|
-
chocolate: 13789470,
|
|
1139
|
-
coral: 16744272,
|
|
1140
|
-
cornflowerblue: 6591981,
|
|
1141
|
-
cornsilk: 16775388,
|
|
1142
|
-
crimson: 14423100,
|
|
1143
|
-
cyan: 65535,
|
|
1144
|
-
darkblue: 139,
|
|
1145
|
-
darkcyan: 35723,
|
|
1146
|
-
darkgoldenrod: 12092939,
|
|
1147
|
-
darkgray: 11119017,
|
|
1148
|
-
darkgreen: 25600,
|
|
1149
|
-
darkgrey: 11119017,
|
|
1150
|
-
darkkhaki: 12433259,
|
|
1151
|
-
darkmagenta: 9109643,
|
|
1152
|
-
darkolivegreen: 5597999,
|
|
1153
|
-
darkorange: 16747520,
|
|
1154
|
-
darkorchid: 10040012,
|
|
1155
|
-
darkred: 9109504,
|
|
1156
|
-
darksalmon: 15308410,
|
|
1157
|
-
darkseagreen: 9419919,
|
|
1158
|
-
darkslateblue: 4734347,
|
|
1159
|
-
darkslategray: 3100495,
|
|
1160
|
-
darkslategrey: 3100495,
|
|
1161
|
-
darkturquoise: 52945,
|
|
1162
|
-
darkviolet: 9699539,
|
|
1163
|
-
deeppink: 16716947,
|
|
1164
|
-
deepskyblue: 49151,
|
|
1165
|
-
dimgray: 6908265,
|
|
1166
|
-
dimgrey: 6908265,
|
|
1167
|
-
dodgerblue: 2003199,
|
|
1168
|
-
firebrick: 11674146,
|
|
1169
|
-
floralwhite: 16775920,
|
|
1170
|
-
forestgreen: 2263842,
|
|
1171
|
-
fuchsia: 16711935,
|
|
1172
|
-
gainsboro: 14474460,
|
|
1173
|
-
ghostwhite: 16316671,
|
|
1174
|
-
gold: 16766720,
|
|
1175
|
-
goldenrod: 14329120,
|
|
1176
|
-
gray: 8421504,
|
|
1177
|
-
green: 32768,
|
|
1178
|
-
greenyellow: 11403055,
|
|
1179
|
-
grey: 8421504,
|
|
1180
|
-
honeydew: 15794160,
|
|
1181
|
-
hotpink: 16738740,
|
|
1182
|
-
indianred: 13458524,
|
|
1183
|
-
indigo: 4915330,
|
|
1184
|
-
ivory: 16777200,
|
|
1185
|
-
khaki: 15787660,
|
|
1186
|
-
lavender: 15132410,
|
|
1187
|
-
lavenderblush: 16773365,
|
|
1188
|
-
lawngreen: 8190976,
|
|
1189
|
-
lemonchiffon: 16775885,
|
|
1190
|
-
lightblue: 11393254,
|
|
1191
|
-
lightcoral: 15761536,
|
|
1192
|
-
lightcyan: 14745599,
|
|
1193
|
-
lightgoldenrodyellow: 16448210,
|
|
1194
|
-
lightgray: 13882323,
|
|
1195
|
-
lightgreen: 9498256,
|
|
1196
|
-
lightgrey: 13882323,
|
|
1197
|
-
lightpink: 16758465,
|
|
1198
|
-
lightsalmon: 16752762,
|
|
1199
|
-
lightseagreen: 2142890,
|
|
1200
|
-
lightskyblue: 8900346,
|
|
1201
|
-
lightslategray: 7833753,
|
|
1202
|
-
lightslategrey: 7833753,
|
|
1203
|
-
lightsteelblue: 11584734,
|
|
1204
|
-
lightyellow: 16777184,
|
|
1205
|
-
lime: 65280,
|
|
1206
|
-
limegreen: 3329330,
|
|
1207
|
-
linen: 16445670,
|
|
1208
|
-
magenta: 16711935,
|
|
1209
|
-
maroon: 8388608,
|
|
1210
|
-
mediumaquamarine: 6737322,
|
|
1211
|
-
mediumblue: 205,
|
|
1212
|
-
mediumorchid: 12211667,
|
|
1213
|
-
mediumpurple: 9662683,
|
|
1214
|
-
mediumseagreen: 3978097,
|
|
1215
|
-
mediumslateblue: 8087790,
|
|
1216
|
-
mediumspringgreen: 64154,
|
|
1217
|
-
mediumturquoise: 4772300,
|
|
1218
|
-
mediumvioletred: 13047173,
|
|
1219
|
-
midnightblue: 1644912,
|
|
1220
|
-
mintcream: 16121850,
|
|
1221
|
-
mistyrose: 16770273,
|
|
1222
|
-
moccasin: 16770229,
|
|
1223
|
-
navajowhite: 16768685,
|
|
1224
|
-
navy: 128,
|
|
1225
|
-
oldlace: 16643558,
|
|
1226
|
-
olive: 8421376,
|
|
1227
|
-
olivedrab: 7048739,
|
|
1228
|
-
orange: 16753920,
|
|
1229
|
-
orangered: 16729344,
|
|
1230
|
-
orchid: 14315734,
|
|
1231
|
-
palegoldenrod: 15657130,
|
|
1232
|
-
palegreen: 10025880,
|
|
1233
|
-
paleturquoise: 11529966,
|
|
1234
|
-
palevioletred: 14381203,
|
|
1235
|
-
papayawhip: 16773077,
|
|
1236
|
-
peachpuff: 16767673,
|
|
1237
|
-
peru: 13468991,
|
|
1238
|
-
pink: 16761035,
|
|
1239
|
-
plum: 14524637,
|
|
1240
|
-
powderblue: 11591910,
|
|
1241
|
-
purple: 8388736,
|
|
1242
|
-
rebeccapurple: 6697881,
|
|
1243
|
-
red: 16711680,
|
|
1244
|
-
rosybrown: 12357519,
|
|
1245
|
-
royalblue: 4286945,
|
|
1246
|
-
saddlebrown: 9127187,
|
|
1247
|
-
salmon: 16416882,
|
|
1248
|
-
sandybrown: 16032864,
|
|
1249
|
-
seagreen: 3050327,
|
|
1250
|
-
seashell: 16774638,
|
|
1251
|
-
sienna: 10506797,
|
|
1252
|
-
silver: 12632256,
|
|
1253
|
-
skyblue: 8900331,
|
|
1254
|
-
slateblue: 6970061,
|
|
1255
|
-
slategray: 7372944,
|
|
1256
|
-
slategrey: 7372944,
|
|
1257
|
-
snow: 16775930,
|
|
1258
|
-
springgreen: 65407,
|
|
1259
|
-
steelblue: 4620980,
|
|
1260
|
-
tan: 13808780,
|
|
1261
|
-
teal: 32896,
|
|
1262
|
-
thistle: 14204888,
|
|
1263
|
-
tomato: 16737095,
|
|
1264
|
-
turquoise: 4251856,
|
|
1265
|
-
violet: 15631086,
|
|
1266
|
-
wheat: 16113331,
|
|
1267
|
-
white: 16777215,
|
|
1268
|
-
whitesmoke: 16119285,
|
|
1269
|
-
yellow: 16776960,
|
|
1270
|
-
yellowgreen: 10145074
|
|
1271
|
-
};
|
|
1272
|
-
$e(ee, J, {
|
|
1273
|
-
copy(e) {
|
|
1274
|
-
return Object.assign(new this.constructor(), this, e);
|
|
1275
|
-
},
|
|
1276
|
-
displayable() {
|
|
1277
|
-
return this.rgb().displayable();
|
|
1278
|
-
},
|
|
1279
|
-
hex: Oe,
|
|
1280
|
-
// Deprecated! Use color.formatHex.
|
|
1281
|
-
formatHex: Oe,
|
|
1282
|
-
formatHex8: Qt,
|
|
1283
|
-
formatHsl: Zt,
|
|
1284
|
-
formatRgb: Ge,
|
|
1285
|
-
toString: Ge
|
|
1286
|
-
});
|
|
1287
|
-
function Oe() {
|
|
1288
|
-
return this.rgb().formatHex();
|
|
1289
|
-
}
|
|
1290
|
-
function Qt() {
|
|
1291
|
-
return this.rgb().formatHex8();
|
|
1292
|
-
}
|
|
1293
|
-
function Zt() {
|
|
1294
|
-
return nt(this).formatHsl();
|
|
1295
|
-
}
|
|
1296
|
-
function Ge() {
|
|
1297
|
-
return this.rgb().formatRgb();
|
|
1298
|
-
}
|
|
1299
|
-
function J(e) {
|
|
1300
|
-
var t, r;
|
|
1301
|
-
return e = (e + "").trim().toLowerCase(), (t = qt.exec(e)) ? (r = t[1].length, t = parseInt(t[1], 16), r === 6 ? Ue(t) : r === 3 ? new F(t >> 8 & 15 | t >> 4 & 240, t >> 4 & 15 | t & 240, (t & 15) << 4 | t & 15, 1) : r === 8 ? ae(t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, (t & 255) / 255) : r === 4 ? ae(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 = Bt.exec(e)) ? new F(t[1], t[2], t[3], 1) : (t = _t.exec(e)) ? new F(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, 1) : (t = Kt.exec(e)) ? ae(t[1], t[2], t[3], t[4]) : (t = Yt.exec(e)) ? ae(t[1] * 255 / 100, t[2] * 255 / 100, t[3] * 255 / 100, t[4]) : (t = Wt.exec(e)) ? Be(t[1], t[2] / 100, t[3] / 100, 1) : (t = Xt.exec(e)) ? Be(t[1], t[2] / 100, t[3] / 100, t[4]) : Pe.hasOwnProperty(e) ? Ue(Pe[e]) : e === "transparent" ? new F(NaN, NaN, NaN, 0) : null;
|
|
1302
|
-
}
|
|
1303
|
-
function Ue(e) {
|
|
1304
|
-
return new F(e >> 16 & 255, e >> 8 & 255, e & 255, 1);
|
|
1305
|
-
}
|
|
1306
|
-
function ae(e, t, r, n) {
|
|
1307
|
-
return n <= 0 && (e = t = r = NaN), new F(e, t, r, n);
|
|
1308
|
-
}
|
|
1309
|
-
function Jt(e) {
|
|
1310
|
-
return e instanceof ee || (e = J(e)), e ? (e = e.rgb(), new F(e.r, e.g, e.b, e.opacity)) : new F();
|
|
1311
|
-
}
|
|
1312
|
-
function Ae(e, t, r, n) {
|
|
1313
|
-
return arguments.length === 1 ? Jt(e) : new F(e, t, r, n ?? 1);
|
|
1314
|
-
}
|
|
1315
|
-
function F(e, t, r, n) {
|
|
1316
|
-
this.r = +e, this.g = +t, this.b = +r, this.opacity = +n;
|
|
1317
|
-
}
|
|
1318
|
-
$e(F, Ae, rt(ee, {
|
|
1319
|
-
brighter(e) {
|
|
1320
|
-
return e = e == null ? de : Math.pow(de, e), new F(this.r * e, this.g * e, this.b * e, this.opacity);
|
|
1321
|
-
},
|
|
1322
|
-
darker(e) {
|
|
1323
|
-
return e = e == null ? Q : Math.pow(Q, e), new F(this.r * e, this.g * e, this.b * e, this.opacity);
|
|
1324
|
-
},
|
|
1325
|
-
rgb() {
|
|
1326
|
-
return this;
|
|
1327
|
-
},
|
|
1328
|
-
clamp() {
|
|
1329
|
-
return new F(q(this.r), q(this.g), q(this.b), ue(this.opacity));
|
|
1330
|
-
},
|
|
1331
|
-
displayable() {
|
|
1332
|
-
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;
|
|
1333
|
-
},
|
|
1334
|
-
hex: Ve,
|
|
1335
|
-
// Deprecated! Use color.formatHex.
|
|
1336
|
-
formatHex: Ve,
|
|
1337
|
-
formatHex8: Ct,
|
|
1338
|
-
formatRgb: qe,
|
|
1339
|
-
toString: qe
|
|
1340
|
-
}));
|
|
1341
|
-
function Ve() {
|
|
1342
|
-
return `#${V(this.r)}${V(this.g)}${V(this.b)}`;
|
|
1343
|
-
}
|
|
1344
|
-
function Ct() {
|
|
1345
|
-
return `#${V(this.r)}${V(this.g)}${V(this.b)}${V((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;
|
|
1346
|
-
}
|
|
1347
|
-
function qe() {
|
|
1348
|
-
const e = ue(this.opacity);
|
|
1349
|
-
return `${e === 1 ? "rgb(" : "rgba("}${q(this.r)}, ${q(this.g)}, ${q(this.b)}${e === 1 ? ")" : `, ${e})`}`;
|
|
1350
|
-
}
|
|
1351
|
-
function ue(e) {
|
|
1352
|
-
return isNaN(e) ? 1 : Math.max(0, Math.min(1, e));
|
|
1353
|
-
}
|
|
1354
|
-
function q(e) {
|
|
1355
|
-
return Math.max(0, Math.min(255, Math.round(e) || 0));
|
|
1356
|
-
}
|
|
1357
|
-
function V(e) {
|
|
1358
|
-
return e = q(e), (e < 16 ? "0" : "") + e.toString(16);
|
|
1359
|
-
}
|
|
1360
|
-
function Be(e, t, r, n) {
|
|
1361
|
-
return n <= 0 ? e = t = r = NaN : r <= 0 || r >= 1 ? e = t = NaN : t <= 0 && (e = NaN), new E(e, t, r, n);
|
|
1362
|
-
}
|
|
1363
|
-
function nt(e) {
|
|
1364
|
-
if (e instanceof E) return new E(e.h, e.s, e.l, e.opacity);
|
|
1365
|
-
if (e instanceof ee || (e = J(e)), !e) return new E();
|
|
1366
|
-
if (e instanceof E) return e;
|
|
1367
|
-
e = e.rgb();
|
|
1368
|
-
var t = e.r / 255, r = e.g / 255, n = e.b / 255, s = Math.min(t, r, n), o = Math.max(t, r, n), l = NaN, d = o - s, c = (o + s) / 2;
|
|
1369
|
-
return d ? (t === o ? l = (r - n) / d + (r < n) * 6 : r === o ? l = (n - t) / d + 2 : l = (t - r) / d + 4, d /= c < 0.5 ? o + s : 2 - o - s, l *= 60) : d = c > 0 && c < 1 ? 0 : l, new E(l, d, c, e.opacity);
|
|
1370
|
-
}
|
|
1371
|
-
function er(e, t, r, n) {
|
|
1372
|
-
return arguments.length === 1 ? nt(e) : new E(e, t, r, n ?? 1);
|
|
1373
|
-
}
|
|
1374
|
-
function E(e, t, r, n) {
|
|
1375
|
-
this.h = +e, this.s = +t, this.l = +r, this.opacity = +n;
|
|
1376
|
-
}
|
|
1377
|
-
$e(E, er, rt(ee, {
|
|
1378
|
-
brighter(e) {
|
|
1379
|
-
return e = e == null ? de : Math.pow(de, e), new E(this.h, this.s, this.l * e, this.opacity);
|
|
1380
|
-
},
|
|
1381
|
-
darker(e) {
|
|
1382
|
-
return e = e == null ? Q : Math.pow(Q, e), new E(this.h, this.s, this.l * e, this.opacity);
|
|
1383
|
-
},
|
|
1384
|
-
rgb() {
|
|
1385
|
-
var e = this.h % 360 + (this.h < 0) * 360, t = isNaN(e) || isNaN(this.s) ? 0 : this.s, r = this.l, n = r + (r < 0.5 ? r : 1 - r) * t, s = 2 * r - n;
|
|
1386
|
-
return new F(
|
|
1387
|
-
be(e >= 240 ? e - 240 : e + 120, s, n),
|
|
1388
|
-
be(e, s, n),
|
|
1389
|
-
be(e < 120 ? e + 240 : e - 120, s, n),
|
|
1390
|
-
this.opacity
|
|
1391
|
-
);
|
|
1392
|
-
},
|
|
1393
|
-
clamp() {
|
|
1394
|
-
return new E(_e(this.h), ie(this.s), ie(this.l), ue(this.opacity));
|
|
1395
|
-
},
|
|
1396
|
-
displayable() {
|
|
1397
|
-
return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && 0 <= this.l && this.l <= 1 && 0 <= this.opacity && this.opacity <= 1;
|
|
1398
|
-
},
|
|
1399
|
-
formatHsl() {
|
|
1400
|
-
const e = ue(this.opacity);
|
|
1401
|
-
return `${e === 1 ? "hsl(" : "hsla("}${_e(this.h)}, ${ie(this.s) * 100}%, ${ie(this.l) * 100}%${e === 1 ? ")" : `, ${e})`}`;
|
|
1402
|
-
}
|
|
1403
|
-
}));
|
|
1404
|
-
function _e(e) {
|
|
1405
|
-
return e = (e || 0) % 360, e < 0 ? e + 360 : e;
|
|
1406
|
-
}
|
|
1407
|
-
function ie(e) {
|
|
1408
|
-
return Math.max(0, Math.min(1, e || 0));
|
|
1409
|
-
}
|
|
1410
|
-
function be(e, t, r) {
|
|
1411
|
-
return (e < 60 ? t + (r - t) * e / 60 : e < 180 ? r : e < 240 ? t + (r - t) * (240 - e) / 60 : t) * 255;
|
|
1412
|
-
}
|
|
1413
|
-
const Le = (e) => () => e;
|
|
1414
|
-
function tr(e, t) {
|
|
1415
|
-
return function(r) {
|
|
1416
|
-
return e + r * t;
|
|
1417
|
-
};
|
|
1418
|
-
}
|
|
1419
|
-
function rr(e, t, r) {
|
|
1420
|
-
return e = Math.pow(e, r), t = Math.pow(t, r) - e, r = 1 / r, function(n) {
|
|
1421
|
-
return Math.pow(e + n * t, r);
|
|
1422
|
-
};
|
|
1423
|
-
}
|
|
1424
|
-
function nr(e) {
|
|
1425
|
-
return (e = +e) == 1 ? st : function(t, r) {
|
|
1426
|
-
return r - t ? rr(t, r, e) : Le(isNaN(t) ? r : t);
|
|
1427
|
-
};
|
|
1428
|
-
}
|
|
1429
|
-
function st(e, t) {
|
|
1430
|
-
var r = t - e;
|
|
1431
|
-
return r ? tr(e, r) : Le(isNaN(e) ? t : e);
|
|
1432
|
-
}
|
|
1433
|
-
const Ke = function e(t) {
|
|
1434
|
-
var r = nr(t);
|
|
1435
|
-
function n(s, o) {
|
|
1436
|
-
var l = r((s = Ae(s)).r, (o = Ae(o)).r), d = r(s.g, o.g), c = r(s.b, o.b), i = st(s.opacity, o.opacity);
|
|
1437
|
-
return function(f) {
|
|
1438
|
-
return s.r = l(f), s.g = d(f), s.b = c(f), s.opacity = i(f), s + "";
|
|
1439
|
-
};
|
|
1440
|
-
}
|
|
1441
|
-
return n.gamma = e, n;
|
|
1442
|
-
}(1);
|
|
1443
|
-
function sr(e, t) {
|
|
1444
|
-
t || (t = []);
|
|
1445
|
-
var r = e ? Math.min(t.length, e.length) : 0, n = t.slice(), s;
|
|
1446
|
-
return function(o) {
|
|
1447
|
-
for (s = 0; s < r; ++s) n[s] = e[s] * (1 - o) + t[s] * o;
|
|
1448
|
-
return n;
|
|
1449
|
-
};
|
|
1450
|
-
}
|
|
1451
|
-
function ar(e) {
|
|
1452
|
-
return ArrayBuffer.isView(e) && !(e instanceof DataView);
|
|
1453
|
-
}
|
|
1454
|
-
function ir(e, t) {
|
|
1455
|
-
var r = t ? t.length : 0, n = e ? Math.min(r, e.length) : 0, s = new Array(n), o = new Array(r), l;
|
|
1456
|
-
for (l = 0; l < n; ++l) s[l] = Te(e[l], t[l]);
|
|
1457
|
-
for (; l < r; ++l) o[l] = t[l];
|
|
1458
|
-
return function(d) {
|
|
1459
|
-
for (l = 0; l < n; ++l) o[l] = s[l](d);
|
|
1460
|
-
return o;
|
|
1461
|
-
};
|
|
1462
|
-
}
|
|
1463
|
-
function lr(e, t) {
|
|
1464
|
-
var r = /* @__PURE__ */ new Date();
|
|
1465
|
-
return e = +e, t = +t, function(n) {
|
|
1466
|
-
return r.setTime(e * (1 - n) + t * n), r;
|
|
1467
|
-
};
|
|
1468
|
-
}
|
|
1469
|
-
function fe(e, t) {
|
|
1470
|
-
return e = +e, t = +t, function(r) {
|
|
1471
|
-
return e * (1 - r) + t * r;
|
|
1472
|
-
};
|
|
1473
|
-
}
|
|
1474
|
-
function or(e, t) {
|
|
1475
|
-
var r = {}, n = {}, s;
|
|
1476
|
-
(e === null || typeof e != "object") && (e = {}), (t === null || typeof t != "object") && (t = {});
|
|
1477
|
-
for (s in t)
|
|
1478
|
-
s in e ? r[s] = Te(e[s], t[s]) : n[s] = t[s];
|
|
1479
|
-
return function(o) {
|
|
1480
|
-
for (s in r) n[s] = r[s](o);
|
|
1481
|
-
return n;
|
|
1482
|
-
};
|
|
1483
|
-
}
|
|
1484
|
-
var Se = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, ge = new RegExp(Se.source, "g");
|
|
1485
|
-
function cr(e) {
|
|
1486
|
-
return function() {
|
|
1487
|
-
return e;
|
|
1488
|
-
};
|
|
1489
|
-
}
|
|
1490
|
-
function dr(e) {
|
|
1491
|
-
return function(t) {
|
|
1492
|
-
return e(t) + "";
|
|
1493
|
-
};
|
|
1494
|
-
}
|
|
1495
|
-
function ur(e, t) {
|
|
1496
|
-
var r = Se.lastIndex = ge.lastIndex = 0, n, s, o, l = -1, d = [], c = [];
|
|
1497
|
-
for (e = e + "", t = t + ""; (n = Se.exec(e)) && (s = ge.exec(t)); )
|
|
1498
|
-
(o = s.index) > r && (o = t.slice(r, o), d[l] ? d[l] += o : d[++l] = o), (n = n[0]) === (s = s[0]) ? d[l] ? d[l] += s : d[++l] = s : (d[++l] = null, c.push({ i: l, x: fe(n, s) })), r = ge.lastIndex;
|
|
1499
|
-
return r < t.length && (o = t.slice(r), d[l] ? d[l] += o : d[++l] = o), d.length < 2 ? c[0] ? dr(c[0].x) : cr(t) : (t = c.length, function(i) {
|
|
1500
|
-
for (var f = 0, u; f < t; ++f) d[(u = c[f]).i] = u.x(i);
|
|
1501
|
-
return d.join("");
|
|
1502
|
-
});
|
|
1503
|
-
}
|
|
1504
|
-
function Te(e, t) {
|
|
1505
|
-
var r = typeof t, n;
|
|
1506
|
-
return t == null || r === "boolean" ? Le(t) : (r === "number" ? fe : r === "string" ? (n = J(t)) ? (t = n, Ke) : ur : t instanceof J ? Ke : t instanceof Date ? lr : ar(t) ? sr : Array.isArray(t) ? ir : typeof t.valueOf != "function" && typeof t.toString != "function" || isNaN(t) ? or : fe)(e, t);
|
|
1507
|
-
}
|
|
1508
|
-
function fr(e, t) {
|
|
1509
|
-
return e = +e, t = +t, function(r) {
|
|
1510
|
-
return Math.round(e * (1 - r) + t * r);
|
|
1511
|
-
};
|
|
1512
|
-
}
|
|
1513
|
-
function mr(e) {
|
|
1514
|
-
return Math.abs(e = Math.round(e)) >= 1e21 ? e.toLocaleString("en").replace(/,/g, "") : e.toString(10);
|
|
1515
|
-
}
|
|
1516
|
-
function me(e, t) {
|
|
1517
|
-
if ((r = (e = t ? e.toExponential(t - 1) : e.toExponential()).indexOf("e")) < 0) return null;
|
|
1518
|
-
var r, n = e.slice(0, r);
|
|
1519
|
-
return [
|
|
1520
|
-
n.length > 1 ? n[0] + n.slice(2) : n,
|
|
1521
|
-
+e.slice(r + 1)
|
|
1522
|
-
];
|
|
1523
|
-
}
|
|
1524
|
-
function X(e) {
|
|
1525
|
-
return e = me(Math.abs(e)), e ? e[1] : NaN;
|
|
1526
|
-
}
|
|
1527
|
-
function xr(e, t) {
|
|
1528
|
-
return function(r, n) {
|
|
1529
|
-
for (var s = r.length, o = [], l = 0, d = e[0], c = 0; s > 0 && d > 0 && (c + d + 1 > n && (d = Math.max(1, n - c)), o.push(r.substring(s -= d, s + d)), !((c += d + 1) > n)); )
|
|
1530
|
-
d = e[l = (l + 1) % e.length];
|
|
1531
|
-
return o.reverse().join(t);
|
|
1532
|
-
};
|
|
1533
|
-
}
|
|
1534
|
-
function hr(e) {
|
|
1535
|
-
return function(t) {
|
|
1536
|
-
return t.replace(/[0-9]/g, function(r) {
|
|
1537
|
-
return e[+r];
|
|
1538
|
-
});
|
|
1539
|
-
};
|
|
1540
|
-
}
|
|
1541
|
-
var yr = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
|
|
1542
|
-
function xe(e) {
|
|
1543
|
-
if (!(t = yr.exec(e))) throw new Error("invalid format: " + e);
|
|
1544
|
-
var t;
|
|
1545
|
-
return new Fe({
|
|
1546
|
-
fill: t[1],
|
|
1547
|
-
align: t[2],
|
|
1548
|
-
sign: t[3],
|
|
1549
|
-
symbol: t[4],
|
|
1550
|
-
zero: t[5],
|
|
1551
|
-
width: t[6],
|
|
1552
|
-
comma: t[7],
|
|
1553
|
-
precision: t[8] && t[8].slice(1),
|
|
1554
|
-
trim: t[9],
|
|
1555
|
-
type: t[10]
|
|
1556
|
-
});
|
|
1557
|
-
}
|
|
1558
|
-
xe.prototype = Fe.prototype;
|
|
1559
|
-
function Fe(e) {
|
|
1560
|
-
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 + "";
|
|
1561
|
-
}
|
|
1562
|
-
Fe.prototype.toString = function() {
|
|
1563
|
-
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;
|
|
1564
|
-
};
|
|
1565
|
-
function pr(e) {
|
|
1566
|
-
e: for (var t = e.length, r = 1, n = -1, s; r < t; ++r)
|
|
1567
|
-
switch (e[r]) {
|
|
1568
|
-
case ".":
|
|
1569
|
-
n = s = r;
|
|
1570
|
-
break;
|
|
1571
|
-
case "0":
|
|
1572
|
-
n === 0 && (n = r), s = r;
|
|
1573
|
-
break;
|
|
1574
|
-
default:
|
|
1575
|
-
if (!+e[r]) break e;
|
|
1576
|
-
n > 0 && (n = 0);
|
|
1577
|
-
break;
|
|
1578
|
-
}
|
|
1579
|
-
return n > 0 ? e.slice(0, n) + e.slice(s + 1) : e;
|
|
1580
|
-
}
|
|
1581
|
-
var at;
|
|
1582
|
-
function vr(e, t) {
|
|
1583
|
-
var r = me(e, t);
|
|
1584
|
-
if (!r) return e + "";
|
|
1585
|
-
var n = r[0], s = r[1], o = s - (at = Math.max(-8, Math.min(8, Math.floor(s / 3))) * 3) + 1, l = n.length;
|
|
1586
|
-
return o === l ? n : o > l ? n + new Array(o - l + 1).join("0") : o > 0 ? n.slice(0, o) + "." + n.slice(o) : "0." + new Array(1 - o).join("0") + me(e, Math.max(0, t + o - 1))[0];
|
|
1587
|
-
}
|
|
1588
|
-
function Ye(e, t) {
|
|
1589
|
-
var r = me(e, t);
|
|
1590
|
-
if (!r) return e + "";
|
|
1591
|
-
var n = r[0], s = r[1];
|
|
1592
|
-
return s < 0 ? "0." + new Array(-s).join("0") + n : n.length > s + 1 ? n.slice(0, s + 1) + "." + n.slice(s + 1) : n + new Array(s - n.length + 2).join("0");
|
|
1593
|
-
}
|
|
1594
|
-
const We = {
|
|
1595
|
-
"%": (e, t) => (e * 100).toFixed(t),
|
|
1596
|
-
b: (e) => Math.round(e).toString(2),
|
|
1597
|
-
c: (e) => e + "",
|
|
1598
|
-
d: mr,
|
|
1599
|
-
e: (e, t) => e.toExponential(t),
|
|
1600
|
-
f: (e, t) => e.toFixed(t),
|
|
1601
|
-
g: (e, t) => e.toPrecision(t),
|
|
1602
|
-
o: (e) => Math.round(e).toString(8),
|
|
1603
|
-
p: (e, t) => Ye(e * 100, t),
|
|
1604
|
-
r: Ye,
|
|
1605
|
-
s: vr,
|
|
1606
|
-
X: (e) => Math.round(e).toString(16).toUpperCase(),
|
|
1607
|
-
x: (e) => Math.round(e).toString(16)
|
|
1608
|
-
};
|
|
1609
|
-
function Xe(e) {
|
|
1610
|
-
return e;
|
|
1611
|
-
}
|
|
1612
|
-
var Qe = Array.prototype.map, Ze = ["y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
|
|
1613
|
-
function br(e) {
|
|
1614
|
-
var t = e.grouping === void 0 || e.thousands === void 0 ? Xe : xr(Qe.call(e.grouping, Number), e.thousands + ""), r = e.currency === void 0 ? "" : e.currency[0] + "", n = e.currency === void 0 ? "" : e.currency[1] + "", s = e.decimal === void 0 ? "." : e.decimal + "", o = e.numerals === void 0 ? Xe : hr(Qe.call(e.numerals, String)), l = e.percent === void 0 ? "%" : e.percent + "", d = e.minus === void 0 ? "−" : e.minus + "", c = e.nan === void 0 ? "NaN" : e.nan + "";
|
|
1615
|
-
function i(u) {
|
|
1616
|
-
u = xe(u);
|
|
1617
|
-
var h = u.fill, p = u.align, m = u.sign, v = u.symbol, A = u.zero, S = u.width, b = u.comma, x = u.precision, N = u.trim, y = u.type;
|
|
1618
|
-
y === "n" ? (b = !0, y = "g") : We[y] || (x === void 0 && (x = 12), N = !0, y = "g"), (A || h === "0" && p === "=") && (A = !0, h = "0", p = "=");
|
|
1619
|
-
var g = v === "$" ? r : v === "#" && /[boxX]/.test(y) ? "0" + y.toLowerCase() : "", $ = v === "$" ? n : /[%p]/.test(y) ? l : "", M = We[y], T = /[defgprs%]/.test(y);
|
|
1620
|
-
x = x === void 0 ? 6 : /[gprs]/.test(y) ? Math.max(1, Math.min(21, x)) : Math.max(0, Math.min(20, x));
|
|
1621
|
-
function H(k) {
|
|
1622
|
-
var U = g, j = $, K, Ee, te;
|
|
1623
|
-
if (y === "c")
|
|
1624
|
-
j = M(k) + j, k = "";
|
|
1625
|
-
else {
|
|
1626
|
-
k = +k;
|
|
1627
|
-
var re = k < 0 || 1 / k < 0;
|
|
1628
|
-
if (k = isNaN(k) ? c : M(Math.abs(k), x), N && (k = pr(k)), re && +k == 0 && m !== "+" && (re = !1), U = (re ? m === "(" ? m : d : m === "-" || m === "(" ? "" : m) + U, j = (y === "s" ? Ze[8 + at / 3] : "") + j + (re && m === "(" ? ")" : ""), T) {
|
|
1629
|
-
for (K = -1, Ee = k.length; ++K < Ee; )
|
|
1630
|
-
if (te = k.charCodeAt(K), 48 > te || te > 57) {
|
|
1631
|
-
j = (te === 46 ? s + k.slice(K + 1) : k.slice(K)) + j, k = k.slice(0, K);
|
|
1632
|
-
break;
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
}
|
|
1636
|
-
b && !A && (k = t(k, 1 / 0));
|
|
1637
|
-
var ne = U.length + k.length + j.length, D = ne < S ? new Array(S - ne + 1).join(h) : "";
|
|
1638
|
-
switch (b && A && (k = t(D + k, D.length ? S - j.length : 1 / 0), D = ""), p) {
|
|
1639
|
-
case "<":
|
|
1640
|
-
k = U + k + j + D;
|
|
1641
|
-
break;
|
|
1642
|
-
case "=":
|
|
1643
|
-
k = U + D + k + j;
|
|
1644
|
-
break;
|
|
1645
|
-
case "^":
|
|
1646
|
-
k = D.slice(0, ne = D.length >> 1) + U + k + j + D.slice(ne);
|
|
1647
|
-
break;
|
|
1648
|
-
default:
|
|
1649
|
-
k = D + U + k + j;
|
|
1650
|
-
break;
|
|
1651
|
-
}
|
|
1652
|
-
return o(k);
|
|
1653
|
-
}
|
|
1654
|
-
return H.toString = function() {
|
|
1655
|
-
return u + "";
|
|
1656
|
-
}, H;
|
|
1657
|
-
}
|
|
1658
|
-
function f(u, h) {
|
|
1659
|
-
var p = i((u = xe(u), u.type = "f", u)), m = Math.max(-8, Math.min(8, Math.floor(X(h) / 3))) * 3, v = Math.pow(10, -m), A = Ze[8 + m / 3];
|
|
1660
|
-
return function(S) {
|
|
1661
|
-
return p(v * S) + A;
|
|
1662
|
-
};
|
|
1663
|
-
}
|
|
1664
|
-
return {
|
|
1665
|
-
format: i,
|
|
1666
|
-
formatPrefix: f
|
|
1667
|
-
};
|
|
1668
|
-
}
|
|
1669
|
-
var le, it, lt;
|
|
1670
|
-
gr({
|
|
1671
|
-
thousands: ",",
|
|
1672
|
-
grouping: [3],
|
|
1673
|
-
currency: ["$", ""]
|
|
1674
|
-
});
|
|
1675
|
-
function gr(e) {
|
|
1676
|
-
return le = br(e), it = le.format, lt = le.formatPrefix, le;
|
|
1677
|
-
}
|
|
1678
|
-
function wr(e) {
|
|
1679
|
-
return Math.max(0, -X(Math.abs(e)));
|
|
1680
|
-
}
|
|
1681
|
-
function Nr(e, t) {
|
|
1682
|
-
return Math.max(0, Math.max(-8, Math.min(8, Math.floor(X(t) / 3))) * 3 - X(Math.abs(e)));
|
|
1683
|
-
}
|
|
1684
|
-
function Ar(e, t) {
|
|
1685
|
-
return e = Math.abs(e), t = Math.abs(t) - e, Math.max(0, X(t) - X(e)) + 1;
|
|
1686
|
-
}
|
|
1687
|
-
function je(e, t) {
|
|
1688
|
-
switch (arguments.length) {
|
|
1689
|
-
case 0:
|
|
1690
|
-
break;
|
|
1691
|
-
case 1:
|
|
1692
|
-
this.range(e);
|
|
1693
|
-
break;
|
|
1694
|
-
default:
|
|
1695
|
-
this.range(t).domain(e);
|
|
1696
|
-
break;
|
|
1697
|
-
}
|
|
1698
|
-
return this;
|
|
1699
|
-
}
|
|
1700
|
-
const Je = Symbol("implicit");
|
|
1701
|
-
function ot() {
|
|
1702
|
-
var e = new He(), t = [], r = [], n = Je;
|
|
1703
|
-
function s(o) {
|
|
1704
|
-
let l = e.get(o);
|
|
1705
|
-
if (l === void 0) {
|
|
1706
|
-
if (n !== Je) return n;
|
|
1707
|
-
e.set(o, l = t.push(o) - 1);
|
|
1708
|
-
}
|
|
1709
|
-
return r[l % r.length];
|
|
1710
|
-
}
|
|
1711
|
-
return s.domain = function(o) {
|
|
1712
|
-
if (!arguments.length) return t.slice();
|
|
1713
|
-
t = [], e = new He();
|
|
1714
|
-
for (const l of o)
|
|
1715
|
-
e.has(l) || e.set(l, t.push(l) - 1);
|
|
1716
|
-
return s;
|
|
1717
|
-
}, s.range = function(o) {
|
|
1718
|
-
return arguments.length ? (r = Array.from(o), s) : r.slice();
|
|
1719
|
-
}, s.unknown = function(o) {
|
|
1720
|
-
return arguments.length ? (n = o, s) : n;
|
|
1721
|
-
}, s.copy = function() {
|
|
1722
|
-
return ot(t, r).unknown(n);
|
|
1723
|
-
}, je.apply(s, arguments), s;
|
|
1724
|
-
}
|
|
1725
|
-
function Sr(e) {
|
|
1726
|
-
return function() {
|
|
1727
|
-
return e;
|
|
1728
|
-
};
|
|
1729
|
-
}
|
|
1730
|
-
function Mr(e) {
|
|
1731
|
-
return +e;
|
|
1732
|
-
}
|
|
1733
|
-
var Ce = [0, 1];
|
|
1734
|
-
function Y(e) {
|
|
1735
|
-
return e;
|
|
1736
|
-
}
|
|
1737
|
-
function Me(e, t) {
|
|
1738
|
-
return (t -= e = +e) ? function(r) {
|
|
1739
|
-
return (r - e) / t;
|
|
1740
|
-
} : Sr(isNaN(t) ? NaN : 0.5);
|
|
1741
|
-
}
|
|
1742
|
-
function kr(e, t) {
|
|
1743
|
-
var r;
|
|
1744
|
-
return e > t && (r = e, e = t, t = r), function(n) {
|
|
1745
|
-
return Math.max(e, Math.min(t, n));
|
|
1746
|
-
};
|
|
1747
|
-
}
|
|
1748
|
-
function $r(e, t, r) {
|
|
1749
|
-
var n = e[0], s = e[1], o = t[0], l = t[1];
|
|
1750
|
-
return s < n ? (n = Me(s, n), o = r(l, o)) : (n = Me(n, s), o = r(o, l)), function(d) {
|
|
1751
|
-
return o(n(d));
|
|
1752
|
-
};
|
|
1753
|
-
}
|
|
1754
|
-
function Lr(e, t, r) {
|
|
1755
|
-
var n = Math.min(e.length, t.length) - 1, s = new Array(n), o = new Array(n), l = -1;
|
|
1756
|
-
for (e[n] < e[0] && (e = e.slice().reverse(), t = t.slice().reverse()); ++l < n; )
|
|
1757
|
-
s[l] = Me(e[l], e[l + 1]), o[l] = r(t[l], t[l + 1]);
|
|
1758
|
-
return function(d) {
|
|
1759
|
-
var c = tt(e, d, 1, n) - 1;
|
|
1760
|
-
return o[c](s[c](d));
|
|
1761
|
-
};
|
|
1762
|
-
}
|
|
1763
|
-
function Tr(e, t) {
|
|
1764
|
-
return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());
|
|
1765
|
-
}
|
|
1766
|
-
function Fr() {
|
|
1767
|
-
var e = Ce, t = Ce, r = Te, n, s, o, l = Y, d, c, i;
|
|
1768
|
-
function f() {
|
|
1769
|
-
var h = Math.min(e.length, t.length);
|
|
1770
|
-
return l !== Y && (l = kr(e[0], e[h - 1])), d = h > 2 ? Lr : $r, c = i = null, u;
|
|
1771
|
-
}
|
|
1772
|
-
function u(h) {
|
|
1773
|
-
return h == null || isNaN(h = +h) ? o : (c || (c = d(e.map(n), t, r)))(n(l(h)));
|
|
1774
|
-
}
|
|
1775
|
-
return u.invert = function(h) {
|
|
1776
|
-
return l(s((i || (i = d(t, e.map(n), fe)))(h)));
|
|
1777
|
-
}, u.domain = function(h) {
|
|
1778
|
-
return arguments.length ? (e = Array.from(h, Mr), f()) : e.slice();
|
|
1779
|
-
}, u.range = function(h) {
|
|
1780
|
-
return arguments.length ? (t = Array.from(h), f()) : t.slice();
|
|
1781
|
-
}, u.rangeRound = function(h) {
|
|
1782
|
-
return t = Array.from(h), r = fr, f();
|
|
1783
|
-
}, u.clamp = function(h) {
|
|
1784
|
-
return arguments.length ? (l = h ? !0 : Y, f()) : l !== Y;
|
|
1785
|
-
}, u.interpolate = function(h) {
|
|
1786
|
-
return arguments.length ? (r = h, f()) : r;
|
|
1787
|
-
}, u.unknown = function(h) {
|
|
1788
|
-
return arguments.length ? (o = h, u) : o;
|
|
1789
|
-
}, function(h, p) {
|
|
1790
|
-
return n = h, s = p, f();
|
|
1791
|
-
};
|
|
1792
|
-
}
|
|
1793
|
-
function jr() {
|
|
1794
|
-
return Fr()(Y, Y);
|
|
1795
|
-
}
|
|
1796
|
-
function Er(e, t, r, n) {
|
|
1797
|
-
var s = Vt(e, t, r), o;
|
|
1798
|
-
switch (n = xe(n ?? ",f"), n.type) {
|
|
1799
|
-
case "s": {
|
|
1800
|
-
var l = Math.max(Math.abs(e), Math.abs(t));
|
|
1801
|
-
return n.precision == null && !isNaN(o = Nr(s, l)) && (n.precision = o), lt(n, l);
|
|
1802
|
-
}
|
|
1803
|
-
case "":
|
|
1804
|
-
case "e":
|
|
1805
|
-
case "g":
|
|
1806
|
-
case "p":
|
|
1807
|
-
case "r": {
|
|
1808
|
-
n.precision == null && !isNaN(o = Ar(s, Math.max(Math.abs(e), Math.abs(t)))) && (n.precision = o - (n.type === "e"));
|
|
1809
|
-
break;
|
|
1810
|
-
}
|
|
1811
|
-
case "f":
|
|
1812
|
-
case "%": {
|
|
1813
|
-
n.precision == null && !isNaN(o = wr(s)) && (n.precision = o - (n.type === "%") * 2);
|
|
1814
|
-
break;
|
|
1815
|
-
}
|
|
1816
|
-
}
|
|
1817
|
-
return it(n);
|
|
1818
|
-
}
|
|
1819
|
-
function ct(e) {
|
|
1820
|
-
var t = e.domain;
|
|
1821
|
-
return e.ticks = function(r) {
|
|
1822
|
-
var n = t();
|
|
1823
|
-
return Ut(n[0], n[n.length - 1], r ?? 10);
|
|
1824
|
-
}, e.tickFormat = function(r, n) {
|
|
1825
|
-
var s = t();
|
|
1826
|
-
return Er(s[0], s[s.length - 1], r ?? 10, n);
|
|
1827
|
-
}, e.nice = function(r) {
|
|
1828
|
-
r == null && (r = 10);
|
|
1829
|
-
var n = t(), s = 0, o = n.length - 1, l = n[s], d = n[o], c, i, f = 10;
|
|
1830
|
-
for (d < l && (i = l, l = d, d = i, i = s, s = o, o = i); f-- > 0; ) {
|
|
1831
|
-
if (i = Ne(l, d, r), i === c)
|
|
1832
|
-
return n[s] = l, n[o] = d, t(n);
|
|
1833
|
-
if (i > 0)
|
|
1834
|
-
l = Math.floor(l / i) * i, d = Math.ceil(d / i) * i;
|
|
1835
|
-
else if (i < 0)
|
|
1836
|
-
l = Math.ceil(l * i) / i, d = Math.floor(d * i) / i;
|
|
1837
|
-
else
|
|
1838
|
-
break;
|
|
1839
|
-
c = i;
|
|
1840
|
-
}
|
|
1841
|
-
return e;
|
|
1842
|
-
}, e;
|
|
1843
|
-
}
|
|
1844
|
-
function zr() {
|
|
1845
|
-
var e = jr();
|
|
1846
|
-
return e.copy = function() {
|
|
1847
|
-
return Tr(e, zr());
|
|
1848
|
-
}, je.apply(e, arguments), ct(e);
|
|
1849
|
-
}
|
|
1850
|
-
function dt() {
|
|
1851
|
-
var e = 0, t = 1, r = 1, n = [0.5], s = [0, 1], o;
|
|
1852
|
-
function l(c) {
|
|
1853
|
-
return c != null && c <= c ? s[tt(n, c, 0, r)] : o;
|
|
1854
|
-
}
|
|
1855
|
-
function d() {
|
|
1856
|
-
var c = -1;
|
|
1857
|
-
for (n = new Array(r); ++c < r; ) n[c] = ((c + 1) * t - (c - r) * e) / (r + 1);
|
|
1858
|
-
return l;
|
|
1859
|
-
}
|
|
1860
|
-
return l.domain = function(c) {
|
|
1861
|
-
return arguments.length ? ([e, t] = c, e = +e, t = +t, d()) : [e, t];
|
|
1862
|
-
}, l.range = function(c) {
|
|
1863
|
-
return arguments.length ? (r = (s = Array.from(c)).length - 1, d()) : s.slice();
|
|
1864
|
-
}, l.invertExtent = function(c) {
|
|
1865
|
-
var i = s.indexOf(c);
|
|
1866
|
-
return i < 0 ? [NaN, NaN] : i < 1 ? [e, n[0]] : i >= r ? [n[r - 1], t] : [n[i - 1], n[i]];
|
|
1867
|
-
}, l.unknown = function(c) {
|
|
1868
|
-
return arguments.length && (o = c), l;
|
|
1869
|
-
}, l.thresholds = function() {
|
|
1870
|
-
return n.slice();
|
|
1871
|
-
}, l.copy = function() {
|
|
1872
|
-
return dt().domain([e, t]).range(s).unknown(o);
|
|
1873
|
-
}, je.apply(ct(l), arguments);
|
|
1874
|
-
}
|
|
1875
|
-
function Yr({
|
|
1876
|
-
data: e,
|
|
1877
|
-
chartConfig: t,
|
|
1878
|
-
displayConfig: r = {},
|
|
1879
|
-
queryObject: n,
|
|
1880
|
-
height: s = "100%"
|
|
1881
|
-
}) {
|
|
1882
|
-
const [o, l] = P(null), { getFieldLabel: d } = _();
|
|
1883
|
-
try {
|
|
1884
|
-
const c = {
|
|
1885
|
-
showTooltip: (r == null ? void 0 : r.showTooltip) ?? !0,
|
|
1886
|
-
showLegend: (r == null ? void 0 : r.showLegend) ?? !0
|
|
1887
|
-
};
|
|
1888
|
-
if (!e || e.length === 0)
|
|
1889
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
1890
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
1891
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No data points to display in treemap chart" })
|
|
1892
|
-
] }) });
|
|
1893
|
-
let i, f = !1, u;
|
|
1894
|
-
if (t != null && t.xAxis && (t != null && t.yAxis)) {
|
|
1895
|
-
const b = t.xAxis[0], x = Array.isArray(t.yAxis) ? t.yAxis[0] : t.yAxis;
|
|
1896
|
-
u = Array.isArray(t.series) ? t.series[0] : t.series;
|
|
1897
|
-
const N = I(n, b);
|
|
1898
|
-
if (u) {
|
|
1899
|
-
const y = e.map((g) => {
|
|
1900
|
-
const $ = g[u];
|
|
1901
|
-
return typeof $ == "string" ? parseFloat($) : $;
|
|
1902
|
-
}).filter((g) => !isNaN(g));
|
|
1903
|
-
if (f = y.length === e.length && y.every((g) => typeof g == "number"), console.log("TreeMap Debug:", {
|
|
1904
|
-
seriesField: u,
|
|
1905
|
-
data: e,
|
|
1906
|
-
seriesValues: y,
|
|
1907
|
-
isNumericSeries: f,
|
|
1908
|
-
rawValues: e.map((g) => g[u])
|
|
1909
|
-
}), f) {
|
|
1910
|
-
const g = Math.min(...y), $ = Math.max(...y), M = dt().domain([g, $]).range(se);
|
|
1911
|
-
i = e.map((T) => {
|
|
1912
|
-
const H = typeof T[u] == "string" ? parseFloat(T[u]) : T[u], k = M(H);
|
|
1913
|
-
return console.log("TreeMap Color Assignment:", {
|
|
1914
|
-
item: T[b],
|
|
1915
|
-
seriesValue: H,
|
|
1916
|
-
color: k,
|
|
1917
|
-
minValue: g,
|
|
1918
|
-
maxValue: $
|
|
1919
|
-
}), {
|
|
1920
|
-
name: z(T[b], N) || String(T[b]) || "Unknown",
|
|
1921
|
-
size: typeof T[x] == "string" ? parseFloat(T[x]) : T[x] || 0,
|
|
1922
|
-
fill: k,
|
|
1923
|
-
series: String(T[u])
|
|
1924
|
-
};
|
|
1925
|
-
});
|
|
1926
|
-
} else {
|
|
1927
|
-
const g = [...new Set(e.map((M) => String(M[u])))], $ = ot().domain(g).range(r.colors || L);
|
|
1928
|
-
i = e.map((M) => ({
|
|
1929
|
-
name: z(M[b], N) || String(M[b]) || "Unknown",
|
|
1930
|
-
size: typeof M[x] == "string" ? parseFloat(M[x]) : M[x] || 0,
|
|
1931
|
-
fill: $(String(M[u])),
|
|
1932
|
-
series: String(M[u])
|
|
1933
|
-
}));
|
|
1934
|
-
}
|
|
1935
|
-
} else
|
|
1936
|
-
i = e.map((y, g) => {
|
|
1937
|
-
var $;
|
|
1938
|
-
return {
|
|
1939
|
-
name: z(y[b], N) || String(y[b]) || "Unknown",
|
|
1940
|
-
size: typeof y[x] == "string" ? parseFloat(y[x]) : y[x] || 0,
|
|
1941
|
-
fill: (($ = r.colors) == null ? void 0 : $[g]) || L[g % L.length]
|
|
1942
|
-
};
|
|
1943
|
-
});
|
|
1944
|
-
} else {
|
|
1945
|
-
const b = e[0], x = Object.keys(b), N = x.find(
|
|
1946
|
-
(g) => typeof b[g] == "string" || g.toLowerCase().includes("name") || g.toLowerCase().includes("label") || g.toLowerCase().includes("category")
|
|
1947
|
-
) || x[0], y = x.find((g) => g.toLowerCase().includes("size")) || x.find(
|
|
1948
|
-
(g) => typeof b[g] == "number" && g !== N
|
|
1949
|
-
) || x[1];
|
|
1950
|
-
if (!y)
|
|
1951
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-yellow-600", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
1952
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "Configuration Error" }),
|
|
1953
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No numeric field found for treemap chart size" })
|
|
1954
|
-
] }) });
|
|
1955
|
-
i = e.map((g, $) => {
|
|
1956
|
-
var T;
|
|
1957
|
-
let M = g[N];
|
|
1958
|
-
return typeof M == "boolean" ? M = M ? "Active" : "Inactive" : M === "true" || M === "false" ? M = M === "true" ? "Active" : "Inactive" : M = String(M), {
|
|
1959
|
-
name: M,
|
|
1960
|
-
size: typeof g[y] == "string" ? parseFloat(g[y]) : g[y] || 0,
|
|
1961
|
-
fill: ((T = r.colors) == null ? void 0 : T[$]) || L[$ % L.length]
|
|
1962
|
-
};
|
|
1963
|
-
});
|
|
1964
|
-
}
|
|
1965
|
-
if (i = i.filter((b) => b.size != null && b.size > 0), i.length === 0)
|
|
1966
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
1967
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No valid data" }),
|
|
1968
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No valid data points for treemap chart after transformation" })
|
|
1969
|
-
] }) });
|
|
1970
|
-
const h = (b) => {
|
|
1971
|
-
var H;
|
|
1972
|
-
const { x, y: N, width: y, height: g, index: $, name: M, size: T } = b;
|
|
1973
|
-
return y < 20 || g < 20 ? null : /* @__PURE__ */ w("g", { children: [
|
|
1974
|
-
/* @__PURE__ */ a(
|
|
1975
|
-
"rect",
|
|
1976
|
-
{
|
|
1977
|
-
x,
|
|
1978
|
-
y: N,
|
|
1979
|
-
width: y,
|
|
1980
|
-
height: g,
|
|
1981
|
-
style: {
|
|
1982
|
-
fill: ((H = i[$]) == null ? void 0 : H.fill) || L[$ % L.length],
|
|
1983
|
-
fillOpacity: o !== null ? o === $ ? 1 : 0.6 : 0.8,
|
|
1984
|
-
stroke: "#fff",
|
|
1985
|
-
strokeWidth: 2,
|
|
1986
|
-
cursor: "pointer"
|
|
1987
|
-
},
|
|
1988
|
-
onMouseEnter: () => l($),
|
|
1989
|
-
onMouseLeave: () => l(null)
|
|
1990
|
-
}
|
|
1991
|
-
),
|
|
1992
|
-
/* @__PURE__ */ a(
|
|
1993
|
-
"foreignObject",
|
|
1994
|
-
{
|
|
1995
|
-
x,
|
|
1996
|
-
y: N,
|
|
1997
|
-
width: y,
|
|
1998
|
-
height: g,
|
|
1999
|
-
style: { pointerEvents: "none", overflow: "visible" },
|
|
2000
|
-
children: /* @__PURE__ */ w(
|
|
2001
|
-
"div",
|
|
2002
|
-
{
|
|
2003
|
-
style: {
|
|
2004
|
-
width: "100%",
|
|
2005
|
-
height: "100%",
|
|
2006
|
-
display: "flex",
|
|
2007
|
-
flexDirection: "column",
|
|
2008
|
-
alignItems: "center",
|
|
2009
|
-
justifyContent: "center",
|
|
2010
|
-
padding: "4px",
|
|
2011
|
-
boxSizing: "border-box",
|
|
2012
|
-
color: "#ffffff",
|
|
2013
|
-
textShadow: "0 1px 2px rgba(0,0,0,0.8)",
|
|
2014
|
-
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
2015
|
-
overflow: "hidden"
|
|
2016
|
-
},
|
|
2017
|
-
children: [
|
|
2018
|
-
y > 40 && g > 30 && /* @__PURE__ */ a(
|
|
2019
|
-
"div",
|
|
2020
|
-
{
|
|
2021
|
-
style: {
|
|
2022
|
-
fontSize: `${Math.max(10, Math.min(y / 8, g / 8, 16))}px`,
|
|
2023
|
-
fontWeight: "600",
|
|
2024
|
-
textAlign: "center",
|
|
2025
|
-
lineHeight: "1.2",
|
|
2026
|
-
marginBottom: y > 60 && g > 45 ? "4px" : "0",
|
|
2027
|
-
wordBreak: "break-word",
|
|
2028
|
-
hyphens: "auto"
|
|
2029
|
-
},
|
|
2030
|
-
children: M
|
|
2031
|
-
}
|
|
2032
|
-
),
|
|
2033
|
-
y > 60 && g > 45 && /* @__PURE__ */ a(
|
|
2034
|
-
"div",
|
|
2035
|
-
{
|
|
2036
|
-
style: {
|
|
2037
|
-
fontSize: `${Math.max(8, Math.min(y / 10, g / 10, 14))}px`,
|
|
2038
|
-
textAlign: "center",
|
|
2039
|
-
opacity: 0.9
|
|
2040
|
-
},
|
|
2041
|
-
children: typeof T == "number" ? T.toLocaleString() : T
|
|
2042
|
-
}
|
|
2043
|
-
)
|
|
2044
|
-
]
|
|
2045
|
-
}
|
|
2046
|
-
)
|
|
2047
|
-
}
|
|
2048
|
-
)
|
|
2049
|
-
] });
|
|
2050
|
-
}, m = i.some((b) => "series" in b) ? [...new Set(i.map((b) => b.series).filter(Boolean))] : [];
|
|
2051
|
-
let v = [];
|
|
2052
|
-
if (c.showLegend && u) {
|
|
2053
|
-
if (console.log("TreeMap Legend Debug:", {
|
|
2054
|
-
showLegend: c.showLegend,
|
|
2055
|
-
seriesField: u,
|
|
2056
|
-
isNumericSeries: f,
|
|
2057
|
-
uniqueSeries: m,
|
|
2058
|
-
data: e.slice(0, 2)
|
|
2059
|
-
// First 2 items for debugging
|
|
2060
|
-
}), f) {
|
|
2061
|
-
const b = Math.min(...e.map((N) => {
|
|
2062
|
-
const y = N[u];
|
|
2063
|
-
return typeof y == "string" ? parseFloat(y) : y;
|
|
2064
|
-
})), x = Math.max(...e.map((N) => {
|
|
2065
|
-
const y = N[u];
|
|
2066
|
-
return typeof y == "string" ? parseFloat(y) : y;
|
|
2067
|
-
}));
|
|
2068
|
-
console.log("Creating numeric legend:", { minValue: b, maxValue: x }), v = se.map((N, y) => {
|
|
2069
|
-
const g = y / (se.length - 1);
|
|
2070
|
-
return {
|
|
2071
|
-
value: (b + (x - b) * g).toFixed(2),
|
|
2072
|
-
type: "rect",
|
|
2073
|
-
color: N
|
|
2074
|
-
};
|
|
2075
|
-
});
|
|
2076
|
-
} else m.length > 1 && (console.log("Creating categorical legend:", m), v = m.map((b, x) => ({
|
|
2077
|
-
value: b,
|
|
2078
|
-
type: "rect",
|
|
2079
|
-
color: L[x % L.length]
|
|
2080
|
-
})));
|
|
2081
|
-
console.log("Final legendPayload:", v);
|
|
2082
|
-
}
|
|
2083
|
-
const A = c.showLegend && v.length > 0, S = A ? typeof s == "string" && s.includes("%") ? s : typeof s == "number" ? s + 60 : `calc(${s} + 60px)` : s;
|
|
2084
|
-
return /* @__PURE__ */ w("div", { className: "w-full", style: { height: S }, children: [
|
|
2085
|
-
/* @__PURE__ */ a(O, { height: A ? "calc(100% - 50px)" : "100%", children: /* @__PURE__ */ a(
|
|
2086
|
-
Lt,
|
|
2087
|
-
{
|
|
2088
|
-
data: i,
|
|
2089
|
-
dataKey: "size",
|
|
2090
|
-
aspectRatio: 4 / 3,
|
|
2091
|
-
stroke: "#fff",
|
|
2092
|
-
content: /* @__PURE__ */ a(h, {}),
|
|
2093
|
-
children: c.showTooltip && /* @__PURE__ */ a(G, {})
|
|
2094
|
-
}
|
|
2095
|
-
) }),
|
|
2096
|
-
A && /* @__PURE__ */ a("div", { className: "flex justify-center items-center mt-4 pb-2", children: f ? (
|
|
2097
|
-
// Gradient legend for numeric series
|
|
2098
|
-
/* @__PURE__ */ w("div", { className: "flex flex-col items-center", children: [
|
|
2099
|
-
/* @__PURE__ */ a("div", { className: "text-xs font-semibold text-gray-700 mb-2", children: u ? d(u) : "" }),
|
|
2100
|
-
/* @__PURE__ */ w("div", { className: "flex items-center gap-2", children: [
|
|
2101
|
-
/* @__PURE__ */ a("span", { className: "text-xs text-gray-600", children: Math.min(...e.map((b) => {
|
|
2102
|
-
const x = b[u];
|
|
2103
|
-
return typeof x == "string" ? parseFloat(x) : x;
|
|
2104
|
-
})).toFixed(2) }),
|
|
2105
|
-
/* @__PURE__ */ a(
|
|
2106
|
-
"div",
|
|
2107
|
-
{
|
|
2108
|
-
className: "h-4 rounded",
|
|
2109
|
-
style: {
|
|
2110
|
-
width: "200px",
|
|
2111
|
-
background: `linear-gradient(to right, ${se.join(", ")})`
|
|
2112
|
-
}
|
|
2113
|
-
}
|
|
2114
|
-
),
|
|
2115
|
-
/* @__PURE__ */ a("span", { className: "text-xs text-gray-600", children: Math.max(...e.map((b) => {
|
|
2116
|
-
const x = b[u];
|
|
2117
|
-
return typeof x == "string" ? parseFloat(x) : x;
|
|
2118
|
-
})).toFixed(2) })
|
|
2119
|
-
] })
|
|
2120
|
-
] })
|
|
2121
|
-
) : (
|
|
2122
|
-
// Discrete legend for categorical series
|
|
2123
|
-
/* @__PURE__ */ a("div", { className: "flex flex-wrap justify-center gap-4", children: v.map((b, x) => /* @__PURE__ */ w("div", { className: "flex items-center gap-2", children: [
|
|
2124
|
-
/* @__PURE__ */ a(
|
|
2125
|
-
"div",
|
|
2126
|
-
{
|
|
2127
|
-
className: "w-3 h-3 rounded-sm",
|
|
2128
|
-
style: { backgroundColor: b.color }
|
|
2129
|
-
}
|
|
2130
|
-
),
|
|
2131
|
-
/* @__PURE__ */ a("span", { className: "text-xs text-gray-600", children: b.value })
|
|
2132
|
-
] }, x)) })
|
|
2133
|
-
) })
|
|
2134
|
-
] });
|
|
2135
|
-
} catch (c) {
|
|
2136
|
-
return console.error("TreeMapChart rendering error:", c), /* @__PURE__ */ a("div", { className: "flex flex-col items-center justify-center w-full text-red-500 p-4", style: { height: s }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
2137
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "TreeMap Chart Error" }),
|
|
2138
|
-
/* @__PURE__ */ a("div", { className: "text-xs mb-2", children: c instanceof Error ? c.message : "Unknown rendering error" }),
|
|
2139
|
-
/* @__PURE__ */ a("div", { className: "text-xs text-gray-600", children: "Check the data and configuration" })
|
|
2140
|
-
] }) });
|
|
2141
|
-
}
|
|
2142
|
-
}
|
|
2143
|
-
function Wr({
|
|
2144
|
-
data: e,
|
|
2145
|
-
chartConfig: t,
|
|
2146
|
-
height: r = 300
|
|
2147
|
-
}) {
|
|
2148
|
-
const { getFieldLabel: n } = _();
|
|
2149
|
-
if (!e || e.length === 0)
|
|
2150
|
-
return /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: r }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
2151
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No data available" }),
|
|
2152
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "No data to display in table" })
|
|
2153
|
-
] }) });
|
|
2154
|
-
const s = Object.keys(e[0] || {}), o = t != null && t.xAxis && t.xAxis.length > 0 ? t.xAxis.filter((l) => s.includes(l)) : s;
|
|
2155
|
-
return o.length === 0 ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center w-full text-gray-500", style: { height: r }, children: /* @__PURE__ */ w("div", { className: "text-center", children: [
|
|
2156
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold mb-1", children: "No columns available" }),
|
|
2157
|
-
/* @__PURE__ */ a("div", { className: "text-xs", children: "Data structure is invalid" })
|
|
2158
|
-
] }) }) : /* @__PURE__ */ a("div", { className: "w-full overflow-auto", style: { height: r }, children: /* @__PURE__ */ w("table", { className: "min-w-full divide-y divide-gray-200", children: [
|
|
2159
|
-
/* @__PURE__ */ a("thead", { className: "bg-gray-50 sticky top-0", children: /* @__PURE__ */ a("tr", { children: o.map((l) => /* @__PURE__ */ a(
|
|
2160
|
-
"th",
|
|
2161
|
-
{
|
|
2162
|
-
className: "px-3 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",
|
|
2163
|
-
children: n(l)
|
|
2164
|
-
},
|
|
2165
|
-
l
|
|
2166
|
-
)) }) }),
|
|
2167
|
-
/* @__PURE__ */ a("tbody", { className: "bg-white divide-y divide-gray-200", children: e.map((l, d) => /* @__PURE__ */ a("tr", { className: "hover:bg-gray-50", children: o.map((c) => /* @__PURE__ */ a(
|
|
2168
|
-
"td",
|
|
2169
|
-
{
|
|
2170
|
-
className: "px-3 py-2 whitespace-nowrap text-sm text-gray-900",
|
|
2171
|
-
children: Rr(l[c])
|
|
2172
|
-
},
|
|
2173
|
-
c
|
|
2174
|
-
)) }, d)) })
|
|
2175
|
-
] }) });
|
|
2176
|
-
}
|
|
2177
|
-
function Rr(e) {
|
|
2178
|
-
return e == null ? "" : typeof e == "number" ? e.toLocaleString() : typeof e == "boolean" ? e ? "Yes" : "No" : String(e);
|
|
2179
|
-
}
|
|
2180
|
-
function Xr(e) {
|
|
2181
|
-
const t = Dr(e);
|
|
2182
|
-
return {
|
|
2183
|
-
portlets: e,
|
|
2184
|
-
layouts: t
|
|
2185
|
-
};
|
|
2186
|
-
}
|
|
2187
|
-
function Dr(e) {
|
|
2188
|
-
const t = e.map((r) => ({
|
|
2189
|
-
i: r.id,
|
|
2190
|
-
x: r.x,
|
|
2191
|
-
y: r.y,
|
|
2192
|
-
w: r.w,
|
|
2193
|
-
h: r.h,
|
|
2194
|
-
minW: 3,
|
|
2195
|
-
minH: 3
|
|
2196
|
-
}));
|
|
2197
|
-
return {
|
|
2198
|
-
lg: t,
|
|
2199
|
-
md: t.map((r) => ({ ...r, w: Math.min(r.w, 8) })),
|
|
2200
|
-
sm: t.map((r) => ({ ...r, w: Math.min(r.w, 6) })),
|
|
2201
|
-
xs: t.map((r) => ({ ...r, w: Math.min(r.w, 4) })),
|
|
2202
|
-
xxs: t.map((r) => ({ ...r, w: 2 }))
|
|
2203
|
-
};
|
|
2204
|
-
}
|
|
2205
|
-
function Qr(e, t = {}) {
|
|
2206
|
-
const { formatNumbers: r = !0, precision: n = 2 } = t;
|
|
2207
|
-
return r ? e.map((s) => {
|
|
2208
|
-
const o = {};
|
|
2209
|
-
for (const [l, d] of Object.entries(s))
|
|
2210
|
-
typeof d == "number" ? o[l] = Number(d.toFixed(n)) : o[l] = d;
|
|
2211
|
-
return o;
|
|
2212
|
-
}) : e;
|
|
2213
|
-
}
|
|
2214
|
-
function Zr() {
|
|
2215
|
-
return `portlet-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
2216
|
-
}
|
|
2217
|
-
function Jr(e, t = 6, r = 4) {
|
|
2218
|
-
return e.length === 0 ? { x: 0, y: 0 } : { x: 0, y: Math.max(...e.map((s) => s.y + s.h)) };
|
|
2219
|
-
}
|
|
2220
|
-
function Cr(e) {
|
|
2221
|
-
try {
|
|
2222
|
-
const t = JSON.parse(e);
|
|
2223
|
-
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 };
|
|
2224
|
-
} catch {
|
|
2225
|
-
return { valid: !1, error: "Invalid JSON format" };
|
|
2226
|
-
}
|
|
2227
|
-
}
|
|
2228
|
-
function en() {
|
|
2229
|
-
return {
|
|
2230
|
-
title: "Sample Chart",
|
|
2231
|
-
query: JSON.stringify({
|
|
2232
|
-
measures: ["count"],
|
|
2233
|
-
dimensions: ["category"]
|
|
2234
|
-
}, null, 2),
|
|
2235
|
-
chartType: "bar",
|
|
2236
|
-
chartConfig: {
|
|
2237
|
-
x: "category",
|
|
2238
|
-
y: ["count"]
|
|
2239
|
-
},
|
|
2240
|
-
displayConfig: {
|
|
2241
|
-
showLegend: !0,
|
|
2242
|
-
showGrid: !0,
|
|
2243
|
-
showTooltip: !0
|
|
2244
|
-
},
|
|
2245
|
-
w: 6,
|
|
2246
|
-
h: 4,
|
|
2247
|
-
x: 0,
|
|
2248
|
-
y: 0
|
|
2249
|
-
};
|
|
2250
|
-
}
|
|
2251
|
-
export {
|
|
2252
|
-
Vr as A,
|
|
2253
|
-
Gr as B,
|
|
2254
|
-
ve as C,
|
|
2255
|
-
Wr as D,
|
|
2256
|
-
Ur as L,
|
|
2257
|
-
Tt as N,
|
|
2258
|
-
qr as P,
|
|
2259
|
-
_r as R,
|
|
2260
|
-
Br as S,
|
|
2261
|
-
Yr as T,
|
|
2262
|
-
Kr as a,
|
|
2263
|
-
Tr as b,
|
|
2264
|
-
Xr as c,
|
|
2265
|
-
Y as d,
|
|
2266
|
-
z as e,
|
|
2267
|
-
Qr as f,
|
|
2268
|
-
I as g,
|
|
2269
|
-
zr as h,
|
|
2270
|
-
je as i,
|
|
2271
|
-
se as j,
|
|
2272
|
-
L as k,
|
|
2273
|
-
ct as l,
|
|
2274
|
-
O as m,
|
|
2275
|
-
Dr as n,
|
|
2276
|
-
ot as o,
|
|
2277
|
-
Zr as p,
|
|
2278
|
-
dt as q,
|
|
2279
|
-
Jr as r,
|
|
2280
|
-
en as s,
|
|
2281
|
-
Fr as t,
|
|
2282
|
-
De as u,
|
|
2283
|
-
Cr as v
|
|
2284
|
-
};
|
|
2285
|
-
//# sourceMappingURL=charts-BadAUMmd.js.map
|