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