@handijit/ui 1.0.0 → 2.0.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/README.md +485 -571
- package/build/base.css +1 -1
- package/build/charts.cjs +1 -1
- package/build/charts.cjs.map +1 -1
- package/build/charts.css +1 -1
- package/build/charts.js +350 -349
- package/build/charts.js.map +1 -1
- package/build/chat.cjs +3 -3
- package/build/chat.cjs.map +1 -1
- package/build/chat.css +1 -1
- package/build/chat.js +344 -343
- package/build/chat.js.map +1 -1
- package/build/components/Accordion/style.css +1 -1
- package/build/components/Alert/style.css +1 -1
- package/build/components/Avatar/style.css +1 -1
- package/build/components/Badge/index.cjs +1 -1
- package/build/components/Badge/index.cjs.map +1 -1
- package/build/components/Badge/index.d.ts +8 -13
- package/build/components/Badge/index.js +1 -1
- package/build/components/Badge/index.js.map +1 -1
- package/build/components/Badge/style.css +1 -1
- package/build/components/BottomSheet/style.css +1 -1
- package/build/components/Breadcrumb/style.css +1 -1
- package/build/components/Button/index.cjs +1 -1
- package/build/components/Button/index.cjs.map +1 -1
- package/build/components/Button/index.js +2 -2
- package/build/components/Button/index.js.map +1 -1
- package/build/components/Button/style.css +1 -1
- package/build/components/Card/style.css +1 -1
- package/build/components/Carousel/style.css +1 -1
- package/build/components/Checkbox/style.css +1 -1
- package/build/components/Chip/style.css +1 -1
- package/build/components/ChipGroup/style.css +1 -1
- package/build/components/CodeBadge/style.css +1 -1
- package/build/components/Combobox/index.cjs +1 -1
- package/build/components/Combobox/index.cjs.map +1 -1
- package/build/components/Combobox/index.js +51 -51
- package/build/components/Combobox/index.js.map +1 -1
- package/build/components/Combobox/style.css +1 -1
- package/build/components/CommandPalette/style.css +1 -1
- package/build/components/CopyField/style.css +1 -1
- package/build/components/DataTable/style.css +1 -1
- package/build/components/DateField/index.d.ts +1 -1
- package/build/components/DateField/style.css +1 -1
- package/build/components/Directory/style.css +1 -1
- package/build/components/Disclosure/style.css +1 -1
- package/build/components/Divider/style.css +1 -1
- package/build/components/Drawer/style.css +1 -1
- package/build/components/EmptyState/style.css +1 -1
- package/build/components/Field/style.css +1 -1
- package/build/components/FileUpload/style.css +1 -1
- package/build/components/FilterBar/style.css +1 -1
- package/build/components/IconButton/index.cjs +1 -1
- package/build/components/IconButton/index.cjs.map +1 -1
- package/build/components/IconButton/index.d.ts +2 -2
- package/build/components/IconButton/index.js +1 -1
- package/build/components/IconButton/index.js.map +1 -1
- package/build/components/IconButton/style.css +1 -1
- package/build/components/Input/index.d.ts +1 -1
- package/build/components/Input/style.css +1 -1
- package/build/components/Kbd/style.css +1 -1
- package/build/components/Menu/style.css +1 -1
- package/build/components/Modal/style.css +1 -1
- package/build/components/PageHeader/style.css +1 -1
- package/build/components/Pagination/style.css +1 -1
- package/build/components/Panel/style.css +1 -1
- package/build/components/PasswordInput/style.css +1 -1
- package/build/components/Popover/style.css +1 -1
- package/build/components/Price/style.css +1 -1
- package/build/components/Progress/style.css +1 -1
- package/build/components/PromptDialog/style.css +1 -1
- package/build/components/QuantityStepper/style.css +1 -1
- package/build/components/Radio/style.css +1 -1
- package/build/components/RadioCard/style.css +1 -1
- package/build/components/RangeSlider/style.css +1 -1
- package/build/components/Rating/style.css +1 -1
- package/build/components/RatingInput/style.css +1 -1
- package/build/components/ScrollArea/style.css +1 -1
- package/build/components/SectionHeader/style.css +1 -1
- package/build/components/SegmentedControl/style.css +1 -1
- package/build/components/Select/index.cjs +1 -1
- package/build/components/Select/index.cjs.map +1 -1
- package/build/components/Select/index.js +28 -28
- package/build/components/Select/index.js.map +1 -1
- package/build/components/Select/style.css +1 -1
- package/build/components/Skeleton/style.css +1 -1
- package/build/components/Spinner/style.css +1 -1
- package/build/components/Stat/style.css +1 -1
- package/build/components/StatusDot/style.css +1 -1
- package/build/components/Steps/style.css +1 -1
- package/build/components/SummaryCard/style.css +1 -1
- package/build/components/Switch/index.d.ts +1 -1
- package/build/components/Switch/style.css +1 -1
- package/build/components/Table/style.css +1 -1
- package/build/components/TableCheckbox/style.css +1 -1
- package/build/components/Tabs/style.css +1 -1
- package/build/components/TagInput/style.css +1 -1
- package/build/components/TextLink/style.css +1 -1
- package/build/components/Textarea/style.css +1 -1
- package/build/components/Tile/style.css +1 -1
- package/build/components/Timeline/style.css +1 -1
- package/build/components/Toast/style.css +1 -1
- package/build/components/Tooltip/style.css +1 -1
- package/build/constants/breakpoint.constants.cjs +1 -1
- package/build/constants/breakpoint.constants.cjs.map +1 -1
- package/build/constants/breakpoint.constants.d.ts +13 -8
- package/build/constants/breakpoint.constants.js +7 -5
- package/build/constants/breakpoint.constants.js.map +1 -1
- package/build/enums/ui-size.enum.cjs.map +1 -1
- package/build/enums/ui-size.enum.d.ts +5 -2
- package/build/enums/ui-size.enum.js.map +1 -1
- package/build/enums/ui-variant.enum.cjs +1 -1
- package/build/enums/ui-variant.enum.cjs.map +1 -1
- package/build/enums/ui-variant.enum.d.ts +13 -13
- package/build/enums/ui-variant.enum.js +1 -1
- package/build/enums/ui-variant.enum.js.map +1 -1
- package/build/helpers/theme.helper.cjs +1 -23
- package/build/helpers/theme.helper.cjs.map +1 -1
- package/build/helpers/theme.helper.d.ts +13 -44
- package/build/helpers/theme.helper.js +31 -69
- package/build/helpers/theme.helper.js.map +1 -1
- package/build/hooks/useUiTheme.cjs +1 -1
- package/build/hooks/useUiTheme.cjs.map +1 -1
- package/build/hooks/useUiTheme.d.ts +4 -1
- package/build/hooks/useUiTheme.js +34 -28
- package/build/hooks/useUiTheme.js.map +1 -1
- package/build/hooks/useUiTokens.cjs +1 -1
- package/build/hooks/useUiTokens.cjs.map +1 -1
- package/build/hooks/useUiTokens.d.ts +8 -8
- package/build/hooks/useUiTokens.js +24 -27
- package/build/hooks/useUiTokens.js.map +1 -1
- package/build/index.cjs +1 -1
- package/build/index.d.ts +3 -5
- package/build/index.js +194 -202
- package/build/index.js.map +1 -1
- package/build/scss/_index.scss +4 -3
- package/build/scss/_mixins.scss +264 -146
- package/build/scss/_variables.scss +216 -24
- package/build/styles.css +67 -67
- package/build/theme/UiProvider.cjs +1 -1
- package/build/theme/UiProvider.cjs.map +1 -1
- package/build/theme/UiProvider.d.ts +10 -9
- package/build/theme/UiProvider.js +7 -25
- package/build/theme/UiProvider.js.map +1 -1
- package/build/theme/UiThemeScript.cjs +1 -1
- package/build/theme/UiThemeScript.cjs.map +1 -1
- package/build/theme/UiThemeScript.d.ts +13 -10
- package/build/theme/UiThemeScript.js +2 -2
- package/build/theme/UiThemeScript.js.map +1 -1
- package/build/theme/context.js +2 -2
- package/build/types/charts/core/palette.d.ts +6 -8
- package/build/types/chat/Legend/index.d.ts +3 -2
- package/build/types/theme.type.d.ts +6 -48
- package/build/types/types/theme.type.d.ts +6 -48
- package/package.json +10 -10
- package/build/scss/_colors.generated.scss +0 -119
- package/build/scss/_metrics.generated.scss +0 -49
- package/build/theme/initUi.cjs +0 -2
- package/build/theme/initUi.cjs.map +0 -1
- package/build/theme/initUi.d.ts +0 -7
- package/build/theme/initUi.js +0 -10
- package/build/theme/initUi.js.map +0 -1
- package/build/theme/palette.cjs +0 -2
- package/build/theme/palette.cjs.map +0 -1
- package/build/theme/palette.d.ts +0 -219
- package/build/theme/palette.js +0 -148
- package/build/theme/palette.js.map +0 -1
- package/build/theme/tokens.cjs +0 -2
- package/build/theme/tokens.cjs.map +0 -1
- package/build/theme/tokens.d.ts +0 -225
- package/build/theme/tokens.js +0 -384
- package/build/theme/tokens.js.map +0 -1
- package/build/types/theme/palette.d.ts +0 -219
- package/build/types/theme/tokens.d.ts +0 -225
package/build/charts.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as m, jsxs as X, Fragment as Ft } from "react/jsx-runtime";
|
|
3
|
-
import { useId as
|
|
4
|
-
import { useAnnounce as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import { useId as ye, useState as Tt, useRef as Pt, useEffect as ee, useCallback as et, useLayoutEffect as xe, memo as ot, useMemo as L } from "react";
|
|
4
|
+
import { useAnnounce as we, useUi as xt } from "@handijit/ui";
|
|
5
|
+
import { cssVar as Yt } from "@handijit/design";
|
|
6
|
+
const lt = (t, o) => Object.assign(t, { displayName: o }), ke = "ui-axis-AqLAe", Ne = "ui-axis__label-dHxpo", ve = "ui-axis__grid-RVxXW", Ae = "ui-axis__baseline-jhG2z", rt = {
|
|
7
|
+
axis: ke,
|
|
8
|
+
axis__label: Ne,
|
|
9
|
+
axis__grid: ve,
|
|
10
|
+
axis__baseline: Ae
|
|
10
11
|
}, vt = (t, o, e) => {
|
|
11
12
|
const n = e(t);
|
|
12
|
-
return t.map((r,
|
|
13
|
-
},
|
|
13
|
+
return t.map((r, l) => ({ position: o(r), label: n[l] }));
|
|
14
|
+
}, ge = 6.4, ut = (t) => t.length * ge, be = (t, o = 8) => {
|
|
14
15
|
if (t.length < 2) return [...t];
|
|
15
|
-
const e = Math.max(...t.map((
|
|
16
|
-
return t.filter((
|
|
16
|
+
const e = Math.max(...t.map((l) => ut(l.label))), n = Math.abs(t[1].position - t[0].position), r = n <= 0 ? 1 : Math.max(1, Math.ceil((e + o) / n));
|
|
17
|
+
return t.filter((l, d) => d % r === 0);
|
|
17
18
|
}, Gt = (t, o) => {
|
|
18
|
-
const e = Math.max(1, Math.floor(o /
|
|
19
|
+
const e = Math.max(1, Math.floor(o / ge));
|
|
19
20
|
return t.length <= e ? t : `${t.slice(0, Math.max(1, e - 1))}…`;
|
|
20
21
|
}, ft = ({ area: t, ticks: o, side: e, hasGrid: n = !1 }) => /* @__PURE__ */ m("g", { className: rt.axis, "aria-hidden": !0, children: o.map(
|
|
21
22
|
(r) => e === "bottom" ? /* @__PURE__ */ X("g", { children: [
|
|
@@ -62,7 +63,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
62
63
|
}
|
|
63
64
|
)
|
|
64
65
|
] }, `${r.position}-${r.label}`)
|
|
65
|
-
) }),
|
|
66
|
+
) }), Ut = ({ area: t, ticks: o, side: e }) => /* @__PURE__ */ m("g", { className: rt.axis, "aria-hidden": !0, children: e === "bottom" ? /* @__PURE__ */ X(Ft, { children: [
|
|
66
67
|
/* @__PURE__ */ m(
|
|
67
68
|
"line",
|
|
68
69
|
{
|
|
@@ -73,7 +74,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
73
74
|
y2: t.bottom
|
|
74
75
|
}
|
|
75
76
|
),
|
|
76
|
-
|
|
77
|
+
be(o).map((n) => /* @__PURE__ */ m(
|
|
77
78
|
"text",
|
|
78
79
|
{
|
|
79
80
|
className: rt.axis__label,
|
|
@@ -107,77 +108,77 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
107
108
|
},
|
|
108
109
|
`${n.position}-${n.label}`
|
|
109
110
|
))
|
|
110
|
-
] }) }), V = (t) => Math.round(t * 100) / 100,
|
|
111
|
+
] }) }), V = (t) => Math.round(t * 100) / 100, Te = (t) => {
|
|
111
112
|
const o = [];
|
|
112
113
|
let e = [];
|
|
113
114
|
for (const n of t)
|
|
114
115
|
n === null || !Number.isFinite(n.x) || !Number.isFinite(n.y) ? (e.length > 0 && o.push(e), e = []) : e.push(n);
|
|
115
116
|
return e.length > 0 && o.push(e), o;
|
|
116
|
-
}, qt = (t) => t.map((o, e) => `${e === 0 ? "M" : "L"}${V(o.x)},${V(o.y)}`).join(""),
|
|
117
|
+
}, qt = (t) => t.map((o, e) => `${e === 0 ? "M" : "L"}${V(o.x)},${V(o.y)}`).join(""), _e = (t) => {
|
|
117
118
|
const o = t.length;
|
|
118
119
|
if (o < 3) return qt(t);
|
|
119
120
|
const e = [], n = [];
|
|
120
|
-
for (let
|
|
121
|
-
const d = t[
|
|
122
|
-
n.push(d === 0 ? 0 : (t[
|
|
121
|
+
for (let l = 0; l < o - 1; l += 1) {
|
|
122
|
+
const d = t[l + 1].x - t[l].x;
|
|
123
|
+
n.push(d === 0 ? 0 : (t[l + 1].y - t[l].y) / d);
|
|
123
124
|
}
|
|
124
125
|
e.push(n[0]);
|
|
125
|
-
for (let
|
|
126
|
+
for (let l = 1; l < o - 1; l += 1)
|
|
126
127
|
e.push(
|
|
127
|
-
n[
|
|
128
|
+
n[l - 1] * n[l] <= 0 ? 0 : (n[l - 1] + n[l]) / 2
|
|
128
129
|
);
|
|
129
130
|
e.push(n[o - 2]);
|
|
130
|
-
for (let
|
|
131
|
-
if (n[
|
|
132
|
-
e[
|
|
131
|
+
for (let l = 0; l < o - 1; l += 1) {
|
|
132
|
+
if (n[l] === 0) {
|
|
133
|
+
e[l] = 0, e[l + 1] = 0;
|
|
133
134
|
continue;
|
|
134
135
|
}
|
|
135
|
-
const d = e[
|
|
136
|
+
const d = e[l] / n[l], u = e[l + 1] / n[l], k = d * d + u * u;
|
|
136
137
|
if (k > 9) {
|
|
137
138
|
const T = 3 / Math.sqrt(k);
|
|
138
|
-
e[
|
|
139
|
+
e[l] = T * d * n[l], e[l + 1] = T * u * n[l];
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
142
|
let r = `M${V(t[0].x)},${V(t[0].y)}`;
|
|
142
|
-
for (let
|
|
143
|
-
const d = t[
|
|
144
|
-
r += `C${V(d.x + k)},${V(d.y + e[
|
|
143
|
+
for (let l = 0; l < o - 1; l += 1) {
|
|
144
|
+
const d = t[l], u = t[l + 1], k = (u.x - d.x) / 3;
|
|
145
|
+
r += `C${V(d.x + k)},${V(d.y + e[l] * k)} ${V(u.x - k)},${V(u.y - e[l + 1] * k)} ${V(u.x)},${V(u.y)}`;
|
|
145
146
|
}
|
|
146
147
|
return r;
|
|
147
|
-
},
|
|
148
|
+
}, Ie = (t, o = "linear") => Te(t).map((e) => o === "monotone" ? _e(e) : qt(e)).join(""), Ce = (t, o, e = "linear") => {
|
|
148
149
|
const n = [];
|
|
149
|
-
let r = [],
|
|
150
|
+
let r = [], l = [];
|
|
150
151
|
const d = () => {
|
|
151
152
|
if (r.length > 0) {
|
|
152
|
-
const u = e === "monotone" ?
|
|
153
|
+
const u = e === "monotone" ? _e : qt, k = u([...l].reverse()).replace(/^M/, "L");
|
|
153
154
|
n.push(`${u(r)}${k}Z`);
|
|
154
155
|
}
|
|
155
|
-
r = [],
|
|
156
|
+
r = [], l = [];
|
|
156
157
|
};
|
|
157
158
|
return t.forEach((u, k) => {
|
|
158
159
|
const T = o[k];
|
|
159
|
-
u === null || T === null || T === void 0 ? d() : (r.push(u),
|
|
160
|
+
u === null || T === null || T === void 0 ? d() : (r.push(u), l.push(T));
|
|
160
161
|
}), d(), n.join("");
|
|
161
162
|
}, nt = (t, o, e, n) => ({
|
|
162
163
|
x: t + e * Math.sin(n),
|
|
163
164
|
y: o - e * Math.cos(n)
|
|
164
|
-
}),
|
|
165
|
-
const d =
|
|
165
|
+
}), ne = (t, o, e, n, r, l) => {
|
|
166
|
+
const d = l - r;
|
|
166
167
|
if (d <= 0 || e <= 0) return "";
|
|
167
168
|
if (d >= Math.PI * 2 - 1e-6) {
|
|
168
169
|
const g = (R, z) => `M${V(t)},${V(o - R)}A${R},${R} 0 1 ${z} ${V(t)},${V(o + R)}A${R},${R} 0 1 ${z} ${V(t)},${V(o - R)}Z`;
|
|
169
170
|
return g(e, 1) + (n > 0 ? g(n, 0) : "");
|
|
170
171
|
}
|
|
171
|
-
const u = d > Math.PI ? 1 : 0, k = nt(t, o, e, r), T = nt(t, o, e,
|
|
172
|
+
const u = d > Math.PI ? 1 : 0, k = nt(t, o, e, r), T = nt(t, o, e, l);
|
|
172
173
|
if (n <= 0)
|
|
173
174
|
return `M${V(t)},${V(o)}L${V(k.x)},${V(k.y)}A${e},${e} 0 ${u} 1 ${V(T.x)},${V(T.y)}Z`;
|
|
174
|
-
const A = nt(t, o, n,
|
|
175
|
+
const A = nt(t, o, n, l), I = nt(t, o, n, r);
|
|
175
176
|
return `M${V(k.x)},${V(k.y)}A${e},${e} 0 ${u} 1 ${V(T.x)},${V(T.y)}L${V(A.x)},${V(A.y)}A${n},${n} 0 ${u} 0 ${V(I.x)},${V(I.y)}Z`;
|
|
176
|
-
},
|
|
177
|
-
const [e, n] = t, [r,
|
|
178
|
-
return u.domain = t, u.range = o, u.invert = (k) =>
|
|
177
|
+
}, oe = (t) => t.length === 0 ? "" : `${qt(t)}Z`, pt = (t, o) => {
|
|
178
|
+
const [e, n] = t, [r, l] = o, d = n - e, u = (k) => d === 0 ? (r + l) / 2 : r + (k - e) / d * (l - r);
|
|
179
|
+
return u.domain = t, u.range = o, u.invert = (k) => l === r ? e : e + (k - r) / (l - r) * d, u;
|
|
179
180
|
}, Dt = (t, o, { paddingInner: e = 0.2, paddingOuter: n = 0.1 } = {}) => {
|
|
180
|
-
const [r,
|
|
181
|
+
const [r, l] = o, d = t.length, u = d === 0 ? 0 : (l - r) / Math.max(1, d - e + n * 2), k = u * (1 - e), T = r + u * n, A = new Map(t.map((g, R) => [g, R])), I = (g) => {
|
|
181
182
|
const R = A.get(g);
|
|
182
183
|
return R === void 0 ? Number.NaN : T + R * u;
|
|
183
184
|
};
|
|
@@ -188,12 +189,12 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
188
189
|
Math.floor((g - r - u * n + (u - k) / 2) / u)
|
|
189
190
|
)
|
|
190
191
|
), I;
|
|
191
|
-
},
|
|
192
|
+
}, Qt = (t, o, e) => {
|
|
192
193
|
const n = Math.abs(o - t);
|
|
193
194
|
if (n === 0 || !Number.isFinite(n) || e <= 0) return 1;
|
|
194
|
-
const r = n / e,
|
|
195
|
-
return (d >= 7.5 ? 10 : d >= 3.5 ? 5 : d >= 1.5 ? 2 : 1) *
|
|
196
|
-
},
|
|
195
|
+
const r = n / e, l = 10 ** Math.floor(Math.log10(r)), d = r / l;
|
|
196
|
+
return (d >= 7.5 ? 10 : d >= 3.5 ? 5 : d >= 1.5 ? 2 : 1) * l;
|
|
197
|
+
}, Zt = (t, o) => {
|
|
197
198
|
const e = Math.max(0, -Math.floor(Math.log10(o)) + 1);
|
|
198
199
|
return Number(t.toFixed(Math.min(e, 12)));
|
|
199
200
|
}, At = (t, o, e = 5) => {
|
|
@@ -204,16 +205,16 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
204
205
|
const d = Math.abs(n) * 0.5;
|
|
205
206
|
n = n > 0 ? 0 : n - d, r = r < 0 ? 0 : r + d;
|
|
206
207
|
}
|
|
207
|
-
const
|
|
208
|
-
return [
|
|
208
|
+
const l = Qt(n, r, e);
|
|
209
|
+
return [Zt(Math.floor(n / l) * l, l), Zt(Math.ceil(r / l) * l, l)];
|
|
209
210
|
}, ct = (t, o, e = 5) => {
|
|
210
211
|
if (!Number.isFinite(t) || !Number.isFinite(o)) return [];
|
|
211
212
|
if (t === o) return [t];
|
|
212
|
-
const n =
|
|
213
|
-
for (let u = r; u <=
|
|
214
|
-
d.push(
|
|
213
|
+
const n = Qt(t, o, e), r = Math.ceil(t / n - 1e-9), l = Math.floor(o / n + 1e-9), d = [];
|
|
214
|
+
for (let u = r; u <= l && d.length < 1e3; u += 1)
|
|
215
|
+
d.push(Zt(u * n, n));
|
|
215
216
|
return d;
|
|
216
|
-
},
|
|
217
|
+
}, Fe = (t, o) => {
|
|
217
218
|
if (t.length === 0) return -1;
|
|
218
219
|
let e = 0, n = t.length - 1;
|
|
219
220
|
for (; e < n; ) {
|
|
@@ -232,10 +233,10 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
232
233
|
if (t.length === 1) return t[0];
|
|
233
234
|
const e = (t.length - 1) * Math.min(1, Math.max(0, o)), n = Math.floor(e), r = e - n;
|
|
234
235
|
return n + 1 < t.length ? t[n] + (t[n + 1] - t[n]) * r : t[n];
|
|
235
|
-
},
|
|
236
|
+
}, Re = (t) => {
|
|
236
237
|
const o = Ot(t).sort((d, u) => d - u);
|
|
237
238
|
if (o.length === 0) return null;
|
|
238
|
-
const e = Wt(o, 0.25), n = Wt(o, 0.75), r = (n - e) * 1.5,
|
|
239
|
+
const e = Wt(o, 0.25), n = Wt(o, 0.75), r = (n - e) * 1.5, l = o.filter((d) => d >= e - r && d <= n + r);
|
|
239
240
|
return {
|
|
240
241
|
count: o.length,
|
|
241
242
|
min: o[0],
|
|
@@ -243,16 +244,16 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
243
244
|
median: Wt(o, 0.5),
|
|
244
245
|
q3: n,
|
|
245
246
|
max: o[o.length - 1],
|
|
246
|
-
whiskerLow:
|
|
247
|
-
whiskerHigh:
|
|
247
|
+
whiskerLow: l[0] ?? e,
|
|
248
|
+
whiskerHigh: l[l.length - 1] ?? n,
|
|
248
249
|
outliers: o.filter((d) => d < e - r || d > n + r)
|
|
249
250
|
};
|
|
250
|
-
},
|
|
251
|
+
}, Se = (t, o) => {
|
|
251
252
|
const e = Ot(t);
|
|
252
253
|
if (e.length === 0) return [];
|
|
253
254
|
const [n, r] = yt(e);
|
|
254
255
|
if (n === r) return [{ from: n, to: n + 1, count: e.length }];
|
|
255
|
-
const
|
|
256
|
+
const l = o ?? Math.ceil(Math.log2(e.length)) + 1, d = Qt(n, r, Math.max(1, l)), u = Math.floor(n / d) * d, k = Math.max(1, Math.ceil((r - u) / d - 1e-9)), T = Array.from({ length: k }, (A, I) => ({
|
|
256
257
|
from: u + I * d,
|
|
257
258
|
to: u + (I + 1) * d,
|
|
258
259
|
count: 0
|
|
@@ -262,11 +263,11 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
262
263
|
T[I].count += 1;
|
|
263
264
|
}
|
|
264
265
|
return T;
|
|
265
|
-
}, Nt = (t) => typeof t == "number" && Number.isFinite(t) ? t : null,
|
|
266
|
+
}, Nt = (t) => typeof t == "number" && Number.isFinite(t) ? t : null, it = { top: 12, right: 16, bottom: 28, minLeft: 32 }, He = (t, o) => {
|
|
266
267
|
const e = t.map(() => 0), n = t.map(() => 0), r = {};
|
|
267
|
-
for (const
|
|
268
|
-
r[
|
|
269
|
-
const k = Nt(d[
|
|
268
|
+
for (const l of o)
|
|
269
|
+
r[l] = t.map((d, u) => {
|
|
270
|
+
const k = Nt(d[l]) ?? 0;
|
|
270
271
|
if (k >= 0) {
|
|
271
272
|
const A = e[u];
|
|
272
273
|
return e[u] += k, { base: A, top: e[u] };
|
|
@@ -275,13 +276,13 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
275
276
|
return n[u] += k, { base: T, top: n[u] };
|
|
276
277
|
});
|
|
277
278
|
return r;
|
|
278
|
-
},
|
|
279
|
-
const { rows: o, xKey: e, series: n, width: r, height:
|
|
279
|
+
}, Le = (t) => {
|
|
280
|
+
const { rows: o, xKey: e, series: n, width: r, height: l, isStacked: d, curve: u, formatX: k } = t, T = n.some((v) => v.type === "bar"), I = (T && n.every((v) => v.type === "bar") ? t.orientation : "vertical") === "horizontal", g = o.map((v) => v[e]), R = !T && !I && g.length > 1 && g.every((v) => Nt(v) !== null), z = {};
|
|
280
281
|
if (d)
|
|
281
282
|
for (const v of ["left", "right"])
|
|
282
283
|
for (const B of ["bar", "area"]) {
|
|
283
284
|
const W = n.filter((Q) => (Q.axis ?? "left") === v && Q.type === B).map((Q) => Q.key);
|
|
284
|
-
Object.assign(z,
|
|
285
|
+
Object.assign(z, He(o, W));
|
|
285
286
|
}
|
|
286
287
|
const S = (v, B) => {
|
|
287
288
|
if (z[v]) return z[v][B];
|
|
@@ -299,22 +300,22 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
299
300
|
if (B.some((dt) => dt.type !== "line") && (W = Math.min(W, 0), Q = Math.max(Q, 0)), !Number.isFinite(W) || !Number.isFinite(Q)) return [0, 1];
|
|
300
301
|
const [st, K] = v === "left" ? t.domain ?? [void 0, void 0] : [void 0, void 0], tt = At(st ?? W, K ?? Q);
|
|
301
302
|
return [st ?? tt[0], K ?? tt[1]];
|
|
302
|
-
}, D = q("left") ?? [0, 1], N = q("right"), C = N !== null && !I, P = t.formatLeft(ct(D[0], D[1], 5)), M = N ? t.formatRight(ct(N[0], N[1], 5)) : [], w = o.map((v) => k(v[e])), h = I ? Math.min(r * 0.4, Math.max(
|
|
303
|
+
}, D = q("left") ?? [0, 1], N = q("right"), C = N !== null && !I, P = t.formatLeft(ct(D[0], D[1], 5)), M = N ? t.formatRight(ct(N[0], N[1], 5)) : [], w = o.map((v) => k(v[e])), h = I ? Math.min(r * 0.4, Math.max(it.minLeft, ...w.map(ut)) + 12) : Math.max(it.minLeft, ...P.map(ut)) + 10, p = C ? Math.max(it.minLeft, ...M.map(ut)) + 10 : it.right, a = {
|
|
303
304
|
left: h,
|
|
304
|
-
top:
|
|
305
|
+
top: it.top,
|
|
305
306
|
right: Math.max(h + 1, r - p),
|
|
306
|
-
bottom: Math.max(
|
|
307
|
+
bottom: Math.max(it.top + 1, l - it.bottom),
|
|
307
308
|
width: Math.max(1, r - p - h),
|
|
308
|
-
height: Math.max(1,
|
|
309
|
-
},
|
|
309
|
+
height: Math.max(1, l - it.bottom - it.top)
|
|
310
|
+
}, i = I ? [a.top, a.bottom] : [a.left, a.right], c = I ? [a.left, a.right] : [a.bottom, a.top], s = pt(D, c), f = N ? pt(N, c) : s, b = (v) => (v.axis ?? "left") === "right" && N ? f : s;
|
|
310
311
|
let $, y = 0, _ = null;
|
|
311
312
|
if (R) {
|
|
312
313
|
const v = g.map((B) => Nt(B));
|
|
313
|
-
_ = pt(yt(v),
|
|
314
|
+
_ = pt(yt(v), i), $ = v.map(_);
|
|
314
315
|
} else {
|
|
315
316
|
const v = Dt(
|
|
316
317
|
o.map((B, W) => String(W)),
|
|
317
|
-
|
|
318
|
+
i,
|
|
318
319
|
T ? { paddingInner: 0.24, paddingOuter: 0.12 } : { paddingInner: 0, paddingOuter: 0 }
|
|
319
320
|
);
|
|
320
321
|
y = v.bandwidth, $ = o.map((B, W) => v(String(W)) + v.bandwidth / 2);
|
|
@@ -325,24 +326,24 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
325
326
|
o.forEach((st, K) => {
|
|
326
327
|
const tt = S(v.key, K);
|
|
327
328
|
if (!tt || tt.top === tt.base) return;
|
|
328
|
-
const dt = $[K] - y / 2 + Q * (x + O), Mt = W(tt.base), mt = W(tt.top),
|
|
329
|
+
const dt = $[K] - y / 2 + Q * (x + O), Mt = W(tt.base), mt = W(tt.top), Kt = Math.min(Mt, mt), te = Math.max(1, Math.abs(mt - Mt));
|
|
329
330
|
H.push(
|
|
330
331
|
I ? {
|
|
331
332
|
key: v.key,
|
|
332
333
|
index: K,
|
|
333
334
|
tone: v.tone,
|
|
334
|
-
x:
|
|
335
|
+
x: Kt,
|
|
335
336
|
y: dt,
|
|
336
|
-
width:
|
|
337
|
+
width: te,
|
|
337
338
|
height: x
|
|
338
339
|
} : {
|
|
339
340
|
key: v.key,
|
|
340
341
|
index: K,
|
|
341
342
|
tone: v.tone,
|
|
342
343
|
x: dt,
|
|
343
|
-
y:
|
|
344
|
+
y: Kt,
|
|
344
345
|
width: x,
|
|
345
|
-
height:
|
|
346
|
+
height: te
|
|
346
347
|
}
|
|
347
348
|
);
|
|
348
349
|
});
|
|
@@ -359,9 +360,9 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
359
360
|
const tt = S(v.key, K);
|
|
360
361
|
return tt ? G($[K], B(tt.base)) : null;
|
|
361
362
|
});
|
|
362
|
-
U.push({ key: v.key, tone: v.tone, d:
|
|
363
|
+
U.push({ key: v.key, tone: v.tone, d: Ce(W, Q, u) });
|
|
363
364
|
}
|
|
364
|
-
E.push({ key: v.key, tone: v.tone, d:
|
|
365
|
+
E.push({ key: v.key, tone: v.tone, d: Ie(W, u) });
|
|
365
366
|
}
|
|
366
367
|
const ht = o.map((v, B) => {
|
|
367
368
|
let W = null;
|
|
@@ -381,7 +382,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
381
382
|
),
|
|
382
383
|
v,
|
|
383
384
|
W
|
|
384
|
-
),
|
|
385
|
+
), $e = _ ? ct(_.domain[0], _.domain[1], Math.max(2, Math.floor(a.width / 90))).map(
|
|
385
386
|
(v) => ({
|
|
386
387
|
position: _(v),
|
|
387
388
|
label: k(v)
|
|
@@ -396,7 +397,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
396
397
|
centers: $,
|
|
397
398
|
bandwidth: y,
|
|
398
399
|
isContinuous: R,
|
|
399
|
-
categoryTicks:
|
|
400
|
+
categoryTicks: $e,
|
|
400
401
|
leftTicks: It(s, D, t.formatLeft),
|
|
401
402
|
rightTicks: C && N ? It(f, N, t.formatRight) : [],
|
|
402
403
|
hasRightAxis: C,
|
|
@@ -406,40 +407,40 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
406
407
|
points: F,
|
|
407
408
|
anchors: ht
|
|
408
409
|
};
|
|
409
|
-
},
|
|
410
|
+
}, se = (...t) => {
|
|
410
411
|
let o = "";
|
|
411
412
|
for (const e of t)
|
|
412
413
|
e && (o = o === "" ? e : `${o} ${e}`);
|
|
413
414
|
return o;
|
|
414
|
-
},
|
|
415
|
-
"
|
|
416
|
-
"
|
|
417
|
-
"
|
|
418
|
-
"
|
|
419
|
-
"
|
|
420
|
-
"
|
|
421
|
-
], St = (t, o) => o ??
|
|
422
|
-
chart:
|
|
423
|
-
chart__canvas:
|
|
424
|
-
chart__svg:
|
|
425
|
-
chart__overlay:
|
|
426
|
-
chart__tooltip:
|
|
427
|
-
chart__tooltipTitle:
|
|
428
|
-
chart__tooltipRow:
|
|
429
|
-
chart__tooltipLabel:
|
|
430
|
-
chart__tooltipValue:
|
|
431
|
-
chart__swatch:
|
|
432
|
-
chart__legend:
|
|
433
|
-
chart__legendItem:
|
|
415
|
+
}, ae = [
|
|
416
|
+
"chart-1",
|
|
417
|
+
"chart-2",
|
|
418
|
+
"chart-3",
|
|
419
|
+
"chart-4",
|
|
420
|
+
"chart-5",
|
|
421
|
+
"chart-6"
|
|
422
|
+
], St = (t, o) => o ?? ae[t % ae.length], Z = (t) => Yt(t === "muted" ? "text-3" : t), Ee = "ui-chart-iR-5u", ze = "ui-chart__canvas-4wf8o", Pe = "ui-chart__svg-yC5iw", De = "ui-chart__overlay-kbXEv", Ge = "ui-chart__tooltip-wbhLY", qe = "ui-chart__tooltipTitle-j-1Nw", Oe = "ui-chart__tooltipRow-phors", Be = "ui-chart__tooltipLabel-72x80", We = "ui-chart__tooltipValue-caeby", Ve = "ui-chart__swatch--mk77", je = "ui-chart__legend-EhXcQ", Xe = "ui-chart__legendItem--AaGe", Ye = "ui-chart__srOnly-Oyem2", J = {
|
|
423
|
+
chart: Ee,
|
|
424
|
+
chart__canvas: ze,
|
|
425
|
+
chart__svg: Pe,
|
|
426
|
+
chart__overlay: De,
|
|
427
|
+
chart__tooltip: Ge,
|
|
428
|
+
chart__tooltipTitle: qe,
|
|
429
|
+
chart__tooltipRow: Oe,
|
|
430
|
+
chart__tooltipLabel: Be,
|
|
431
|
+
chart__tooltipValue: We,
|
|
432
|
+
chart__swatch: Ve,
|
|
433
|
+
chart__legend: je,
|
|
434
|
+
chart__legendItem: Xe,
|
|
434
435
|
"chart__legendItem--hidden": "ui-chart__legendItem--hidden-D3li8",
|
|
435
|
-
chart__srOnly:
|
|
436
|
-
},
|
|
436
|
+
chart__srOnly: Ye
|
|
437
|
+
}, re = 12, gt = ({
|
|
437
438
|
label: t,
|
|
438
439
|
description: o,
|
|
439
440
|
containerRef: e,
|
|
440
441
|
width: n,
|
|
441
442
|
height: r,
|
|
442
|
-
plot:
|
|
443
|
+
plot: l,
|
|
443
444
|
overlay: d,
|
|
444
445
|
underlay: u,
|
|
445
446
|
itemCount: k,
|
|
@@ -454,16 +455,16 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
454
455
|
className: D,
|
|
455
456
|
testId: N
|
|
456
457
|
}) => {
|
|
457
|
-
const C =
|
|
458
|
-
|
|
458
|
+
const C = ye(), P = we(), [M, w] = Tt(null), h = Pt(null), p = Pt(null), a = Pt(null);
|
|
459
|
+
ee(() => {
|
|
459
460
|
M !== null && M >= k && w(k > 0 ? k - 1 : null);
|
|
460
|
-
}, [M, k]),
|
|
461
|
+
}, [M, k]), ee(
|
|
461
462
|
() => () => {
|
|
462
463
|
h.current !== null && cancelAnimationFrame(h.current);
|
|
463
464
|
},
|
|
464
465
|
[]
|
|
465
466
|
);
|
|
466
|
-
const
|
|
467
|
+
const i = et(
|
|
467
468
|
(y) => {
|
|
468
469
|
const _ = y.currentTarget.getBoundingClientRect();
|
|
469
470
|
a.current = { x: y.clientX - _.left, y: y.clientY - _.top }, h.current === null && (h.current = requestAnimationFrame(() => {
|
|
@@ -485,12 +486,12 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
485
486
|
}
|
|
486
487
|
H !== null && (y.preventDefault(), c(H));
|
|
487
488
|
}, f = M === null ? null : I(M), b = M === null ? null : g(M), $ = b == null ? void 0 : b.x;
|
|
488
|
-
return
|
|
489
|
+
return xe(() => {
|
|
489
490
|
const y = p.current;
|
|
490
491
|
if (!y || $ === void 0) return;
|
|
491
|
-
const _ = y.offsetWidth, G = $ > n / 2, H = R === "outward" ? !G : G, j = $ -
|
|
492
|
+
const _ = y.offsetWidth, G = $ > n / 2, H = R === "outward" ? !G : G, j = $ - re - _, Y = $ + re, O = j >= 0, x = Y + _ <= n, F = R === "outward" ? H ? j : Y : H ? O || !x ? j : Y : x || !O ? Y : j;
|
|
492
493
|
y.style.left = `${Math.min(Math.max(0, F), Math.max(0, n - _))}px`;
|
|
493
|
-
}, [M, $, n, R]), /* @__PURE__ */ X("figure", { className:
|
|
494
|
+
}, [M, $, n, R]), /* @__PURE__ */ X("figure", { className: se(J.chart, D), "data-testid": N, children: [
|
|
494
495
|
/* @__PURE__ */ X("div", { ref: e, className: J.chart__canvas, style: { blockSize: r }, children: [
|
|
495
496
|
/* @__PURE__ */ X(
|
|
496
497
|
"svg",
|
|
@@ -503,14 +504,14 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
503
504
|
"aria-label": t,
|
|
504
505
|
"aria-describedby": o ? C : void 0,
|
|
505
506
|
tabIndex: k > 0 ? 0 : void 0,
|
|
506
|
-
onPointerMove:
|
|
507
|
-
onPointerDown:
|
|
507
|
+
onPointerMove: i,
|
|
508
|
+
onPointerDown: i,
|
|
508
509
|
onPointerLeave: () => w(null),
|
|
509
510
|
onKeyDown: s,
|
|
510
511
|
onBlur: () => w(null),
|
|
511
512
|
children: [
|
|
512
513
|
M !== null && u && /* @__PURE__ */ m("g", { className: J.chart__overlay, children: u(M) }),
|
|
513
|
-
|
|
514
|
+
l,
|
|
514
515
|
M !== null && /* @__PURE__ */ m("g", { className: J.chart__overlay, children: d(M) })
|
|
515
516
|
]
|
|
516
517
|
}
|
|
@@ -546,14 +547,14 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
546
547
|
"button",
|
|
547
548
|
{
|
|
548
549
|
type: "button",
|
|
549
|
-
className:
|
|
550
|
+
className: se(
|
|
550
551
|
J.chart__legendItem,
|
|
551
552
|
_ && J["chart__legendItem--hidden"]
|
|
552
553
|
),
|
|
553
554
|
"aria-pressed": !_,
|
|
554
555
|
onClick: () => q.onToggle(y.id),
|
|
555
556
|
children: [
|
|
556
|
-
/* @__PURE__ */ m(
|
|
557
|
+
/* @__PURE__ */ m(Ue, { tone: y.tone, isHidden: _ }),
|
|
557
558
|
y.label
|
|
558
559
|
]
|
|
559
560
|
}
|
|
@@ -568,76 +569,76 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
568
569
|
) }, _)) })
|
|
569
570
|
] }) })
|
|
570
571
|
] });
|
|
571
|
-
},
|
|
572
|
+
}, Ue = ({ tone: t, isHidden: o }) => /* @__PURE__ */ m(
|
|
572
573
|
"span",
|
|
573
574
|
{
|
|
574
575
|
"aria-hidden": !0,
|
|
575
576
|
className: J.chart__swatch,
|
|
576
577
|
style: o ? { backgroundColor: "transparent", boxShadow: `inset 0 0 0 2px ${Z(t)}` } : { backgroundColor: Z(t) }
|
|
577
578
|
}
|
|
578
|
-
),
|
|
579
|
+
), ce = /* @__PURE__ */ new Map(), Me = (t, o) => {
|
|
579
580
|
const e = `${t ?? ""}|${JSON.stringify(o)}`;
|
|
580
|
-
let n =
|
|
581
|
-
return n || (n = new Intl.NumberFormat(t, o),
|
|
582
|
-
},
|
|
581
|
+
let n = ce.get(e);
|
|
582
|
+
return n || (n = new Intl.NumberFormat(t, o), ce.set(e, n)), n;
|
|
583
|
+
}, le = (t) => {
|
|
583
584
|
if (t === 0 || !Number.isFinite(t)) return null;
|
|
584
585
|
const [o, e] = Math.abs(t).toExponential(9).split("e"), n = Number(e);
|
|
585
586
|
return { first: n, last: n - (o.replace(".", "").replace(/0+$/, "").length - 1) };
|
|
586
587
|
}, Ht = (t) => (o) => {
|
|
587
588
|
const e = o.reduce(
|
|
588
589
|
(n, r) => {
|
|
589
|
-
var
|
|
590
|
-
return Math.min(n, ((
|
|
590
|
+
var l;
|
|
591
|
+
return Math.min(n, ((l = le(r)) == null ? void 0 : l.last) ?? n);
|
|
591
592
|
},
|
|
592
593
|
Number.POSITIVE_INFINITY
|
|
593
594
|
);
|
|
594
595
|
return o.map(
|
|
595
596
|
(n) => {
|
|
596
597
|
var r;
|
|
597
|
-
return
|
|
598
|
+
return Me(t, {
|
|
598
599
|
notation: "compact",
|
|
599
600
|
maximumSignificantDigits: Math.min(
|
|
600
601
|
21,
|
|
601
|
-
Math.max(1, (((r =
|
|
602
|
+
Math.max(1, (((r = le(n)) == null ? void 0 : r.first) ?? 0) - e + 1)
|
|
602
603
|
)
|
|
603
604
|
}).format(n);
|
|
604
605
|
}
|
|
605
606
|
);
|
|
606
|
-
}, bt = (t) => (o) =>
|
|
607
|
-
} :
|
|
608
|
-
const o = Pt(null), [e, n] = Tt(t ??
|
|
609
|
-
return
|
|
607
|
+
}, bt = (t) => (o) => Me(t, { maximumFractionDigits: 2 }).format(o), Ze = 640, Qe = typeof window > "u" ? () => {
|
|
608
|
+
} : xe, _t = (t) => {
|
|
609
|
+
const o = Pt(null), [e, n] = Tt(t ?? Ze);
|
|
610
|
+
return Qe(() => {
|
|
610
611
|
if (t !== void 0) {
|
|
611
612
|
n(t);
|
|
612
613
|
return;
|
|
613
614
|
}
|
|
614
615
|
const r = o.current;
|
|
615
616
|
if (!r) return;
|
|
616
|
-
const
|
|
617
|
+
const l = (u) => {
|
|
617
618
|
const k = Math.floor(u);
|
|
618
619
|
k > 0 && n((T) => T === k ? T : k);
|
|
619
620
|
};
|
|
620
|
-
if (
|
|
621
|
-
const d = new ResizeObserver(([u]) =>
|
|
621
|
+
if (l(r.clientWidth), typeof ResizeObserver > "u") return;
|
|
622
|
+
const d = new ResizeObserver(([u]) => l(u.contentRect.width));
|
|
622
623
|
return d.observe(r), () => d.disconnect();
|
|
623
624
|
}, [t]), [o, e];
|
|
624
|
-
},
|
|
625
|
-
line:
|
|
626
|
-
area:
|
|
627
|
-
bar:
|
|
628
|
-
point:
|
|
629
|
-
marker:
|
|
630
|
-
crosshair:
|
|
631
|
-
band:
|
|
632
|
-
zero:
|
|
633
|
-
},
|
|
625
|
+
}, Je = "ui-line-CLpqU", Ke = "ui-area-LkWXB", tn = "ui-bar-260Bd", en = "ui-point-Vc-kX", nn = "ui-marker-G-xZb", on = "ui-crosshair-nV-xX", sn = "ui-band-jnG7s", an = "ui-zero-GpHvw", at = {
|
|
626
|
+
line: Je,
|
|
627
|
+
area: Ke,
|
|
628
|
+
bar: tn,
|
|
629
|
+
point: en,
|
|
630
|
+
marker: nn,
|
|
631
|
+
crosshair: on,
|
|
632
|
+
band: sn,
|
|
633
|
+
zero: an
|
|
634
|
+
}, rn = 280, ie = "—", cn = ({
|
|
634
635
|
label: t,
|
|
635
636
|
description: o,
|
|
636
637
|
data: e,
|
|
637
638
|
xKey: n,
|
|
638
639
|
xLabel: r,
|
|
639
|
-
series:
|
|
640
|
-
height: d =
|
|
640
|
+
series: l,
|
|
641
|
+
height: d = rn,
|
|
641
642
|
width: u,
|
|
642
643
|
isStacked: k = !1,
|
|
643
644
|
orientation: T = "vertical",
|
|
@@ -652,11 +653,11 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
652
653
|
const { labels: D } = xt(), N = D == null ? void 0 : D.locale, [C, P] = _t(u), [M, w] = Tt(() => /* @__PURE__ */ new Set()), h = L(() => R ?? bt(N), [R, N]), p = L(() => Ht(N), [N]), a = et(
|
|
653
654
|
(x) => x == null ? "" : g(x),
|
|
654
655
|
[g]
|
|
655
|
-
),
|
|
656
|
-
() =>
|
|
657
|
-
[
|
|
658
|
-
), c = L(() =>
|
|
659
|
-
() =>
|
|
656
|
+
), i = L(
|
|
657
|
+
() => l.map((x, F) => ({ ...x, tone: St(F, x.tone) })),
|
|
658
|
+
[l]
|
|
659
|
+
), c = L(() => i.filter((x) => !M.has(x.key)), [i, M]), s = L(
|
|
660
|
+
() => Le({
|
|
660
661
|
rows: e,
|
|
661
662
|
xKey: n,
|
|
662
663
|
series: c,
|
|
@@ -691,7 +692,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
691
692
|
const { area: E } = s;
|
|
692
693
|
if (x < E.left - 4 || x > E.right + 4 || F < E.top - 4 || F > E.bottom + 4)
|
|
693
694
|
return null;
|
|
694
|
-
const U =
|
|
695
|
+
const U = Fe($.centers, f ? F : x);
|
|
695
696
|
return U < 0 ? null : $.indices[U];
|
|
696
697
|
},
|
|
697
698
|
[s, $, f]
|
|
@@ -721,25 +722,25 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
721
722
|
[_]
|
|
722
723
|
), H = L(
|
|
723
724
|
() => ({
|
|
724
|
-
columns: [r ?? n, ...
|
|
725
|
+
columns: [r ?? n, ...i.map((x) => x.label)],
|
|
725
726
|
rows: e.map((x) => [
|
|
726
727
|
a(x[n]),
|
|
727
|
-
...
|
|
728
|
+
...i.map((F) => {
|
|
728
729
|
const E = Nt(x[F.key]);
|
|
729
730
|
return E === null ? ie : (F.format ?? h)(E);
|
|
730
731
|
})
|
|
731
732
|
])
|
|
732
733
|
}),
|
|
733
|
-
[e, n, r,
|
|
734
|
+
[e, n, r, i, h, a]
|
|
734
735
|
), j = L(
|
|
735
736
|
() => /* @__PURE__ */ X("g", { children: [
|
|
736
737
|
f ? /* @__PURE__ */ X(Ft, { children: [
|
|
737
738
|
/* @__PURE__ */ m(ft, { area: s.area, ticks: s.leftTicks, side: "bottom", hasGrid: !0 }),
|
|
738
|
-
/* @__PURE__ */ m(
|
|
739
|
+
/* @__PURE__ */ m(Ut, { area: s.area, ticks: s.categoryTicks, side: "left" })
|
|
739
740
|
] }) : /* @__PURE__ */ X(Ft, { children: [
|
|
740
741
|
/* @__PURE__ */ m(ft, { area: s.area, ticks: s.leftTicks, side: "left", hasGrid: !0 }),
|
|
741
742
|
s.hasRightAxis && /* @__PURE__ */ m(ft, { area: s.area, ticks: s.rightTicks, side: "right" }),
|
|
742
|
-
/* @__PURE__ */ m(
|
|
743
|
+
/* @__PURE__ */ m(Ut, { area: s.area, ticks: s.categoryTicks, side: "bottom" })
|
|
743
744
|
] }),
|
|
744
745
|
s.zero !== null && (f ? /* @__PURE__ */ m(
|
|
745
746
|
"line",
|
|
@@ -884,39 +885,39 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
884
885
|
announce: G,
|
|
885
886
|
table: H,
|
|
886
887
|
legend: {
|
|
887
|
-
entries:
|
|
888
|
+
entries: i.map((x) => ({ id: x.key, label: x.label, tone: x.tone })),
|
|
888
889
|
hidden: M,
|
|
889
890
|
onToggle: (x) => w((F) => {
|
|
890
891
|
const E = new Set(F);
|
|
891
|
-
return E.has(x) ? E.delete(x) :
|
|
892
|
+
return E.has(x) ? E.delete(x) : i.length - F.size > 1 && E.add(x), E;
|
|
892
893
|
})
|
|
893
894
|
},
|
|
894
895
|
className: S,
|
|
895
896
|
testId: q
|
|
896
897
|
}
|
|
897
898
|
);
|
|
898
|
-
}, Bt = ot(
|
|
899
|
+
}, Bt = ot(cn), ln = ({ series: t, ...o }) => {
|
|
899
900
|
const e = L(() => t.map((n) => ({ ...n, type: "line" })), [t]);
|
|
900
901
|
return /* @__PURE__ */ m(Bt, { ...o, series: e });
|
|
901
|
-
},
|
|
902
|
+
}, Yn = /* @__PURE__ */ ot(/* @__PURE__ */ lt(ln, "LineChart")), hn = ({ series: t, ...o }) => {
|
|
902
903
|
const e = L(() => t.map((n) => ({ ...n, type: "area" })), [t]);
|
|
903
904
|
return /* @__PURE__ */ m(Bt, { ...o, series: e });
|
|
904
|
-
},
|
|
905
|
+
}, Un = /* @__PURE__ */ ot(/* @__PURE__ */ lt(hn, "AreaChart")), dn = ({ series: t, ...o }) => {
|
|
905
906
|
const e = L(() => t.map((n) => ({ ...n, type: "bar" })), [t]);
|
|
906
907
|
return /* @__PURE__ */ m(Bt, { ...o, series: e });
|
|
907
|
-
},
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
-
),
|
|
910
|
-
slice:
|
|
911
|
-
center__value:
|
|
912
|
-
center__label:
|
|
913
|
-
}, Lt = 6,
|
|
908
|
+
}, Zn = /* @__PURE__ */ ot(/* @__PURE__ */ lt(dn, "BarChart")), mn = (t) => /* @__PURE__ */ m(Bt, { ...t }), Qn = /* @__PURE__ */ ot(
|
|
909
|
+
/* @__PURE__ */ lt(mn, "ComposedChart")
|
|
910
|
+
), un = "ui-slice-dFWuh", fn = "ui-center__value-GnqKe", pn = "ui-center__label-DsgTV", Ct = {
|
|
911
|
+
slice: un,
|
|
912
|
+
center__value: fn,
|
|
913
|
+
center__label: pn
|
|
914
|
+
}, Lt = 6, he = 1.5, yn = ({
|
|
914
915
|
label: t,
|
|
915
916
|
description: o,
|
|
916
917
|
data: e,
|
|
917
918
|
variant: n = "donut",
|
|
918
919
|
centerValue: r,
|
|
919
|
-
centerLabel:
|
|
920
|
+
centerLabel: l,
|
|
920
921
|
valueLabel: d,
|
|
921
922
|
height: u = 260,
|
|
922
923
|
width: k,
|
|
@@ -925,33 +926,33 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
925
926
|
testId: I
|
|
926
927
|
}) => {
|
|
927
928
|
const { labels: g } = xt(), [R, z] = _t(k), [S, q] = Tt(() => /* @__PURE__ */ new Set()), D = L(() => bt(g == null ? void 0 : g.locale), [g == null ? void 0 : g.locale]), N = T ?? D, C = L(
|
|
928
|
-
() => e.map((a,
|
|
929
|
+
() => e.map((a, i) => ({ ...a, tone: St(i, a.tone) })),
|
|
929
930
|
[e]
|
|
930
931
|
), P = L(() => {
|
|
931
932
|
const a = C.filter(
|
|
932
933
|
(_) => !S.has(_.id) && Number.isFinite(_.value) && _.value > 0
|
|
933
|
-
),
|
|
934
|
+
), i = a.reduce((_, G) => _ + G.value, 0), c = z / 2, s = u / 2, f = Math.max(8, Math.min(z, u) / 2 - Lt - 4), b = n === "donut" ? f * 0.62 : 0;
|
|
934
935
|
let $ = 0;
|
|
935
936
|
const y = a.map((_) => {
|
|
936
|
-
const G =
|
|
937
|
-
return $ += G, { ..._, start: H, end: $, share:
|
|
937
|
+
const G = i > 0 ? _.value / i * Math.PI * 2 : 0, H = $;
|
|
938
|
+
return $ += G, { ..._, start: H, end: $, share: i > 0 ? _.value / i : 0 };
|
|
938
939
|
});
|
|
939
|
-
return { cx: c, cy: s, outer: f, inner: b, total:
|
|
940
|
+
return { cx: c, cy: s, outer: f, inner: b, total: i, slices: y };
|
|
940
941
|
}, [C, S, z, u, n]), M = L(() => {
|
|
941
942
|
const a = new Intl.NumberFormat(g == null ? void 0 : g.locale, {
|
|
942
943
|
style: "percent",
|
|
943
944
|
maximumFractionDigits: 1
|
|
944
945
|
});
|
|
945
|
-
return (
|
|
946
|
+
return (i) => a.format(i);
|
|
946
947
|
}, [g == null ? void 0 : g.locale]), w = L(() => {
|
|
947
|
-
const { cx: a, cy:
|
|
948
|
+
const { cx: a, cy: i, outer: c, inner: s, slices: f, total: b } = P;
|
|
948
949
|
return /* @__PURE__ */ X("g", { children: [
|
|
949
950
|
f.map(($) => /* @__PURE__ */ m(
|
|
950
951
|
"path",
|
|
951
952
|
{
|
|
952
953
|
className: Ct.slice,
|
|
953
|
-
d:
|
|
954
|
-
style: { fill: Z($.tone), strokeWidth: f.length > 1 ?
|
|
954
|
+
d: ne(a, i, c, s, $.start, $.end),
|
|
955
|
+
style: { fill: Z($.tone), strokeWidth: f.length > 1 ? he : 0 }
|
|
955
956
|
},
|
|
956
957
|
$.id
|
|
957
958
|
)),
|
|
@@ -961,38 +962,38 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
961
962
|
{
|
|
962
963
|
className: Ct.center__value,
|
|
963
964
|
x: a,
|
|
964
|
-
y:
|
|
965
|
+
y: l ? i - 4 : i,
|
|
965
966
|
dy: "0.32em",
|
|
966
967
|
textAnchor: "middle",
|
|
967
968
|
children: r ?? N(b)
|
|
968
969
|
}
|
|
969
970
|
),
|
|
970
|
-
|
|
971
|
+
l && /* @__PURE__ */ m(
|
|
971
972
|
"text",
|
|
972
973
|
{
|
|
973
974
|
className: Ct.center__label,
|
|
974
975
|
x: a,
|
|
975
|
-
y:
|
|
976
|
+
y: i + 16,
|
|
976
977
|
dy: "0.32em",
|
|
977
978
|
textAnchor: "middle",
|
|
978
|
-
children:
|
|
979
|
+
children: l
|
|
979
980
|
}
|
|
980
981
|
)
|
|
981
982
|
] })
|
|
982
983
|
] });
|
|
983
|
-
}, [P, n, r,
|
|
984
|
-
(a,
|
|
985
|
-
const { cx: c, cy: s, outer: f, inner: b, slices: $ } = P, y = Math.hypot(a - c,
|
|
984
|
+
}, [P, n, r, l, N]), h = et(
|
|
985
|
+
(a, i) => {
|
|
986
|
+
const { cx: c, cy: s, outer: f, inner: b, slices: $ } = P, y = Math.hypot(a - c, i - s);
|
|
986
987
|
if (y > f + Lt || y < b) return null;
|
|
987
|
-
let _ = Math.atan2(a - c, -(
|
|
988
|
+
let _ = Math.atan2(a - c, -(i - s));
|
|
988
989
|
_ < 0 && (_ += Math.PI * 2);
|
|
989
990
|
const G = $.findIndex((H) => _ >= H.start && _ < H.end);
|
|
990
991
|
return G < 0 ? null : G;
|
|
991
992
|
},
|
|
992
993
|
[P]
|
|
993
994
|
), p = (a) => {
|
|
994
|
-
const
|
|
995
|
-
return `${N(
|
|
995
|
+
const i = P.slices[a];
|
|
996
|
+
return `${N(i.value)} (${M(i.share)})`;
|
|
996
997
|
};
|
|
997
998
|
return /* @__PURE__ */ m(
|
|
998
999
|
gt,
|
|
@@ -1004,27 +1005,27 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1004
1005
|
height: u,
|
|
1005
1006
|
plot: w,
|
|
1006
1007
|
overlay: (a) => {
|
|
1007
|
-
const { cx:
|
|
1008
|
+
const { cx: i, cy: c, outer: s, inner: f, slices: b } = P, $ = b[a], y = ($.start + $.end) / 2, _ = nt(0, 0, Lt, y);
|
|
1008
1009
|
return /* @__PURE__ */ m(
|
|
1009
1010
|
"path",
|
|
1010
1011
|
{
|
|
1011
1012
|
className: Ct.slice,
|
|
1012
|
-
d:
|
|
1013
|
-
style: { fill: Z($.tone), strokeWidth:
|
|
1013
|
+
d: ne(i + _.x, c + _.y, s, f, $.start, $.end),
|
|
1014
|
+
style: { fill: Z($.tone), strokeWidth: he }
|
|
1014
1015
|
}
|
|
1015
1016
|
);
|
|
1016
1017
|
},
|
|
1017
1018
|
itemCount: P.slices.length,
|
|
1018
1019
|
pick: h,
|
|
1019
1020
|
tooltip: (a) => {
|
|
1020
|
-
const
|
|
1021
|
+
const i = P.slices[a];
|
|
1021
1022
|
return {
|
|
1022
|
-
rows: [{ id:
|
|
1023
|
+
rows: [{ id: i.id, label: i.label, value: p(a), tone: i.tone }]
|
|
1023
1024
|
};
|
|
1024
1025
|
},
|
|
1025
1026
|
anchor: (a) => {
|
|
1026
|
-
const { cx:
|
|
1027
|
-
return nt(
|
|
1027
|
+
const { cx: i, cy: c, outer: s, slices: f } = P, b = f[a];
|
|
1028
|
+
return nt(i, c, s + Lt, (b.start + b.end) / 2);
|
|
1028
1029
|
},
|
|
1029
1030
|
tooltipSide: "outward",
|
|
1030
1031
|
announce: (a) => `${P.slices[a].label}: ${p(a)}`,
|
|
@@ -1038,54 +1039,54 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1038
1039
|
legend: {
|
|
1039
1040
|
entries: C.map((a) => ({ id: a.id, label: a.label, tone: a.tone })),
|
|
1040
1041
|
hidden: S,
|
|
1041
|
-
onToggle: (a) => q((
|
|
1042
|
-
const c = new Set(
|
|
1043
|
-
return c.has(a) ? c.delete(a) : C.length -
|
|
1042
|
+
onToggle: (a) => q((i) => {
|
|
1043
|
+
const c = new Set(i);
|
|
1044
|
+
return c.has(a) ? c.delete(a) : C.length - i.size > 1 && c.add(a), c;
|
|
1044
1045
|
})
|
|
1045
1046
|
},
|
|
1046
1047
|
className: A,
|
|
1047
1048
|
testId: I
|
|
1048
1049
|
}
|
|
1049
1050
|
);
|
|
1050
|
-
},
|
|
1051
|
+
}, Jn = /* @__PURE__ */ ot(/* @__PURE__ */ lt(yn, "PieChart")), Jt = (t, o, e, { top: n = 12, right: r = 16, bottom: l = 28 } = {}) => {
|
|
1051
1052
|
const d = Math.max(32, ...e.map(ut)) + 10;
|
|
1052
1053
|
return {
|
|
1053
1054
|
left: d,
|
|
1054
1055
|
top: n,
|
|
1055
1056
|
right: Math.max(d + 1, t - r),
|
|
1056
|
-
bottom: Math.max(n + 1, o -
|
|
1057
|
+
bottom: Math.max(n + 1, o - l),
|
|
1057
1058
|
width: Math.max(1, t - r - d),
|
|
1058
|
-
height: Math.max(1, o - n -
|
|
1059
|
+
height: Math.max(1, o - n - l)
|
|
1059
1060
|
};
|
|
1060
|
-
}, Rt = (t, o) => Math.max(2, Math.floor(t / (o ? 90 : 48))),
|
|
1061
|
-
const e = /* @__PURE__ */ new Map(), n = (r,
|
|
1062
|
-
return t.forEach((r,
|
|
1061
|
+
}, Rt = (t, o) => Math.max(2, Math.floor(t / (o ? 90 : 48))), xn = (t, o = 24) => {
|
|
1062
|
+
const e = /* @__PURE__ */ new Map(), n = (r, l) => `${r}:${l}`;
|
|
1063
|
+
return t.forEach((r, l) => {
|
|
1063
1064
|
if (!Number.isFinite(r.x) || !Number.isFinite(r.y)) return;
|
|
1064
1065
|
const d = n(Math.floor(r.x / o), Math.floor(r.y / o)), u = e.get(d);
|
|
1065
|
-
u ? u.push(
|
|
1066
|
+
u ? u.push(l) : e.set(d, [l]);
|
|
1066
1067
|
}), {
|
|
1067
|
-
nearest: (r,
|
|
1068
|
-
const u = Math.ceil(d / o), k = Math.floor(r / o), T = Math.floor(
|
|
1068
|
+
nearest: (r, l, d) => {
|
|
1069
|
+
const u = Math.ceil(d / o), k = Math.floor(r / o), T = Math.floor(l / o);
|
|
1069
1070
|
let A = null, I = d * d;
|
|
1070
1071
|
for (let g = -u; g <= u; g += 1)
|
|
1071
1072
|
for (let R = -u; R <= u; R += 1)
|
|
1072
1073
|
for (const z of e.get(n(k + g, T + R)) ?? []) {
|
|
1073
|
-
const S = (t[z].x - r) ** 2 + (t[z].y -
|
|
1074
|
+
const S = (t[z].x - r) ** 2 + (t[z].y - l) ** 2;
|
|
1074
1075
|
S <= I && (I = S, A = z);
|
|
1075
1076
|
}
|
|
1076
1077
|
return A;
|
|
1077
1078
|
}
|
|
1078
1079
|
};
|
|
1079
|
-
},
|
|
1080
|
-
point:
|
|
1081
|
-
marker:
|
|
1082
|
-
}, $t = { plain: 4, min: 3, max: 16 },
|
|
1080
|
+
}, gn = "ui-point-YKyMm", bn = "ui-marker-ToO1T", de = {
|
|
1081
|
+
point: gn,
|
|
1082
|
+
marker: bn
|
|
1083
|
+
}, $t = { plain: 4, min: 3, max: 16 }, _n = 22, Mn = ({
|
|
1083
1084
|
label: t,
|
|
1084
1085
|
description: o,
|
|
1085
1086
|
series: e,
|
|
1086
1087
|
xLabel: n,
|
|
1087
1088
|
yLabel: r,
|
|
1088
|
-
sizeLabel:
|
|
1089
|
+
sizeLabel: l,
|
|
1089
1090
|
height: d = 300,
|
|
1090
1091
|
width: u,
|
|
1091
1092
|
formatX: k,
|
|
@@ -1102,7 +1103,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1102
1103
|
).sort((c, s) => c.x - s.x || c.y - s.y),
|
|
1103
1104
|
[M, S]
|
|
1104
1105
|
), h = L(() => {
|
|
1105
|
-
const c = At(...yt(w.map((O) => O.x))), s = At(...yt(w.map((O) => O.y))), f = ct(s[0], s[1], Rt(d, !1)), b =
|
|
1106
|
+
const c = At(...yt(w.map((O) => O.x))), s = At(...yt(w.map((O) => O.y))), f = ct(s[0], s[1], Rt(d, !1)), b = Jt(z, d, N(f), { right: 20 }), $ = pt(c, [b.left, b.right]), y = pt(s, [b.bottom, b.top]), _ = Ot(w.map((O) => O.size)), [G, H] = yt(_), j = (O) => O === void 0 || !Number.isFinite(O) || _.length === 0 ? $t.plain : H === G ? ($t.min + $t.max) / 2 : Math.sqrt(
|
|
1106
1107
|
$t.min ** 2 + (O - G) / (H - G) * ($t.max ** 2 - $t.min ** 2)
|
|
1107
1108
|
), Y = w.map((O) => ({
|
|
1108
1109
|
...O,
|
|
@@ -1113,7 +1114,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1113
1114
|
return {
|
|
1114
1115
|
area: b,
|
|
1115
1116
|
placed: Y,
|
|
1116
|
-
index:
|
|
1117
|
+
index: xn(Y.map((O) => ({ x: O.cx, y: O.cy }))),
|
|
1117
1118
|
xTicks: vt(ct(c[0], c[1], Rt(b.width, !0)), $, N),
|
|
1118
1119
|
yTicks: vt(f, y, N)
|
|
1119
1120
|
};
|
|
@@ -1124,7 +1125,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1124
1125
|
h.placed.map((c, s) => /* @__PURE__ */ m(
|
|
1125
1126
|
"circle",
|
|
1126
1127
|
{
|
|
1127
|
-
className:
|
|
1128
|
+
className: de.point,
|
|
1128
1129
|
cx: c.cx,
|
|
1129
1130
|
cy: c.cy,
|
|
1130
1131
|
r: c.r,
|
|
@@ -1138,9 +1139,9 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1138
1139
|
] }),
|
|
1139
1140
|
[h]
|
|
1140
1141
|
), a = et(
|
|
1141
|
-
(c, s) => h.index.nearest(c, s,
|
|
1142
|
+
(c, s) => h.index.nearest(c, s, _n),
|
|
1142
1143
|
[h]
|
|
1143
|
-
),
|
|
1144
|
+
), i = (c) => {
|
|
1144
1145
|
const s = h.placed[c];
|
|
1145
1146
|
return {
|
|
1146
1147
|
title: s.label ?? s.series.label,
|
|
@@ -1148,7 +1149,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1148
1149
|
{ id: "series", label: s.series.label, value: "", tone: s.series.tone },
|
|
1149
1150
|
{ id: "x", label: n, value: C(s.x) },
|
|
1150
1151
|
{ id: "y", label: r, value: P(s.y) },
|
|
1151
|
-
...s.size !== void 0 &&
|
|
1152
|
+
...s.size !== void 0 && l ? [{ id: "size", label: l, value: D(s.size) }] : []
|
|
1152
1153
|
]
|
|
1153
1154
|
};
|
|
1154
1155
|
};
|
|
@@ -1166,7 +1167,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1166
1167
|
return /* @__PURE__ */ m(
|
|
1167
1168
|
"circle",
|
|
1168
1169
|
{
|
|
1169
|
-
className:
|
|
1170
|
+
className: de.marker,
|
|
1170
1171
|
cx: s.cx,
|
|
1171
1172
|
cy: s.cy,
|
|
1172
1173
|
r: s.r + 3,
|
|
@@ -1176,7 +1177,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1176
1177
|
},
|
|
1177
1178
|
itemCount: h.placed.length,
|
|
1178
1179
|
pick: a,
|
|
1179
|
-
tooltip:
|
|
1180
|
+
tooltip: i,
|
|
1180
1181
|
anchor: (c) => ({ x: h.placed[c].cx, y: h.placed[c].cy }),
|
|
1181
1182
|
announce: (c) => {
|
|
1182
1183
|
const s = h.placed[c];
|
|
@@ -1198,63 +1199,63 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1198
1199
|
testId: I
|
|
1199
1200
|
}
|
|
1200
1201
|
);
|
|
1201
|
-
},
|
|
1202
|
-
/* @__PURE__ */
|
|
1203
|
-
),
|
|
1204
|
-
labels:
|
|
1205
|
-
empty:
|
|
1206
|
-
focus:
|
|
1207
|
-
}, Vt = 8,
|
|
1202
|
+
}, Kn = /* @__PURE__ */ ot(
|
|
1203
|
+
/* @__PURE__ */ lt(Mn, "ScatterPlot")
|
|
1204
|
+
), $n = "ui-labels-MJWYF", wn = "ui-empty-AW7c9", kn = "ui-focus-hLQdB", Et = {
|
|
1205
|
+
labels: $n,
|
|
1206
|
+
empty: wn,
|
|
1207
|
+
focus: kn
|
|
1208
|
+
}, Vt = 8, Nn = 28, jt = 140, me = (t, o, e) => {
|
|
1208
1209
|
var r;
|
|
1209
1210
|
const n = (r = t[o]) == null ? void 0 : r[e];
|
|
1210
1211
|
return typeof n == "number" && Number.isFinite(n) ? n : null;
|
|
1211
|
-
},
|
|
1212
|
+
}, ue = (t) => t.map((o, e) => String(e)), vn = ({
|
|
1212
1213
|
label: t,
|
|
1213
1214
|
description: o,
|
|
1214
1215
|
columns: e,
|
|
1215
1216
|
rows: n,
|
|
1216
1217
|
values: r,
|
|
1217
|
-
valueLabel:
|
|
1218
|
-
tone: d = "
|
|
1218
|
+
valueLabel: l,
|
|
1219
|
+
tone: d = "chart-1",
|
|
1219
1220
|
height: u = 280,
|
|
1220
1221
|
width: k,
|
|
1221
1222
|
formatValue: T,
|
|
1222
1223
|
className: A,
|
|
1223
1224
|
testId: I
|
|
1224
1225
|
}) => {
|
|
1225
|
-
const { labels: g } = xt(), [R, z] = _t(k), S = L(() => bt(g == null ? void 0 : g.locale), [g == null ? void 0 : g.locale]), q = T ?? S, D = `ui-heat-${
|
|
1226
|
-
const p = { left: Math.min(z * 0.3, Math.max(32, ...n.map(ut)) + 12), top: 8, right: z - 8, bottom: u - 28 -
|
|
1226
|
+
const { labels: g } = xt(), [R, z] = _t(k), S = L(() => bt(g == null ? void 0 : g.locale), [g == null ? void 0 : g.locale]), q = T ?? S, D = `ui-heat-${ye().replace(/:/g, "")}`, N = L(() => {
|
|
1227
|
+
const p = { left: Math.min(z * 0.3, Math.max(32, ...n.map(ut)) + 12), top: 8, right: z - 8, bottom: u - 28 - Nn }, a = Dt(ue(e), [p.left, p.right], {
|
|
1227
1228
|
paddingInner: 0.06,
|
|
1228
1229
|
paddingOuter: 0
|
|
1229
|
-
}),
|
|
1230
|
+
}), i = Dt(ue(n), [p.top, p.bottom], {
|
|
1230
1231
|
paddingInner: 0.06,
|
|
1231
1232
|
paddingOuter: 0
|
|
1232
1233
|
}), [c, s] = yt(Ot(r.flat())), f = ($) => $ === null ? null : s === c ? 60 : Vt + ($ - c) / (s - c) * (100 - Vt), b = n.flatMap(
|
|
1233
1234
|
($, y) => e.map((_, G) => {
|
|
1234
|
-
const H =
|
|
1235
|
+
const H = me(r, y, G);
|
|
1235
1236
|
return {
|
|
1236
1237
|
row: $,
|
|
1237
1238
|
column: _,
|
|
1238
1239
|
key: `${y}:${G}`,
|
|
1239
1240
|
value: H,
|
|
1240
1241
|
x: a(String(G)),
|
|
1241
|
-
y:
|
|
1242
|
+
y: i(String(y)),
|
|
1242
1243
|
width: a.bandwidth,
|
|
1243
|
-
height:
|
|
1244
|
+
height: i.bandwidth,
|
|
1244
1245
|
mix: f(H)
|
|
1245
1246
|
};
|
|
1246
1247
|
})
|
|
1247
1248
|
);
|
|
1248
|
-
return { area: p, x: a, y:
|
|
1249
|
+
return { area: p, x: a, y: i, cells: b, min: c, max: s };
|
|
1249
1250
|
}, [e, n, r, z, u]), C = Z(d), P = L(() => {
|
|
1250
|
-
const { area: h, x: p, y: a, cells:
|
|
1251
|
+
const { area: h, x: p, y: a, cells: i } = N, c = q(N.max), s = h.right - ut(c) - 8, f = be(
|
|
1251
1252
|
e.map((b, $) => ({
|
|
1252
1253
|
position: p(String($)) + p.bandwidth / 2,
|
|
1253
1254
|
label: b
|
|
1254
1255
|
}))
|
|
1255
1256
|
);
|
|
1256
1257
|
return /* @__PURE__ */ X("g", { children: [
|
|
1257
|
-
|
|
1258
|
+
i.map((b) => /* @__PURE__ */ m(
|
|
1258
1259
|
"rect",
|
|
1259
1260
|
{
|
|
1260
1261
|
className: b.mix === null ? Et.empty : void 0,
|
|
@@ -1263,7 +1264,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1263
1264
|
width: b.width,
|
|
1264
1265
|
height: b.height,
|
|
1265
1266
|
rx: 2,
|
|
1266
|
-
style: b.mix === null ? void 0 : { fill: `color-mix(in srgb, ${C} ${b.mix}%,
|
|
1267
|
+
style: b.mix === null ? void 0 : { fill: `color-mix(in srgb, ${C} ${b.mix}%, ${Yt("bg-surface")})` }
|
|
1267
1268
|
},
|
|
1268
1269
|
b.key
|
|
1269
1270
|
)),
|
|
@@ -1287,7 +1288,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1287
1288
|
{
|
|
1288
1289
|
offset: "0%",
|
|
1289
1290
|
style: {
|
|
1290
|
-
stopColor: `color-mix(in srgb, ${C} ${Vt}%,
|
|
1291
|
+
stopColor: `color-mix(in srgb, ${C} ${Vt}%, ${Yt("bg-surface")})`
|
|
1291
1292
|
}
|
|
1292
1293
|
}
|
|
1293
1294
|
),
|
|
@@ -1311,9 +1312,9 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1311
1312
|
] });
|
|
1312
1313
|
}, [N, e, n, C, D, u, q]), M = et(
|
|
1313
1314
|
(h, p) => {
|
|
1314
|
-
const { area: a, x:
|
|
1315
|
+
const { area: a, x: i, y: c } = N;
|
|
1315
1316
|
if (h < a.left || h > a.right || p < a.top || p > a.bottom) return null;
|
|
1316
|
-
const s =
|
|
1317
|
+
const s = i.indexAt(h), f = c.indexAt(p);
|
|
1317
1318
|
return s < 0 || f < 0 ? null : f * e.length + s;
|
|
1318
1319
|
},
|
|
1319
1320
|
[N, e.length]
|
|
@@ -1351,7 +1352,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1351
1352
|
const { cell: p, value: a } = w(h);
|
|
1352
1353
|
return {
|
|
1353
1354
|
title: `${p.row} · ${p.column}`,
|
|
1354
|
-
rows: [{ id: "value", label:
|
|
1355
|
+
rows: [{ id: "value", label: l, value: a, tone: d }]
|
|
1355
1356
|
};
|
|
1356
1357
|
},
|
|
1357
1358
|
anchor: (h) => {
|
|
@@ -1360,14 +1361,14 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1360
1361
|
},
|
|
1361
1362
|
announce: (h) => {
|
|
1362
1363
|
const { cell: p, value: a } = w(h);
|
|
1363
|
-
return `${p.row}, ${p.column}: ${
|
|
1364
|
+
return `${p.row}, ${p.column}: ${l} ${a}`;
|
|
1364
1365
|
},
|
|
1365
1366
|
table: {
|
|
1366
1367
|
columns: [t, ...e],
|
|
1367
1368
|
rows: n.map((h, p) => [
|
|
1368
1369
|
h,
|
|
1369
|
-
...e.map((a,
|
|
1370
|
-
const c =
|
|
1370
|
+
...e.map((a, i) => {
|
|
1371
|
+
const c = me(r, p, i);
|
|
1371
1372
|
return c === null ? "—" : q(c);
|
|
1372
1373
|
})
|
|
1373
1374
|
])
|
|
@@ -1376,18 +1377,18 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1376
1377
|
testId: I
|
|
1377
1378
|
}
|
|
1378
1379
|
);
|
|
1379
|
-
},
|
|
1380
|
-
box:
|
|
1381
|
-
median:
|
|
1382
|
-
outlier:
|
|
1383
|
-
band:
|
|
1384
|
-
},
|
|
1380
|
+
}, to = /* @__PURE__ */ ot(/* @__PURE__ */ lt(vn, "Heatmap")), An = "ui-box-7zEQ-", Tn = "ui-median-J5g6o", In = "ui-outlier-M0VN-", Cn = "ui-band-kK09D", zt = {
|
|
1381
|
+
box: An,
|
|
1382
|
+
median: Tn,
|
|
1383
|
+
outlier: In,
|
|
1384
|
+
band: Cn
|
|
1385
|
+
}, Fn = ({
|
|
1385
1386
|
label: t,
|
|
1386
1387
|
description: o,
|
|
1387
1388
|
groups: e,
|
|
1388
1389
|
groupLabel: n,
|
|
1389
1390
|
labels: r,
|
|
1390
|
-
height:
|
|
1391
|
+
height: l = 280,
|
|
1391
1392
|
width: d,
|
|
1392
1393
|
formatValue: u,
|
|
1393
1394
|
className: k,
|
|
@@ -1397,17 +1398,17 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1397
1398
|
() => e.map((M, w) => ({
|
|
1398
1399
|
group: M,
|
|
1399
1400
|
tone: St(w, M.tone),
|
|
1400
|
-
stats:
|
|
1401
|
+
stats: Re(M.values)
|
|
1401
1402
|
})),
|
|
1402
1403
|
[e]
|
|
1403
1404
|
), D = L(() => {
|
|
1404
|
-
const M = q.flatMap((f) => f.stats ? [f.stats.min, f.stats.max] : []), [w, h] = M.length ? yt(M) : [0, 1], p = At(w, h), a = ct(p[0], p[1], Rt(
|
|
1405
|
+
const M = q.flatMap((f) => f.stats ? [f.stats.min, f.stats.max] : []), [w, h] = M.length ? yt(M) : [0, 1], p = At(w, h), a = ct(p[0], p[1], Rt(l, !1)), i = Jt(g, l, z(a)), c = Dt(
|
|
1405
1406
|
e.map((f) => f.id),
|
|
1406
|
-
[
|
|
1407
|
+
[i.left, i.right],
|
|
1407
1408
|
{ paddingInner: 0.4, paddingOuter: 0.2 }
|
|
1408
|
-
), s = pt(p, [
|
|
1409
|
+
), s = pt(p, [i.bottom, i.top]);
|
|
1409
1410
|
return {
|
|
1410
|
-
area:
|
|
1411
|
+
area: i,
|
|
1411
1412
|
band: c,
|
|
1412
1413
|
y: s,
|
|
1413
1414
|
yTicks: vt(a, s, z),
|
|
@@ -1416,7 +1417,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1416
1417
|
label: f.label
|
|
1417
1418
|
}))
|
|
1418
1419
|
};
|
|
1419
|
-
}, [q, e, g,
|
|
1420
|
+
}, [q, e, g, l, z]), N = (M) => [
|
|
1420
1421
|
{ id: "max", label: r.max, value: S(M.whiskerHigh) },
|
|
1421
1422
|
{ id: "q3", label: r.q3, value: S(M.q3) },
|
|
1422
1423
|
{ id: "median", label: r.median, value: S(M.median) },
|
|
@@ -1428,20 +1429,20 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1428
1429
|
const { area: M, band: w, y: h } = D;
|
|
1429
1430
|
return /* @__PURE__ */ X("g", { children: [
|
|
1430
1431
|
/* @__PURE__ */ m(ft, { area: M, ticks: D.yTicks, side: "left", hasGrid: !0 }),
|
|
1431
|
-
/* @__PURE__ */ m(
|
|
1432
|
-
q.map(({ group: p, tone: a, stats:
|
|
1433
|
-
if (!
|
|
1432
|
+
/* @__PURE__ */ m(Ut, { area: M, ticks: D.groupTicks, side: "bottom" }),
|
|
1433
|
+
q.map(({ group: p, tone: a, stats: i }) => {
|
|
1434
|
+
if (!i) return null;
|
|
1434
1435
|
const c = w(p.id), s = c + w.bandwidth / 2, f = w.bandwidth * 0.3, b = Z(a);
|
|
1435
1436
|
return /* @__PURE__ */ X("g", { style: { stroke: b }, className: zt.box, children: [
|
|
1436
|
-
/* @__PURE__ */ m("line", { x1: s, x2: s, y1: h(
|
|
1437
|
-
/* @__PURE__ */ m("line", { x1: s, x2: s, y1: h(
|
|
1437
|
+
/* @__PURE__ */ m("line", { x1: s, x2: s, y1: h(i.whiskerHigh), y2: h(i.q3) }),
|
|
1438
|
+
/* @__PURE__ */ m("line", { x1: s, x2: s, y1: h(i.q1), y2: h(i.whiskerLow) }),
|
|
1438
1439
|
/* @__PURE__ */ m(
|
|
1439
1440
|
"line",
|
|
1440
1441
|
{
|
|
1441
1442
|
x1: s - f,
|
|
1442
1443
|
x2: s + f,
|
|
1443
|
-
y1: h(
|
|
1444
|
-
y2: h(
|
|
1444
|
+
y1: h(i.whiskerHigh),
|
|
1445
|
+
y2: h(i.whiskerHigh)
|
|
1445
1446
|
}
|
|
1446
1447
|
),
|
|
1447
1448
|
/* @__PURE__ */ m(
|
|
@@ -1449,8 +1450,8 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1449
1450
|
{
|
|
1450
1451
|
x1: s - f,
|
|
1451
1452
|
x2: s + f,
|
|
1452
|
-
y1: h(
|
|
1453
|
-
y2: h(
|
|
1453
|
+
y1: h(i.whiskerLow),
|
|
1454
|
+
y2: h(i.whiskerLow)
|
|
1454
1455
|
}
|
|
1455
1456
|
),
|
|
1456
1457
|
/* @__PURE__ */ m(
|
|
@@ -1458,8 +1459,8 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1458
1459
|
{
|
|
1459
1460
|
x: c,
|
|
1460
1461
|
width: w.bandwidth,
|
|
1461
|
-
y: h(
|
|
1462
|
-
height: Math.max(1, h(
|
|
1462
|
+
y: h(i.q3),
|
|
1463
|
+
height: Math.max(1, h(i.q1) - h(i.q3)),
|
|
1463
1464
|
rx: 2,
|
|
1464
1465
|
style: { fill: `color-mix(in srgb, ${b} 22%, transparent)` }
|
|
1465
1466
|
}
|
|
@@ -1470,11 +1471,11 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1470
1471
|
className: zt.median,
|
|
1471
1472
|
x1: c,
|
|
1472
1473
|
x2: c + w.bandwidth,
|
|
1473
|
-
y1: h(
|
|
1474
|
-
y2: h(
|
|
1474
|
+
y1: h(i.median),
|
|
1475
|
+
y2: h(i.median)
|
|
1475
1476
|
}
|
|
1476
1477
|
),
|
|
1477
|
-
|
|
1478
|
+
i.outliers.map(($, y) => /* @__PURE__ */ m("circle", { className: zt.outlier, cx: s, cy: h($), r: 3 }, y))
|
|
1478
1479
|
] }, p.id);
|
|
1479
1480
|
})
|
|
1480
1481
|
] });
|
|
@@ -1495,7 +1496,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1495
1496
|
description: o,
|
|
1496
1497
|
containerRef: I,
|
|
1497
1498
|
width: g,
|
|
1498
|
-
height:
|
|
1499
|
+
height: l,
|
|
1499
1500
|
plot: C,
|
|
1500
1501
|
underlay: (M) => {
|
|
1501
1502
|
const { area: w, band: h } = D, p = h.step * 0.2;
|
|
@@ -1560,36 +1561,36 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1560
1561
|
testId: T
|
|
1561
1562
|
}
|
|
1562
1563
|
);
|
|
1563
|
-
},
|
|
1564
|
-
baseline:
|
|
1565
|
-
band:
|
|
1566
|
-
}, wt = 1,
|
|
1564
|
+
}, eo = /* @__PURE__ */ ot(/* @__PURE__ */ lt(Fn, "BoxPlot")), Rn = "ui-baseline-wWs7h", Sn = "ui-band-xvYtL", fe = {
|
|
1565
|
+
baseline: Rn,
|
|
1566
|
+
band: Sn
|
|
1567
|
+
}, wt = 1, Hn = ({
|
|
1567
1568
|
label: t,
|
|
1568
1569
|
description: o,
|
|
1569
1570
|
values: e,
|
|
1570
1571
|
bins: n,
|
|
1571
1572
|
valueLabel: r,
|
|
1572
|
-
countLabel:
|
|
1573
|
-
tone: d = "
|
|
1573
|
+
countLabel: l,
|
|
1574
|
+
tone: d = "chart-1",
|
|
1574
1575
|
height: u = 260,
|
|
1575
1576
|
width: k,
|
|
1576
1577
|
formatValue: T,
|
|
1577
1578
|
className: A,
|
|
1578
1579
|
testId: I
|
|
1579
1580
|
}) => {
|
|
1580
|
-
const { labels: g } = xt(), [R, z] = _t(k), S = L(() => bt(g == null ? void 0 : g.locale), [g == null ? void 0 : g.locale]), q = L(() => Ht(g == null ? void 0 : g.locale), [g == null ? void 0 : g.locale]), D = T ?? S, N = L(() =>
|
|
1581
|
+
const { labels: g } = xt(), [R, z] = _t(k), S = L(() => bt(g == null ? void 0 : g.locale), [g == null ? void 0 : g.locale]), q = L(() => Ht(g == null ? void 0 : g.locale), [g == null ? void 0 : g.locale]), D = T ?? S, N = L(() => Se(e, n), [e, n]), C = L(() => {
|
|
1581
1582
|
var $, y;
|
|
1582
|
-
const h = Math.max(1, ...N.map((_) => _.count)), p = At(0, h), a = ct(0, p[1], Rt(u, !1)).filter(Number.isInteger),
|
|
1583
|
+
const h = Math.max(1, ...N.map((_) => _.count)), p = At(0, h), a = ct(0, p[1], Rt(u, !1)).filter(Number.isInteger), i = Jt(z, u, q(a)), c = (($ = N[0]) == null ? void 0 : $.from) ?? 0, s = ((y = N[N.length - 1]) == null ? void 0 : y.to) ?? 1, f = pt([c, s], [i.left, i.right]), b = pt(p, [i.bottom, i.top]);
|
|
1583
1584
|
return {
|
|
1584
|
-
area:
|
|
1585
|
+
area: i,
|
|
1585
1586
|
columns: N.map((_) => ({
|
|
1586
1587
|
x: f(_.from) + wt / 2,
|
|
1587
1588
|
width: Math.max(1, f(_.to) - f(_.from) - wt),
|
|
1588
1589
|
y: b(_.count),
|
|
1589
|
-
height: Math.max(0,
|
|
1590
|
+
height: Math.max(0, i.bottom - b(_.count)),
|
|
1590
1591
|
center: (f(_.from) + f(_.to)) / 2
|
|
1591
1592
|
})),
|
|
1592
|
-
xTicks: vt(ct(c, s, Rt(
|
|
1593
|
+
xTicks: vt(ct(c, s, Rt(i.width, !0)), f, q),
|
|
1593
1594
|
yTicks: vt(a, b, q)
|
|
1594
1595
|
};
|
|
1595
1596
|
}, [N, z, u, q]), P = (h) => `${D(N[h].from)} – ${D(N[h].to)}`, M = L(
|
|
@@ -1599,7 +1600,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1599
1600
|
/* @__PURE__ */ m(
|
|
1600
1601
|
"line",
|
|
1601
1602
|
{
|
|
1602
|
-
className:
|
|
1603
|
+
className: fe.baseline,
|
|
1603
1604
|
x1: C.area.left,
|
|
1604
1605
|
x2: C.area.right,
|
|
1605
1606
|
y1: C.area.bottom,
|
|
@@ -1623,10 +1624,10 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1623
1624
|
[C, d]
|
|
1624
1625
|
), w = et(
|
|
1625
1626
|
(h, p) => {
|
|
1626
|
-
const { area: a, columns:
|
|
1627
|
+
const { area: a, columns: i } = C;
|
|
1627
1628
|
if (h < a.left || h > a.right || p < a.top - 4 || p > a.bottom + 4)
|
|
1628
1629
|
return null;
|
|
1629
|
-
const c =
|
|
1630
|
+
const c = i.findIndex(
|
|
1630
1631
|
(s) => h >= s.x - wt && h <= s.x + s.width + wt
|
|
1631
1632
|
);
|
|
1632
1633
|
return c < 0 ? null : c;
|
|
@@ -1647,7 +1648,7 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1647
1648
|
return /* @__PURE__ */ m(
|
|
1648
1649
|
"rect",
|
|
1649
1650
|
{
|
|
1650
|
-
className:
|
|
1651
|
+
className: fe.band,
|
|
1651
1652
|
x: p.x - wt / 2,
|
|
1652
1653
|
width: p.width + wt,
|
|
1653
1654
|
y: C.area.top,
|
|
@@ -1660,45 +1661,45 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1660
1661
|
pick: w,
|
|
1661
1662
|
tooltip: (h) => ({
|
|
1662
1663
|
title: P(h),
|
|
1663
|
-
rows: [{ id: "count", label:
|
|
1664
|
+
rows: [{ id: "count", label: l, value: S(N[h].count), tone: d }]
|
|
1664
1665
|
}),
|
|
1665
1666
|
anchor: (h) => ({ x: C.columns[h].center, y: C.columns[h].y }),
|
|
1666
|
-
announce: (h) => `${r} ${P(h)}: ${
|
|
1667
|
+
announce: (h) => `${r} ${P(h)}: ${l} ${S(N[h].count)}`,
|
|
1667
1668
|
table: {
|
|
1668
|
-
columns: [r,
|
|
1669
|
+
columns: [r, l],
|
|
1669
1670
|
rows: N.map((h, p) => [P(p), S(h.count)])
|
|
1670
1671
|
},
|
|
1671
1672
|
className: A,
|
|
1672
1673
|
testId: I
|
|
1673
1674
|
}
|
|
1674
1675
|
);
|
|
1675
|
-
},
|
|
1676
|
-
grid:
|
|
1677
|
-
shape:
|
|
1678
|
-
labels:
|
|
1679
|
-
axisLabel:
|
|
1680
|
-
spoke:
|
|
1681
|
-
marker:
|
|
1682
|
-
},
|
|
1676
|
+
}, no = /* @__PURE__ */ ot(/* @__PURE__ */ lt(Hn, "Histogram")), Ln = "ui-grid-fHioN", En = "ui-shape-Vbb9D", zn = "ui-labels-nRfEk", Pn = "ui-axisLabel-UOZQ7", Dn = "ui-spoke-P-6cp", Gn = "ui-marker-xzn9h", kt = {
|
|
1677
|
+
grid: Ln,
|
|
1678
|
+
shape: En,
|
|
1679
|
+
labels: zn,
|
|
1680
|
+
axisLabel: Pn,
|
|
1681
|
+
spoke: Dn,
|
|
1682
|
+
marker: Gn
|
|
1683
|
+
}, pe = 10, qn = 16, On = 28, Xt = (t, o) => {
|
|
1683
1684
|
const e = t.values[o];
|
|
1684
1685
|
return typeof e == "number" && Number.isFinite(e) ? e : null;
|
|
1685
|
-
},
|
|
1686
|
+
}, Bn = ({
|
|
1686
1687
|
label: t,
|
|
1687
1688
|
description: o,
|
|
1688
1689
|
axes: e,
|
|
1689
1690
|
series: n,
|
|
1690
1691
|
max: r,
|
|
1691
|
-
height:
|
|
1692
|
+
height: l = 320,
|
|
1692
1693
|
width: d,
|
|
1693
1694
|
formatValue: u,
|
|
1694
1695
|
className: k,
|
|
1695
1696
|
testId: T
|
|
1696
1697
|
}) => {
|
|
1697
1698
|
const { labels: A } = xt(), [I, g] = _t(d), [R, z] = Tt(() => /* @__PURE__ */ new Set()), S = L(() => Ht(A == null ? void 0 : A.locale), [A == null ? void 0 : A.locale]), q = L(() => bt(A == null ? void 0 : A.locale), [A == null ? void 0 : A.locale]), D = u ?? q, N = L(
|
|
1698
|
-
() => n.map((a,
|
|
1699
|
+
() => n.map((a, i) => ({ ...a, tone: St(i, a.tone) })),
|
|
1699
1700
|
[n]
|
|
1700
1701
|
), C = L(() => N.filter((a) => !R.has(a.id)), [N, R]), P = L(() => {
|
|
1701
|
-
const a = e.length,
|
|
1702
|
+
const a = e.length, i = a > 0 ? Math.PI * 2 / a : 0, c = e.map((j, Y) => Y * i), s = Math.min(g * 0.22, Math.max(0, ...e.map((j) => ut(j.label)))), f = Math.max(24, Math.min(l / 2 - 24, g / 2 - s - pe - 4)), b = g / 2, $ = l / 2;
|
|
1702
1703
|
let y = 0;
|
|
1703
1704
|
for (const j of n)
|
|
1704
1705
|
for (const Y of e) {
|
|
@@ -1706,37 +1707,37 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1706
1707
|
O !== null && O > y && (y = O);
|
|
1707
1708
|
}
|
|
1708
1709
|
const _ = r !== void 0 && r > 0 ? r : At(0, y, 4)[1], G = ct(0, _, 4).filter((j) => j > 0);
|
|
1709
|
-
return { cx: b, cy: $, radius: f, angles: c, step:
|
|
1710
|
-
}, [e, n, r, g,
|
|
1711
|
-
const { cx: a, cy:
|
|
1710
|
+
return { cx: b, cy: $, radius: f, angles: c, step: i, top: _, rings: G, scale: (j) => Math.min(Math.max(j, 0), _) / _ * f, labelRoom: s };
|
|
1711
|
+
}, [e, n, r, g, l]), M = L(() => {
|
|
1712
|
+
const { cx: a, cy: i, angles: c, scale: s } = P;
|
|
1712
1713
|
return C.map((f) => ({
|
|
1713
1714
|
...f,
|
|
1714
1715
|
points: e.map((b, $) => {
|
|
1715
1716
|
const y = Xt(f, b.key);
|
|
1716
|
-
return { ...nt(a,
|
|
1717
|
+
return { ...nt(a, i, s(y ?? 0), c[$]), value: y };
|
|
1717
1718
|
})
|
|
1718
1719
|
}));
|
|
1719
1720
|
}, [P, C, e]), w = L(() => {
|
|
1720
|
-
const { cx: a, cy:
|
|
1721
|
+
const { cx: a, cy: i, radius: c, angles: s, rings: f, scale: b, labelRoom: $ } = P, y = f.length > 0 ? b(f[0]) : c, _ = Math.max(1, Math.ceil(qn / Math.max(1, y))), G = S(f);
|
|
1721
1722
|
return /* @__PURE__ */ X("g", { children: [
|
|
1722
1723
|
/* @__PURE__ */ X("g", { "aria-hidden": !0, className: kt.grid, children: [
|
|
1723
1724
|
f.map((H) => /* @__PURE__ */ m(
|
|
1724
1725
|
"path",
|
|
1725
1726
|
{
|
|
1726
|
-
d:
|
|
1727
|
+
d: oe(s.map((j) => nt(a, i, b(H), j)))
|
|
1727
1728
|
},
|
|
1728
1729
|
H
|
|
1729
1730
|
)),
|
|
1730
1731
|
s.map((H, j) => {
|
|
1731
|
-
const Y = nt(a,
|
|
1732
|
-
return /* @__PURE__ */ m("line", { x1: a, y1:
|
|
1732
|
+
const Y = nt(a, i, c, H);
|
|
1733
|
+
return /* @__PURE__ */ m("line", { x1: a, y1: i, x2: Y.x, y2: Y.y }, e[j].key);
|
|
1733
1734
|
})
|
|
1734
1735
|
] }),
|
|
1735
1736
|
M.map((H) => /* @__PURE__ */ m(
|
|
1736
1737
|
"path",
|
|
1737
1738
|
{
|
|
1738
1739
|
className: kt.shape,
|
|
1739
|
-
d:
|
|
1740
|
+
d: oe(H.points),
|
|
1740
1741
|
style: {
|
|
1741
1742
|
fill: `color-mix(in srgb, ${Z(H.tone)} 14%, transparent)`,
|
|
1742
1743
|
stroke: Z(H.tone)
|
|
@@ -1746,10 +1747,10 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1746
1747
|
)),
|
|
1747
1748
|
/* @__PURE__ */ X("g", { "aria-hidden": !0, className: kt.labels, children: [
|
|
1748
1749
|
f.map(
|
|
1749
|
-
(H, j) => (f.length - 1 - j) % _ === 0 ? /* @__PURE__ */ m("text", { x: a + 4, y:
|
|
1750
|
+
(H, j) => (f.length - 1 - j) % _ === 0 ? /* @__PURE__ */ m("text", { x: a + 4, y: i - b(H), dy: "1.1em", children: G[j] }, H) : null
|
|
1750
1751
|
),
|
|
1751
1752
|
e.map((H, j) => {
|
|
1752
|
-
const Y = s[j], O = nt(a,
|
|
1753
|
+
const Y = s[j], O = nt(a, i, c + pe, Y), x = Math.sin(Y), F = Math.cos(Y), E = x > 0.3 ? "start" : x < -0.3 ? "end" : "middle", U = F > 0.3 ? "-0.2em" : F < -0.3 ? "0.9em" : "0.32em";
|
|
1753
1754
|
return /* @__PURE__ */ m(
|
|
1754
1755
|
"text",
|
|
1755
1756
|
{
|
|
@@ -1766,20 +1767,20 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1766
1767
|
] })
|
|
1767
1768
|
] });
|
|
1768
1769
|
}, [P, M, e, S]), h = et(
|
|
1769
|
-
(a,
|
|
1770
|
+
(a, i) => {
|
|
1770
1771
|
const { cx: c, cy: s, radius: f, step: b } = P;
|
|
1771
|
-
if (e.length === 0 || Math.hypot(a - c,
|
|
1772
|
-
let $ = Math.atan2(a - c, -(
|
|
1772
|
+
if (e.length === 0 || Math.hypot(a - c, i - s) > f + On) return null;
|
|
1773
|
+
let $ = Math.atan2(a - c, -(i - s));
|
|
1773
1774
|
return $ < 0 && ($ += Math.PI * 2), Math.round($ / b) % e.length;
|
|
1774
1775
|
},
|
|
1775
1776
|
[P, e.length]
|
|
1776
|
-
), p = (a) => M.map((
|
|
1777
|
-
const c =
|
|
1777
|
+
), p = (a) => M.map((i) => {
|
|
1778
|
+
const c = i.points[a].value;
|
|
1778
1779
|
return {
|
|
1779
|
-
id:
|
|
1780
|
-
label:
|
|
1780
|
+
id: i.id,
|
|
1781
|
+
label: i.label,
|
|
1781
1782
|
value: c === null ? "—" : D(c),
|
|
1782
|
-
tone:
|
|
1783
|
+
tone: i.tone
|
|
1783
1784
|
};
|
|
1784
1785
|
});
|
|
1785
1786
|
return /* @__PURE__ */ m(
|
|
@@ -1789,12 +1790,12 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1789
1790
|
description: o,
|
|
1790
1791
|
containerRef: I,
|
|
1791
1792
|
width: g,
|
|
1792
|
-
height:
|
|
1793
|
+
height: l,
|
|
1793
1794
|
plot: w,
|
|
1794
1795
|
overlay: (a) => {
|
|
1795
|
-
const { cx:
|
|
1796
|
+
const { cx: i, cy: c, radius: s, angles: f } = P, b = nt(i, c, s, f[a]);
|
|
1796
1797
|
return /* @__PURE__ */ X("g", { children: [
|
|
1797
|
-
/* @__PURE__ */ m("line", { className: kt.spoke, x1:
|
|
1798
|
+
/* @__PURE__ */ m("line", { className: kt.spoke, x1: i, y1: c, x2: b.x, y2: b.y }),
|
|
1798
1799
|
M.map(($) => {
|
|
1799
1800
|
const y = $.points[a];
|
|
1800
1801
|
return y.value === null ? null : /* @__PURE__ */ m(
|
|
@@ -1815,22 +1816,22 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1815
1816
|
pick: h,
|
|
1816
1817
|
tooltip: (a) => ({ title: e[a].label, rows: p(a) }),
|
|
1817
1818
|
anchor: (a) => {
|
|
1818
|
-
const { cx:
|
|
1819
|
+
const { cx: i, cy: c, radius: s, angles: f } = P;
|
|
1819
1820
|
let b = 0;
|
|
1820
1821
|
for (const $ of M) {
|
|
1821
1822
|
const y = $.points[a];
|
|
1822
|
-
b = Math.max(b, Math.hypot(y.x -
|
|
1823
|
+
b = Math.max(b, Math.hypot(y.x - i, y.y - c));
|
|
1823
1824
|
}
|
|
1824
|
-
return nt(
|
|
1825
|
+
return nt(i, c, Math.min(s, b), f[a]);
|
|
1825
1826
|
},
|
|
1826
1827
|
tooltipSide: "outward",
|
|
1827
|
-
announce: (a) => `${e[a].label}: ${p(a).map((
|
|
1828
|
+
announce: (a) => `${e[a].label}: ${p(a).map((i) => `${i.label} ${i.value}`).join(", ")}`,
|
|
1828
1829
|
table: {
|
|
1829
1830
|
columns: [t, ...N.map((a) => a.label)],
|
|
1830
1831
|
rows: e.map((a) => [
|
|
1831
1832
|
a.label,
|
|
1832
|
-
...N.map((
|
|
1833
|
-
const c = Xt(
|
|
1833
|
+
...N.map((i) => {
|
|
1834
|
+
const c = Xt(i, a.key);
|
|
1834
1835
|
return c === null ? "—" : D(c);
|
|
1835
1836
|
})
|
|
1836
1837
|
])
|
|
@@ -1838,28 +1839,28 @@ const it = (t, o) => Object.assign(t, { displayName: o }), we = "ui-axis-AqLAe",
|
|
|
1838
1839
|
legend: N.length > 1 ? {
|
|
1839
1840
|
entries: N.map((a) => ({ id: a.id, label: a.label, tone: a.tone })),
|
|
1840
1841
|
hidden: R,
|
|
1841
|
-
onToggle: (a) => z((
|
|
1842
|
-
const c = new Set(
|
|
1843
|
-
return c.has(a) ? c.delete(a) : N.length -
|
|
1842
|
+
onToggle: (a) => z((i) => {
|
|
1843
|
+
const c = new Set(i);
|
|
1844
|
+
return c.has(a) ? c.delete(a) : N.length - i.size > 1 && c.add(a), c;
|
|
1844
1845
|
})
|
|
1845
1846
|
} : void 0,
|
|
1846
1847
|
className: k,
|
|
1847
1848
|
testId: T
|
|
1848
1849
|
}
|
|
1849
1850
|
);
|
|
1850
|
-
},
|
|
1851
|
-
/* @__PURE__ */
|
|
1851
|
+
}, oo = /* @__PURE__ */ ot(
|
|
1852
|
+
/* @__PURE__ */ lt(Bn, "RadarChart")
|
|
1852
1853
|
);
|
|
1853
1854
|
export {
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1855
|
+
Un as AreaChart,
|
|
1856
|
+
Zn as BarChart,
|
|
1857
|
+
eo as BoxPlot,
|
|
1858
|
+
Qn as ComposedChart,
|
|
1859
|
+
to as Heatmap,
|
|
1860
|
+
no as Histogram,
|
|
1861
|
+
Yn as LineChart,
|
|
1862
|
+
Jn as PieChart,
|
|
1863
|
+
oo as RadarChart,
|
|
1864
|
+
Kn as ScatterPlot
|
|
1864
1865
|
};
|
|
1865
1866
|
//# sourceMappingURL=charts.js.map
|