@dcs-tech/ui 0.4.0 → 0.6.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/ChartImageMenu-CuuFnW9q.js +1481 -0
- package/dist/{ChartView-Cehrcr05.js → ChartView-nS4f4EU_.js} +514 -514
- package/dist/{SummaryChart-y27q_BBN.js → SummaryChart-CVg6i2mx.js} +2 -2
- package/dist/{SummaryImage-DDNEEu_K.js → SummaryImage-CoEFzMl6.js} +2 -2
- package/dist/{SummarySeeAll-0dX-_LFe.js → SummarySeeAll-C_OUs3kn.js} +5 -5
- package/dist/assets/fileTask.worker-FQSUtwcz.js +1 -0
- package/dist/columnValue-K98ElfJc.js +610 -0
- package/dist/exportContext-CJaIv8R-.js +166 -0
- package/dist/{exportEngine-DL-jEXFU.js → exportEngine-CDLYHH0d.js} +137 -133
- package/dist/fileActions-KSaVGnaE.js +144 -0
- package/dist/{geometry-CG2nOEnw.js → geometry-ChwYB45B.js} +433 -497
- package/dist/index.js +8572 -8435
- package/dist/{defaults-DL745PK1.js → labels-CnqqTrne.js} +3 -79
- package/dist/runFileTask-BClLQjmv.js +109 -0
- package/dist/scrollArea-DAlVT5U7.js +214 -0
- package/dist/style.css +1 -1
- package/dist/{summaryChartData-Djo73zb8.js → summaryChartData-pNvzaEHp.js} +1 -1
- package/dist/types/components/Charts/parts.d.ts +1 -1
- package/dist/types/components/Collapsible/index.d.ts +1 -1
- package/dist/types/components/DataTable/DataTable.d.ts +1 -1
- package/dist/types/components/DataTable/cards/cardFields.d.ts +2 -4
- package/dist/types/components/DataTable/columnValue.d.ts +19 -0
- package/dist/types/components/DataTable/export/exportCells.d.ts +13 -0
- package/dist/types/components/DataTable/export/exportEngine.d.ts +2 -0
- package/dist/types/components/DataTable/export/useTableExport.d.ts +2 -0
- package/dist/types/components/DataTable/host.d.ts +2 -0
- package/dist/types/components/DataTable/index.d.ts +1 -1
- package/dist/types/components/DataTable/labels.d.ts +2 -0
- package/dist/types/components/DataTable/types.d.ts +11 -0
- package/dist/types/components/DataTable/useTable.d.ts +4 -1
- package/dist/types/components/DataTable/vendor/index.d.ts +1 -1
- package/dist/types/components/EditableTable/EditableTableCell.d.ts +1 -1
- package/dist/types/components/FileEngine/FileEngineContext.d.ts +17 -0
- package/dist/types/components/FileEngine/FileEngineProvider.d.ts +12 -0
- package/dist/types/components/FileEngine/FileJobsTray.d.ts +10 -0
- package/dist/types/components/FileEngine/index.d.ts +8 -0
- package/dist/types/components/FileEngine/labels.d.ts +29 -0
- package/dist/types/components/Toast/ToastHost.d.ts +1 -0
- package/dist/types/components/UIProvider/UIFormatContext.d.ts +7 -0
- package/dist/types/components/UIProvider/UILabelsContext.d.ts +116 -0
- package/dist/types/components/UIProvider/UIProvider.d.ts +6 -1
- package/dist/types/components/UIProvider/index.d.ts +4 -0
- package/dist/types/core/logic/collapsible.logic.d.ts +6 -1
- package/dist/types/core/logic/datePicker.logic.d.ts +5 -0
- package/dist/types/core/logic/exportSafety.logic.d.ts +1 -0
- package/dist/types/core/logic/fileQueue.logic.d.ts +28 -0
- package/dist/types/core/logic/format.logic.d.ts +4 -0
- package/dist/types/core/logic/index.d.ts +4 -0
- package/dist/types/core/logic/tableDate.logic.d.ts +7 -0
- package/dist/types/core/logic/tableSummary.logic.d.ts +2 -2
- package/dist/types/core/types/collapsible.types.d.ts +4 -16
- package/dist/types/core/types/fileEngine.types.d.ts +65 -0
- package/dist/types/core/types/format.types.d.ts +15 -0
- package/dist/types/core/types/index.d.ts +2 -0
- package/dist/types/core/types/table.types.d.ts +1 -0
- package/dist/types/{components/DataTable/vendor → file}/fileActions.d.ts +17 -7
- package/dist/types/file/fileEngine.d.ts +48 -0
- package/dist/types/file/tasks/fileTask.worker.d.ts +1 -0
- package/dist/types/file/tasks/runFileTask.d.ts +6 -0
- package/dist/types/file/workerPool.d.ts +17 -0
- package/dist/types/index.d.ts +9 -2
- package/package.json +1 -1
- package/dist/ChartImageMenu-HILSfn5A.js +0 -1115
- package/dist/exportContext-CdpsOzE8.js +0 -235
- package/dist/scrollArea-CkPGDYH2.js +0 -210
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { A as e, C as t,
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { Fragment as se, jsx as
|
|
2
|
+
import { A as e, C as t, Cn as n, D as r, E as i, En as a, F as o, G as s, J as c, K as l, L as u, M as d, N as f, O as p, R as m, S as h, T as g, Tn as _, W as v, X as y, Y as b, Z as x, _ as S, b as C, c as w, ct as T, d as E, f as D, ft as O, g as k, h as A, i as j, j as M, k as N, l as P, m as F, o as I, ot as L, p as R, q as z, r as B, s as V, t as H, u as ee, v as U, vt as te, w as ne, y as re, z as ie } from "./geometry-ChwYB45B.js";
|
|
3
|
+
import { useCallback as W, useEffect as ae, useLayoutEffect as G, useMemo as oe, useRef as K, useState as q } from "react";
|
|
4
|
+
import { Fragment as se, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
5
5
|
import { createPortal as ce } from "react-dom";
|
|
6
6
|
// src/core/logic/uiScale.logic.ts
|
|
7
7
|
function le(e) {
|
|
@@ -9,15 +9,15 @@ function le(e) {
|
|
|
9
9
|
return Number.isFinite(t) && t > 0 ? t : 1;
|
|
10
10
|
}
|
|
11
11
|
// src/components/Charts/useUiScale.ts
|
|
12
|
-
function
|
|
13
|
-
let [e, t] =
|
|
14
|
-
return
|
|
12
|
+
function X() {
|
|
13
|
+
let [e, t] = q(null), [n, r] = q(1);
|
|
14
|
+
return G(() => {
|
|
15
15
|
e && r(le(getComputedStyle(e).getPropertyValue("--ui-scale")));
|
|
16
|
-
}),
|
|
16
|
+
}), G(() => {
|
|
17
17
|
if (!e || typeof ResizeObserver > "u") return;
|
|
18
18
|
let t = new ResizeObserver(() => r(le(getComputedStyle(e).getPropertyValue("--ui-scale"))));
|
|
19
19
|
return t.observe(e), () => t.disconnect();
|
|
20
|
-
}, [e]), [
|
|
20
|
+
}, [e]), [W((e) => t(e), []), n];
|
|
21
21
|
}
|
|
22
22
|
// src/components/Charts/pointer.ts
|
|
23
23
|
function ue(e, t, n) {
|
|
@@ -74,88 +74,88 @@ function _e(e, t, n, r = ge, i = 8) {
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
// src/components/Charts/ChartTooltip.tsx
|
|
77
|
-
var
|
|
77
|
+
var Z = null, ve = 8, ye = () => ({
|
|
78
78
|
width: document.documentElement.clientWidth || window.innerWidth,
|
|
79
79
|
height: document.documentElement.clientHeight || window.innerHeight
|
|
80
80
|
});
|
|
81
|
-
function
|
|
82
|
-
let t =
|
|
81
|
+
function Q(e) {
|
|
82
|
+
let t = K(e);
|
|
83
83
|
t.current = e;
|
|
84
|
-
let [n] =
|
|
84
|
+
let [n] = q(() => ({})), r = K(null), i = K(null), o = _(), [s, c] = q(null), l = K(null), u = K(null), [d, f] = q(null), p = !!e.onPick, m = (e) => e >= 0 && e < t.current.count && (t.current.focusable?.(e) ?? !0), h = W((e) => {
|
|
85
85
|
r.current = e;
|
|
86
|
-
}, []),
|
|
87
|
-
|
|
88
|
-
}, []),
|
|
89
|
-
|
|
86
|
+
}, []), g = W(() => {
|
|
87
|
+
l.current = null, c(null);
|
|
88
|
+
}, []), v = W((e, t) => {
|
|
89
|
+
Z && Z.id !== n && Z.clear(), Z = {
|
|
90
90
|
id: n,
|
|
91
|
-
clear:
|
|
92
|
-
},
|
|
91
|
+
clear: g
|
|
92
|
+
}, c((n) => n && n.index === e && n.via === t ? n : {
|
|
93
93
|
index: e,
|
|
94
94
|
via: t
|
|
95
95
|
});
|
|
96
|
-
}, [n,
|
|
96
|
+
}, [n, g]);
|
|
97
97
|
ae(() => () => {
|
|
98
|
-
|
|
98
|
+
Z?.id === n && (Z = null);
|
|
99
99
|
}, [n]);
|
|
100
|
-
let b =
|
|
100
|
+
let b = W(() => {
|
|
101
101
|
let e = i.current, n = r.current;
|
|
102
|
-
if (!e || !n || !
|
|
103
|
-
let
|
|
102
|
+
if (!e || !n || !s) return;
|
|
103
|
+
let o = {
|
|
104
104
|
width: e.offsetWidth,
|
|
105
105
|
height: e.offsetHeight
|
|
106
|
-
},
|
|
107
|
-
if (
|
|
106
|
+
}, c;
|
|
107
|
+
if (l.current) c = _e(l.current, o, ye());
|
|
108
108
|
else {
|
|
109
|
-
let e = t.current.anchor?.(
|
|
110
|
-
|
|
109
|
+
let e = t.current.anchor?.(s.index, n) ?? be(n, s.index) ?? n.getBoundingClientRect();
|
|
110
|
+
c = a({
|
|
111
111
|
anchor: e,
|
|
112
|
-
tooltip:
|
|
112
|
+
tooltip: o,
|
|
113
113
|
viewport: ye(),
|
|
114
114
|
placement: "top",
|
|
115
115
|
offset: 8,
|
|
116
116
|
margin: 8
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
let
|
|
119
|
+
let u = e.parentElement?.getBoundingClientRect() ?? {
|
|
120
120
|
left: 0,
|
|
121
121
|
top: 0
|
|
122
122
|
};
|
|
123
|
-
e.style.transform = `translate(${Math.round(
|
|
124
|
-
}, [
|
|
125
|
-
|
|
126
|
-
if (
|
|
123
|
+
e.style.transform = `translate(${Math.round(c.left - u.left)}px, ${Math.round(c.top - u.top)}px)`, e.style.visibility = "visible";
|
|
124
|
+
}, [s]);
|
|
125
|
+
G(b), ae(() => {
|
|
126
|
+
if (s?.via !== "touch") return;
|
|
127
127
|
let e = (e) => {
|
|
128
|
-
r.current?.contains(e.target) ||
|
|
128
|
+
r.current?.contains(e.target) || g();
|
|
129
129
|
};
|
|
130
130
|
return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
|
|
131
|
-
}, [
|
|
131
|
+
}, [s?.via, g]);
|
|
132
132
|
let x = (e, n) => {
|
|
133
133
|
let i = r.current;
|
|
134
134
|
if (!i) return null;
|
|
135
135
|
let a = i.getBoundingClientRect();
|
|
136
136
|
return t.current.pick(e - a.left, n - a.top, a, i);
|
|
137
137
|
}, S = (e) => {
|
|
138
|
-
|
|
138
|
+
l.current = {
|
|
139
139
|
x: e.clientX,
|
|
140
140
|
y: e.clientY
|
|
141
141
|
};
|
|
142
142
|
let t = x(e.clientX, e.clientY);
|
|
143
|
-
if (t === null) return
|
|
144
|
-
|
|
143
|
+
if (t === null) return g();
|
|
144
|
+
v(t, e.pointerType === "touch" ? "touch" : "pointer"), b();
|
|
145
145
|
}, C = [
|
|
146
146
|
d,
|
|
147
|
-
|
|
147
|
+
s?.index ?? null,
|
|
148
148
|
e.start ?? null
|
|
149
|
-
].find((e) => e !== null &&
|
|
150
|
-
for (let t = 0; t < e.count && C === null; t++)
|
|
149
|
+
].find((e) => e !== null && m(e)) ?? null;
|
|
150
|
+
for (let t = 0; t < e.count && C === null; t++) m(t) && (C = t);
|
|
151
151
|
let w = (e) => {
|
|
152
152
|
let t = e instanceof Element && e !== r.current ? e.closest("[data-hit]") : null;
|
|
153
153
|
return t && r.current?.contains(t) ? Number(t.getAttribute("data-hit")) : null;
|
|
154
154
|
};
|
|
155
155
|
return {
|
|
156
|
-
active:
|
|
157
|
-
pickable:
|
|
158
|
-
item: (e, t = {}) =>
|
|
156
|
+
active: s?.index ?? null,
|
|
157
|
+
pickable: p,
|
|
158
|
+
item: (e, t = {}) => p && m(e) ? {
|
|
159
159
|
"data-hit": e,
|
|
160
160
|
role: "button",
|
|
161
161
|
tabIndex: e === C ? 0 : -1,
|
|
@@ -163,11 +163,11 @@ function Z(e) {
|
|
|
163
163
|
"aria-disabled": t.disabled ? !0 : void 0
|
|
164
164
|
} : { "data-hit": e },
|
|
165
165
|
plotProps: {
|
|
166
|
-
ref:
|
|
167
|
-
tabIndex:
|
|
166
|
+
ref: h,
|
|
167
|
+
tabIndex: p ? void 0 : 0,
|
|
168
168
|
"data-chart-plot": "",
|
|
169
169
|
onPointerDown: (e) => {
|
|
170
|
-
e.pointerType === "touch" && (
|
|
170
|
+
e.pointerType === "touch" && (u.current = {
|
|
171
171
|
x: e.clientX,
|
|
172
172
|
y: e.clientY,
|
|
173
173
|
moved: !1
|
|
@@ -175,49 +175,49 @@ function Z(e) {
|
|
|
175
175
|
},
|
|
176
176
|
onPointerMove: (e) => {
|
|
177
177
|
if (e.pointerType === "touch") {
|
|
178
|
-
if (!
|
|
179
|
-
Math.hypot(e.clientX -
|
|
178
|
+
if (!u.current) return;
|
|
179
|
+
Math.hypot(e.clientX - u.current.x, e.clientY - u.current.y) > ve && (u.current.moved = !0);
|
|
180
180
|
}
|
|
181
181
|
S(e);
|
|
182
182
|
},
|
|
183
183
|
onPointerUp: () => {
|
|
184
|
-
|
|
184
|
+
u.current && setTimeout(() => u.current = null, 0);
|
|
185
185
|
},
|
|
186
186
|
onPointerLeave: (e) => {
|
|
187
|
-
e.pointerType !== "touch" &&
|
|
187
|
+
e.pointerType !== "touch" && g();
|
|
188
188
|
},
|
|
189
189
|
onClick: (e) => {
|
|
190
|
-
if (
|
|
190
|
+
if (u.current?.moved) return;
|
|
191
191
|
let n = x(e.clientX, e.clientY);
|
|
192
192
|
n !== null && n >= 0 && t.current.onPick?.(n);
|
|
193
193
|
},
|
|
194
194
|
onKeyDown: (e) => {
|
|
195
195
|
let n = t.current, i = w(e.target);
|
|
196
|
-
if (n.onPick && i !== null && !
|
|
197
|
-
let a = i ?? (
|
|
196
|
+
if (n.onPick && i !== null && !m(i)) return;
|
|
197
|
+
let a = i ?? (s && s.index >= 0 ? s.index : null);
|
|
198
198
|
if ((e.key === "Enter" || e.key === " ") && a !== null && n.onPick) {
|
|
199
199
|
e.preventDefault(), n.onPick(a);
|
|
200
200
|
return;
|
|
201
201
|
}
|
|
202
|
-
if (e.key === "Escape") return
|
|
203
|
-
let
|
|
204
|
-
|
|
202
|
+
if (e.key === "Escape") return s && e.stopPropagation(), g();
|
|
203
|
+
let o = s && s.index >= 0 ? s.index : n.start ?? null, c = y(e.key, o, n.count, n.keys, n.onPick ? m : void 0);
|
|
204
|
+
c !== null && (e.preventDefault(), l.current = null, v(c, "key"), n.onPick && r.current?.querySelector(`[data-hit="${c}"]`)?.focus());
|
|
205
205
|
},
|
|
206
206
|
onFocus: (e) => {
|
|
207
207
|
let t = w(e.target);
|
|
208
|
-
|
|
208
|
+
p && t !== null && (f(t), s?.index !== t && (l.current = null, v(t, "key")));
|
|
209
209
|
},
|
|
210
210
|
onBlur: (e) => {
|
|
211
|
-
e.relatedTarget instanceof Node && r.current?.contains(e.relatedTarget) ||
|
|
211
|
+
e.relatedTarget instanceof Node && r.current?.contains(e.relatedTarget) || s?.via === "key" && g();
|
|
212
212
|
}
|
|
213
213
|
},
|
|
214
214
|
tooltip: (e) => {
|
|
215
|
-
if (!
|
|
215
|
+
if (!s || e == null || !o) return null;
|
|
216
216
|
let t = r.current?.closest("[data-theme]")?.getAttribute("data-theme") ?? void 0;
|
|
217
|
-
return ce(/* @__PURE__ */
|
|
217
|
+
return ce(/* @__PURE__ */ J("div", {
|
|
218
218
|
className: "chart-tooltip-layer",
|
|
219
219
|
"data-theme": t,
|
|
220
|
-
children: /* @__PURE__ */
|
|
220
|
+
children: /* @__PURE__ */ J("div", {
|
|
221
221
|
ref: i,
|
|
222
222
|
className: "chart-root chart-tooltip",
|
|
223
223
|
role: "presentation",
|
|
@@ -225,7 +225,7 @@ function Z(e) {
|
|
|
225
225
|
style: { visibility: "hidden" },
|
|
226
226
|
children: e
|
|
227
227
|
})
|
|
228
|
-
}),
|
|
228
|
+
}), o);
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
231
|
}
|
|
@@ -245,30 +245,30 @@ function xe(e) {
|
|
|
245
245
|
};
|
|
246
246
|
}), n;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
249
|
-
return /* @__PURE__ */
|
|
250
|
-
e != null && e !== "" && /* @__PURE__ */
|
|
248
|
+
function $({ title: e, rows: t = [], note: n }) {
|
|
249
|
+
return /* @__PURE__ */ Y(se, { children: [
|
|
250
|
+
e != null && e !== "" && /* @__PURE__ */ J("p", {
|
|
251
251
|
className: "chart-tooltip-title",
|
|
252
252
|
children: e
|
|
253
253
|
}),
|
|
254
|
-
t.map((e) => /* @__PURE__ */
|
|
254
|
+
t.map((e) => /* @__PURE__ */ Y("p", {
|
|
255
255
|
className: "chart-tooltip-series",
|
|
256
256
|
children: [
|
|
257
|
-
e.color && /* @__PURE__ */
|
|
257
|
+
e.color && /* @__PURE__ */ J("span", {
|
|
258
258
|
className: "chart-swatch chart-swatch--small",
|
|
259
259
|
style: { background: e.color }
|
|
260
260
|
}),
|
|
261
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ J("span", {
|
|
262
262
|
className: "chart-tooltip-label",
|
|
263
263
|
children: e.label
|
|
264
264
|
}),
|
|
265
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ J("strong", {
|
|
266
266
|
className: "chart-tooltip-value",
|
|
267
267
|
children: e.value
|
|
268
268
|
})
|
|
269
269
|
]
|
|
270
270
|
}, e.key)),
|
|
271
|
-
n != null && n !== "" && /* @__PURE__ */
|
|
271
|
+
n != null && n !== "" && /* @__PURE__ */ J("p", {
|
|
272
272
|
className: "chart-tooltip-note",
|
|
273
273
|
children: n
|
|
274
274
|
})
|
|
@@ -276,15 +276,15 @@ function Q({ title: e, rows: t = [], note: n }) {
|
|
|
276
276
|
}
|
|
277
277
|
// src/components/Charts/BarList.tsx
|
|
278
278
|
function Se({ href: e, className: t, title: n, children: r }) {
|
|
279
|
-
return /* @__PURE__ */
|
|
279
|
+
return /* @__PURE__ */ J("a", {
|
|
280
280
|
href: e,
|
|
281
281
|
className: t,
|
|
282
282
|
title: n,
|
|
283
283
|
children: r
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
|
-
function Ce({ data: e, series: t, ariaLabel: n, title: r, linkAs: i = Se, compact:
|
|
287
|
-
let { nf: p, L: m } =
|
|
286
|
+
function Ce({ data: e, series: t, ariaLabel: n, title: r, linkAs: i = Se, compact: a = !1, onSelect: o, selected: u = null, ...d }) {
|
|
287
|
+
let { nf: p, L: m } = x(d), h = (t) => !!o && !e[t]?.href && e[t]?.selectable !== !1, g = Q({
|
|
288
288
|
count: e.length,
|
|
289
289
|
pick: (e, t, n, r) => de(t, xe(r).map((e) => e ? {
|
|
290
290
|
start: e.top,
|
|
@@ -297,94 +297,94 @@ function Ce({ data: e, series: t, ariaLabel: n, title: r, linkAs: i = Se, compac
|
|
|
297
297
|
ArrowLeft: 0,
|
|
298
298
|
ArrowRight: 0
|
|
299
299
|
},
|
|
300
|
-
start: u === null ? null : e.findIndex((e) =>
|
|
301
|
-
onPick:
|
|
300
|
+
start: u === null ? null : e.findIndex((e) => U(e) === u),
|
|
301
|
+
onPick: o ? (t) => h(t) && o(e[t]) : void 0,
|
|
302
302
|
focusable: (t) => !e[t]?.href
|
|
303
|
-
}),
|
|
304
|
-
if (
|
|
303
|
+
}), _ = e.map((e) => re(e, t));
|
|
304
|
+
if (_.every((e) => e === 0)) return /* @__PURE__ */ J(l, {
|
|
305
305
|
title: r,
|
|
306
|
-
children: /* @__PURE__ */
|
|
306
|
+
children: /* @__PURE__ */ J(v, {
|
|
307
307
|
ariaLabel: n,
|
|
308
308
|
text: m.empty,
|
|
309
|
-
compact:
|
|
309
|
+
compact: a
|
|
310
310
|
})
|
|
311
311
|
});
|
|
312
|
-
let y =
|
|
313
|
-
return /* @__PURE__ */
|
|
312
|
+
let y = P(_), b = _.reduce((e, t) => e + t, 0), S = g.active, C = S === null ? u : U(e[S]), w = S === null ? null : e[S], T = (e, t) => `${e.fullLabel ?? e.label}: ${p(_[t])}`;
|
|
313
|
+
return /* @__PURE__ */ Y(l, {
|
|
314
314
|
title: r,
|
|
315
315
|
children: [
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
className:
|
|
318
|
-
role:
|
|
319
|
-
"aria-label": !
|
|
316
|
+
/* @__PURE__ */ J("div", {
|
|
317
|
+
className: z(`chart-bars chart-plot chart-plot--rows${o ? " chart-plot--pick" : ""}`, a),
|
|
318
|
+
role: o ? "group" : "img",
|
|
319
|
+
"aria-label": !o && w ? T(w, S) : n,
|
|
320
320
|
...g.plotProps,
|
|
321
321
|
children: e.map((e, n) => {
|
|
322
|
-
let r =
|
|
323
|
-
return /* @__PURE__ */
|
|
322
|
+
let r = U(e), a = e.fullLabel ?? e.label, o = g.pickable && !e.href;
|
|
323
|
+
return /* @__PURE__ */ Y("div", {
|
|
324
324
|
...g.item(n, {
|
|
325
325
|
pressed: u === r,
|
|
326
326
|
disabled: !h(n)
|
|
327
327
|
}),
|
|
328
|
-
"aria-label": o ? `${e.label}: ${p(
|
|
328
|
+
"aria-label": o ? `${e.label}: ${p(_[n])}` : void 0,
|
|
329
329
|
"aria-description": o && a !== e.label ? a : void 0,
|
|
330
330
|
className: `chart-bars-item${n === S ? " chart-bars-item--active" : ""}${u === r ? " chart-bars-item--on" : ""}`,
|
|
331
331
|
children: [
|
|
332
|
-
e.href ? /* @__PURE__ */
|
|
332
|
+
e.href ? /* @__PURE__ */ J(i, {
|
|
333
333
|
href: e.href,
|
|
334
334
|
className: "chart-bars-label chart-bars-link",
|
|
335
335
|
title: a,
|
|
336
336
|
children: e.label
|
|
337
|
-
}) : /* @__PURE__ */
|
|
337
|
+
}) : /* @__PURE__ */ J("span", {
|
|
338
338
|
className: "chart-bars-label",
|
|
339
339
|
title: a,
|
|
340
340
|
children: e.label
|
|
341
341
|
}),
|
|
342
342
|
" ",
|
|
343
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ J("span", {
|
|
344
344
|
className: `chart-bars-bar${C !== null && C !== r ? " chart-faded" : ""}`,
|
|
345
345
|
"aria-hidden": !0,
|
|
346
346
|
children: t.map((n, r) => {
|
|
347
347
|
let i = e.values[n.key] ?? 0;
|
|
348
348
|
if (!i) return null;
|
|
349
349
|
let a = t.slice(r + 1).every((t) => !(e.values[t.key] ?? 0));
|
|
350
|
-
return /* @__PURE__ */
|
|
350
|
+
return /* @__PURE__ */ J("span", {
|
|
351
351
|
className: `chart-bars-segment${a ? " chart-bars-segment--end" : ""}`,
|
|
352
352
|
style: {
|
|
353
353
|
width: `${i / y * 100}%`,
|
|
354
|
-
background:
|
|
354
|
+
background: L(t.length === 1 && e.slot ? e.slot : n.slot)
|
|
355
355
|
}
|
|
356
356
|
}, n.key);
|
|
357
357
|
})
|
|
358
358
|
}),
|
|
359
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ J("span", {
|
|
360
360
|
className: "chart-bars-value",
|
|
361
|
-
children: p(
|
|
361
|
+
children: p(_[n])
|
|
362
362
|
})
|
|
363
363
|
]
|
|
364
364
|
}, r);
|
|
365
365
|
})
|
|
366
366
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
g.tooltip(w && /* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ J(s, { text: w ? T(w, S) : "" }),
|
|
368
|
+
g.tooltip(w && /* @__PURE__ */ J($, {
|
|
369
369
|
title: w.fullLabel ?? w.label,
|
|
370
370
|
rows: t.map((e) => ({
|
|
371
371
|
key: e.key,
|
|
372
|
-
color:
|
|
372
|
+
color: L(t.length === 1 && w.slot ? w.slot : e.slot),
|
|
373
373
|
label: e.label,
|
|
374
374
|
value: p(w.values[e.key] ?? 0)
|
|
375
375
|
})),
|
|
376
|
-
note: m.shareOf(
|
|
376
|
+
note: m.shareOf(c(f(_[S], b)), p(b))
|
|
377
377
|
}))
|
|
378
378
|
]
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
// src/components/Charts/useBoxSize.ts
|
|
382
382
|
function we() {
|
|
383
|
-
let [e, t] =
|
|
383
|
+
let [e, t] = q(null), [n, r] = q({
|
|
384
384
|
width: 0,
|
|
385
385
|
height: 0
|
|
386
386
|
});
|
|
387
|
-
return
|
|
387
|
+
return G(() => {
|
|
388
388
|
if (!e) return;
|
|
389
389
|
let t = () => {
|
|
390
390
|
let t = e.getBoundingClientRect();
|
|
@@ -396,14 +396,14 @@ function we() {
|
|
|
396
396
|
if (t(), typeof ResizeObserver > "u") return;
|
|
397
397
|
let n = new ResizeObserver(t);
|
|
398
398
|
return n.observe(e), () => n.disconnect();
|
|
399
|
-
}, [e]), [
|
|
399
|
+
}, [e]), [W((e) => t(e), []), n];
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function Te() {
|
|
402
402
|
let [e, t] = we();
|
|
403
403
|
return [e, t.width];
|
|
404
404
|
}
|
|
405
405
|
// src/components/Charts/CalendarHeatmap.tsx
|
|
406
|
-
function
|
|
406
|
+
function Ee(e) {
|
|
407
407
|
let t = (t) => {
|
|
408
408
|
try {
|
|
409
409
|
return new Intl.DateTimeFormat(e, {
|
|
@@ -423,15 +423,15 @@ function Te(e) {
|
|
|
423
423
|
weekday: t({ weekday: "short" })
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
var
|
|
427
|
-
function
|
|
428
|
-
let { nf:
|
|
429
|
-
count:
|
|
430
|
-
pick: (e, t) => fe(e, t,
|
|
431
|
-
left:
|
|
432
|
-
top: e.weekday *
|
|
433
|
-
width:
|
|
434
|
-
height:
|
|
426
|
+
var De = (e) => Array.from({ length: 7 }, (t, n) => Ee(e).weekday.format(Date.UTC(2024, 0, 1 + n)));
|
|
427
|
+
function Oe({ days: e, ariaLabel: t, title: r, onSelect: i, selected: a = null, compact: o = !1, ...c }) {
|
|
428
|
+
let { nf: u, L: d } = x(c), f = n().locale, p = c.locale ?? f, m = oe(() => Ee(p), [p]), h = oe(() => De(p), [p]), g = oe(() => E(e), [e]), [_, y] = Te(), [b, S] = X(), w = ee(y, g.weeks, o ? H.compactMax : H.max, S), O = w.cell + w.gap, k = w.weekdays ? F(S) : 0, A = a === null ? -1 : g.cells.findIndex((e) => e.day === a), j = Q({
|
|
429
|
+
count: g.cells.length,
|
|
430
|
+
pick: (e, t) => fe(e, t, g.cells.map((e) => ({
|
|
431
|
+
left: k + e.week * O,
|
|
432
|
+
top: e.weekday * O,
|
|
433
|
+
width: w.cell,
|
|
434
|
+
height: w.cell
|
|
435
435
|
}))),
|
|
436
436
|
keys: {
|
|
437
437
|
ArrowLeft: -7,
|
|
@@ -439,56 +439,56 @@ function De({ days: e, ariaLabel: t, title: n, onSelect: r, selected: i = null,
|
|
|
439
439
|
ArrowUp: -1,
|
|
440
440
|
ArrowDown: 1
|
|
441
441
|
},
|
|
442
|
-
start:
|
|
443
|
-
onPick:
|
|
444
|
-
day:
|
|
445
|
-
count:
|
|
442
|
+
start: A >= 0 ? A : null,
|
|
443
|
+
onPick: i ? (e) => i({
|
|
444
|
+
day: g.cells[e].day,
|
|
445
|
+
count: g.cells[e].count
|
|
446
446
|
}) : void 0
|
|
447
447
|
});
|
|
448
|
-
if (!
|
|
449
|
-
title:
|
|
450
|
-
children: /* @__PURE__ */
|
|
448
|
+
if (!g.cells.length || g.total === 0) return /* @__PURE__ */ J(l, {
|
|
449
|
+
title: r,
|
|
450
|
+
children: /* @__PURE__ */ J(v, {
|
|
451
451
|
ariaLabel: t,
|
|
452
|
-
text:
|
|
452
|
+
text: d.empty,
|
|
453
453
|
compact: o
|
|
454
454
|
})
|
|
455
455
|
});
|
|
456
|
-
let
|
|
457
|
-
return /* @__PURE__ */
|
|
458
|
-
title:
|
|
459
|
-
children: /* @__PURE__ */
|
|
460
|
-
ref:
|
|
461
|
-
className:
|
|
456
|
+
let M = (e) => `${m.day.format(C(e.day))}: ${u(e.count)}`, N = j.active, P = N === null ? null : g.cells[N] ?? null, I = `${w.weekdays ? `${k}px ` : ""}repeat(${g.weeks}, ${w.cell}px)`, L = w.weekdays ? 2 : 1;
|
|
457
|
+
return /* @__PURE__ */ J(l, {
|
|
458
|
+
title: r,
|
|
459
|
+
children: /* @__PURE__ */ Y("div", {
|
|
460
|
+
ref: _,
|
|
461
|
+
className: z("chart-calendar", o),
|
|
462
462
|
role: "group",
|
|
463
|
-
"aria-label": `${t}: ${
|
|
463
|
+
"aria-label": `${t}: ${d.total} ${u(g.total)}`,
|
|
464
464
|
children: [
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
ref:
|
|
465
|
+
/* @__PURE__ */ J("div", {
|
|
466
|
+
ref: b,
|
|
467
467
|
className: "chart-calendar-months",
|
|
468
468
|
style: {
|
|
469
|
-
gridTemplateColumns:
|
|
470
|
-
columnGap:
|
|
469
|
+
gridTemplateColumns: I,
|
|
470
|
+
columnGap: w.gap
|
|
471
471
|
},
|
|
472
472
|
"aria-hidden": !0,
|
|
473
|
-
children:
|
|
473
|
+
children: D(g.months, O, S).map((e) => /* @__PURE__ */ J("span", {
|
|
474
474
|
style: {
|
|
475
475
|
gridRow: 1,
|
|
476
|
-
gridColumn: `${e.week +
|
|
476
|
+
gridColumn: `${e.week + L} / span ${Math.max(1, Math.ceil(R(S) / O))}`
|
|
477
477
|
},
|
|
478
|
-
children:
|
|
478
|
+
children: m.month.format(C(`${e.month}-01`))
|
|
479
479
|
}, e.month))
|
|
480
480
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
482
|
-
className: `chart-calendar-grid chart-plot${
|
|
481
|
+
/* @__PURE__ */ Y("div", {
|
|
482
|
+
className: `chart-calendar-grid chart-plot${i ? " chart-plot--pick" : ""}`,
|
|
483
483
|
style: {
|
|
484
|
-
gridTemplateColumns:
|
|
485
|
-
gridTemplateRows: `repeat(7, ${
|
|
486
|
-
gap:
|
|
484
|
+
gridTemplateColumns: I,
|
|
485
|
+
gridTemplateRows: `repeat(7, ${w.cell}px)`,
|
|
486
|
+
gap: w.gap
|
|
487
487
|
},
|
|
488
|
-
role:
|
|
489
|
-
"aria-label":
|
|
490
|
-
...
|
|
491
|
-
children: [
|
|
488
|
+
role: i ? void 0 : "img",
|
|
489
|
+
"aria-label": i ? void 0 : P ? M(P) : t,
|
|
490
|
+
...j.plotProps,
|
|
491
|
+
children: [w.weekdays && h.map((e, t) => /* @__PURE__ */ J("span", {
|
|
492
492
|
className: "chart-calendar-weekday",
|
|
493
493
|
style: {
|
|
494
494
|
gridRow: t + 1,
|
|
@@ -496,40 +496,40 @@ function De({ days: e, ariaLabel: t, title: n, onSelect: r, selected: i = null,
|
|
|
496
496
|
},
|
|
497
497
|
"aria-hidden": !0,
|
|
498
498
|
children: t % 2 == 0 ? e : ""
|
|
499
|
-
}, e)),
|
|
500
|
-
...
|
|
501
|
-
"aria-label":
|
|
502
|
-
className: `chart-calendar-day${t ===
|
|
499
|
+
}, e)), g.cells.map((e, t) => /* @__PURE__ */ J("span", {
|
|
500
|
+
...j.item(t, { pressed: t === A }),
|
|
501
|
+
"aria-label": j.pickable ? M(e) : void 0,
|
|
502
|
+
className: `chart-calendar-day${t === A ? " chart-calendar-day--on" : ""}${t === N ? " chart-calendar-day--active" : ""}${A >= 0 && t !== A ? " chart-calendar-day--faded" : ""}`,
|
|
503
503
|
style: {
|
|
504
504
|
gridRow: e.weekday + 1,
|
|
505
|
-
gridColumn: e.week +
|
|
506
|
-
background:
|
|
507
|
-
borderRadius:
|
|
505
|
+
gridColumn: e.week + L,
|
|
506
|
+
background: T(e.level),
|
|
507
|
+
borderRadius: w.cell < 8 ? 1 : 2
|
|
508
508
|
},
|
|
509
509
|
"data-level": e.level,
|
|
510
|
-
"aria-hidden": !
|
|
510
|
+
"aria-hidden": !j.pickable || void 0
|
|
511
511
|
}, e.day))]
|
|
512
512
|
}),
|
|
513
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ Y("div", {
|
|
514
514
|
className: "chart-calendar-legend",
|
|
515
515
|
"aria-hidden": !0,
|
|
516
516
|
children: [
|
|
517
|
-
/* @__PURE__ */
|
|
518
|
-
Array.from({ length: 5 }, (e, t) => /* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ J("span", { children: d.less }),
|
|
518
|
+
Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ J("span", {
|
|
519
519
|
className: "chart-calendar-swatch",
|
|
520
|
-
style: { background:
|
|
520
|
+
style: { background: T(t) }
|
|
521
521
|
}, t)),
|
|
522
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ J("span", { children: d.more })
|
|
523
523
|
]
|
|
524
524
|
}),
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
|
|
527
|
-
title:
|
|
525
|
+
/* @__PURE__ */ J(s, { text: P ? M(P) : "" }),
|
|
526
|
+
j.tooltip(P && /* @__PURE__ */ J($, {
|
|
527
|
+
title: m.day.format(C(P.day)),
|
|
528
528
|
rows: [{
|
|
529
529
|
key: "n",
|
|
530
|
-
color:
|
|
530
|
+
color: T(Math.max(1, P.level)),
|
|
531
531
|
label: t,
|
|
532
|
-
value:
|
|
532
|
+
value: u(P.count)
|
|
533
533
|
}]
|
|
534
534
|
}))
|
|
535
535
|
]
|
|
@@ -537,33 +537,33 @@ function De({ days: e, ariaLabel: t, title: n, onSelect: r, selected: i = null,
|
|
|
537
537
|
});
|
|
538
538
|
}
|
|
539
539
|
// src/components/Charts/Legend.tsx
|
|
540
|
-
function
|
|
541
|
-
let { L: n } =
|
|
542
|
-
return e.length < 2 ? null : /* @__PURE__ */
|
|
543
|
-
className:
|
|
540
|
+
function ke({ series: e, labels: t }) {
|
|
541
|
+
let { L: n } = x({ labels: t });
|
|
542
|
+
return e.length < 2 ? null : /* @__PURE__ */ J("ul", {
|
|
543
|
+
className: z("chart-legend"),
|
|
544
544
|
"aria-label": n.legend,
|
|
545
|
-
children: e.map((e) => /* @__PURE__ */
|
|
545
|
+
children: e.map((e) => /* @__PURE__ */ Y("li", {
|
|
546
546
|
className: "chart-legend-item",
|
|
547
|
-
children: [/* @__PURE__ */
|
|
547
|
+
children: [/* @__PURE__ */ J("span", {
|
|
548
548
|
className: "chart-swatch",
|
|
549
|
-
style: { background:
|
|
549
|
+
style: { background: L(e.slot) },
|
|
550
550
|
"aria-hidden": !0
|
|
551
551
|
}), e.label]
|
|
552
552
|
}, e.key))
|
|
553
553
|
});
|
|
554
554
|
}
|
|
555
555
|
// src/components/Charts/ColumnChart.tsx
|
|
556
|
-
var
|
|
557
|
-
function
|
|
558
|
-
let { nf: m, L: h } =
|
|
559
|
-
count:
|
|
560
|
-
pick: (e, t, n) => ue(e, n.width,
|
|
556
|
+
var Ae = 6, je = 2, Me = 6, Ne = 44;
|
|
557
|
+
function Pe({ data: e, series: t, ariaLabel: n, title: r, height: a, compact: o = !1, mode: c = "stacked", legend: u = !1, onSelect: d, selected: f = null, ...p }) {
|
|
558
|
+
let { nf: m, L: h } = x(p), [g, _] = Te(), [y, b] = X(), C = e.length, T = (t) => !!d && e[t]?.selectable !== !1, E = Q({
|
|
559
|
+
count: C,
|
|
560
|
+
pick: (e, t, n) => ue(e, n.width, C),
|
|
561
561
|
anchor: (e, t) => {
|
|
562
562
|
let n = t.getBoundingClientRect();
|
|
563
563
|
return {
|
|
564
|
-
left: n.left + n.width * e /
|
|
564
|
+
left: n.left + n.width * e / C,
|
|
565
565
|
top: n.top,
|
|
566
|
-
width: n.width /
|
|
566
|
+
width: n.width / C,
|
|
567
567
|
height: n.height
|
|
568
568
|
};
|
|
569
569
|
},
|
|
@@ -571,77 +571,77 @@ function Ne({ data: e, series: t, ariaLabel: n, title: i, height: o, compact: c
|
|
|
571
571
|
ArrowUp: 0,
|
|
572
572
|
ArrowDown: 0
|
|
573
573
|
},
|
|
574
|
-
start: f === null ? null : e.findIndex((e) =>
|
|
574
|
+
start: f === null ? null : e.findIndex((e) => U(e) === f),
|
|
575
575
|
onPick: d ? (t) => T(t) && d(e[t]) : void 0
|
|
576
576
|
}), D = e.map((e) => re(e, t));
|
|
577
|
-
if (D.every((e) => e === 0)) return /* @__PURE__ */
|
|
578
|
-
title:
|
|
579
|
-
children: /* @__PURE__ */
|
|
577
|
+
if (D.every((e) => e === 0)) return /* @__PURE__ */ J(l, {
|
|
578
|
+
title: r,
|
|
579
|
+
children: /* @__PURE__ */ J(v, {
|
|
580
580
|
ariaLabel: n,
|
|
581
581
|
text: h.empty,
|
|
582
|
-
compact:
|
|
582
|
+
compact: o
|
|
583
583
|
})
|
|
584
584
|
});
|
|
585
|
-
let
|
|
586
|
-
return /* @__PURE__ */
|
|
587
|
-
title:
|
|
588
|
-
children: /* @__PURE__ */
|
|
585
|
+
let O = (a ?? (o ? 96 : 220)) * b, A = c === "grouped" && t.length > 1, { max: j, ticks: M } = k(S(e, t, A ? "grouped" : "stacked")), N = A ? i(t.length, 100, Ae) : [], P = E.active, F = (P === null ? null : U(e[P])) ?? f, I = _ && _ / Math.max(1, C) < Me ? 0 : je, R = new Set(w(C, Math.max(2, Math.min(12, Math.floor((_ || 600) / (Ne * b)))))), B = (e, n) => `${e.fullLabel ?? e.label}: ${t.length > 1 ? t.map((t) => `${t.label} ${m(e.values[t.key] ?? 0)}`).join(", ") : m(D[n])}`, V = P === null ? null : e[P];
|
|
586
|
+
return /* @__PURE__ */ J(l, {
|
|
587
|
+
title: r,
|
|
588
|
+
children: /* @__PURE__ */ Y("div", {
|
|
589
589
|
ref: g,
|
|
590
|
-
className:
|
|
590
|
+
className: z(`chart-columns${A ? " chart-columns--grouped" : ""}`, o),
|
|
591
591
|
role: "group",
|
|
592
592
|
"aria-label": n,
|
|
593
593
|
children: [
|
|
594
|
-
/* @__PURE__ */
|
|
594
|
+
/* @__PURE__ */ Y("div", {
|
|
595
595
|
className: "chart-columns-plot",
|
|
596
|
-
style: { height:
|
|
597
|
-
children: [!
|
|
596
|
+
style: { height: O },
|
|
597
|
+
children: [!o && /* @__PURE__ */ J("div", {
|
|
598
598
|
className: "chart-axis-y",
|
|
599
599
|
"aria-hidden": !0,
|
|
600
|
-
children: [...M].reverse().map((e) => /* @__PURE__ */
|
|
601
|
-
}), /* @__PURE__ */
|
|
600
|
+
children: [...M].reverse().map((e) => /* @__PURE__ */ J("span", { children: m(e) }, e))
|
|
601
|
+
}), /* @__PURE__ */ Y("div", {
|
|
602
602
|
className: `chart-columns-area chart-plot chart-plot--x${d ? " chart-plot--pick" : ""}`,
|
|
603
603
|
role: d ? void 0 : "img",
|
|
604
604
|
"aria-label": d ? void 0 : V ? B(V, P) : n,
|
|
605
605
|
...E.plotProps,
|
|
606
|
-
children: [!
|
|
606
|
+
children: [!o && M.slice(1).map((e) => /* @__PURE__ */ J("div", {
|
|
607
607
|
className: "chart-gridline",
|
|
608
608
|
style: { bottom: `${e / j * 100}%` },
|
|
609
609
|
"aria-hidden": !0
|
|
610
|
-
}, e)), /* @__PURE__ */
|
|
610
|
+
}, e)), /* @__PURE__ */ J("div", {
|
|
611
611
|
className: "chart-columns-bars",
|
|
612
|
-
style: { gap:
|
|
612
|
+
style: { gap: I },
|
|
613
613
|
"aria-hidden": !E.pickable || void 0,
|
|
614
614
|
children: e.map((e, n) => {
|
|
615
|
-
let r =
|
|
616
|
-
return /* @__PURE__ */
|
|
615
|
+
let r = U(e), i = F !== null && F !== r ? " chart-faded" : "";
|
|
616
|
+
return /* @__PURE__ */ J("div", {
|
|
617
617
|
...E.item(n, {
|
|
618
618
|
pressed: f === r,
|
|
619
619
|
disabled: !T(n)
|
|
620
620
|
}),
|
|
621
621
|
"aria-label": E.pickable ? B(e, n) : void 0,
|
|
622
622
|
className: `chart-column${n === P ? " chart-column--active" : ""}${f === r ? " chart-column--on" : ""}`,
|
|
623
|
-
children: A ? /* @__PURE__ */
|
|
623
|
+
children: A ? /* @__PURE__ */ J("span", {
|
|
624
624
|
className: `chart-column-group${i}`,
|
|
625
|
-
children: t.map((t, n) => /* @__PURE__ */
|
|
625
|
+
children: t.map((t, n) => /* @__PURE__ */ J("span", {
|
|
626
626
|
className: "chart-column-segment chart-column-segment--top chart-column-bar",
|
|
627
627
|
style: {
|
|
628
628
|
left: `${N[n].x}%`,
|
|
629
629
|
width: `${N[n].width}%`,
|
|
630
|
-
height: `${(e.values[t.key] ?? 0) / j *
|
|
631
|
-
background:
|
|
630
|
+
height: `${(e.values[t.key] ?? 0) / j * O}px`,
|
|
631
|
+
background: L(t.slot)
|
|
632
632
|
}
|
|
633
633
|
}, t.key))
|
|
634
|
-
}) : /* @__PURE__ */
|
|
634
|
+
}) : /* @__PURE__ */ J("span", {
|
|
635
635
|
className: `chart-column-stack${i}`,
|
|
636
636
|
children: t.map((n, r) => {
|
|
637
637
|
let i = e.values[n.key] ?? 0;
|
|
638
638
|
if (!i) return null;
|
|
639
639
|
let a = t.slice(r + 1).every((t) => !(e.values[t.key] ?? 0));
|
|
640
|
-
return /* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ J("span", {
|
|
641
641
|
className: `chart-column-segment${a ? " chart-column-segment--top" : ""}`,
|
|
642
642
|
style: {
|
|
643
|
-
height: `${i / j *
|
|
644
|
-
background:
|
|
643
|
+
height: `${i / j * O}px`,
|
|
644
|
+
background: L(n.slot)
|
|
645
645
|
}
|
|
646
646
|
}, n.key);
|
|
647
647
|
})
|
|
@@ -651,29 +651,29 @@ function Ne({ data: e, series: t, ariaLabel: n, title: i, height: o, compact: c
|
|
|
651
651
|
})]
|
|
652
652
|
})]
|
|
653
653
|
}),
|
|
654
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ J("div", {
|
|
655
655
|
ref: y,
|
|
656
|
-
className: `chart-axis-x${
|
|
657
|
-
style: { gap:
|
|
656
|
+
className: `chart-axis-x${o ? " chart-axis-x--compact" : ""}`,
|
|
657
|
+
style: { gap: I },
|
|
658
658
|
"aria-hidden": !0,
|
|
659
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
660
|
-
className: f !== null && f !==
|
|
661
|
-
children:
|
|
662
|
-
},
|
|
659
|
+
children: e.map((e, t) => /* @__PURE__ */ J("span", {
|
|
660
|
+
className: f !== null && f !== U(e) ? "chart-faded" : void 0,
|
|
661
|
+
children: R.has(t) ? e.label : ""
|
|
662
|
+
}, U(e)))
|
|
663
663
|
}),
|
|
664
|
-
u && /* @__PURE__ */
|
|
664
|
+
u && /* @__PURE__ */ J("div", {
|
|
665
665
|
className: "chart-columns-legend",
|
|
666
|
-
children: /* @__PURE__ */
|
|
666
|
+
children: /* @__PURE__ */ J(ke, {
|
|
667
667
|
series: t,
|
|
668
668
|
labels: p.labels
|
|
669
669
|
})
|
|
670
670
|
}),
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
E.tooltip(V && /* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ J(s, { text: V ? B(V, P) : "" }),
|
|
672
|
+
E.tooltip(V && /* @__PURE__ */ J($, {
|
|
673
673
|
title: V.fullLabel ?? V.label,
|
|
674
674
|
rows: t.map((e) => ({
|
|
675
675
|
key: e.key,
|
|
676
|
-
color:
|
|
676
|
+
color: L(e.slot),
|
|
677
677
|
label: e.label,
|
|
678
678
|
value: m(V.values[e.key] ?? 0)
|
|
679
679
|
})),
|
|
@@ -684,9 +684,9 @@ function Ne({ data: e, series: t, ariaLabel: n, title: i, height: o, compact: c
|
|
|
684
684
|
});
|
|
685
685
|
}
|
|
686
686
|
// src/components/Charts/useLegendFit.ts
|
|
687
|
-
function
|
|
688
|
-
let [n, r] =
|
|
689
|
-
return
|
|
687
|
+
function Fe(e, t) {
|
|
688
|
+
let [n, r] = q(null), [i, a] = q(e), [o, s] = q(e);
|
|
689
|
+
return G(() => {
|
|
690
690
|
if (!t || !n) {
|
|
691
691
|
a(e), s(e);
|
|
692
692
|
return;
|
|
@@ -713,36 +713,36 @@ function Pe(e, t) {
|
|
|
713
713
|
e,
|
|
714
714
|
t
|
|
715
715
|
]), [
|
|
716
|
-
|
|
716
|
+
W((e) => r(e), []),
|
|
717
717
|
t ? i : e,
|
|
718
718
|
t ? o : e
|
|
719
719
|
];
|
|
720
720
|
}
|
|
721
721
|
// src/components/Charts/Donut.tsx
|
|
722
|
-
var
|
|
723
|
-
function
|
|
724
|
-
let { nf: _, L: v } =
|
|
725
|
-
ae(() =>
|
|
726
|
-
|
|
722
|
+
var Ie = 2.5;
|
|
723
|
+
function Le({ slices: n, ariaLabel: r, title: i, size: a, compact: o = !1, variant: l = "donut", onLegendCut: u, legend: p = !0, onSelect: m, selected: h = null, ...g }) {
|
|
724
|
+
let { nf: _, L: v } = x(g), [y, b] = q(null), [S, C, w] = Fe(n.length, o);
|
|
725
|
+
ae(() => u?.(n.length - w), [
|
|
726
|
+
u,
|
|
727
727
|
n.length,
|
|
728
728
|
w
|
|
729
729
|
]);
|
|
730
|
-
let [T, E] =
|
|
730
|
+
let [T, E] = X(), D = (a ?? (o ? 112 : 168)) * E, O = n.reduce((e, t) => e + t.value, 0), k = l === "pie", A = k ? e(n).map((e) => ({
|
|
731
731
|
slice: e.slice,
|
|
732
732
|
a0: e.a0,
|
|
733
733
|
a1: e.a1
|
|
734
734
|
})) : t(n).map((e) => ({
|
|
735
735
|
slice: e.slice,
|
|
736
|
-
a0: e.start /
|
|
737
|
-
a1: (e.start + e.length) /
|
|
738
|
-
})), j = (e) => !!m && n[e].value > 0 && n[e].selectable !== !1, M =
|
|
736
|
+
a0: e.start / B * 2 * Math.PI,
|
|
737
|
+
a1: (e.start + e.length) / B * 2 * Math.PI
|
|
738
|
+
})), j = (e) => !!m && n[e].value > 0 && n[e].selectable !== !1, M = Q({
|
|
739
739
|
count: n.length,
|
|
740
740
|
pick: (e, t, r) => {
|
|
741
741
|
let i = r.width / 100, a = 48 * i, o = k ? 0 : 32 * i, s = he(e - r.width / 2, t - r.height / 2, a, o, A);
|
|
742
742
|
return s === null || s === -1 ? s : n.indexOf(A[s].slice);
|
|
743
743
|
},
|
|
744
744
|
anchor: (e, t) => {
|
|
745
|
-
let r = t.getBoundingClientRect(), i = A.find((t) => t.slice === n[e]), a = i ?
|
|
745
|
+
let r = t.getBoundingClientRect(), i = A.find((t) => t.slice === n[e]), a = i ? d(r.left + r.width / 2, r.top + r.height / 2, r.width / 100 * (k ? 36 : 40), (i.a0 + i.a1) / 2) : {
|
|
746
746
|
x: r.left + r.width / 2,
|
|
747
747
|
y: r.top + r.height / 2
|
|
748
748
|
};
|
|
@@ -765,54 +765,54 @@ function Ie({ slices: n, ariaLabel: r, title: i, size: s, compact: c = !1, varia
|
|
|
765
765
|
}),
|
|
766
766
|
"aria-label": M.pickable ? F(e) : void 0
|
|
767
767
|
};
|
|
768
|
-
}, P = (e) =>
|
|
769
|
-
return /* @__PURE__ */
|
|
768
|
+
}, P = (e) => f(e, O), F = (e) => `${e.label} ${_(e.value)} (${c(P(e.value))})`, I = M.active === -1, R = M.active !== null && M.active >= 0 ? n[M.active] : void 0, V = R?.key ?? y ?? h, H = n.find((e) => e.key === V) ?? n[0], ee = (e) => V !== null && V !== e ? .55 : 1, U = k ? e(n) : [];
|
|
769
|
+
return /* @__PURE__ */ Y("figure", {
|
|
770
770
|
ref: T,
|
|
771
|
-
className:
|
|
771
|
+
className: z(k ? "chart-donut chart-pie" : "chart-donut", o),
|
|
772
772
|
"aria-label": r,
|
|
773
773
|
children: [
|
|
774
|
-
i && /* @__PURE__ */
|
|
774
|
+
i && /* @__PURE__ */ J("figcaption", {
|
|
775
775
|
className: "chart-donut-title",
|
|
776
776
|
children: i
|
|
777
777
|
}),
|
|
778
|
-
/* @__PURE__ */
|
|
778
|
+
/* @__PURE__ */ Y("div", {
|
|
779
779
|
className: `chart-donut-ring chart-plot${m ? " chart-plot--pick" : ""}`,
|
|
780
780
|
style: {
|
|
781
781
|
width: D,
|
|
782
782
|
height: D
|
|
783
783
|
},
|
|
784
784
|
role: m ? void 0 : "img",
|
|
785
|
-
"aria-label": m ? void 0 :
|
|
785
|
+
"aria-label": m ? void 0 : R ? F(R) : `${r}: ${n.map(F).join(", ")}`,
|
|
786
786
|
...M.plotProps,
|
|
787
|
-
children: [/* @__PURE__ */
|
|
787
|
+
children: [/* @__PURE__ */ J("svg", {
|
|
788
788
|
viewBox: "0 0 100 100",
|
|
789
789
|
width: D,
|
|
790
790
|
height: D,
|
|
791
791
|
className: "chart-donut-svg",
|
|
792
792
|
overflow: "visible",
|
|
793
793
|
"aria-hidden": !M.pickable || void 0,
|
|
794
|
-
children: k ? O === 0 ? /* @__PURE__ */
|
|
794
|
+
children: k ? O === 0 ? /* @__PURE__ */ J("circle", {
|
|
795
795
|
cx: "50",
|
|
796
796
|
cy: "50",
|
|
797
797
|
r: 48,
|
|
798
|
-
fill:
|
|
798
|
+
fill: L("rest"),
|
|
799
799
|
opacity: .5,
|
|
800
800
|
"aria-hidden": !0
|
|
801
|
-
}) :
|
|
802
|
-
let t = e.slice, n = V === t.key &&
|
|
803
|
-
return /* @__PURE__ */
|
|
801
|
+
}) : U.map((e) => {
|
|
802
|
+
let t = e.slice, n = V === t.key && U.length > 1 ? d(0, 0, Ie, (e.a0 + e.a1) / 2) : null;
|
|
803
|
+
return /* @__PURE__ */ Y("g", {
|
|
804
804
|
transform: n ? `translate(${n.x} ${n.y})` : void 0,
|
|
805
|
-
opacity:
|
|
805
|
+
opacity: ee(t.key),
|
|
806
806
|
className: "chart-pie-slice-group",
|
|
807
|
-
children: [/* @__PURE__ */
|
|
807
|
+
children: [/* @__PURE__ */ J("path", {
|
|
808
808
|
...N(t),
|
|
809
809
|
d: ie(50, 50, 48, e.a0, e.a1),
|
|
810
|
-
fill:
|
|
810
|
+
fill: L(t.slot),
|
|
811
811
|
stroke: "var(--chart-surface)",
|
|
812
|
-
strokeWidth: +(
|
|
812
|
+
strokeWidth: +(U.length > 1),
|
|
813
813
|
strokeLinejoin: "round",
|
|
814
814
|
className: "chart-donut-slice chart-pie-slice"
|
|
815
|
-
}), e.label && /* @__PURE__ */
|
|
815
|
+
}), e.label && /* @__PURE__ */ J("text", {
|
|
816
816
|
x: e.label.x,
|
|
817
817
|
y: e.label.y,
|
|
818
818
|
className: "chart-pie-share",
|
|
@@ -820,121 +820,121 @@ function Ie({ slices: n, ariaLabel: r, title: i, size: s, compact: c = !1, varia
|
|
|
820
820
|
textAnchor: "middle",
|
|
821
821
|
dominantBaseline: "central",
|
|
822
822
|
"aria-hidden": !0,
|
|
823
|
-
children:
|
|
823
|
+
children: c(e.share)
|
|
824
824
|
})]
|
|
825
825
|
}, t.key);
|
|
826
|
-
}) : /* @__PURE__ */
|
|
826
|
+
}) : /* @__PURE__ */ J("g", {
|
|
827
827
|
transform: "rotate(-90 50 50)",
|
|
828
|
-
children: O === 0 ? /* @__PURE__ */
|
|
828
|
+
children: O === 0 ? /* @__PURE__ */ J("circle", {
|
|
829
829
|
cx: "50",
|
|
830
830
|
cy: "50",
|
|
831
831
|
r: 40,
|
|
832
832
|
fill: "none",
|
|
833
|
-
stroke:
|
|
833
|
+
stroke: L("rest"),
|
|
834
834
|
strokeWidth: 16,
|
|
835
835
|
opacity: .5,
|
|
836
836
|
"aria-hidden": !0
|
|
837
|
-
}) : t(n).map(({ slice: e, start: t, length: n }) => /* @__PURE__ */
|
|
837
|
+
}) : t(n).map(({ slice: e, start: t, length: n }) => /* @__PURE__ */ J("circle", {
|
|
838
838
|
...N(e),
|
|
839
839
|
cx: "50",
|
|
840
840
|
cy: "50",
|
|
841
841
|
r: 40,
|
|
842
842
|
fill: "none",
|
|
843
|
-
stroke:
|
|
843
|
+
stroke: L(e.slot),
|
|
844
844
|
strokeWidth: V === e.key ? 18 : 16,
|
|
845
|
-
strokeDasharray: `${n} ${
|
|
845
|
+
strokeDasharray: `${n} ${B}`,
|
|
846
846
|
strokeDashoffset: -t,
|
|
847
847
|
className: "chart-donut-slice",
|
|
848
|
-
opacity:
|
|
848
|
+
opacity: I ? 1 : ee(e.key)
|
|
849
849
|
}, e.key))
|
|
850
850
|
})
|
|
851
|
-
}), k ? O === 0 && /* @__PURE__ */
|
|
851
|
+
}), k ? O === 0 && /* @__PURE__ */ J("div", {
|
|
852
852
|
className: "chart-donut-centre",
|
|
853
853
|
"aria-hidden": !0,
|
|
854
|
-
children: /* @__PURE__ */
|
|
854
|
+
children: /* @__PURE__ */ J("span", {
|
|
855
855
|
className: "chart-donut-empty",
|
|
856
856
|
children: v.empty
|
|
857
857
|
})
|
|
858
|
-
}) : /* @__PURE__ */
|
|
858
|
+
}) : /* @__PURE__ */ J("div", {
|
|
859
859
|
className: "chart-donut-centre",
|
|
860
860
|
"aria-hidden": !0,
|
|
861
|
-
children: O > 0 &&
|
|
861
|
+
children: O > 0 && I ? /* @__PURE__ */ Y(se, { children: [/* @__PURE__ */ J("span", {
|
|
862
862
|
className: "chart-donut-share",
|
|
863
863
|
children: _(O)
|
|
864
|
-
}), /* @__PURE__ */
|
|
864
|
+
}), /* @__PURE__ */ J("span", {
|
|
865
865
|
className: "chart-donut-share-label",
|
|
866
866
|
children: v.total.toLowerCase()
|
|
867
|
-
})] }) : O > 0 &&
|
|
867
|
+
})] }) : O > 0 && H ? /* @__PURE__ */ Y(se, { children: [/* @__PURE__ */ J("span", {
|
|
868
868
|
className: "chart-donut-share",
|
|
869
|
-
children:
|
|
870
|
-
}), /* @__PURE__ */
|
|
869
|
+
children: c(P(H.value))
|
|
870
|
+
}), /* @__PURE__ */ J("span", {
|
|
871
871
|
className: "chart-donut-share-label",
|
|
872
|
-
children:
|
|
873
|
-
})] }) : /* @__PURE__ */
|
|
872
|
+
children: H.label.toLowerCase()
|
|
873
|
+
})] }) : /* @__PURE__ */ J("span", {
|
|
874
874
|
className: "chart-donut-empty",
|
|
875
875
|
children: v.empty
|
|
876
876
|
})
|
|
877
877
|
})]
|
|
878
878
|
}),
|
|
879
|
-
p && /* @__PURE__ */
|
|
879
|
+
p && /* @__PURE__ */ Y("ul", {
|
|
880
880
|
ref: S,
|
|
881
881
|
className: "chart-donut-legend",
|
|
882
882
|
"aria-label": v.legend,
|
|
883
|
-
children: [n.slice(0, C).map((e, t) => /* @__PURE__ */
|
|
883
|
+
children: [n.slice(0, C).map((e, t) => /* @__PURE__ */ Y("li", {
|
|
884
884
|
className: `chart-donut-legend-item${j(t) ? " chart-donut-legend-item--hit" : ""}${h === e.key ? " chart-donut-legend-item--on" : ""}${h !== null && h !== e.key ? " chart-faded" : ""}`,
|
|
885
|
-
onMouseEnter: () =>
|
|
886
|
-
onMouseLeave: () =>
|
|
885
|
+
onMouseEnter: () => b(e.key),
|
|
886
|
+
onMouseLeave: () => b(null),
|
|
887
887
|
onClick: j(t) ? () => m(e) : void 0,
|
|
888
888
|
children: [
|
|
889
|
-
/* @__PURE__ */
|
|
889
|
+
/* @__PURE__ */ J("span", {
|
|
890
890
|
className: "chart-swatch",
|
|
891
|
-
style: { background:
|
|
891
|
+
style: { background: L(e.slot) },
|
|
892
892
|
"aria-hidden": !0
|
|
893
893
|
}),
|
|
894
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ J("span", {
|
|
895
895
|
className: "chart-donut-legend-label",
|
|
896
896
|
children: e.label
|
|
897
897
|
}),
|
|
898
|
-
/* @__PURE__ */
|
|
898
|
+
/* @__PURE__ */ Y("span", {
|
|
899
899
|
className: "chart-donut-legend-value",
|
|
900
900
|
children: [
|
|
901
901
|
_(e.value),
|
|
902
902
|
" · ",
|
|
903
|
-
|
|
903
|
+
c(P(e.value))
|
|
904
904
|
]
|
|
905
905
|
})
|
|
906
906
|
]
|
|
907
|
-
}, e.key)), C < n.length && /* @__PURE__ */
|
|
907
|
+
}, e.key)), C < n.length && /* @__PURE__ */ J("li", {
|
|
908
908
|
className: "chart-donut-legend-more",
|
|
909
909
|
"data-legend-more": "",
|
|
910
910
|
children: v.moreValues(_(n.length - C))
|
|
911
911
|
})]
|
|
912
912
|
}),
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
M.tooltip(
|
|
913
|
+
/* @__PURE__ */ J(s, { text: R ? F(R) : I ? `${v.total} ${_(O)}` : "" }),
|
|
914
|
+
M.tooltip(I ? /* @__PURE__ */ J($, {
|
|
915
915
|
title: r,
|
|
916
916
|
rows: n.map((e) => ({
|
|
917
917
|
key: e.key,
|
|
918
|
-
color:
|
|
918
|
+
color: L(e.slot),
|
|
919
919
|
label: e.label,
|
|
920
920
|
value: _(e.value)
|
|
921
921
|
})),
|
|
922
922
|
note: `${v.total}: ${_(O)}`
|
|
923
|
-
}) :
|
|
923
|
+
}) : R && /* @__PURE__ */ J($, {
|
|
924
924
|
rows: [{
|
|
925
|
-
key:
|
|
926
|
-
color:
|
|
927
|
-
label:
|
|
928
|
-
value: _(
|
|
925
|
+
key: R.key,
|
|
926
|
+
color: L(R.slot),
|
|
927
|
+
label: R.label,
|
|
928
|
+
value: _(R.value)
|
|
929
929
|
}],
|
|
930
|
-
note: v.shareOf(
|
|
930
|
+
note: v.shareOf(c(P(R.value)), _(O))
|
|
931
931
|
}))
|
|
932
932
|
]
|
|
933
933
|
});
|
|
934
934
|
}
|
|
935
935
|
// src/components/Charts/Funnel.tsx
|
|
936
|
-
function
|
|
937
|
-
let { nf: u, L: d } =
|
|
936
|
+
function Re({ steps: e, ariaLabel: t, title: n, compact: r = !1, onSelect: i, selected: a = null, ...o }) {
|
|
937
|
+
let { nf: u, L: d } = x(o), f = (t) => !!i && e[t].selectable !== !1, p = Q({
|
|
938
938
|
count: e.length,
|
|
939
939
|
pick: (e, t, n, r) => de(t, xe(r).map((e) => e ? {
|
|
940
940
|
start: e.top,
|
|
@@ -947,86 +947,86 @@ function Le({ steps: e, ariaLabel: t, title: n, compact: r = !1, onSelect: i, se
|
|
|
947
947
|
ArrowLeft: 0,
|
|
948
948
|
ArrowRight: 0
|
|
949
949
|
},
|
|
950
|
-
start:
|
|
950
|
+
start: a === null ? null : e.findIndex((e) => e.key === a),
|
|
951
951
|
onPick: i ? (t) => f(t) && i(e[t]) : void 0
|
|
952
952
|
});
|
|
953
|
-
if (!e.some((e) => e.value > 0)) return /* @__PURE__ */
|
|
953
|
+
if (!e.some((e) => e.value > 0)) return /* @__PURE__ */ J(l, {
|
|
954
954
|
title: n,
|
|
955
|
-
children: /* @__PURE__ */
|
|
955
|
+
children: /* @__PURE__ */ J(v, {
|
|
956
956
|
ariaLabel: t,
|
|
957
957
|
text: d.empty,
|
|
958
958
|
compact: r
|
|
959
959
|
})
|
|
960
960
|
});
|
|
961
|
-
let m = ne(e), h = p.active === null ? null : m[p.active] ?? null, g = h?.step.key ??
|
|
962
|
-
return /* @__PURE__ */
|
|
961
|
+
let m = ne(e), h = p.active === null ? null : m[p.active] ?? null, g = h?.step.key ?? a, _ = (e) => `${e.step.label}: ${u(e.step.value)}${e.drop === null ? "" : `, ${d.funnelDrop} ${b(e.drop)}`}`;
|
|
962
|
+
return /* @__PURE__ */ Y(l, {
|
|
963
963
|
title: n,
|
|
964
964
|
children: [
|
|
965
|
-
/* @__PURE__ */
|
|
966
|
-
className:
|
|
965
|
+
/* @__PURE__ */ J("ol", {
|
|
966
|
+
className: z(`chart-funnel chart-plot chart-plot--rows${i ? " chart-plot--pick" : ""}`, r),
|
|
967
967
|
role: i ? void 0 : "img",
|
|
968
|
-
"aria-label": !i && h ?
|
|
968
|
+
"aria-label": !i && h ? _(h) : t,
|
|
969
969
|
...p.plotProps,
|
|
970
|
-
children: m.map(({ step: e, width: t, drop: n }, r) => /* @__PURE__ */
|
|
970
|
+
children: m.map(({ step: e, width: t, drop: n }, r) => /* @__PURE__ */ J("li", {
|
|
971
971
|
"data-hit": p.pickable ? void 0 : r,
|
|
972
972
|
className: `chart-funnel-item${r === p.active ? " chart-funnel-item--active" : ""}`,
|
|
973
973
|
"aria-hidden": !p.pickable || void 0,
|
|
974
|
-
children: /* @__PURE__ */
|
|
974
|
+
children: /* @__PURE__ */ Y("span", {
|
|
975
975
|
...p.pickable ? p.item(r, {
|
|
976
|
-
pressed:
|
|
976
|
+
pressed: a === e.key,
|
|
977
977
|
disabled: !f(r)
|
|
978
978
|
}) : {},
|
|
979
|
-
"aria-label": p.pickable ? `${e.label}: ${u(e.value)}${n === null ? "" : `, ${
|
|
979
|
+
"aria-label": p.pickable ? `${e.label}: ${u(e.value)}${n === null ? "" : `, ${b(n)}`}` : void 0,
|
|
980
980
|
"aria-description": p.pickable && n !== null ? d.funnelDrop : void 0,
|
|
981
981
|
className: `chart-funnel-row${g !== null && g !== e.key ? " chart-faded" : ""}`,
|
|
982
982
|
children: [
|
|
983
|
-
/* @__PURE__ */
|
|
983
|
+
/* @__PURE__ */ J("span", {
|
|
984
984
|
className: "chart-funnel-label",
|
|
985
985
|
title: e.label,
|
|
986
986
|
children: e.label
|
|
987
987
|
}),
|
|
988
988
|
" ",
|
|
989
|
-
/* @__PURE__ */
|
|
989
|
+
/* @__PURE__ */ Y("span", {
|
|
990
990
|
className: "chart-funnel-track",
|
|
991
|
-
children: [/* @__PURE__ */
|
|
991
|
+
children: [/* @__PURE__ */ J("span", {
|
|
992
992
|
className: "chart-funnel-bar",
|
|
993
993
|
style: {
|
|
994
994
|
width: `${t * 100}%`,
|
|
995
|
-
background:
|
|
995
|
+
background: L(e.slot),
|
|
996
996
|
color: te(e.slot)
|
|
997
997
|
},
|
|
998
998
|
children: t >= .18 ? u(e.value) : ""
|
|
999
|
-
}), t < .18 && /* @__PURE__ */
|
|
999
|
+
}), t < .18 && /* @__PURE__ */ J("span", {
|
|
1000
1000
|
className: "chart-funnel-outside",
|
|
1001
1001
|
children: u(e.value)
|
|
1002
1002
|
})]
|
|
1003
1003
|
}),
|
|
1004
1004
|
" ",
|
|
1005
|
-
/* @__PURE__ */
|
|
1005
|
+
/* @__PURE__ */ J("span", {
|
|
1006
1006
|
className: "chart-funnel-drop",
|
|
1007
1007
|
"data-change": n === null ? void 0 : n > 0 ? "drop" : n < 0 ? "rise" : "flat",
|
|
1008
|
-
children: n === null ? "" :
|
|
1008
|
+
children: n === null ? "" : b(n)
|
|
1009
1009
|
})
|
|
1010
1010
|
]
|
|
1011
1011
|
})
|
|
1012
1012
|
}, e.key))
|
|
1013
1013
|
}),
|
|
1014
|
-
/* @__PURE__ */
|
|
1015
|
-
p.tooltip(h && /* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ J(s, { text: h ? _(h) : "" }),
|
|
1015
|
+
p.tooltip(h && /* @__PURE__ */ J($, {
|
|
1016
1016
|
rows: [{
|
|
1017
1017
|
key: h.step.key,
|
|
1018
|
-
color:
|
|
1018
|
+
color: L(h.step.slot),
|
|
1019
1019
|
label: h.step.label,
|
|
1020
1020
|
value: u(h.step.value)
|
|
1021
1021
|
}],
|
|
1022
|
-
note: [p.active > 0 ? `${d.funnelOfFirst}: ${
|
|
1022
|
+
note: [p.active > 0 ? `${d.funnelOfFirst}: ${c(h.ofFirst)}` : "", h.drop === null ? "" : `${d.funnelDrop}: ${b(h.drop)}`].filter(Boolean).join(" · ") || void 0
|
|
1023
1023
|
}))
|
|
1024
1024
|
]
|
|
1025
1025
|
});
|
|
1026
1026
|
}
|
|
1027
1027
|
// src/components/Charts/Gauge.tsx
|
|
1028
|
-
function
|
|
1029
|
-
let { nf:
|
|
1028
|
+
function ze({ value: e, total: t, ariaLabel: n, label: r, variant: i = "half", color: a = 1, size: o, compact: l = !1, ...u }) {
|
|
1029
|
+
let { nf: d, L: p } = x(u), m = j[i], h = f(e, t), { a0: _, a1: v, end: y } = g(i, h), [b, S] = X(), C = (o ?? (i === "half" ? l ? 120 : 168 : l ? 88 : 128)) * S, w = Q({
|
|
1030
1030
|
count: 1,
|
|
1031
1031
|
pick: (e, t, n) => {
|
|
1032
1032
|
let r = n.width / m.width;
|
|
@@ -1035,78 +1035,78 @@ function Re({ value: e, total: t, ariaLabel: n, label: r, variant: i = "half", c
|
|
|
1035
1035
|
a1: v
|
|
1036
1036
|
}]) === null ? null : 0;
|
|
1037
1037
|
}
|
|
1038
|
-
}), T = p.ofTotal(
|
|
1039
|
-
return /* @__PURE__ */
|
|
1040
|
-
ref:
|
|
1041
|
-
className:
|
|
1038
|
+
}), T = p.ofTotal(d(e), d(t)), E = L(O(a, h));
|
|
1039
|
+
return /* @__PURE__ */ Y("div", {
|
|
1040
|
+
ref: b,
|
|
1041
|
+
className: z(`chart-gauge chart-gauge--${i}`, l),
|
|
1042
1042
|
role: "meter",
|
|
1043
1043
|
"aria-label": n,
|
|
1044
1044
|
"aria-valuemin": 0,
|
|
1045
1045
|
"aria-valuemax": 100,
|
|
1046
1046
|
"aria-valuenow": Math.round(h * 10) / 10,
|
|
1047
|
-
"aria-valuetext": `${T} (${
|
|
1047
|
+
"aria-valuetext": `${T} (${c(h)})`,
|
|
1048
1048
|
children: [
|
|
1049
|
-
/* @__PURE__ */
|
|
1049
|
+
/* @__PURE__ */ Y("div", {
|
|
1050
1050
|
className: "chart-gauge-dial chart-plot",
|
|
1051
1051
|
style: { width: C },
|
|
1052
1052
|
...w.plotProps,
|
|
1053
|
-
children: [/* @__PURE__ */
|
|
1053
|
+
children: [/* @__PURE__ */ Y("svg", {
|
|
1054
1054
|
viewBox: `0 0 ${m.width} ${m.height}`,
|
|
1055
1055
|
width: C,
|
|
1056
1056
|
height: C * m.height / m.width,
|
|
1057
1057
|
"aria-hidden": !0,
|
|
1058
|
-
children: [/* @__PURE__ */
|
|
1059
|
-
d:
|
|
1058
|
+
children: [/* @__PURE__ */ J("path", {
|
|
1059
|
+
d: I(m.cx, m.cy, m.r, _, v),
|
|
1060
1060
|
className: "chart-gauge-track",
|
|
1061
1061
|
fill: "none",
|
|
1062
1062
|
strokeWidth: 12,
|
|
1063
1063
|
strokeLinecap: "round"
|
|
1064
|
-
}), h > 0 && /* @__PURE__ */
|
|
1065
|
-
d:
|
|
1064
|
+
}), h > 0 && /* @__PURE__ */ J("path", {
|
|
1065
|
+
d: I(m.cx, m.cy, m.r, _, Math.max(y, _ + .01)),
|
|
1066
1066
|
className: "chart-gauge-value",
|
|
1067
1067
|
fill: "none",
|
|
1068
1068
|
stroke: E,
|
|
1069
1069
|
strokeWidth: 12,
|
|
1070
1070
|
strokeLinecap: "round"
|
|
1071
1071
|
})]
|
|
1072
|
-
}), /* @__PURE__ */
|
|
1072
|
+
}), /* @__PURE__ */ J("span", {
|
|
1073
1073
|
className: "chart-gauge-share",
|
|
1074
1074
|
"aria-hidden": !0,
|
|
1075
|
-
children:
|
|
1075
|
+
children: c(h)
|
|
1076
1076
|
})]
|
|
1077
1077
|
}),
|
|
1078
|
-
r !== void 0 && /* @__PURE__ */
|
|
1078
|
+
r !== void 0 && /* @__PURE__ */ J("span", {
|
|
1079
1079
|
className: "chart-gauge-label",
|
|
1080
1080
|
children: r
|
|
1081
1081
|
}),
|
|
1082
|
-
/* @__PURE__ */
|
|
1082
|
+
/* @__PURE__ */ J("span", {
|
|
1083
1083
|
className: "chart-gauge-of",
|
|
1084
1084
|
"aria-hidden": !0,
|
|
1085
1085
|
children: T
|
|
1086
1086
|
}),
|
|
1087
|
-
/* @__PURE__ */
|
|
1088
|
-
w.tooltip(w.active !== null && /* @__PURE__ */
|
|
1087
|
+
/* @__PURE__ */ J(s, { text: w.active === null ? "" : `${T} (${c(h)})` }),
|
|
1088
|
+
w.tooltip(w.active !== null && /* @__PURE__ */ J($, {
|
|
1089
1089
|
title: r ?? n,
|
|
1090
1090
|
rows: [{
|
|
1091
1091
|
key: "v",
|
|
1092
1092
|
color: E,
|
|
1093
1093
|
label: T,
|
|
1094
|
-
value:
|
|
1094
|
+
value: c(h)
|
|
1095
1095
|
}]
|
|
1096
1096
|
}))
|
|
1097
1097
|
]
|
|
1098
1098
|
});
|
|
1099
1099
|
}
|
|
1100
1100
|
// src/components/Charts/LineChart.tsx
|
|
1101
|
-
var
|
|
1102
|
-
function
|
|
1103
|
-
let { nf: m, L: h } =
|
|
1101
|
+
var Be = 64;
|
|
1102
|
+
function Ve({ data: e, series: t, ariaLabel: n, title: i, area: a = !1, height: o, compact: c = !1, onSelect: u, selected: d = null, ...f }) {
|
|
1103
|
+
let { nf: m, L: h } = x(f), [g, _] = Te(), [y, b] = X(), S = e.length, C = d === null ? -1 : e.findIndex((e) => U(e) === d), T = Q({
|
|
1104
1104
|
count: S,
|
|
1105
|
-
pick: (e, t, n) =>
|
|
1105
|
+
pick: (e, t, n) => N(e, n.width, S),
|
|
1106
1106
|
anchor: (e, t) => {
|
|
1107
1107
|
let n = t.getBoundingClientRect();
|
|
1108
1108
|
return {
|
|
1109
|
-
left: n.left +
|
|
1109
|
+
left: n.left + M(e, S, 100) / 100 * n.width - 1,
|
|
1110
1110
|
top: n.top,
|
|
1111
1111
|
width: 2,
|
|
1112
1112
|
height: n.height
|
|
@@ -1116,57 +1116,57 @@ function Be({ data: e, series: t, ariaLabel: r, title: i, area: o = !1, height:
|
|
|
1116
1116
|
ArrowUp: 0,
|
|
1117
1117
|
ArrowDown: 0
|
|
1118
1118
|
},
|
|
1119
|
-
start:
|
|
1119
|
+
start: C >= 0 ? C : null,
|
|
1120
1120
|
onPick: u ? (t) => e[t].selectable !== !1 && u(e[t]) : void 0
|
|
1121
1121
|
}), E = e.flatMap((e) => t.map((t) => e.values[t.key] ?? 0));
|
|
1122
|
-
if (!E.some((e) => e > 0)) return /* @__PURE__ */
|
|
1122
|
+
if (!E.some((e) => e > 0)) return /* @__PURE__ */ J(l, {
|
|
1123
1123
|
title: i,
|
|
1124
|
-
children: /* @__PURE__ */
|
|
1125
|
-
ariaLabel:
|
|
1124
|
+
children: /* @__PURE__ */ J(v, {
|
|
1125
|
+
ariaLabel: n,
|
|
1126
1126
|
text: h.empty,
|
|
1127
|
-
compact:
|
|
1127
|
+
compact: c
|
|
1128
1128
|
})
|
|
1129
1129
|
});
|
|
1130
|
-
let D = (
|
|
1130
|
+
let D = (o ?? (c ? 96 : 220)) * b, { max: O, ticks: A } = k(E), j = t.map((t) => ({
|
|
1131
1131
|
s: t,
|
|
1132
|
-
points: p(e.map((e) => e.values[t.key] ?? 0), 100, 100,
|
|
1133
|
-
})), P = T.active, F = (e) => `${e.fullLabel ?? e.label}: ${t.map((n) => t.length > 1 ? `${n.label} ${m(e.values[n.key] ?? 0)}` : m(e.values[n.key] ?? 0)).join(", ")}`,
|
|
1134
|
-
return /* @__PURE__ */
|
|
1132
|
+
points: p(e.map((e) => e.values[t.key] ?? 0), 100, 100, O)
|
|
1133
|
+
})), P = T.active, F = (e) => `${e.fullLabel ?? e.label}: ${t.map((n) => t.length > 1 ? `${n.label} ${m(e.values[n.key] ?? 0)}` : m(e.values[n.key] ?? 0)).join(", ")}`, I = P === null ? null : e[P] ?? null, R = w(S, Math.max(2, Math.min(c ? 4 : 6, Math.floor((_ || 400) / (Be * b))))), B = (e) => `${M(e, S, 100)}%`;
|
|
1134
|
+
return /* @__PURE__ */ J(l, {
|
|
1135
1135
|
title: i,
|
|
1136
|
-
children: /* @__PURE__ */
|
|
1136
|
+
children: /* @__PURE__ */ Y("div", {
|
|
1137
1137
|
ref: g,
|
|
1138
|
-
className:
|
|
1138
|
+
className: z(`chart-line${a ? " chart-line--area" : ""}`, c),
|
|
1139
1139
|
role: "group",
|
|
1140
|
-
"aria-label":
|
|
1140
|
+
"aria-label": n,
|
|
1141
1141
|
children: [
|
|
1142
|
-
/* @__PURE__ */
|
|
1142
|
+
/* @__PURE__ */ Y("div", {
|
|
1143
1143
|
className: "chart-columns-plot",
|
|
1144
1144
|
style: { height: D },
|
|
1145
|
-
children: [!
|
|
1145
|
+
children: [!c && /* @__PURE__ */ J("div", {
|
|
1146
1146
|
className: "chart-axis-y",
|
|
1147
1147
|
"aria-hidden": !0,
|
|
1148
|
-
children: [...A].reverse().map((e) => /* @__PURE__ */
|
|
1149
|
-
}), /* @__PURE__ */
|
|
1148
|
+
children: [...A].reverse().map((e) => /* @__PURE__ */ J("span", { children: m(e) }, e))
|
|
1149
|
+
}), /* @__PURE__ */ Y("div", {
|
|
1150
1150
|
className: `chart-line-area chart-plot chart-plot--x${u ? " chart-plot--pick" : ""}`,
|
|
1151
1151
|
role: u ? void 0 : "img",
|
|
1152
|
-
"aria-label": u ? void 0 :
|
|
1152
|
+
"aria-label": u ? void 0 : I ? F(I) : n,
|
|
1153
1153
|
...T.plotProps,
|
|
1154
1154
|
children: [
|
|
1155
|
-
T.pickable && e.map((e, t) => /* @__PURE__ */
|
|
1155
|
+
T.pickable && e.map((e, t) => /* @__PURE__ */ J("span", {
|
|
1156
1156
|
...T.item(t, {
|
|
1157
|
-
pressed: t ===
|
|
1157
|
+
pressed: t === C,
|
|
1158
1158
|
disabled: e.selectable === !1
|
|
1159
1159
|
}),
|
|
1160
1160
|
"aria-label": F(e),
|
|
1161
1161
|
className: "chart-line-slot",
|
|
1162
|
-
style: { left:
|
|
1163
|
-
},
|
|
1164
|
-
!
|
|
1162
|
+
style: { left: B(t) }
|
|
1163
|
+
}, U(e))),
|
|
1164
|
+
!c && A.slice(1).map((e) => /* @__PURE__ */ J("div", {
|
|
1165
1165
|
className: "chart-gridline",
|
|
1166
|
-
style: { bottom: `${e /
|
|
1166
|
+
style: { bottom: `${e / O * 100}%` },
|
|
1167
1167
|
"aria-hidden": !0
|
|
1168
1168
|
}, e)),
|
|
1169
|
-
/* @__PURE__ */
|
|
1169
|
+
/* @__PURE__ */ Y("svg", {
|
|
1170
1170
|
className: "chart-line-svg",
|
|
1171
1171
|
viewBox: "0 0 100 100",
|
|
1172
1172
|
preserveAspectRatio: "none",
|
|
@@ -1174,82 +1174,82 @@ function Be({ data: e, series: t, ariaLabel: r, title: i, area: o = !1, height:
|
|
|
1174
1174
|
height: "100%",
|
|
1175
1175
|
"aria-hidden": !0,
|
|
1176
1176
|
children: [
|
|
1177
|
-
|
|
1178
|
-
d:
|
|
1179
|
-
fill:
|
|
1177
|
+
a && j.map(({ s: e, points: t }) => /* @__PURE__ */ J("path", {
|
|
1178
|
+
d: V(t, 100),
|
|
1179
|
+
fill: L(e.slot),
|
|
1180
1180
|
className: "chart-line-fill"
|
|
1181
1181
|
}, `a-${e.key}`)),
|
|
1182
|
-
|
|
1183
|
-
d:
|
|
1182
|
+
j.map(({ s: e, points: t }) => /* @__PURE__ */ J("path", {
|
|
1183
|
+
d: r(t),
|
|
1184
1184
|
fill: "none",
|
|
1185
|
-
stroke:
|
|
1185
|
+
stroke: L(e.slot),
|
|
1186
1186
|
className: "chart-line-path",
|
|
1187
1187
|
vectorEffect: "non-scaling-stroke"
|
|
1188
1188
|
}, e.key)),
|
|
1189
|
-
|
|
1189
|
+
C >= 0 && /* @__PURE__ */ J("line", {
|
|
1190
1190
|
className: "chart-line-selected",
|
|
1191
|
-
x1:
|
|
1192
|
-
x2:
|
|
1191
|
+
x1: M(C, S, 100),
|
|
1192
|
+
x2: M(C, S, 100),
|
|
1193
1193
|
y1: 0,
|
|
1194
1194
|
y2: 100,
|
|
1195
1195
|
vectorEffect: "non-scaling-stroke"
|
|
1196
1196
|
}),
|
|
1197
|
-
P !== null && /* @__PURE__ */
|
|
1197
|
+
P !== null && /* @__PURE__ */ J("line", {
|
|
1198
1198
|
className: "chart-line-crosshair",
|
|
1199
|
-
x1:
|
|
1200
|
-
x2:
|
|
1199
|
+
x1: M(P, S, 100),
|
|
1200
|
+
x2: M(P, S, 100),
|
|
1201
1201
|
y1: 0,
|
|
1202
1202
|
y2: 100,
|
|
1203
1203
|
vectorEffect: "non-scaling-stroke"
|
|
1204
1204
|
})
|
|
1205
1205
|
]
|
|
1206
1206
|
}),
|
|
1207
|
-
[P,
|
|
1207
|
+
[P, C >= 0 ? C : null].map((e, t) => e === null || t === 1 && e === P ? null : j.map(({ s: n, points: r }) => /* @__PURE__ */ J("span", {
|
|
1208
1208
|
className: "chart-line-dot",
|
|
1209
1209
|
style: {
|
|
1210
|
-
left:
|
|
1210
|
+
left: B(e),
|
|
1211
1211
|
top: `${r[e].y}%`,
|
|
1212
|
-
background:
|
|
1212
|
+
background: L(n.slot)
|
|
1213
1213
|
},
|
|
1214
1214
|
"aria-hidden": !0
|
|
1215
1215
|
}, `${t}-${n.key}`)))
|
|
1216
1216
|
]
|
|
1217
1217
|
})]
|
|
1218
1218
|
}),
|
|
1219
|
-
/* @__PURE__ */
|
|
1219
|
+
/* @__PURE__ */ J("div", {
|
|
1220
1220
|
ref: y,
|
|
1221
|
-
className: `chart-line-axis-x${
|
|
1221
|
+
className: `chart-line-axis-x${c ? " chart-line-axis-x--compact" : ""}`,
|
|
1222
1222
|
"aria-hidden": !0,
|
|
1223
|
-
children:
|
|
1224
|
-
style: { left:
|
|
1223
|
+
children: R.map((t) => /* @__PURE__ */ J("span", {
|
|
1224
|
+
style: { left: B(t) },
|
|
1225
1225
|
className: t === 0 ? "chart-line-axis-first" : t === S - 1 ? "chart-line-axis-last" : void 0,
|
|
1226
1226
|
children: e[t].label
|
|
1227
1227
|
}, t))
|
|
1228
1228
|
}),
|
|
1229
|
-
/* @__PURE__ */
|
|
1230
|
-
T.tooltip(
|
|
1231
|
-
title:
|
|
1229
|
+
/* @__PURE__ */ J(s, { text: I ? F(I) : "" }),
|
|
1230
|
+
T.tooltip(I && /* @__PURE__ */ J($, {
|
|
1231
|
+
title: I.fullLabel ?? I.label,
|
|
1232
1232
|
rows: t.map((e) => ({
|
|
1233
1233
|
key: e.key,
|
|
1234
|
-
color:
|
|
1234
|
+
color: L(e.slot),
|
|
1235
1235
|
label: e.label,
|
|
1236
|
-
value: m(
|
|
1236
|
+
value: m(I.values[e.key] ?? 0)
|
|
1237
1237
|
})),
|
|
1238
|
-
note: t.length > 1 ? `${h.total}: ${m(re(
|
|
1238
|
+
note: t.length > 1 ? `${h.total}: ${m(re(I, t))}` : void 0
|
|
1239
1239
|
}))
|
|
1240
1240
|
]
|
|
1241
1241
|
})
|
|
1242
1242
|
});
|
|
1243
1243
|
}
|
|
1244
1244
|
// src/components/Charts/NumberTrend.tsx
|
|
1245
|
-
function
|
|
1246
|
-
let { nf: g, L: _ } =
|
|
1247
|
-
count:
|
|
1248
|
-
pick: (e, t, n) =>
|
|
1245
|
+
function He({ value: e, ariaLabel: t, title: n, points: i = [], current: a, previous: l, good: u = "up", slot: d = 1, compact: f = !1, ...p }) {
|
|
1246
|
+
let { nf: g, L: _ } = x(p), v = Q({
|
|
1247
|
+
count: i.length,
|
|
1248
|
+
pick: (e, t, n) => N(e, n.width, i.length),
|
|
1249
1249
|
anchor: (e, t) => {
|
|
1250
1250
|
let n = t.getBoundingClientRect();
|
|
1251
1251
|
return {
|
|
1252
|
-
left: n.left +
|
|
1252
|
+
left: n.left + M(e, i.length, 100) / 100 * n.width - 1,
|
|
1253
1253
|
top: n.top,
|
|
1254
1254
|
width: 2,
|
|
1255
1255
|
height: n.height
|
|
@@ -1259,87 +1259,87 @@ function Ve({ value: e, ariaLabel: t, title: r, points: s = [], current: c, prev
|
|
|
1259
1259
|
ArrowUp: 0,
|
|
1260
1260
|
ArrowDown: 0
|
|
1261
1261
|
}
|
|
1262
|
-
}), y =
|
|
1263
|
-
return /* @__PURE__ */
|
|
1264
|
-
className:
|
|
1262
|
+
}), y = a ?? i.reduce((e, t) => e + t.value, 0), b = l === void 0 ? null : m(y, l), S = b ? h(b.direction, u) : "neutral", C = b ? b.direction === "up" ? "▲" : b.direction === "down" ? "▼" : "=" : "", w = b ? b.percent === null ? _.deltaNew : c(Math.abs(b.percent)) : "", T = b ? `${b.direction === "up" ? _.deltaUp : b.direction === "down" ? _.deltaDown : _.deltaSame}${b.direction === "same" ? "" : ` ${w}`} ${_.vsPrevious}` : "", E = o(i.map((e) => e.value), 100, 100), D = v.active, O = D === null ? null : i[D] ?? null;
|
|
1263
|
+
return /* @__PURE__ */ Y("div", {
|
|
1264
|
+
className: z("chart-number", f),
|
|
1265
1265
|
role: "group",
|
|
1266
1266
|
"aria-label": `${t}: ${g(e)}${T ? `, ${T}` : ""}`,
|
|
1267
1267
|
children: [
|
|
1268
|
-
|
|
1268
|
+
n != null && n !== "" && /* @__PURE__ */ J("div", {
|
|
1269
1269
|
className: "chart-title",
|
|
1270
|
-
children:
|
|
1270
|
+
children: n
|
|
1271
1271
|
}),
|
|
1272
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ Y("div", {
|
|
1273
1273
|
className: "chart-number-line",
|
|
1274
1274
|
"aria-hidden": !0,
|
|
1275
|
-
children: [/* @__PURE__ */
|
|
1275
|
+
children: [/* @__PURE__ */ J("span", {
|
|
1276
1276
|
className: "chart-number-value",
|
|
1277
1277
|
children: g(e)
|
|
1278
|
-
}),
|
|
1278
|
+
}), b && /* @__PURE__ */ Y("span", {
|
|
1279
1279
|
className: "chart-number-delta",
|
|
1280
1280
|
"data-tone": S,
|
|
1281
|
-
style: { color:
|
|
1281
|
+
style: { color: L(S) },
|
|
1282
1282
|
children: [
|
|
1283
1283
|
C,
|
|
1284
1284
|
" ",
|
|
1285
|
-
|
|
1285
|
+
b.direction === "same" ? c(0) : w
|
|
1286
1286
|
]
|
|
1287
1287
|
})]
|
|
1288
1288
|
}),
|
|
1289
|
-
E.length > 1 && /* @__PURE__ */
|
|
1289
|
+
E.length > 1 && /* @__PURE__ */ Y("div", {
|
|
1290
1290
|
className: "chart-number-spark chart-plot chart-plot--x",
|
|
1291
1291
|
role: "img",
|
|
1292
1292
|
"aria-label": O ? `${O.label}: ${g(O.value)}` : t,
|
|
1293
1293
|
...v.plotProps,
|
|
1294
|
-
children: [/* @__PURE__ */
|
|
1294
|
+
children: [/* @__PURE__ */ Y("svg", {
|
|
1295
1295
|
viewBox: "0 0 100 100",
|
|
1296
1296
|
preserveAspectRatio: "none",
|
|
1297
1297
|
width: "100%",
|
|
1298
1298
|
height: "100%",
|
|
1299
1299
|
"aria-hidden": !0,
|
|
1300
1300
|
children: [
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
d:
|
|
1303
|
-
fill:
|
|
1301
|
+
/* @__PURE__ */ J("path", {
|
|
1302
|
+
d: V(E, 100),
|
|
1303
|
+
fill: L(d),
|
|
1304
1304
|
className: "chart-line-fill"
|
|
1305
1305
|
}),
|
|
1306
|
-
/* @__PURE__ */
|
|
1307
|
-
d:
|
|
1306
|
+
/* @__PURE__ */ J("path", {
|
|
1307
|
+
d: r(E),
|
|
1308
1308
|
fill: "none",
|
|
1309
|
-
stroke:
|
|
1309
|
+
stroke: L(d),
|
|
1310
1310
|
className: "chart-line-path",
|
|
1311
1311
|
vectorEffect: "non-scaling-stroke"
|
|
1312
1312
|
}),
|
|
1313
|
-
D !== null && /* @__PURE__ */
|
|
1313
|
+
D !== null && /* @__PURE__ */ J("line", {
|
|
1314
1314
|
className: "chart-line-crosshair",
|
|
1315
|
-
x1:
|
|
1316
|
-
x2:
|
|
1315
|
+
x1: M(D, i.length, 100),
|
|
1316
|
+
x2: M(D, i.length, 100),
|
|
1317
1317
|
y1: 0,
|
|
1318
1318
|
y2: 100,
|
|
1319
1319
|
vectorEffect: "non-scaling-stroke"
|
|
1320
1320
|
})
|
|
1321
1321
|
]
|
|
1322
|
-
}), D !== null && E[D] && /* @__PURE__ */
|
|
1322
|
+
}), D !== null && E[D] && /* @__PURE__ */ J("span", {
|
|
1323
1323
|
className: "chart-line-dot",
|
|
1324
1324
|
style: {
|
|
1325
1325
|
left: `${E[D].x}%`,
|
|
1326
1326
|
top: `${E[D].y}%`,
|
|
1327
|
-
background:
|
|
1327
|
+
background: L(d)
|
|
1328
1328
|
},
|
|
1329
1329
|
"aria-hidden": !0
|
|
1330
1330
|
})]
|
|
1331
1331
|
}),
|
|
1332
|
-
|
|
1332
|
+
b && /* @__PURE__ */ J("div", {
|
|
1333
1333
|
className: "chart-number-note",
|
|
1334
1334
|
"aria-hidden": !0,
|
|
1335
1335
|
children: _.vsPrevious
|
|
1336
1336
|
}),
|
|
1337
|
-
/* @__PURE__ */
|
|
1338
|
-
v.tooltip(O && /* @__PURE__ */
|
|
1337
|
+
/* @__PURE__ */ J(s, { text: O ? `${O.label}: ${g(O.value)}` : "" }),
|
|
1338
|
+
v.tooltip(O && /* @__PURE__ */ J($, {
|
|
1339
1339
|
title: O.label,
|
|
1340
1340
|
rows: [{
|
|
1341
1341
|
key: "v",
|
|
1342
|
-
color:
|
|
1342
|
+
color: L(d),
|
|
1343
1343
|
label: t,
|
|
1344
1344
|
value: g(O.value)
|
|
1345
1345
|
}]
|
|
@@ -1348,34 +1348,34 @@ function Ve({ value: e, ariaLabel: t, title: r, points: s = [], current: c, prev
|
|
|
1348
1348
|
});
|
|
1349
1349
|
}
|
|
1350
1350
|
// src/components/Charts/Progress.tsx
|
|
1351
|
-
function
|
|
1352
|
-
let { nf: l, L: u } =
|
|
1351
|
+
function Ue({ value: e, total: t, ariaLabel: n, label: r, color: i = 1, compact: a = !1, ...o }) {
|
|
1352
|
+
let { nf: l, L: u } = x(o), d = Q({
|
|
1353
1353
|
count: 1,
|
|
1354
1354
|
pick: () => 0
|
|
1355
|
-
}), f = t > 0 ? e / t * 100 : 0, p =
|
|
1356
|
-
return /* @__PURE__ */
|
|
1357
|
-
className:
|
|
1355
|
+
}), f = t > 0 ? e / t * 100 : 0, p = L(O(i, f)), m = u.ofTotal(l(e), l(t));
|
|
1356
|
+
return /* @__PURE__ */ Y("div", {
|
|
1357
|
+
className: z("chart-progress chart-plot", a),
|
|
1358
1358
|
role: "progressbar",
|
|
1359
1359
|
"aria-label": n,
|
|
1360
1360
|
"aria-valuemin": 0,
|
|
1361
1361
|
"aria-valuemax": 100,
|
|
1362
1362
|
"aria-valuenow": Math.round(f * 10) / 10,
|
|
1363
|
-
"aria-valuetext": `${l(e)} / ${l(t)} (${
|
|
1363
|
+
"aria-valuetext": `${l(e)} / ${l(t)} (${c(f)})`,
|
|
1364
1364
|
...d.plotProps,
|
|
1365
1365
|
children: [
|
|
1366
|
-
r !== void 0 && /* @__PURE__ */
|
|
1366
|
+
r !== void 0 && /* @__PURE__ */ Y("div", {
|
|
1367
1367
|
className: "chart-progress-head",
|
|
1368
|
-
children: [/* @__PURE__ */
|
|
1368
|
+
children: [/* @__PURE__ */ J("span", {
|
|
1369
1369
|
className: "chart-progress-label",
|
|
1370
1370
|
children: r
|
|
1371
|
-
}), /* @__PURE__ */
|
|
1371
|
+
}), /* @__PURE__ */ J("span", {
|
|
1372
1372
|
className: "chart-progress-share",
|
|
1373
|
-
children:
|
|
1373
|
+
children: c(f)
|
|
1374
1374
|
})]
|
|
1375
1375
|
}),
|
|
1376
|
-
/* @__PURE__ */
|
|
1376
|
+
/* @__PURE__ */ J("div", {
|
|
1377
1377
|
className: "chart-progress-track",
|
|
1378
|
-
children: /* @__PURE__ */
|
|
1378
|
+
children: /* @__PURE__ */ J("div", {
|
|
1379
1379
|
className: "chart-progress-fill",
|
|
1380
1380
|
style: {
|
|
1381
1381
|
width: `${Math.min(100, f)}%`,
|
|
@@ -1383,29 +1383,29 @@ function He({ value: e, total: t, ariaLabel: n, label: r, color: i = 1, compact:
|
|
|
1383
1383
|
}
|
|
1384
1384
|
})
|
|
1385
1385
|
}),
|
|
1386
|
-
/* @__PURE__ */
|
|
1387
|
-
d.tooltip(d.active !== null && /* @__PURE__ */
|
|
1386
|
+
/* @__PURE__ */ J(s, { text: d.active === null ? "" : `${m} (${c(f)})` }),
|
|
1387
|
+
d.tooltip(d.active !== null && /* @__PURE__ */ J($, {
|
|
1388
1388
|
title: r ?? n,
|
|
1389
1389
|
rows: [{
|
|
1390
1390
|
key: "v",
|
|
1391
1391
|
color: p,
|
|
1392
1392
|
label: m,
|
|
1393
|
-
value:
|
|
1393
|
+
value: c(f)
|
|
1394
1394
|
}]
|
|
1395
1395
|
}))
|
|
1396
1396
|
]
|
|
1397
1397
|
});
|
|
1398
1398
|
}
|
|
1399
1399
|
// src/components/Charts/StackedBar.tsx
|
|
1400
|
-
function
|
|
1401
|
-
let { nf:
|
|
1400
|
+
function We({ slices: e, ariaLabel: t, title: n, compact: r = !1, onLegendCut: i, onSelect: a, selected: o = null, ...u }) {
|
|
1401
|
+
let { nf: d, L: p } = x(u), [m, h] = q(null), [g, _, y] = Fe(e.length, r);
|
|
1402
1402
|
ae(() => i?.(e.length - y), [
|
|
1403
1403
|
i,
|
|
1404
1404
|
e.length,
|
|
1405
1405
|
y
|
|
1406
1406
|
]);
|
|
1407
|
-
let
|
|
1408
|
-
count:
|
|
1407
|
+
let b = e.filter((e) => e.value > 0), S = (e) => !!a && e.value > 0 && e.selectable !== !1, C = Q({
|
|
1408
|
+
count: b.length,
|
|
1409
1409
|
pick: (e, t, n, r) => de(e, xe(r).map((e) => e ? {
|
|
1410
1410
|
start: e.left,
|
|
1411
1411
|
end: e.left + e.width
|
|
@@ -1417,34 +1417,34 @@ function Ue({ slices: e, ariaLabel: t, title: n, compact: r = !1, onLegendCut: i
|
|
|
1417
1417
|
ArrowUp: 0,
|
|
1418
1418
|
ArrowDown: 0
|
|
1419
1419
|
},
|
|
1420
|
-
start:
|
|
1421
|
-
onPick:
|
|
1420
|
+
start: o === null ? null : b.findIndex((e) => e.key === o),
|
|
1421
|
+
onPick: a ? (e) => S(b[e]) && a(b[e]) : void 0
|
|
1422
1422
|
}), w = e.reduce((e, t) => e + t.value, 0);
|
|
1423
|
-
if (w === 0) return /* @__PURE__ */
|
|
1423
|
+
if (w === 0) return /* @__PURE__ */ J(l, {
|
|
1424
1424
|
title: n,
|
|
1425
|
-
children: /* @__PURE__ */
|
|
1425
|
+
children: /* @__PURE__ */ J(v, {
|
|
1426
1426
|
ariaLabel: t,
|
|
1427
1427
|
text: p.empty,
|
|
1428
1428
|
compact: r
|
|
1429
1429
|
})
|
|
1430
1430
|
});
|
|
1431
|
-
let T = (e) =>
|
|
1432
|
-
return /* @__PURE__ */
|
|
1433
|
-
className:
|
|
1431
|
+
let T = (e) => f(e, w), E = (e) => `${e.label} ${d(e.value)} (${c(T(e.value))})`, D = C.active === null ? null : b[C.active] ?? null, O = D?.key ?? m ?? o, k = (e) => O !== null && O !== e ? " chart-faded" : "";
|
|
1432
|
+
return /* @__PURE__ */ Y("figure", {
|
|
1433
|
+
className: z("chart-stacked", r),
|
|
1434
1434
|
"aria-label": t,
|
|
1435
1435
|
children: [
|
|
1436
|
-
n && /* @__PURE__ */
|
|
1436
|
+
n && /* @__PURE__ */ J("figcaption", {
|
|
1437
1437
|
className: "chart-title",
|
|
1438
1438
|
children: n
|
|
1439
1439
|
}),
|
|
1440
|
-
/* @__PURE__ */
|
|
1441
|
-
className: `chart-stacked-bar chart-plot chart-plot--x${
|
|
1442
|
-
role:
|
|
1443
|
-
"aria-label":
|
|
1440
|
+
/* @__PURE__ */ J("div", {
|
|
1441
|
+
className: `chart-stacked-bar chart-plot chart-plot--x${a ? " chart-plot--pick" : ""}`,
|
|
1442
|
+
role: a ? void 0 : "img",
|
|
1443
|
+
"aria-label": a ? void 0 : D ? E(D) : `${t}: ${e.map(E).join(", ")}`,
|
|
1444
1444
|
...C.plotProps,
|
|
1445
|
-
children:
|
|
1445
|
+
children: b.map((e, t) => /* @__PURE__ */ J("span", {
|
|
1446
1446
|
...C.item(t, {
|
|
1447
|
-
pressed:
|
|
1447
|
+
pressed: o === e.key,
|
|
1448
1448
|
disabled: !S(e)
|
|
1449
1449
|
}),
|
|
1450
1450
|
"aria-label": C.pickable ? E(e) : void 0,
|
|
@@ -1452,127 +1452,127 @@ function Ue({ slices: e, ariaLabel: t, title: n, compact: r = !1, onLegendCut: i
|
|
|
1452
1452
|
className: `chart-stacked-segment${k(e.key)}`,
|
|
1453
1453
|
style: {
|
|
1454
1454
|
flexGrow: e.value,
|
|
1455
|
-
background:
|
|
1455
|
+
background: L(e.slot)
|
|
1456
1456
|
}
|
|
1457
1457
|
}, e.key))
|
|
1458
1458
|
}),
|
|
1459
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ Y("ul", {
|
|
1460
1460
|
ref: g,
|
|
1461
1461
|
className: "chart-donut-legend chart-stacked-legend",
|
|
1462
1462
|
"aria-label": p.legend,
|
|
1463
|
-
children: [e.slice(0,
|
|
1464
|
-
className: `chart-donut-legend-item${S(e) ? " chart-donut-legend-item--hit" : ""}${
|
|
1463
|
+
children: [e.slice(0, _).map((e) => /* @__PURE__ */ Y("li", {
|
|
1464
|
+
className: `chart-donut-legend-item${S(e) ? " chart-donut-legend-item--hit" : ""}${o === e.key ? " chart-donut-legend-item--on" : ""}${k(e.key)}`,
|
|
1465
1465
|
onMouseEnter: () => h(e.key),
|
|
1466
1466
|
onMouseLeave: () => h(null),
|
|
1467
|
-
onClick: S(e) ? () =>
|
|
1467
|
+
onClick: S(e) ? () => a(e) : void 0,
|
|
1468
1468
|
children: [
|
|
1469
|
-
/* @__PURE__ */
|
|
1469
|
+
/* @__PURE__ */ J("span", {
|
|
1470
1470
|
className: "chart-swatch",
|
|
1471
|
-
style: { background:
|
|
1471
|
+
style: { background: L(e.slot) },
|
|
1472
1472
|
"aria-hidden": !0
|
|
1473
1473
|
}),
|
|
1474
|
-
/* @__PURE__ */
|
|
1474
|
+
/* @__PURE__ */ J("span", {
|
|
1475
1475
|
className: "chart-donut-legend-label",
|
|
1476
1476
|
children: e.label
|
|
1477
1477
|
}),
|
|
1478
|
-
/* @__PURE__ */
|
|
1478
|
+
/* @__PURE__ */ Y("span", {
|
|
1479
1479
|
className: "chart-donut-legend-value",
|
|
1480
1480
|
children: [
|
|
1481
|
-
|
|
1481
|
+
d(e.value),
|
|
1482
1482
|
" · ",
|
|
1483
|
-
|
|
1483
|
+
c(T(e.value))
|
|
1484
1484
|
]
|
|
1485
1485
|
})
|
|
1486
1486
|
]
|
|
1487
|
-
}, e.key)),
|
|
1487
|
+
}, e.key)), _ < e.length && /* @__PURE__ */ J("li", {
|
|
1488
1488
|
className: "chart-donut-legend-more",
|
|
1489
1489
|
"data-legend-more": "",
|
|
1490
|
-
children: p.moreValues(
|
|
1490
|
+
children: p.moreValues(d(e.length - _))
|
|
1491
1491
|
})]
|
|
1492
1492
|
}),
|
|
1493
|
-
/* @__PURE__ */
|
|
1494
|
-
C.tooltip(D && /* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ J(s, { text: D ? E(D) : "" }),
|
|
1494
|
+
C.tooltip(D && /* @__PURE__ */ J($, {
|
|
1495
1495
|
rows: [{
|
|
1496
1496
|
key: D.key,
|
|
1497
|
-
color:
|
|
1497
|
+
color: L(D.slot),
|
|
1498
1498
|
label: D.label,
|
|
1499
|
-
value:
|
|
1499
|
+
value: d(D.value)
|
|
1500
1500
|
}],
|
|
1501
|
-
note: p.shareOf(
|
|
1501
|
+
note: p.shareOf(c(T(D.value)), d(w))
|
|
1502
1502
|
}))
|
|
1503
1503
|
]
|
|
1504
1504
|
});
|
|
1505
1505
|
}
|
|
1506
1506
|
// src/components/Charts/Treemap.tsx
|
|
1507
|
-
var
|
|
1508
|
-
function
|
|
1509
|
-
let { nf: p, L: m } =
|
|
1507
|
+
var Ge = 400;
|
|
1508
|
+
function Ke({ nodes: e, ariaLabel: t, title: n, height: r, compact: i = !1, onSelect: a, selected: o = null, ...d }) {
|
|
1509
|
+
let { nf: p, L: m } = x(d), [h, g] = Te(), _ = g || Ge, [y, b] = X(), S = (r ?? (i ? 120 : 220)) * b, C = e.reduce((e, t) => e + Math.max(0, t.value), 0), w = C > 0 ? u(e, _, S, b) : [], T = w.filter((e) => !e.node.children?.some((e) => e.value > 0)), E = (e) => e.parent ?? e.node, D = (e) => !!a && E(e).selectable !== !1, O = Q({
|
|
1510
1510
|
count: T.length,
|
|
1511
|
-
pick: (e, t, n) => fe(e / n.width *
|
|
1511
|
+
pick: (e, t, n) => fe(e / n.width * _, t / n.height * S, T.map((e) => ({
|
|
1512
1512
|
left: e.rect.x,
|
|
1513
1513
|
top: e.rect.y,
|
|
1514
1514
|
width: e.rect.w,
|
|
1515
1515
|
height: e.rect.h
|
|
1516
1516
|
}))),
|
|
1517
|
-
start:
|
|
1518
|
-
onPick:
|
|
1519
|
-
}),
|
|
1520
|
-
h(e),
|
|
1521
|
-
}, [h,
|
|
1522
|
-
if (C <= 0) return /* @__PURE__ */
|
|
1517
|
+
start: o === null ? null : T.findIndex((e) => E(e).key === o),
|
|
1518
|
+
onPick: a ? (e) => D(T[e]) && a(E(T[e])) : void 0
|
|
1519
|
+
}), k = O.plotProps.ref, j = W((e) => {
|
|
1520
|
+
h(e), k(e);
|
|
1521
|
+
}, [h, k]);
|
|
1522
|
+
if (C <= 0) return /* @__PURE__ */ J(l, {
|
|
1523
1523
|
title: n,
|
|
1524
|
-
children: /* @__PURE__ */
|
|
1524
|
+
children: /* @__PURE__ */ J(v, {
|
|
1525
1525
|
ariaLabel: t,
|
|
1526
1526
|
text: m.empty,
|
|
1527
1527
|
compact: i
|
|
1528
1528
|
})
|
|
1529
1529
|
});
|
|
1530
|
-
let M = (e) => `${e.parent ? `${e.parent.label} › ` : ""}${e.node.label} ${p(e.node.value)} (${
|
|
1531
|
-
left: `${e.rect.x /
|
|
1530
|
+
let M = (e) => `${e.parent ? `${e.parent.label} › ` : ""}${e.node.label} ${p(e.node.value)} (${c(f(e.node.value, C))})`, N = (e) => e.parent ? `${e.parent.key}\u0000${e.node.key}` : e.node.key, P = O.active === null ? null : T[O.active] ?? null, F = (e) => ({
|
|
1531
|
+
left: `${e.rect.x / _ * 100}%`,
|
|
1532
1532
|
top: `${e.rect.y / S * 100}%`,
|
|
1533
|
-
width: `${e.rect.w /
|
|
1533
|
+
width: `${e.rect.w / _ * 100}%`,
|
|
1534
1534
|
height: `${e.rect.h / S * 100}%`
|
|
1535
1535
|
});
|
|
1536
|
-
return /* @__PURE__ */
|
|
1536
|
+
return /* @__PURE__ */ J(l, {
|
|
1537
1537
|
title: n,
|
|
1538
|
-
children: /* @__PURE__ */
|
|
1538
|
+
children: /* @__PURE__ */ Y("div", {
|
|
1539
1539
|
ref: y,
|
|
1540
|
-
className:
|
|
1540
|
+
className: z("chart-treemap", i),
|
|
1541
1541
|
role: "group",
|
|
1542
1542
|
"aria-label": t,
|
|
1543
1543
|
children: [
|
|
1544
|
-
/* @__PURE__ */
|
|
1545
|
-
className: `chart-treemap-box chart-plot${
|
|
1544
|
+
/* @__PURE__ */ J("div", {
|
|
1545
|
+
className: `chart-treemap-box chart-plot${a ? " chart-plot--pick" : ""}`,
|
|
1546
1546
|
style: { height: S },
|
|
1547
|
-
role:
|
|
1548
|
-
"aria-label":
|
|
1547
|
+
role: a ? void 0 : "img",
|
|
1548
|
+
"aria-label": a ? void 0 : P ? M(P) : `${t}: ${T.map(M).join(", ")}`,
|
|
1549
1549
|
...O.plotProps,
|
|
1550
1550
|
ref: j,
|
|
1551
1551
|
children: w.map((e) => {
|
|
1552
|
-
let t = E(e), n = !!e.node.children?.some((e) => e.value > 0), r = e.parent ? e.parent.children.filter((e) => e.value > 0).indexOf(e.node) : 0, i =
|
|
1553
|
-
return /* @__PURE__ */
|
|
1552
|
+
let t = E(e), n = !!e.node.children?.some((e) => e.value > 0), r = e.parent ? e.parent.children.filter((e) => e.value > 0).indexOf(e.node) : 0, i = o !== null && o !== t.key || P !== null && E(P).key !== t.key, a = T.indexOf(e);
|
|
1553
|
+
return /* @__PURE__ */ J("div", {
|
|
1554
1554
|
...a >= 0 ? O.item(a, {
|
|
1555
|
-
pressed:
|
|
1555
|
+
pressed: o === t.key,
|
|
1556
1556
|
disabled: !D(e)
|
|
1557
1557
|
}) : {},
|
|
1558
1558
|
"aria-label": O.pickable && a >= 0 ? M(e) : void 0,
|
|
1559
|
-
className: `chart-treemap-tile${n ? " chart-treemap-tile--group" : ""}${e.parent ? " chart-treemap-tile--child" : ""}${i ? " chart-faded" : ""}${
|
|
1559
|
+
className: `chart-treemap-tile${n ? " chart-treemap-tile--group" : ""}${e.parent ? " chart-treemap-tile--child" : ""}${i ? " chart-faded" : ""}${o === t.key ? " chart-treemap-tile--on" : ""}${P === e ? " chart-treemap-tile--active" : ""}`,
|
|
1560
1560
|
style: {
|
|
1561
1561
|
...F(e),
|
|
1562
|
-
background:
|
|
1562
|
+
background: L(t.slot),
|
|
1563
1563
|
color: te(t.slot),
|
|
1564
|
-
opacity: e.parent ?
|
|
1564
|
+
opacity: e.parent ? A(r) : void 0
|
|
1565
1565
|
},
|
|
1566
1566
|
"aria-hidden": O.pickable && a >= 0 ? void 0 : !0,
|
|
1567
|
-
children: e.label && /* @__PURE__ */
|
|
1567
|
+
children: e.label && /* @__PURE__ */ Y("span", {
|
|
1568
1568
|
className: "chart-treemap-label",
|
|
1569
1569
|
children: [
|
|
1570
|
-
/* @__PURE__ */
|
|
1570
|
+
/* @__PURE__ */ J("span", {
|
|
1571
1571
|
className: "chart-treemap-name",
|
|
1572
1572
|
children: e.node.label
|
|
1573
1573
|
}),
|
|
1574
1574
|
" ",
|
|
1575
|
-
!n && /* @__PURE__ */
|
|
1575
|
+
!n && /* @__PURE__ */ J("span", {
|
|
1576
1576
|
className: "chart-treemap-count",
|
|
1577
1577
|
children: p(e.node.value)
|
|
1578
1578
|
})
|
|
@@ -1581,30 +1581,30 @@ function Ge({ nodes: e, ariaLabel: t, title: n, height: r, compact: i = !1, onSe
|
|
|
1581
1581
|
}, N(e));
|
|
1582
1582
|
})
|
|
1583
1583
|
}),
|
|
1584
|
-
/* @__PURE__ */
|
|
1585
|
-
O.tooltip(P && /* @__PURE__ */
|
|
1584
|
+
/* @__PURE__ */ J(s, { text: P ? M(P) : "" }),
|
|
1585
|
+
O.tooltip(P && /* @__PURE__ */ J($, {
|
|
1586
1586
|
title: P.parent ? `${P.parent.label} › ${P.node.label}` : P.node.label,
|
|
1587
1587
|
rows: [{
|
|
1588
1588
|
key: "n",
|
|
1589
|
-
color:
|
|
1589
|
+
color: L(E(P).slot),
|
|
1590
1590
|
label: t,
|
|
1591
1591
|
value: p(P.node.value)
|
|
1592
1592
|
}],
|
|
1593
|
-
note: m.shareOf(
|
|
1593
|
+
note: m.shareOf(c(f(P.node.value, C)), p(C))
|
|
1594
1594
|
}))
|
|
1595
1595
|
]
|
|
1596
1596
|
})
|
|
1597
1597
|
});
|
|
1598
1598
|
}
|
|
1599
1599
|
// src/components/Charts/ChartView.tsx
|
|
1600
|
-
function
|
|
1600
|
+
function qe({ chart: e, ariaLabel: t, compact: n = !1, height: r, size: i, onSelect: a, selected: o = null, linkAs: s, onLegendCut: c, legend: l = !0, ...u }) {
|
|
1601
1601
|
let d = {
|
|
1602
1602
|
ariaLabel: t,
|
|
1603
1603
|
compact: n,
|
|
1604
1604
|
...u
|
|
1605
1605
|
}, f = a ? (e) => a(e.key ?? e.label) : void 0;
|
|
1606
1606
|
switch (e.kind) {
|
|
1607
|
-
case "columns": return /* @__PURE__ */
|
|
1607
|
+
case "columns": return /* @__PURE__ */ J(Pe, {
|
|
1608
1608
|
data: e.data,
|
|
1609
1609
|
series: e.series,
|
|
1610
1610
|
mode: e.mode,
|
|
@@ -1614,7 +1614,7 @@ function Ke({ chart: e, ariaLabel: t, compact: n = !1, height: r, size: i, onSel
|
|
|
1614
1614
|
selected: o,
|
|
1615
1615
|
...d
|
|
1616
1616
|
});
|
|
1617
|
-
case "line": return /* @__PURE__ */
|
|
1617
|
+
case "line": return /* @__PURE__ */ J(Ve, {
|
|
1618
1618
|
data: e.data,
|
|
1619
1619
|
series: e.series,
|
|
1620
1620
|
area: e.area,
|
|
@@ -1623,7 +1623,7 @@ function Ke({ chart: e, ariaLabel: t, compact: n = !1, height: r, size: i, onSel
|
|
|
1623
1623
|
selected: o,
|
|
1624
1624
|
...d
|
|
1625
1625
|
});
|
|
1626
|
-
case "bars": return /* @__PURE__ */
|
|
1626
|
+
case "bars": return /* @__PURE__ */ J(Ce, {
|
|
1627
1627
|
data: e.data,
|
|
1628
1628
|
series: e.series,
|
|
1629
1629
|
linkAs: s,
|
|
@@ -1631,7 +1631,7 @@ function Ke({ chart: e, ariaLabel: t, compact: n = !1, height: r, size: i, onSel
|
|
|
1631
1631
|
selected: o,
|
|
1632
1632
|
...d
|
|
1633
1633
|
});
|
|
1634
|
-
case "stacked": return /* @__PURE__ */
|
|
1634
|
+
case "stacked": return /* @__PURE__ */ J(We, {
|
|
1635
1635
|
slices: e.slices,
|
|
1636
1636
|
onLegendCut: c,
|
|
1637
1637
|
onSelect: f,
|
|
@@ -1639,7 +1639,7 @@ function Ke({ chart: e, ariaLabel: t, compact: n = !1, height: r, size: i, onSel
|
|
|
1639
1639
|
...d
|
|
1640
1640
|
});
|
|
1641
1641
|
case "donut":
|
|
1642
|
-
case "pie": return /* @__PURE__ */
|
|
1642
|
+
case "pie": return /* @__PURE__ */ J(Le, {
|
|
1643
1643
|
variant: e.kind,
|
|
1644
1644
|
slices: e.slices,
|
|
1645
1645
|
size: i,
|
|
@@ -1649,20 +1649,20 @@ function Ke({ chart: e, ariaLabel: t, compact: n = !1, height: r, size: i, onSel
|
|
|
1649
1649
|
selected: o,
|
|
1650
1650
|
...d
|
|
1651
1651
|
});
|
|
1652
|
-
case "treemap": return /* @__PURE__ */
|
|
1652
|
+
case "treemap": return /* @__PURE__ */ J(Ke, {
|
|
1653
1653
|
nodes: e.nodes,
|
|
1654
1654
|
height: r,
|
|
1655
1655
|
onSelect: f,
|
|
1656
1656
|
selected: o,
|
|
1657
1657
|
...d
|
|
1658
1658
|
});
|
|
1659
|
-
case "calendar": return /* @__PURE__ */
|
|
1659
|
+
case "calendar": return /* @__PURE__ */ J(Oe, {
|
|
1660
1660
|
days: e.days,
|
|
1661
1661
|
onSelect: a ? (e) => a(e.day) : void 0,
|
|
1662
1662
|
selected: o,
|
|
1663
1663
|
...d
|
|
1664
1664
|
});
|
|
1665
|
-
case "funnel": return /* @__PURE__ */
|
|
1665
|
+
case "funnel": return /* @__PURE__ */ J(Re, {
|
|
1666
1666
|
steps: e.steps,
|
|
1667
1667
|
onSelect: f,
|
|
1668
1668
|
selected: o,
|
|
@@ -1670,7 +1670,7 @@ function Ke({ chart: e, ariaLabel: t, compact: n = !1, height: r, size: i, onSel
|
|
|
1670
1670
|
});
|
|
1671
1671
|
case "gauge": {
|
|
1672
1672
|
let t = e.rows[0];
|
|
1673
|
-
return /* @__PURE__ */
|
|
1673
|
+
return /* @__PURE__ */ J(ze, {
|
|
1674
1674
|
value: t.value,
|
|
1675
1675
|
total: t.total,
|
|
1676
1676
|
color: t.color,
|
|
@@ -1681,7 +1681,7 @@ function Ke({ chart: e, ariaLabel: t, compact: n = !1, height: r, size: i, onSel
|
|
|
1681
1681
|
}
|
|
1682
1682
|
case "progress": {
|
|
1683
1683
|
let t = e.rows[0];
|
|
1684
|
-
return /* @__PURE__ */
|
|
1684
|
+
return /* @__PURE__ */ J(Ue, {
|
|
1685
1685
|
value: t.value,
|
|
1686
1686
|
total: t.total,
|
|
1687
1687
|
color: t.color,
|
|
@@ -1689,7 +1689,7 @@ function Ke({ chart: e, ariaLabel: t, compact: n = !1, height: r, size: i, onSel
|
|
|
1689
1689
|
...d
|
|
1690
1690
|
});
|
|
1691
1691
|
}
|
|
1692
|
-
case "number": return /* @__PURE__ */
|
|
1692
|
+
case "number": return /* @__PURE__ */ J(He, {
|
|
1693
1693
|
value: e.value,
|
|
1694
1694
|
points: e.points,
|
|
1695
1695
|
current: e.current,
|
|
@@ -1700,4 +1700,4 @@ function Ke({ chart: e, ariaLabel: t, compact: n = !1, height: r, size: i, onSel
|
|
|
1700
1700
|
});
|
|
1701
1701
|
}
|
|
1702
1702
|
}
|
|
1703
|
-
export { pe as C, he as D, fe as E, de as O, ge as S, _e as T,
|
|
1703
|
+
export { pe as C, he as D, fe as E, de as O, ge as S, _e as T, $ as _, He as a, Q as b, Re as c, ke as d, Oe as f, Ce as g, Te as h, Ue as i, X as k, Le as l, we as m, Ke as n, Ve as o, De as p, We as r, ze as s, qe as t, Pe as u, be as v, ue as w, me as x, xe as y };
|