@actioneer/ads 0.5.9 → 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/components/assistant-ui/composer-harness.js +12 -10
- package/components/breadcrumbs.d.ts +1 -1
- package/components/breadcrumbs.js +42 -38
- package/components/button.js +11 -11
- package/components/card.js +19 -18
- package/components/chart.js +406 -385
- package/components/date-range-picker.d.ts +25 -0
- package/components/date-range-picker.js +187 -0
- package/components/drawer.js +110 -92
- package/components/index.d.ts +1 -0
- package/components/index.js +499 -497
- package/components/panel.js +31 -28
- package/components/tabs.js +1 -1
- package/components/tree.js +86 -58
- package/components/viz-charts.js +186 -183
- package/demo/components/add-to-artifact.js +4 -2
- package/fonts.css +2 -0
- package/llms.txt +22 -2
- package/manifest.json +13755 -8
- package/package.json +4 -1
- package/styles.css +76 -60
- package/theme.css +70 -57
package/components/chart.js
CHANGED
|
@@ -1,44 +1,65 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as A, jsx as e, Fragment as
|
|
3
|
-
import * as
|
|
4
|
-
import { ResponsiveContainer as j, LineChart as
|
|
5
|
-
import { MotionConfig as
|
|
6
|
-
import { cn as
|
|
2
|
+
import { jsxs as A, jsx as e, Fragment as K } from "react/jsx-runtime";
|
|
3
|
+
import * as R from "react";
|
|
4
|
+
import { ResponsiveContainer as j, LineChart as be, Tooltip as O, Line as se, AreaChart as pe, Area as Ne, CartesianGrid as te, XAxis as ne, YAxis as U, BarChart as we, Bar as ce, Cell as de, ComposedChart as Ae, ScatterChart as Ce, Scatter as ye, PieChart as Re, Pie as ke, RadarChart as Me, PolarGrid as $e, PolarAngleAxis as ue, PolarRadiusAxis as Se, Radar as Le, RadialBarChart as Fe, RadialBar as Oe, Treemap as Te, ReferenceArea as Ie, ReferenceLine as Be, ReferenceDot as De } from "recharts";
|
|
5
|
+
import { MotionConfig as Ee, AnimatePresence as We, motion as ze } from "motion/react";
|
|
6
|
+
import { cn as $ } from "../lib/cn.js";
|
|
7
7
|
import { floatVariants as je } from "../lib/motion.js";
|
|
8
|
-
const
|
|
8
|
+
const V = (t) => `var(--color-chart-${t % 6 + 1})`, ee = (t) => V(t), re = "var(--chart-context)", Y = 2.5, He = 2.5, W = {
|
|
9
9
|
primary: { ref: "var(--brand)", pill: "bg-fill text-fill-foreground" },
|
|
10
10
|
success: { ref: "var(--color-success-600)", pill: "bg-success-50 text-success-700" },
|
|
11
11
|
warning: { ref: "var(--color-warning-500)", pill: "bg-warning-50 text-warning-700" },
|
|
12
12
|
danger: { ref: "var(--color-danger-500)", pill: "bg-danger-50 text-danger-700" },
|
|
13
13
|
info: { ref: "var(--color-info-500)", pill: "bg-info-50 text-info-700" }
|
|
14
|
-
}, F = (t) => new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }).format(t),
|
|
14
|
+
}, F = (t) => new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 }).format(t), me = (t, r) => {
|
|
15
15
|
const a = [];
|
|
16
16
|
for (const i of t)
|
|
17
|
-
for (const
|
|
18
|
-
|
|
17
|
+
for (const o of Object.keys(i))
|
|
18
|
+
o !== r && typeof i[o] == "number" && !a.includes(o) && a.push(o);
|
|
19
19
|
return a;
|
|
20
20
|
};
|
|
21
|
-
function D({ x: t, y: r, payload: a, anchor: i, dy:
|
|
22
|
-
const
|
|
23
|
-
return /* @__PURE__ */ e("text", { x: t, y: r, dy:
|
|
21
|
+
function D({ x: t, y: r, payload: a, anchor: i, dy: o, format: n }) {
|
|
22
|
+
const l = (a == null ? void 0 : a.value) ?? "", x = n ? n(l) : l;
|
|
23
|
+
return /* @__PURE__ */ e("text", { x: t, y: r, dy: o, textAnchor: i, className: "fill-tertiary text-xs tabular-nums", children: x });
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function fe({
|
|
26
26
|
x: t,
|
|
27
27
|
y: r,
|
|
28
28
|
value: a,
|
|
29
29
|
hidden: i,
|
|
30
|
-
|
|
30
|
+
color: o,
|
|
31
|
+
format: n
|
|
31
32
|
}) {
|
|
32
33
|
if (i || t == null || r == null || a == null || a === "") return null;
|
|
33
|
-
const
|
|
34
|
-
return Number.isNaN(
|
|
34
|
+
const l = Number(a);
|
|
35
|
+
return Number.isNaN(l) ? null : /* @__PURE__ */ e(
|
|
35
36
|
"text",
|
|
36
37
|
{
|
|
37
38
|
x: Number(t),
|
|
38
39
|
y: Number(r) - 10,
|
|
39
40
|
textAnchor: "middle",
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
fill: o,
|
|
42
|
+
className: $(!o && "fill-secondary", "text-xs tabular-nums"),
|
|
43
|
+
children: n(l)
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function E({
|
|
48
|
+
cx: t,
|
|
49
|
+
cy: r,
|
|
50
|
+
color: a,
|
|
51
|
+
active: i = !1
|
|
52
|
+
}) {
|
|
53
|
+
return t == null || r == null ? null : /* @__PURE__ */ e(
|
|
54
|
+
"circle",
|
|
55
|
+
{
|
|
56
|
+
"aria-hidden": !0,
|
|
57
|
+
cx: t,
|
|
58
|
+
cy: r,
|
|
59
|
+
r: i ? 5.5 : 4,
|
|
60
|
+
fill: "var(--background)",
|
|
61
|
+
stroke: a,
|
|
62
|
+
strokeWidth: i ? 3 : He
|
|
42
63
|
}
|
|
43
64
|
);
|
|
44
65
|
}
|
|
@@ -47,18 +68,18 @@ function Pe({
|
|
|
47
68
|
y: r,
|
|
48
69
|
width: a,
|
|
49
70
|
height: i,
|
|
50
|
-
value:
|
|
71
|
+
value: o,
|
|
51
72
|
format: n,
|
|
52
|
-
horizontal:
|
|
73
|
+
horizontal: l
|
|
53
74
|
}) {
|
|
54
|
-
if (t == null || r == null ||
|
|
55
|
-
const x = Number(
|
|
75
|
+
if (t == null || r == null || o == null || o === "") return null;
|
|
76
|
+
const x = Number(o);
|
|
56
77
|
if (Number.isNaN(x)) return null;
|
|
57
|
-
const
|
|
58
|
-
return
|
|
78
|
+
const c = Number(t), m = Number(r), u = Number(a ?? 0), N = Number(i ?? 0);
|
|
79
|
+
return l ? /* @__PURE__ */ e(
|
|
59
80
|
"text",
|
|
60
81
|
{
|
|
61
|
-
x:
|
|
82
|
+
x: c + u + 8,
|
|
62
83
|
y: m + N / 2,
|
|
63
84
|
dy: "0.32em",
|
|
64
85
|
textAnchor: "start",
|
|
@@ -68,7 +89,7 @@ function Pe({
|
|
|
68
89
|
) : /* @__PURE__ */ e(
|
|
69
90
|
"text",
|
|
70
91
|
{
|
|
71
|
-
x:
|
|
92
|
+
x: c + u / 2,
|
|
72
93
|
y: m - 8,
|
|
73
94
|
textAnchor: "middle",
|
|
74
95
|
className: "fill-secondary text-xs tabular-nums",
|
|
@@ -76,23 +97,16 @@ function Pe({
|
|
|
76
97
|
}
|
|
77
98
|
);
|
|
78
99
|
}
|
|
79
|
-
function ne({
|
|
80
|
-
cx: t,
|
|
81
|
-
cy: r,
|
|
82
|
-
fill: a
|
|
83
|
-
}) {
|
|
84
|
-
return t == null || r == null ? null : /* @__PURE__ */ e("circle", { cx: t, cy: r, r: 4.5, fill: a, stroke: "var(--background)", strokeWidth: 2 });
|
|
85
|
-
}
|
|
86
100
|
function T({
|
|
87
101
|
active: t,
|
|
88
102
|
payload: r,
|
|
89
103
|
label: a,
|
|
90
104
|
format: i,
|
|
91
|
-
labelKey:
|
|
105
|
+
labelKey: o,
|
|
92
106
|
renderer: n
|
|
93
107
|
}) {
|
|
94
|
-
var N,
|
|
95
|
-
const
|
|
108
|
+
var N, b;
|
|
109
|
+
const l = (r ?? []).map((f, y) => {
|
|
96
110
|
const C = f.payload && typeof f.payload == "object" ? f.payload : void 0;
|
|
97
111
|
return {
|
|
98
112
|
key: f.dataKey ?? y,
|
|
@@ -101,19 +115,19 @@ function T({
|
|
|
101
115
|
color: f.color,
|
|
102
116
|
datum: C
|
|
103
117
|
};
|
|
104
|
-
}), x =
|
|
118
|
+
}), x = o ? (b = (N = l[0]) == null ? void 0 : N.datum) == null ? void 0 : b[o] : void 0, c = {
|
|
105
119
|
active: !!t,
|
|
106
120
|
label: typeof x == "string" || typeof x == "number" ? x : a,
|
|
107
|
-
items:
|
|
121
|
+
items: l,
|
|
108
122
|
formatValue: i
|
|
109
123
|
};
|
|
110
|
-
if (n) return /* @__PURE__ */ e(
|
|
111
|
-
if (!
|
|
112
|
-
const m =
|
|
124
|
+
if (n) return /* @__PURE__ */ e(K, { children: n(c) });
|
|
125
|
+
if (!c.active || !l.length) return null;
|
|
126
|
+
const m = l.length === 1, u = c.label ?? (m ? l[0].name : void 0);
|
|
113
127
|
return /* @__PURE__ */ A("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background", children: [
|
|
114
|
-
/* @__PURE__ */ e("div", { className:
|
|
115
|
-
|
|
116
|
-
!m && /* @__PURE__ */ A(
|
|
128
|
+
/* @__PURE__ */ e("div", { className: $("text-xs font-normal tracking-wide uppercase text-background/60", !m && "mb-1"), children: u }),
|
|
129
|
+
l.map((f) => /* @__PURE__ */ A("div", { className: "flex items-center gap-1.5", children: [
|
|
130
|
+
!m && /* @__PURE__ */ A(K, { children: [
|
|
117
131
|
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "size-1.5 rounded-dot", style: { background: f.color } }),
|
|
118
132
|
/* @__PURE__ */ e("span", { className: "text-background/70", children: f.name })
|
|
119
133
|
] }),
|
|
@@ -121,35 +135,35 @@ function T({
|
|
|
121
135
|
] }, f.key))
|
|
122
136
|
] });
|
|
123
137
|
}
|
|
124
|
-
const
|
|
125
|
-
function
|
|
138
|
+
const he = "pointer-events-none inline-flex min-h-4 items-center rounded-full px-2 py-0.5 text-xs font-normal whitespace-nowrap";
|
|
139
|
+
function _e({
|
|
126
140
|
viewBox: t,
|
|
127
141
|
label: r,
|
|
128
142
|
value: a,
|
|
129
143
|
color: i,
|
|
130
|
-
axis:
|
|
144
|
+
axis: o
|
|
131
145
|
}) {
|
|
132
|
-
const n = t ?? {},
|
|
146
|
+
const n = t ?? {}, l = /* @__PURE__ */ A("span", { className: $(he, W[i].pill), children: [
|
|
133
147
|
r,
|
|
134
148
|
a != null && /* @__PURE__ */ e("span", { className: "ml-1 tabular-nums", children: a })
|
|
135
149
|
] });
|
|
136
|
-
return
|
|
150
|
+
return o === "y" ? /* @__PURE__ */ e("foreignObject", { x: n.x ?? 0, y: (n.y ?? 0) - 12, width: n.width ?? 0, height: 24, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-end pr-1", children: l }) }) : /* @__PURE__ */ e("foreignObject", { x: (n.x ?? 0) - 90, y: (n.y ?? 0) - 12, width: 180, height: 24, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: l }) });
|
|
137
151
|
}
|
|
138
|
-
function
|
|
152
|
+
function Ge({ viewBox: t, label: r, color: a }) {
|
|
139
153
|
const i = t ?? {};
|
|
140
|
-
return /* @__PURE__ */ e("foreignObject", { x: i.x ?? 0, y: i.y ?? 0, width: i.width ?? 0, height: 28, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center pl-1.5", children: /* @__PURE__ */ e("span", { className:
|
|
154
|
+
return /* @__PURE__ */ e("foreignObject", { x: i.x ?? 0, y: i.y ?? 0, width: i.width ?? 0, height: 28, className: "overflow-visible", children: /* @__PURE__ */ e("div", { className: "flex h-full items-center pl-1.5", children: /* @__PURE__ */ e("span", { className: $(he, W[a].pill), children: r }) }) });
|
|
141
155
|
}
|
|
142
|
-
function
|
|
156
|
+
function Ue({
|
|
143
157
|
cx: t,
|
|
144
158
|
cy: r,
|
|
145
159
|
n: a,
|
|
146
160
|
ann: i,
|
|
147
|
-
onEnter:
|
|
161
|
+
onEnter: o,
|
|
148
162
|
onLeave: n
|
|
149
163
|
}) {
|
|
150
|
-
const [
|
|
164
|
+
const [l, x] = R.useState(!1);
|
|
151
165
|
if (t == null || r == null || !Number.isFinite(t) || !Number.isFinite(r)) return /* @__PURE__ */ e("g", {});
|
|
152
|
-
const
|
|
166
|
+
const c = () => o({ ann: i, n: a, cx: t, cy: r }), m = () => n();
|
|
153
167
|
return /* @__PURE__ */ A(
|
|
154
168
|
"g",
|
|
155
169
|
{
|
|
@@ -157,16 +171,16 @@ function _e({
|
|
|
157
171
|
role: "img",
|
|
158
172
|
"aria-label": `Annotation ${a}: ${i.label}`,
|
|
159
173
|
className: "cursor-default outline-none [transform-box:fill-box] origin-center transition-transform ease-out [transition-duration:150ms] hover:scale-110 focus-visible:scale-110 motion-reduce:transition-none motion-reduce:hover:scale-100 motion-reduce:focus-visible:scale-100",
|
|
160
|
-
onMouseEnter:
|
|
174
|
+
onMouseEnter: c,
|
|
161
175
|
onMouseLeave: m,
|
|
162
176
|
onFocus: () => {
|
|
163
|
-
x(!0),
|
|
177
|
+
x(!0), c();
|
|
164
178
|
},
|
|
165
179
|
onBlur: () => {
|
|
166
180
|
x(!1), m();
|
|
167
181
|
},
|
|
168
182
|
children: [
|
|
169
|
-
|
|
183
|
+
l && /* @__PURE__ */ e("circle", { cx: t, cy: r, r: 12, fill: "none", stroke: "var(--ring)", strokeWidth: 2 }),
|
|
170
184
|
/* @__PURE__ */ e("circle", { cx: t, cy: r, r: 10, fill: "var(--background)" }),
|
|
171
185
|
/* @__PURE__ */ e("circle", { cx: t, cy: r, r: 8, fill: W[i.color ?? "primary"].ref }),
|
|
172
186
|
/* @__PURE__ */ e(
|
|
@@ -184,8 +198,8 @@ function _e({
|
|
|
184
198
|
}
|
|
185
199
|
);
|
|
186
200
|
}
|
|
187
|
-
function
|
|
188
|
-
return /* @__PURE__ */ e(
|
|
201
|
+
function Ve({ hovered: t, frameWidth: r, format: a }) {
|
|
202
|
+
return /* @__PURE__ */ e(Ee, { reducedMotion: "user", children: /* @__PURE__ */ e(We, { children: t && /* @__PURE__ */ e(
|
|
189
203
|
"div",
|
|
190
204
|
{
|
|
191
205
|
className: "pointer-events-none absolute z-10",
|
|
@@ -226,45 +240,45 @@ function Ge({ hovered: t, frameWidth: r, format: a }) {
|
|
|
226
240
|
}
|
|
227
241
|
) }) });
|
|
228
242
|
}
|
|
229
|
-
function
|
|
230
|
-
const [a, i] =
|
|
231
|
-
const x = [],
|
|
243
|
+
function xe(t, r) {
|
|
244
|
+
const [a, i] = R.useState(null), o = R.useCallback(() => i(null), []), { back: n, front: l } = R.useMemo(() => {
|
|
245
|
+
const x = [], c = [];
|
|
232
246
|
let m = 0;
|
|
233
247
|
return (t ?? []).forEach((u, N) => {
|
|
234
|
-
const
|
|
248
|
+
const b = u.color ?? "primary";
|
|
235
249
|
if (u.kind === "band") {
|
|
236
250
|
const f = u.axis ?? "y";
|
|
237
251
|
x.push(
|
|
238
252
|
/* @__PURE__ */ e(
|
|
239
|
-
|
|
253
|
+
Ie,
|
|
240
254
|
{
|
|
241
255
|
...f === "y" ? { y1: u.from, y2: u.to } : { x1: u.from, x2: u.to },
|
|
242
|
-
fill: W[
|
|
256
|
+
fill: W[b].ref,
|
|
243
257
|
fillOpacity: 0.06,
|
|
244
258
|
stroke: "none",
|
|
245
259
|
ifOverflow: f === "y" ? "extendDomain" : "visible",
|
|
246
|
-
label: u.label ? /* @__PURE__ */ e(
|
|
260
|
+
label: u.label ? /* @__PURE__ */ e(Ge, { label: u.label, color: b }) : void 0
|
|
247
261
|
},
|
|
248
262
|
`ann-${N}`
|
|
249
263
|
)
|
|
250
264
|
);
|
|
251
265
|
} else if (u.kind === "line") {
|
|
252
266
|
const f = u.axis ?? "y";
|
|
253
|
-
|
|
267
|
+
c.push(
|
|
254
268
|
/* @__PURE__ */ e(
|
|
255
|
-
|
|
269
|
+
Be,
|
|
256
270
|
{
|
|
257
271
|
...f === "y" ? { y: u.value } : { x: u.value },
|
|
258
|
-
stroke: W[
|
|
272
|
+
stroke: W[b].ref,
|
|
259
273
|
strokeWidth: 1,
|
|
260
274
|
strokeDasharray: "4 4",
|
|
261
275
|
ifOverflow: f === "y" ? "extendDomain" : "visible",
|
|
262
276
|
label: u.label ? /* @__PURE__ */ e(
|
|
263
|
-
|
|
277
|
+
_e,
|
|
264
278
|
{
|
|
265
279
|
label: u.label,
|
|
266
280
|
value: typeof u.value == "number" ? r(u.value) : String(u.value),
|
|
267
|
-
color:
|
|
281
|
+
color: b,
|
|
268
282
|
axis: f
|
|
269
283
|
}
|
|
270
284
|
) : void 0
|
|
@@ -275,35 +289,35 @@ function he(t, r) {
|
|
|
275
289
|
} else {
|
|
276
290
|
m += 1;
|
|
277
291
|
const f = m;
|
|
278
|
-
|
|
292
|
+
c.push(
|
|
279
293
|
/* @__PURE__ */ e(
|
|
280
|
-
|
|
294
|
+
De,
|
|
281
295
|
{
|
|
282
296
|
x: u.x,
|
|
283
297
|
y: u.y,
|
|
284
298
|
ifOverflow: "visible",
|
|
285
|
-
shape: (y) => /* @__PURE__ */ e(
|
|
299
|
+
shape: (y) => /* @__PURE__ */ e(Ue, { cx: y.cx, cy: y.cy, n: f, ann: u, onEnter: i, onLeave: o })
|
|
286
300
|
},
|
|
287
301
|
`ann-${N}`
|
|
288
302
|
)
|
|
289
303
|
);
|
|
290
304
|
}
|
|
291
|
-
}), { back: x, front:
|
|
292
|
-
}, [t, r,
|
|
293
|
-
return { back: n, front:
|
|
305
|
+
}), { back: x, front: c };
|
|
306
|
+
}, [t, r, o]);
|
|
307
|
+
return { back: n, front: l, hovered: a };
|
|
294
308
|
}
|
|
295
|
-
function
|
|
309
|
+
function X({
|
|
296
310
|
items: t,
|
|
297
311
|
align: r = "end",
|
|
298
312
|
className: a,
|
|
299
313
|
onToggle: i
|
|
300
314
|
}) {
|
|
301
|
-
const
|
|
315
|
+
const o = {
|
|
302
316
|
start: "justify-start",
|
|
303
317
|
center: "justify-center",
|
|
304
318
|
end: "justify-end"
|
|
305
319
|
}[r];
|
|
306
|
-
return /* @__PURE__ */ e("div", { className:
|
|
320
|
+
return /* @__PURE__ */ e("div", { className: $("mb-3 flex flex-wrap items-center gap-x-4 gap-y-1", o, a), children: t.map(
|
|
307
321
|
(n) => i && n.key !== void 0 ? /* @__PURE__ */ A(
|
|
308
322
|
"button",
|
|
309
323
|
{
|
|
@@ -311,7 +325,7 @@ function V({
|
|
|
311
325
|
"aria-pressed": !n.hidden,
|
|
312
326
|
"aria-label": `Toggle ${n.label} series`,
|
|
313
327
|
onClick: () => i(n.key),
|
|
314
|
-
className:
|
|
328
|
+
className: $(
|
|
315
329
|
"inline-flex cursor-pointer items-center gap-1.5 rounded-sm text-xs outline-none",
|
|
316
330
|
"transition-colors duration-150 ease-out motion-reduce:transition-none",
|
|
317
331
|
"focus-visible:ring-2 focus-visible:ring-ring",
|
|
@@ -322,7 +336,7 @@ function V({
|
|
|
322
336
|
"span",
|
|
323
337
|
{
|
|
324
338
|
"aria-hidden": !0,
|
|
325
|
-
className:
|
|
339
|
+
className: $(
|
|
326
340
|
"size-2 rounded-dot transition-opacity duration-150 ease-out motion-reduce:transition-none",
|
|
327
341
|
n.hidden && "opacity-25"
|
|
328
342
|
),
|
|
@@ -339,67 +353,67 @@ function V({
|
|
|
339
353
|
] }, n.label)
|
|
340
354
|
) });
|
|
341
355
|
}
|
|
342
|
-
const z =
|
|
343
|
-
({ className: t, height: r, legendItems: a, hovered: i, format:
|
|
356
|
+
const z = R.forwardRef(
|
|
357
|
+
({ className: t, height: r, legendItems: a, hovered: i, format: o, onLegendToggle: n, children: l, ...x }, c) => {
|
|
344
358
|
var N;
|
|
345
|
-
const m =
|
|
346
|
-
return /* @__PURE__ */ A("div", { ref: (
|
|
347
|
-
m.current =
|
|
348
|
-
}, className:
|
|
349
|
-
a && /* @__PURE__ */ e(
|
|
350
|
-
/* @__PURE__ */ e(j, { width: "100%", height: Math.max(r, I), children:
|
|
351
|
-
/* @__PURE__ */ e(
|
|
359
|
+
const m = R.useRef(null);
|
|
360
|
+
return /* @__PURE__ */ A("div", { ref: (b) => {
|
|
361
|
+
m.current = b, typeof c == "function" ? c(b) : c && (c.current = b);
|
|
362
|
+
}, className: $("relative w-full font-sans", t), ...x, children: [
|
|
363
|
+
a && /* @__PURE__ */ e(X, { items: a, onToggle: n }),
|
|
364
|
+
/* @__PURE__ */ e(j, { width: "100%", height: Math.max(r, I), children: l }),
|
|
365
|
+
/* @__PURE__ */ e(Ve, { hovered: i, frameWidth: ((N = m.current) == null ? void 0 : N.clientWidth) ?? 0, format: o })
|
|
352
366
|
] });
|
|
353
367
|
}
|
|
354
368
|
);
|
|
355
369
|
z.displayName = "ChartFrame";
|
|
356
|
-
function
|
|
370
|
+
function Z(t) {
|
|
357
371
|
const {
|
|
358
372
|
data: r,
|
|
359
373
|
categoryKey: a,
|
|
360
374
|
series: i,
|
|
361
|
-
seriesLabels:
|
|
375
|
+
seriesLabels: o,
|
|
362
376
|
highlight: n,
|
|
363
|
-
annotations:
|
|
377
|
+
annotations: l,
|
|
364
378
|
grid: x = !1,
|
|
365
|
-
legend:
|
|
379
|
+
legend: c,
|
|
366
380
|
showYAxis: m = !0,
|
|
367
381
|
formatValue: u,
|
|
368
382
|
xScale: N = "category",
|
|
369
|
-
xDomain:
|
|
383
|
+
xDomain: b,
|
|
370
384
|
yDomain: f,
|
|
371
385
|
xTickFormatter: y,
|
|
372
386
|
yTickFormatter: C,
|
|
373
387
|
yAxisWidth: w = 44
|
|
374
|
-
} = t, p =
|
|
388
|
+
} = t, p = R.useMemo(() => i ?? me(r, a), [i, r, a]), h = u ?? F, k = C ?? ((M) => typeof M == "number" ? h(M) : M), d = xe(l, h), s = (M, B) => n && p.includes(n) ? M === n ? "var(--color-chart-1)" : re : V(B), v = (M) => (o == null ? void 0 : o[M]) ?? M, [g, S] = R.useState(
|
|
375
389
|
() => /* @__PURE__ */ new Set()
|
|
376
|
-
),
|
|
377
|
-
|
|
378
|
-
const
|
|
379
|
-
return
|
|
390
|
+
), L = R.useCallback((M) => {
|
|
391
|
+
S((B) => {
|
|
392
|
+
const _ = new Set(B);
|
|
393
|
+
return _.has(M) ? _.delete(M) : _.add(M), _;
|
|
380
394
|
});
|
|
381
|
-
}, []),
|
|
395
|
+
}, []), P = (M) => g.has(M), Q = c ?? p.length > 1 ? p.map((M, B) => ({
|
|
382
396
|
key: M,
|
|
383
|
-
label:
|
|
384
|
-
color:
|
|
397
|
+
label: v(M),
|
|
398
|
+
color: s(M, B),
|
|
385
399
|
hidden: g.has(M)
|
|
386
400
|
})) : null;
|
|
387
401
|
return {
|
|
388
402
|
names: p,
|
|
389
403
|
format: h,
|
|
390
404
|
layers: d,
|
|
391
|
-
legendItems:
|
|
405
|
+
legendItems: Q,
|
|
392
406
|
furniture: [
|
|
393
407
|
/* Gridlines one step below the border token — guides, not content. */
|
|
394
|
-
x ? /* @__PURE__ */ e(
|
|
408
|
+
x ? /* @__PURE__ */ e(te, { vertical: !1, stroke: "var(--chart-grid)" }, "grid") : null,
|
|
395
409
|
/* @__PURE__ */ e(
|
|
396
|
-
|
|
410
|
+
ne,
|
|
397
411
|
{
|
|
398
412
|
dataKey: a,
|
|
399
413
|
type: N === "time" ? "number" : "category",
|
|
400
414
|
scale: N === "time" ? "time" : "auto",
|
|
401
|
-
domain: N === "time" ?
|
|
402
|
-
allowDataOverflow: !!
|
|
415
|
+
domain: N === "time" ? b ?? ["dataMin", "dataMax"] : b,
|
|
416
|
+
allowDataOverflow: !!b,
|
|
403
417
|
axisLine: { stroke: "var(--chart-axis)" },
|
|
404
418
|
tickLine: !1,
|
|
405
419
|
minTickGap: 28,
|
|
@@ -411,7 +425,7 @@ function Y(t) {
|
|
|
411
425
|
"x"
|
|
412
426
|
),
|
|
413
427
|
m ? /* @__PURE__ */ e(
|
|
414
|
-
|
|
428
|
+
U,
|
|
415
429
|
{
|
|
416
430
|
width: w,
|
|
417
431
|
domain: f,
|
|
@@ -419,62 +433,62 @@ function Y(t) {
|
|
|
419
433
|
axisLine: { stroke: "var(--chart-axis)" },
|
|
420
434
|
tickLine: !1,
|
|
421
435
|
tickMargin: 12,
|
|
422
|
-
tick: /* @__PURE__ */ e(D, { anchor: "end", dy: "0.32em", format:
|
|
436
|
+
tick: /* @__PURE__ */ e(D, { anchor: "end", dy: "0.32em", format: k })
|
|
423
437
|
},
|
|
424
438
|
"y"
|
|
425
439
|
) : null
|
|
426
440
|
],
|
|
427
|
-
colorFor:
|
|
428
|
-
labelFor:
|
|
429
|
-
toggleSeries:
|
|
430
|
-
isHidden:
|
|
441
|
+
colorFor: s,
|
|
442
|
+
labelFor: v,
|
|
443
|
+
toggleSeries: L,
|
|
444
|
+
isHidden: P
|
|
431
445
|
};
|
|
432
446
|
}
|
|
433
|
-
const I = 300,
|
|
434
|
-
function
|
|
447
|
+
const I = 300, H = { top: 24, right: 12, bottom: 8, left: 0 };
|
|
448
|
+
function ae(t, r, a, i) {
|
|
435
449
|
if (i === !0) return new Set(t);
|
|
436
450
|
if (i === !1) return /* @__PURE__ */ new Set();
|
|
437
451
|
if (a && t.includes(a)) {
|
|
438
|
-
const n = (r ?? []).filter((
|
|
452
|
+
const n = (r ?? []).filter((l) => l !== a);
|
|
439
453
|
return /* @__PURE__ */ new Set([a, ...n]);
|
|
440
454
|
}
|
|
441
455
|
return t.filter((n) => !(r != null && r.includes(n))).length === 1 ? new Set(t) : /* @__PURE__ */ new Set();
|
|
442
456
|
}
|
|
443
|
-
function
|
|
444
|
-
return
|
|
445
|
-
(i,
|
|
446
|
-
if (!(r != null && r.includes(i))) return a(i,
|
|
447
|
-
const n = t.filter((x) => !r.includes(x)),
|
|
448
|
-
return
|
|
457
|
+
function ge(t, r, a) {
|
|
458
|
+
return R.useCallback(
|
|
459
|
+
(i, o) => {
|
|
460
|
+
if (!(r != null && r.includes(i))) return a(i, o);
|
|
461
|
+
const n = t.filter((x) => !r.includes(x)), l = n[r.indexOf(i)] ?? n[0];
|
|
462
|
+
return l ? a(l, t.indexOf(l)) : a(i, o);
|
|
449
463
|
},
|
|
450
464
|
[t, r, a]
|
|
451
465
|
);
|
|
452
466
|
}
|
|
453
|
-
const
|
|
467
|
+
const Ye = R.forwardRef(
|
|
454
468
|
// Straight segments by default: the house line is a solid stroke with a DOT
|
|
455
469
|
// at every observation — the data points are visible, the path connects them
|
|
456
470
|
// without inventing values between them.
|
|
457
471
|
// A smooth curve invents values between observations; opt back in with
|
|
458
472
|
// `curve="natural"` when the interpolation is the point.
|
|
459
|
-
({ height: t = I, curve: r = "linear", forecastKeys: a, animatedSeriesKeys: i, showValues:
|
|
460
|
-
const { names:
|
|
473
|
+
({ height: t = I, curve: r = "linear", forecastKeys: a, animatedSeriesKeys: i, showValues: o, className: n, ...l }, x) => {
|
|
474
|
+
const { names: c, format: m, layers: u, legendItems: N, furniture: b, colorFor: f, labelFor: y, toggleSeries: C, isHidden: w } = Z(l), p = ge(c, a, f), h = ae(c, a, l.highlight, o), [k, d] = R.useState(null);
|
|
461
475
|
return /* @__PURE__ */ e(z, { ref: x, className: n, height: t, legendItems: N, hovered: u.hovered, format: m, onLegendToggle: C, children: /* @__PURE__ */ A(
|
|
462
|
-
|
|
476
|
+
be,
|
|
463
477
|
{
|
|
464
|
-
data:
|
|
465
|
-
margin:
|
|
466
|
-
onMouseMove: (
|
|
478
|
+
data: l.data,
|
|
479
|
+
margin: H,
|
|
480
|
+
onMouseMove: (s) => d((s == null ? void 0 : s.activeTooltipIndex) ?? null),
|
|
467
481
|
onMouseLeave: () => d(null),
|
|
468
482
|
children: [
|
|
469
|
-
|
|
470
|
-
|
|
483
|
+
b,
|
|
484
|
+
l.tooltip !== !1 && /* @__PURE__ */ e(
|
|
471
485
|
O,
|
|
472
486
|
{
|
|
473
487
|
content: /* @__PURE__ */ e(
|
|
474
488
|
T,
|
|
475
489
|
{
|
|
476
490
|
format: m,
|
|
477
|
-
renderer:
|
|
491
|
+
renderer: l.tooltip
|
|
478
492
|
}
|
|
479
493
|
),
|
|
480
494
|
cursor: { stroke: "var(--border-strong)" },
|
|
@@ -482,22 +496,29 @@ const Ue = k.forwardRef(
|
|
|
482
496
|
}
|
|
483
497
|
),
|
|
484
498
|
u.back,
|
|
485
|
-
|
|
486
|
-
|
|
499
|
+
c.map((s, v) => /* @__PURE__ */ e(
|
|
500
|
+
se,
|
|
487
501
|
{
|
|
488
|
-
dataKey:
|
|
489
|
-
name: y(
|
|
502
|
+
dataKey: s,
|
|
503
|
+
name: y(s),
|
|
490
504
|
type: r,
|
|
491
|
-
stroke: p(
|
|
492
|
-
strokeWidth:
|
|
493
|
-
strokeDasharray: a != null && a.includes(
|
|
494
|
-
dot:
|
|
495
|
-
activeDot: /* @__PURE__ */ e(
|
|
496
|
-
label: h.has(
|
|
497
|
-
|
|
498
|
-
|
|
505
|
+
stroke: p(s, v),
|
|
506
|
+
strokeWidth: Y,
|
|
507
|
+
strokeDasharray: a != null && a.includes(s) ? "6 4" : void 0,
|
|
508
|
+
dot: /* @__PURE__ */ e(E, { color: p(s, v) }),
|
|
509
|
+
activeDot: /* @__PURE__ */ e(E, { color: p(s, v), active: !0 }),
|
|
510
|
+
label: h.has(s) ? /* @__PURE__ */ e(
|
|
511
|
+
fe,
|
|
512
|
+
{
|
|
513
|
+
color: p(s, v),
|
|
514
|
+
format: m,
|
|
515
|
+
hidden: k != null
|
|
516
|
+
}
|
|
517
|
+
) : void 0,
|
|
518
|
+
hide: w(s),
|
|
519
|
+
isAnimationActive: (i == null ? void 0 : i.includes(s)) ?? !1
|
|
499
520
|
},
|
|
500
|
-
|
|
521
|
+
s
|
|
501
522
|
)),
|
|
502
523
|
u.front
|
|
503
524
|
]
|
|
@@ -505,31 +526,31 @@ const Ue = k.forwardRef(
|
|
|
505
526
|
) });
|
|
506
527
|
}
|
|
507
528
|
);
|
|
508
|
-
|
|
509
|
-
const
|
|
510
|
-
({ height: t = I, curve: r = "linear", stacked: a = !1, forecastKeys: i, showValues:
|
|
511
|
-
const { names:
|
|
529
|
+
Ye.displayName = "LineChart";
|
|
530
|
+
const Xe = R.forwardRef(
|
|
531
|
+
({ height: t = I, curve: r = "linear", stacked: a = !1, forecastKeys: i, showValues: o, className: n, ...l }, x) => {
|
|
532
|
+
const { names: c, format: m, layers: u, legendItems: N, furniture: b, colorFor: f, labelFor: y, toggleSeries: C, isHidden: w } = Z(l), p = ge(c, i, f), h = a ? /* @__PURE__ */ new Set() : ae(c, i, l.highlight, o), [k, d] = R.useState(null), s = R.useId().replace(/[^a-zA-Z0-9]/g, "");
|
|
512
533
|
return /* @__PURE__ */ e(z, { ref: x, className: n, height: t, legendItems: N, hovered: u.hovered, format: m, onLegendToggle: C, children: /* @__PURE__ */ A(
|
|
513
|
-
|
|
534
|
+
pe,
|
|
514
535
|
{
|
|
515
|
-
data:
|
|
516
|
-
margin:
|
|
517
|
-
onMouseMove: (
|
|
536
|
+
data: l.data,
|
|
537
|
+
margin: H,
|
|
538
|
+
onMouseMove: (v) => d((v == null ? void 0 : v.activeTooltipIndex) ?? null),
|
|
518
539
|
onMouseLeave: () => d(null),
|
|
519
540
|
children: [
|
|
520
|
-
/* @__PURE__ */ e("defs", { children:
|
|
521
|
-
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: f(
|
|
522
|
-
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: f(
|
|
523
|
-
] },
|
|
524
|
-
|
|
525
|
-
|
|
541
|
+
/* @__PURE__ */ e("defs", { children: c.map((v, g) => /* @__PURE__ */ A("linearGradient", { id: `${s}-${g}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
542
|
+
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: f(v, g), stopOpacity: 0.18 }),
|
|
543
|
+
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: f(v, g), stopOpacity: 0.02 })
|
|
544
|
+
] }, v)) }),
|
|
545
|
+
b,
|
|
546
|
+
l.tooltip !== !1 && /* @__PURE__ */ e(
|
|
526
547
|
O,
|
|
527
548
|
{
|
|
528
549
|
content: /* @__PURE__ */ e(
|
|
529
550
|
T,
|
|
530
551
|
{
|
|
531
552
|
format: m,
|
|
532
|
-
renderer:
|
|
553
|
+
renderer: l.tooltip
|
|
533
554
|
}
|
|
534
555
|
),
|
|
535
556
|
cursor: { stroke: "var(--border-strong)" },
|
|
@@ -537,24 +558,24 @@ const Ve = k.forwardRef(
|
|
|
537
558
|
}
|
|
538
559
|
),
|
|
539
560
|
u.back,
|
|
540
|
-
|
|
541
|
-
|
|
561
|
+
c.map((v, g) => /* @__PURE__ */ e(
|
|
562
|
+
Ne,
|
|
542
563
|
{
|
|
543
|
-
dataKey:
|
|
544
|
-
name: y(
|
|
564
|
+
dataKey: v,
|
|
565
|
+
name: y(v),
|
|
545
566
|
type: r,
|
|
546
567
|
stackId: a ? "stack" : void 0,
|
|
547
|
-
stroke: p(
|
|
548
|
-
strokeWidth:
|
|
549
|
-
strokeDasharray: i != null && i.includes(
|
|
550
|
-
fill: `url(#${
|
|
551
|
-
dot:
|
|
552
|
-
activeDot: /* @__PURE__ */ e(
|
|
553
|
-
label: h.has(
|
|
554
|
-
hide: w(
|
|
568
|
+
stroke: p(v, g),
|
|
569
|
+
strokeWidth: Y,
|
|
570
|
+
strokeDasharray: i != null && i.includes(v) ? "6 4" : void 0,
|
|
571
|
+
fill: `url(#${s}-${g})`,
|
|
572
|
+
dot: /* @__PURE__ */ e(E, { color: p(v, g) }),
|
|
573
|
+
activeDot: /* @__PURE__ */ e(E, { color: p(v, g), active: !0 }),
|
|
574
|
+
label: h.has(v) ? /* @__PURE__ */ e(fe, { color: p(v, g), format: m, hidden: k != null }) : void 0,
|
|
575
|
+
hide: w(v),
|
|
555
576
|
isAnimationActive: !1
|
|
556
577
|
},
|
|
557
|
-
|
|
578
|
+
v
|
|
558
579
|
)),
|
|
559
580
|
u.front
|
|
560
581
|
]
|
|
@@ -562,19 +583,19 @@ const Ve = k.forwardRef(
|
|
|
562
583
|
) });
|
|
563
584
|
}
|
|
564
585
|
);
|
|
565
|
-
|
|
566
|
-
const
|
|
586
|
+
Xe.displayName = "AreaChart";
|
|
587
|
+
const Ze = R.forwardRef(
|
|
567
588
|
({
|
|
568
589
|
height: t = I,
|
|
569
590
|
stacked: r = !1,
|
|
570
591
|
layout: a = "vertical",
|
|
571
592
|
showValues: i,
|
|
572
|
-
className:
|
|
593
|
+
className: o,
|
|
573
594
|
...n
|
|
574
|
-
},
|
|
575
|
-
const { names: x, format:
|
|
595
|
+
}, l) => {
|
|
596
|
+
const { names: x, format: c, layers: m, legendItems: u, furniture: N, colorFor: b, labelFor: f, toggleSeries: y, isHidden: C } = Z(n), w = a === "horizontal", p = r ? /* @__PURE__ */ new Set() : ae(x, void 0, n.highlight, i), h = n.xTickFormatter ?? ((s) => typeof s == "number" ? c(s) : s), k = [
|
|
576
597
|
n.grid !== !1 ? /* @__PURE__ */ e(
|
|
577
|
-
|
|
598
|
+
te,
|
|
578
599
|
{
|
|
579
600
|
horizontal: !1,
|
|
580
601
|
vertical: !0,
|
|
@@ -583,7 +604,7 @@ const Ye = k.forwardRef(
|
|
|
583
604
|
"grid"
|
|
584
605
|
) : null,
|
|
585
606
|
/* @__PURE__ */ e(
|
|
586
|
-
|
|
607
|
+
ne,
|
|
587
608
|
{
|
|
588
609
|
type: "number",
|
|
589
610
|
domain: n.xDomain,
|
|
@@ -597,7 +618,7 @@ const Ye = k.forwardRef(
|
|
|
597
618
|
"x"
|
|
598
619
|
),
|
|
599
620
|
n.showYAxis !== !1 ? /* @__PURE__ */ e(
|
|
600
|
-
|
|
621
|
+
U,
|
|
601
622
|
{
|
|
602
623
|
type: "category",
|
|
603
624
|
dataKey: n.categoryKey,
|
|
@@ -617,22 +638,22 @@ const Ye = k.forwardRef(
|
|
|
617
638
|
"y"
|
|
618
639
|
) : null
|
|
619
640
|
], d = n.highlight && x.length === 1 && !x.includes(n.highlight) ? n.highlight : null;
|
|
620
|
-
return /* @__PURE__ */ e(z, { ref:
|
|
621
|
-
|
|
641
|
+
return /* @__PURE__ */ e(z, { ref: l, className: o, height: t, legendItems: u, hovered: m.hovered, format: c, onLegendToggle: y, children: /* @__PURE__ */ A(
|
|
642
|
+
we,
|
|
622
643
|
{
|
|
623
644
|
data: n.data,
|
|
624
645
|
layout: w ? "vertical" : "horizontal",
|
|
625
|
-
margin:
|
|
646
|
+
margin: H,
|
|
626
647
|
barCategoryGap: "24%",
|
|
627
648
|
children: [
|
|
628
|
-
w ?
|
|
649
|
+
w ? k : N,
|
|
629
650
|
n.tooltip !== !1 && /* @__PURE__ */ e(
|
|
630
651
|
O,
|
|
631
652
|
{
|
|
632
653
|
content: /* @__PURE__ */ e(
|
|
633
654
|
T,
|
|
634
655
|
{
|
|
635
|
-
format:
|
|
656
|
+
format: c,
|
|
636
657
|
renderer: n.tooltip
|
|
637
658
|
}
|
|
638
659
|
),
|
|
@@ -641,29 +662,29 @@ const Ye = k.forwardRef(
|
|
|
641
662
|
}
|
|
642
663
|
),
|
|
643
664
|
m.back,
|
|
644
|
-
x.map((
|
|
645
|
-
const g = r ?
|
|
665
|
+
x.map((s, v) => {
|
|
666
|
+
const g = r ? v === x.length - 1 : !0, S = w ? [0, 4, 4, 0] : [4, 4, 0, 0];
|
|
646
667
|
return /* @__PURE__ */ e(
|
|
647
|
-
|
|
668
|
+
ce,
|
|
648
669
|
{
|
|
649
|
-
dataKey:
|
|
650
|
-
name: f(
|
|
670
|
+
dataKey: s,
|
|
671
|
+
name: f(s),
|
|
651
672
|
stackId: r ? "stack" : void 0,
|
|
652
|
-
fill:
|
|
653
|
-
radius: g ?
|
|
673
|
+
fill: b(s, v),
|
|
674
|
+
radius: g ? S : 0,
|
|
654
675
|
maxBarSize: 48,
|
|
655
|
-
label: p.has(
|
|
656
|
-
hide: C(
|
|
676
|
+
label: p.has(s) ? /* @__PURE__ */ e(Pe, { format: c, horizontal: w }) : void 0,
|
|
677
|
+
hide: C(s),
|
|
657
678
|
isAnimationActive: !1,
|
|
658
|
-
children: d && n.data.map((
|
|
659
|
-
|
|
679
|
+
children: d && n.data.map((L) => /* @__PURE__ */ e(
|
|
680
|
+
de,
|
|
660
681
|
{
|
|
661
|
-
fill:
|
|
682
|
+
fill: L[n.categoryKey] === d ? "var(--color-chart-1)" : re
|
|
662
683
|
},
|
|
663
|
-
String(
|
|
684
|
+
String(L[n.categoryKey])
|
|
664
685
|
))
|
|
665
686
|
},
|
|
666
|
-
|
|
687
|
+
s
|
|
667
688
|
);
|
|
668
689
|
}),
|
|
669
690
|
m.front
|
|
@@ -672,27 +693,27 @@ const Ye = k.forwardRef(
|
|
|
672
693
|
) });
|
|
673
694
|
}
|
|
674
695
|
);
|
|
675
|
-
|
|
676
|
-
const
|
|
677
|
-
({ height: t = I, lineKeys: r, dualAxis: a = !1, stacked: i = !1, forecastKeys:
|
|
678
|
-
const { names:
|
|
696
|
+
Ze.displayName = "BarChart";
|
|
697
|
+
const ve = R.forwardRef(
|
|
698
|
+
({ height: t = I, lineKeys: r, dualAxis: a = !1, stacked: i = !1, forecastKeys: o, className: n, ...l }, x) => {
|
|
699
|
+
const { names: c, format: m, layers: u, furniture: N, colorFor: b, labelFor: f, toggleSeries: y, isHidden: C } = Z(l), w = c.filter((d) => !r.includes(d)), p = (d, s) => r.length ? "var(--chart-axis)" : b(d, s), h = (d, s) => r.length ? "var(--color-chart-1)" : b(d, s), k = c.length > 1 ? [
|
|
679
700
|
...w.map((d) => ({
|
|
680
701
|
key: d,
|
|
681
702
|
label: f(d),
|
|
682
|
-
color: p(d,
|
|
703
|
+
color: p(d, c.indexOf(d)),
|
|
683
704
|
hidden: C(d)
|
|
684
705
|
})),
|
|
685
706
|
...r.map((d) => ({
|
|
686
707
|
key: d,
|
|
687
708
|
label: f(d),
|
|
688
|
-
color: h(d,
|
|
709
|
+
color: h(d, c.indexOf(d)),
|
|
689
710
|
hidden: C(d)
|
|
690
711
|
}))
|
|
691
712
|
] : null;
|
|
692
|
-
return /* @__PURE__ */ e(z, { ref: x, className: n, height: t, legendItems:
|
|
713
|
+
return /* @__PURE__ */ e(z, { ref: x, className: n, height: t, legendItems: k, hovered: u.hovered, format: m, onLegendToggle: y, children: /* @__PURE__ */ A(Ae, { data: l.data, margin: H, barCategoryGap: "24%", children: [
|
|
693
714
|
N,
|
|
694
715
|
a && /* @__PURE__ */ e(
|
|
695
|
-
|
|
716
|
+
U,
|
|
696
717
|
{
|
|
697
718
|
yAxisId: "right",
|
|
698
719
|
orientation: "right",
|
|
@@ -710,14 +731,14 @@ const ge = k.forwardRef(
|
|
|
710
731
|
)
|
|
711
732
|
}
|
|
712
733
|
),
|
|
713
|
-
|
|
734
|
+
l.tooltip !== !1 && /* @__PURE__ */ e(
|
|
714
735
|
O,
|
|
715
736
|
{
|
|
716
737
|
content: /* @__PURE__ */ e(
|
|
717
738
|
T,
|
|
718
739
|
{
|
|
719
740
|
format: m,
|
|
720
|
-
renderer:
|
|
741
|
+
renderer: l.tooltip
|
|
721
742
|
}
|
|
722
743
|
),
|
|
723
744
|
cursor: { fill: "var(--muted)" },
|
|
@@ -726,15 +747,15 @@ const ge = k.forwardRef(
|
|
|
726
747
|
),
|
|
727
748
|
u.back,
|
|
728
749
|
w.map((d) => {
|
|
729
|
-
const
|
|
750
|
+
const s = c.indexOf(d), v = i ? d === w[w.length - 1] : !0;
|
|
730
751
|
return /* @__PURE__ */ e(
|
|
731
|
-
|
|
752
|
+
ce,
|
|
732
753
|
{
|
|
733
754
|
dataKey: d,
|
|
734
755
|
name: f(d),
|
|
735
756
|
stackId: i ? "stack" : void 0,
|
|
736
|
-
fill: p(d,
|
|
737
|
-
radius:
|
|
757
|
+
fill: p(d, s),
|
|
758
|
+
radius: v ? [4, 4, 0, 0] : 0,
|
|
738
759
|
maxBarSize: 48,
|
|
739
760
|
hide: C(d),
|
|
740
761
|
isAnimationActive: !1
|
|
@@ -743,19 +764,19 @@ const ge = k.forwardRef(
|
|
|
743
764
|
);
|
|
744
765
|
}),
|
|
745
766
|
r.map((d) => {
|
|
746
|
-
const
|
|
767
|
+
const s = c.indexOf(d);
|
|
747
768
|
return /* @__PURE__ */ e(
|
|
748
|
-
|
|
769
|
+
se,
|
|
749
770
|
{
|
|
750
771
|
dataKey: d,
|
|
751
772
|
name: f(d),
|
|
752
773
|
yAxisId: a ? "right" : void 0,
|
|
753
774
|
type: "linear",
|
|
754
|
-
stroke: h(d,
|
|
755
|
-
strokeWidth:
|
|
756
|
-
strokeDasharray:
|
|
757
|
-
dot:
|
|
758
|
-
activeDot: /* @__PURE__ */ e(
|
|
775
|
+
stroke: h(d, s),
|
|
776
|
+
strokeWidth: Y,
|
|
777
|
+
strokeDasharray: o != null && o.includes(d) ? "6 4" : void 0,
|
|
778
|
+
dot: /* @__PURE__ */ e(E, { color: h(d, s) }),
|
|
779
|
+
activeDot: /* @__PURE__ */ e(E, { color: h(d, s), active: !0 }),
|
|
759
780
|
hide: C(d),
|
|
760
781
|
isAnimationActive: !1
|
|
761
782
|
},
|
|
@@ -766,36 +787,36 @@ const ge = k.forwardRef(
|
|
|
766
787
|
] }) });
|
|
767
788
|
}
|
|
768
789
|
);
|
|
769
|
-
|
|
770
|
-
const
|
|
771
|
-
(t, r) => /* @__PURE__ */ e(
|
|
790
|
+
ve.displayName = "ComboChart";
|
|
791
|
+
const Qe = R.forwardRef(
|
|
792
|
+
(t, r) => /* @__PURE__ */ e(ve, { ref: r, ...t })
|
|
772
793
|
);
|
|
773
|
-
|
|
774
|
-
const
|
|
794
|
+
Qe.displayName = "ComposedChart";
|
|
795
|
+
const qe = R.forwardRef(
|
|
775
796
|
({
|
|
776
797
|
data: t,
|
|
777
798
|
xKey: r,
|
|
778
799
|
yKey: a,
|
|
779
800
|
labelKey: i,
|
|
780
|
-
annotations:
|
|
801
|
+
annotations: o,
|
|
781
802
|
height: n = I,
|
|
782
|
-
grid:
|
|
803
|
+
grid: l = !1,
|
|
783
804
|
showYAxis: x = !0,
|
|
784
|
-
formatValue:
|
|
805
|
+
formatValue: c,
|
|
785
806
|
xScale: m = "number",
|
|
786
807
|
xDomain: u,
|
|
787
808
|
yDomain: N,
|
|
788
|
-
xTickFormatter:
|
|
809
|
+
xTickFormatter: b,
|
|
789
810
|
yTickFormatter: f,
|
|
790
811
|
yAxisWidth: y = 44,
|
|
791
812
|
tooltip: C,
|
|
792
813
|
className: w
|
|
793
814
|
}, p) => {
|
|
794
|
-
const h =
|
|
795
|
-
return /* @__PURE__ */ e(z, { ref: p, className: w, height: n, legendItems: null, hovered:
|
|
796
|
-
|
|
815
|
+
const h = c ?? F, k = b ?? ((v) => typeof v == "number" ? F(v) : v), d = f ?? ((v) => typeof v == "number" ? h(v) : v), s = xe(o, h);
|
|
816
|
+
return /* @__PURE__ */ e(z, { ref: p, className: w, height: n, legendItems: null, hovered: s.hovered, format: h, children: /* @__PURE__ */ A(Ce, { margin: H, children: [
|
|
817
|
+
l && /* @__PURE__ */ e(te, { vertical: !1, stroke: "var(--chart-grid)" }),
|
|
797
818
|
/* @__PURE__ */ e(
|
|
798
|
-
|
|
819
|
+
ne,
|
|
799
820
|
{
|
|
800
821
|
type: "number",
|
|
801
822
|
dataKey: r,
|
|
@@ -806,11 +827,11 @@ const Ze = k.forwardRef(
|
|
|
806
827
|
tickLine: !1,
|
|
807
828
|
minTickGap: 28,
|
|
808
829
|
tickMargin: 10,
|
|
809
|
-
tick: /* @__PURE__ */ e(D, { anchor: "middle", dy: 0, format:
|
|
830
|
+
tick: /* @__PURE__ */ e(D, { anchor: "middle", dy: 0, format: k })
|
|
810
831
|
}
|
|
811
832
|
),
|
|
812
833
|
x && /* @__PURE__ */ e(
|
|
813
|
-
|
|
834
|
+
U,
|
|
814
835
|
{
|
|
815
836
|
type: "number",
|
|
816
837
|
dataKey: a,
|
|
@@ -838,50 +859,50 @@ const Ze = k.forwardRef(
|
|
|
838
859
|
isAnimationActive: !1
|
|
839
860
|
}
|
|
840
861
|
),
|
|
841
|
-
|
|
862
|
+
s.back,
|
|
842
863
|
/* @__PURE__ */ e(
|
|
843
|
-
|
|
864
|
+
ye,
|
|
844
865
|
{
|
|
845
866
|
data: t,
|
|
846
867
|
fill: "var(--color-chart-1)",
|
|
847
|
-
shape: (
|
|
868
|
+
shape: (v) => /* @__PURE__ */ e("circle", { cx: v.cx, cy: v.cy, r: 4.5, fill: "var(--color-chart-1)", fillOpacity: 0.75 }),
|
|
848
869
|
isAnimationActive: !1
|
|
849
870
|
}
|
|
850
871
|
),
|
|
851
|
-
|
|
872
|
+
s.front
|
|
852
873
|
] }) });
|
|
853
874
|
}
|
|
854
875
|
);
|
|
855
|
-
|
|
856
|
-
const
|
|
876
|
+
qe.displayName = "ScatterChart";
|
|
877
|
+
const Je = R.forwardRef(
|
|
857
878
|
({
|
|
858
879
|
data: t,
|
|
859
880
|
nameKey: r,
|
|
860
881
|
valueKey: a,
|
|
861
882
|
donut: i = !0,
|
|
862
|
-
centerLabel:
|
|
883
|
+
centerLabel: o,
|
|
863
884
|
highlight: n,
|
|
864
|
-
height:
|
|
885
|
+
height: l = 260,
|
|
865
886
|
legend: x = !0,
|
|
866
|
-
formatValue:
|
|
887
|
+
formatValue: c,
|
|
867
888
|
tooltip: m,
|
|
868
889
|
className: u
|
|
869
890
|
}, N) => {
|
|
870
|
-
const
|
|
891
|
+
const b = c ?? F, f = t.reduce((p, h) => p + (typeof h[a] == "number" ? h[a] : 0), 0), y = (p, h) => V(h), C = (p) => n && p !== n ? 0.3 : 1, w = x ? t.map((p, h) => ({
|
|
871
892
|
label: `${p[r]} · ${f ? Math.round(Number(p[a]) / f * 100) : 0}%`,
|
|
872
893
|
color: y(String(p[r]), h)
|
|
873
894
|
})) : null;
|
|
874
|
-
return /* @__PURE__ */ A("div", { ref: N, className:
|
|
875
|
-
w && /* @__PURE__ */ e(
|
|
895
|
+
return /* @__PURE__ */ A("div", { ref: N, className: $("relative w-full font-sans", u), children: [
|
|
896
|
+
w && /* @__PURE__ */ e(X, { items: w }),
|
|
876
897
|
/* @__PURE__ */ A("div", { className: "relative", children: [
|
|
877
|
-
/* @__PURE__ */ e(j, { width: "100%", height:
|
|
898
|
+
/* @__PURE__ */ e(j, { width: "100%", height: l, children: /* @__PURE__ */ A(Re, { margin: { top: 8, right: 8, bottom: 8, left: 8 }, children: [
|
|
878
899
|
m !== !1 && /* @__PURE__ */ e(
|
|
879
900
|
O,
|
|
880
901
|
{
|
|
881
902
|
content: /* @__PURE__ */ e(
|
|
882
903
|
T,
|
|
883
904
|
{
|
|
884
|
-
format:
|
|
905
|
+
format: b,
|
|
885
906
|
renderer: m
|
|
886
907
|
}
|
|
887
908
|
),
|
|
@@ -901,7 +922,7 @@ const Qe = k.forwardRef(
|
|
|
901
922
|
stroke: "none",
|
|
902
923
|
isAnimationActive: !1,
|
|
903
924
|
children: t.map((p, h) => /* @__PURE__ */ e(
|
|
904
|
-
|
|
925
|
+
de,
|
|
905
926
|
{
|
|
906
927
|
role: "presentation",
|
|
907
928
|
"aria-hidden": "true",
|
|
@@ -914,43 +935,43 @@ const Qe = k.forwardRef(
|
|
|
914
935
|
)
|
|
915
936
|
] }) }),
|
|
916
937
|
i && /* @__PURE__ */ A("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
917
|
-
/* @__PURE__ */ e("div", { className: "text-xl font-medium text-foreground tabular-nums", children:
|
|
918
|
-
|
|
938
|
+
/* @__PURE__ */ e("div", { className: "text-xl font-medium text-foreground tabular-nums", children: b(f) }),
|
|
939
|
+
o && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-normal tracking-wide uppercase text-tertiary", children: o })
|
|
919
940
|
] })
|
|
920
941
|
] })
|
|
921
942
|
] });
|
|
922
943
|
}
|
|
923
944
|
);
|
|
924
|
-
|
|
925
|
-
const
|
|
945
|
+
Je.displayName = "PieChart";
|
|
946
|
+
const Ke = R.forwardRef(
|
|
926
947
|
({
|
|
927
948
|
data: t,
|
|
928
949
|
categoryKey: r,
|
|
929
950
|
series: a,
|
|
930
951
|
seriesLabels: i,
|
|
931
|
-
highlight:
|
|
952
|
+
highlight: o,
|
|
932
953
|
maxValue: n,
|
|
933
|
-
height:
|
|
954
|
+
height: l = 300,
|
|
934
955
|
legend: x,
|
|
935
|
-
formatValue:
|
|
956
|
+
formatValue: c,
|
|
936
957
|
tooltip: m,
|
|
937
958
|
className: u
|
|
938
959
|
}, N) => {
|
|
939
|
-
const
|
|
940
|
-
() => a ??
|
|
960
|
+
const b = R.useMemo(
|
|
961
|
+
() => a ?? me(t, r),
|
|
941
962
|
[r, t, a]
|
|
942
|
-
), f =
|
|
963
|
+
), f = c ?? F, y = n ?? Math.max(
|
|
943
964
|
1,
|
|
944
965
|
...t.flatMap(
|
|
945
|
-
(h) =>
|
|
946
|
-
(
|
|
966
|
+
(h) => b.map(
|
|
967
|
+
(k) => typeof h[k] == "number" ? h[k] : 0
|
|
947
968
|
)
|
|
948
969
|
)
|
|
949
|
-
), C = (h) => (i == null ? void 0 : i[h]) ?? h, w = (h,
|
|
950
|
-
return /* @__PURE__ */ A("div", { ref: N, className:
|
|
951
|
-
p && /* @__PURE__ */ e(
|
|
952
|
-
/* @__PURE__ */ e("div", { className: "mx-auto w-full max-w-[520px]", children: /* @__PURE__ */ e(j, { width: "100%", height:
|
|
953
|
-
|
|
970
|
+
), C = (h) => (i == null ? void 0 : i[h]) ?? h, w = (h, k) => o && b.includes(o) ? h === o ? "var(--color-chart-1)" : re : V(k), p = x ?? b.length > 1 ? b.map((h, k) => ({ label: C(h), color: w(h, k) })) : null;
|
|
971
|
+
return /* @__PURE__ */ A("div", { ref: N, className: $("relative w-full font-sans", u), children: [
|
|
972
|
+
p && /* @__PURE__ */ e(X, { items: p, align: "center" }),
|
|
973
|
+
/* @__PURE__ */ e("div", { className: "mx-auto w-full max-w-[520px]", children: /* @__PURE__ */ e(j, { width: "100%", height: l, children: /* @__PURE__ */ A(
|
|
974
|
+
Me,
|
|
954
975
|
{
|
|
955
976
|
data: t,
|
|
956
977
|
cx: "50%",
|
|
@@ -958,16 +979,16 @@ const qe = k.forwardRef(
|
|
|
958
979
|
outerRadius: "68%",
|
|
959
980
|
margin: { top: 10, right: 56, bottom: 16, left: 56 },
|
|
960
981
|
children: [
|
|
961
|
-
/* @__PURE__ */ e(
|
|
982
|
+
/* @__PURE__ */ e($e, { stroke: "var(--border)", radialLines: !0 }),
|
|
962
983
|
/* @__PURE__ */ e(
|
|
963
|
-
|
|
984
|
+
ue,
|
|
964
985
|
{
|
|
965
986
|
dataKey: r,
|
|
966
987
|
tick: { fill: "var(--text-secondary)", fontSize: 11, fontWeight: 500 }
|
|
967
988
|
}
|
|
968
989
|
),
|
|
969
990
|
/* @__PURE__ */ e(
|
|
970
|
-
|
|
991
|
+
Se,
|
|
971
992
|
{
|
|
972
993
|
angle: 90,
|
|
973
994
|
domain: [0, y],
|
|
@@ -989,16 +1010,16 @@ const qe = k.forwardRef(
|
|
|
989
1010
|
isAnimationActive: !1
|
|
990
1011
|
}
|
|
991
1012
|
),
|
|
992
|
-
|
|
1013
|
+
b.map((h, k) => /* @__PURE__ */ e(
|
|
993
1014
|
Le,
|
|
994
1015
|
{
|
|
995
1016
|
dataKey: h,
|
|
996
1017
|
name: C(h),
|
|
997
|
-
stroke: w(h,
|
|
998
|
-
fill: w(h,
|
|
999
|
-
fillOpacity:
|
|
1000
|
-
strokeWidth:
|
|
1001
|
-
dot:
|
|
1018
|
+
stroke: w(h, k),
|
|
1019
|
+
fill: w(h, k),
|
|
1020
|
+
fillOpacity: o ? h === o ? 0.16 : 0.05 : 0.1,
|
|
1021
|
+
strokeWidth: Y,
|
|
1022
|
+
dot: /* @__PURE__ */ e(E, { color: w(h, k) }),
|
|
1002
1023
|
isAnimationActive: !1
|
|
1003
1024
|
},
|
|
1004
1025
|
h
|
|
@@ -1009,59 +1030,59 @@ const qe = k.forwardRef(
|
|
|
1009
1030
|
] });
|
|
1010
1031
|
}
|
|
1011
1032
|
);
|
|
1012
|
-
|
|
1013
|
-
const
|
|
1033
|
+
Ke.displayName = "RadarChart";
|
|
1034
|
+
const et = R.forwardRef(
|
|
1014
1035
|
({
|
|
1015
1036
|
data: t,
|
|
1016
1037
|
nameKey: r,
|
|
1017
1038
|
valueKey: a,
|
|
1018
1039
|
maxValue: i = 100,
|
|
1019
|
-
centerLabel:
|
|
1040
|
+
centerLabel: o,
|
|
1020
1041
|
height: n = I,
|
|
1021
|
-
legend:
|
|
1042
|
+
legend: l = !0,
|
|
1022
1043
|
formatValue: x,
|
|
1023
|
-
tooltip:
|
|
1044
|
+
tooltip: c,
|
|
1024
1045
|
className: m
|
|
1025
1046
|
}, u) => {
|
|
1026
|
-
const N = x ?? F,
|
|
1047
|
+
const N = x ?? F, b = t.map((C, w) => ({
|
|
1027
1048
|
...C,
|
|
1028
1049
|
name: String(C[r]),
|
|
1029
|
-
fill:
|
|
1030
|
-
})), f =
|
|
1050
|
+
fill: ee(w)
|
|
1051
|
+
})), f = b.length ? b.reduce(
|
|
1031
1052
|
(C, w) => C + (typeof w[a] == "number" ? w[a] : 0),
|
|
1032
1053
|
0
|
|
1033
|
-
) /
|
|
1054
|
+
) / b.length : 0, y = l ? b.map((C, w) => ({
|
|
1034
1055
|
label: String(C[r]),
|
|
1035
|
-
color:
|
|
1056
|
+
color: ee(w)
|
|
1036
1057
|
})) : null;
|
|
1037
|
-
return /* @__PURE__ */ A("div", { ref: u, className:
|
|
1058
|
+
return /* @__PURE__ */ A("div", { ref: u, className: $("relative w-full font-sans", m), children: [
|
|
1038
1059
|
/* @__PURE__ */ A("div", { className: "relative mx-auto w-full max-w-[420px]", children: [
|
|
1039
1060
|
/* @__PURE__ */ e(j, { width: "100%", height: n, children: /* @__PURE__ */ A(
|
|
1040
|
-
|
|
1061
|
+
Fe,
|
|
1041
1062
|
{
|
|
1042
|
-
data:
|
|
1063
|
+
data: b,
|
|
1043
1064
|
innerRadius: "48%",
|
|
1044
1065
|
outerRadius: "82%",
|
|
1045
1066
|
startAngle: 90,
|
|
1046
1067
|
endAngle: -270,
|
|
1047
1068
|
margin: { top: 6, right: 6, bottom: 6, left: 6 },
|
|
1048
1069
|
children: [
|
|
1049
|
-
/* @__PURE__ */ e(
|
|
1050
|
-
|
|
1070
|
+
/* @__PURE__ */ e(ue, { type: "number", domain: [0, i], tick: !1 }),
|
|
1071
|
+
c !== !1 && /* @__PURE__ */ e(
|
|
1051
1072
|
O,
|
|
1052
1073
|
{
|
|
1053
1074
|
content: /* @__PURE__ */ e(
|
|
1054
1075
|
T,
|
|
1055
1076
|
{
|
|
1056
1077
|
format: N,
|
|
1057
|
-
renderer:
|
|
1078
|
+
renderer: c
|
|
1058
1079
|
}
|
|
1059
1080
|
),
|
|
1060
1081
|
isAnimationActive: !1
|
|
1061
1082
|
}
|
|
1062
1083
|
),
|
|
1063
1084
|
/* @__PURE__ */ e(
|
|
1064
|
-
|
|
1085
|
+
Oe,
|
|
1065
1086
|
{
|
|
1066
1087
|
dataKey: a,
|
|
1067
1088
|
background: { fill: "var(--muted)" },
|
|
@@ -1075,27 +1096,27 @@ const Je = k.forwardRef(
|
|
|
1075
1096
|
) }),
|
|
1076
1097
|
/* @__PURE__ */ A("div", { className: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
1077
1098
|
/* @__PURE__ */ e("div", { className: "text-xl font-medium text-foreground tabular-nums", children: N(Math.round(f)) }),
|
|
1078
|
-
|
|
1099
|
+
o && /* @__PURE__ */ e("div", { className: "mt-0.5 text-xs font-normal tracking-wide uppercase text-tertiary", children: o })
|
|
1079
1100
|
] })
|
|
1080
1101
|
] }),
|
|
1081
|
-
y && /* @__PURE__ */ e(
|
|
1102
|
+
y && /* @__PURE__ */ e(X, { items: y, align: "center", className: "mb-0 mt-3" })
|
|
1082
1103
|
] });
|
|
1083
1104
|
}
|
|
1084
1105
|
);
|
|
1085
|
-
|
|
1086
|
-
function
|
|
1106
|
+
et.displayName = "RadialBarChart";
|
|
1107
|
+
function tt({
|
|
1087
1108
|
x: t = 0,
|
|
1088
1109
|
y: r = 0,
|
|
1089
1110
|
width: a = 0,
|
|
1090
1111
|
height: i = 0,
|
|
1091
|
-
depth:
|
|
1112
|
+
depth: o = 0,
|
|
1092
1113
|
index: n = 0,
|
|
1093
|
-
name:
|
|
1114
|
+
name: l,
|
|
1094
1115
|
value: x,
|
|
1095
|
-
format:
|
|
1116
|
+
format: c = F
|
|
1096
1117
|
}) {
|
|
1097
|
-
if (
|
|
1098
|
-
const m =
|
|
1118
|
+
if (o === 0) return /* @__PURE__ */ e("g", {});
|
|
1119
|
+
const m = o === 0 ? "transparent" : ee(n), u = o > 0 && n < 4, N = a > 72 && i > 38;
|
|
1099
1120
|
return /* @__PURE__ */ A("g", { children: [
|
|
1100
1121
|
/* @__PURE__ */ e(
|
|
1101
1122
|
"rect",
|
|
@@ -1123,21 +1144,21 @@ function Ke({
|
|
|
1123
1144
|
/* @__PURE__ */ e(
|
|
1124
1145
|
"p",
|
|
1125
1146
|
{
|
|
1126
|
-
className:
|
|
1147
|
+
className: $(
|
|
1127
1148
|
"truncate text-xs font-medium",
|
|
1128
1149
|
u ? "text-background" : "text-foreground"
|
|
1129
1150
|
),
|
|
1130
|
-
children:
|
|
1151
|
+
children: l
|
|
1131
1152
|
}
|
|
1132
1153
|
),
|
|
1133
1154
|
typeof x == "number" && i > 58 && /* @__PURE__ */ e(
|
|
1134
1155
|
"p",
|
|
1135
1156
|
{
|
|
1136
|
-
className:
|
|
1157
|
+
className: $(
|
|
1137
1158
|
"text-xs tabular-nums",
|
|
1138
1159
|
u ? "text-background/70" : "text-tertiary"
|
|
1139
1160
|
),
|
|
1140
|
-
children:
|
|
1161
|
+
children: c(x)
|
|
1141
1162
|
}
|
|
1142
1163
|
)
|
|
1143
1164
|
] })
|
|
@@ -1145,11 +1166,11 @@ function Ke({
|
|
|
1145
1166
|
)
|
|
1146
1167
|
] });
|
|
1147
1168
|
}
|
|
1148
|
-
function
|
|
1149
|
-
const i = [],
|
|
1150
|
-
const
|
|
1151
|
-
if (
|
|
1152
|
-
|
|
1169
|
+
function nt(t, r, a) {
|
|
1170
|
+
const i = [], o = (n) => {
|
|
1171
|
+
const l = Array.isArray(n.children) ? n.children : void 0;
|
|
1172
|
+
if (l != null && l.length) {
|
|
1173
|
+
l.forEach(o);
|
|
1153
1174
|
return;
|
|
1154
1175
|
}
|
|
1155
1176
|
typeof n[a] == "number" && i.push({
|
|
@@ -1158,31 +1179,31 @@ function et(t, r, a) {
|
|
|
1158
1179
|
value: n[a]
|
|
1159
1180
|
});
|
|
1160
1181
|
};
|
|
1161
|
-
return t.forEach(
|
|
1182
|
+
return t.forEach(o), i.length ? i : t;
|
|
1162
1183
|
}
|
|
1163
|
-
const
|
|
1184
|
+
const rt = R.forwardRef(
|
|
1164
1185
|
({
|
|
1165
1186
|
data: t,
|
|
1166
1187
|
nameKey: r,
|
|
1167
1188
|
valueKey: a,
|
|
1168
1189
|
height: i = I,
|
|
1169
|
-
formatValue:
|
|
1190
|
+
formatValue: o,
|
|
1170
1191
|
tooltip: n,
|
|
1171
|
-
className:
|
|
1192
|
+
className: l
|
|
1172
1193
|
}, x) => {
|
|
1173
|
-
const
|
|
1174
|
-
() =>
|
|
1194
|
+
const c = o ?? F, m = R.useMemo(
|
|
1195
|
+
() => nt(t, r, a),
|
|
1175
1196
|
[t, r, a]
|
|
1176
1197
|
);
|
|
1177
|
-
return /* @__PURE__ */ e("div", { ref: x, className:
|
|
1178
|
-
|
|
1198
|
+
return /* @__PURE__ */ e("div", { ref: x, className: $("relative w-full font-sans", l), children: /* @__PURE__ */ e(j, { width: "100%", height: i, children: /* @__PURE__ */ e(
|
|
1199
|
+
Te,
|
|
1179
1200
|
{
|
|
1180
1201
|
data: m,
|
|
1181
1202
|
nameKey: r,
|
|
1182
1203
|
dataKey: a,
|
|
1183
1204
|
type: "flat",
|
|
1184
1205
|
aspectRatio: 1.6,
|
|
1185
|
-
content: /* @__PURE__ */ e(
|
|
1206
|
+
content: /* @__PURE__ */ e(tt, { format: c }),
|
|
1186
1207
|
isAnimationActive: !1,
|
|
1187
1208
|
children: n !== !1 && /* @__PURE__ */ e(
|
|
1188
1209
|
O,
|
|
@@ -1190,7 +1211,7 @@ const tt = k.forwardRef(
|
|
|
1190
1211
|
content: /* @__PURE__ */ e(
|
|
1191
1212
|
T,
|
|
1192
1213
|
{
|
|
1193
|
-
format:
|
|
1214
|
+
format: c,
|
|
1194
1215
|
renderer: n
|
|
1195
1216
|
}
|
|
1196
1217
|
),
|
|
@@ -1201,64 +1222,64 @@ const tt = k.forwardRef(
|
|
|
1201
1222
|
) }) });
|
|
1202
1223
|
}
|
|
1203
1224
|
);
|
|
1204
|
-
|
|
1205
|
-
const
|
|
1206
|
-
const n = Math.min(
|
|
1225
|
+
rt.displayName = "TreemapChart";
|
|
1226
|
+
const J = "var(--color-chart-1)", at = "var(--chart-track)", G = 24, it = 44, ie = 0.55, oe = 4, le = (t, r, a, i, o) => {
|
|
1227
|
+
const n = Math.min(o, a / 2, i);
|
|
1207
1228
|
return `M ${t},${r + i} L ${t},${r + n} Q ${t},${r} ${t + n},${r} L ${t + a - n},${r} Q ${t + a},${r} ${t + a},${r + n} L ${t + a},${r + i} Z`;
|
|
1208
1229
|
};
|
|
1209
|
-
function
|
|
1210
|
-
const t =
|
|
1211
|
-
return
|
|
1230
|
+
function ot() {
|
|
1231
|
+
const t = R.useRef(null), [r, a] = R.useState(0);
|
|
1232
|
+
return R.useLayoutEffect(() => {
|
|
1212
1233
|
const i = t.current;
|
|
1213
1234
|
if (!i) return;
|
|
1214
1235
|
a(i.getBoundingClientRect().width);
|
|
1215
|
-
const
|
|
1236
|
+
const o = new ResizeObserver((n) => {
|
|
1216
1237
|
var x;
|
|
1217
|
-
const
|
|
1218
|
-
a((
|
|
1238
|
+
const l = ((x = n[0]) == null ? void 0 : x.contentRect.width) ?? 0;
|
|
1239
|
+
a((c) => Math.abs(c - l) > 0.5 ? l : c);
|
|
1219
1240
|
});
|
|
1220
|
-
return
|
|
1241
|
+
return o.observe(i), () => o.disconnect();
|
|
1221
1242
|
}, []), { ref: t, width: r };
|
|
1222
1243
|
}
|
|
1223
|
-
const
|
|
1244
|
+
const lt = R.forwardRef(
|
|
1224
1245
|
({
|
|
1225
1246
|
data: t,
|
|
1226
1247
|
nameKey: r,
|
|
1227
1248
|
valueKey: a,
|
|
1228
1249
|
height: i = I,
|
|
1229
|
-
formatValue:
|
|
1250
|
+
formatValue: o,
|
|
1230
1251
|
label: n,
|
|
1231
|
-
tooltip:
|
|
1252
|
+
tooltip: l,
|
|
1232
1253
|
className: x
|
|
1233
|
-
},
|
|
1234
|
-
var
|
|
1235
|
-
const m =
|
|
1254
|
+
}, c) => {
|
|
1255
|
+
var v;
|
|
1256
|
+
const m = o ?? F, { ref: u, width: N } = ot(), [b, f] = R.useState(null), y = Number(((v = t[0]) == null ? void 0 : v[a]) ?? 0), C = t.length, w = Math.max(0, i - G - it), p = G + w, h = C > 0 ? N / (C + (C - 1) * ie) : 0, k = h * ie, d = t.map((g, S) => {
|
|
1236
1257
|
var B;
|
|
1237
|
-
const
|
|
1258
|
+
const L = Number(g[a]), P = Number(((B = t[S - 1]) == null ? void 0 : B[a]) ?? L), Q = y ? L / y * 100 : 0, q = P ? L / P * 100 : 0, M = y && L > 0 ? Math.max(2, L / y * w) : 0;
|
|
1238
1259
|
return {
|
|
1239
1260
|
datum: g,
|
|
1240
|
-
index:
|
|
1261
|
+
index: S,
|
|
1241
1262
|
name: String(g[r]),
|
|
1242
|
-
value:
|
|
1243
|
-
conversionFromFirst:
|
|
1244
|
-
conversionFromPrevious:
|
|
1245
|
-
dropOffFromPrevious:
|
|
1246
|
-
x:
|
|
1263
|
+
value: L,
|
|
1264
|
+
conversionFromFirst: Q,
|
|
1265
|
+
conversionFromPrevious: q,
|
|
1266
|
+
dropOffFromPrevious: S === 0 ? 0 : 100 - q,
|
|
1267
|
+
x: S * (h + k),
|
|
1247
1268
|
y: p - M,
|
|
1248
1269
|
width: h,
|
|
1249
1270
|
height: M,
|
|
1250
1271
|
formatValue: m
|
|
1251
1272
|
};
|
|
1252
|
-
}),
|
|
1253
|
-
return /* @__PURE__ */ e("div", { ref:
|
|
1273
|
+
}), s = b != null ? d[b] : void 0;
|
|
1274
|
+
return /* @__PURE__ */ e("div", { ref: c, className: $("relative w-full font-sans", x), children: /* @__PURE__ */ A("div", { ref: u, className: "relative w-full", style: { height: i }, children: [
|
|
1254
1275
|
N > 0 && C > 0 && /* @__PURE__ */ A("svg", { width: N, height: i, className: "block", children: [
|
|
1255
1276
|
d.slice(1).map((g) => {
|
|
1256
|
-
const
|
|
1277
|
+
const S = d[g.index - 1];
|
|
1257
1278
|
return /* @__PURE__ */ e(
|
|
1258
1279
|
"path",
|
|
1259
1280
|
{
|
|
1260
|
-
d: `M ${
|
|
1261
|
-
fill:
|
|
1281
|
+
d: `M ${S.x + S.width},${S.y} L ${g.x},${g.y} L ${g.x},${p} L ${S.x + S.width},${p} Z`,
|
|
1282
|
+
fill: J,
|
|
1262
1283
|
opacity: 0.14
|
|
1263
1284
|
},
|
|
1264
1285
|
`connector-${g.index}`
|
|
@@ -1273,15 +1294,15 @@ const it = k.forwardRef(
|
|
|
1273
1294
|
/* @__PURE__ */ e(
|
|
1274
1295
|
"path",
|
|
1275
1296
|
{
|
|
1276
|
-
d: le(g.x,
|
|
1277
|
-
fill:
|
|
1297
|
+
d: le(g.x, G, g.width, w, oe),
|
|
1298
|
+
fill: at
|
|
1278
1299
|
}
|
|
1279
1300
|
),
|
|
1280
1301
|
g.height > 0 && /* @__PURE__ */ e(
|
|
1281
1302
|
"path",
|
|
1282
1303
|
{
|
|
1283
|
-
d: le(g.x, g.y, g.width, g.height,
|
|
1284
|
-
fill:
|
|
1304
|
+
d: le(g.x, g.y, g.width, g.height, oe),
|
|
1305
|
+
fill: J
|
|
1285
1306
|
}
|
|
1286
1307
|
),
|
|
1287
1308
|
n !== !1 && (n ? n(g) : /* @__PURE__ */ A(
|
|
@@ -1321,8 +1342,8 @@ const it = k.forwardRef(
|
|
|
1321
1342
|
"rect",
|
|
1322
1343
|
{
|
|
1323
1344
|
x: g.x,
|
|
1324
|
-
y:
|
|
1325
|
-
width: g.index === C - 1 ? h : h +
|
|
1345
|
+
y: G,
|
|
1346
|
+
width: g.index === C - 1 ? h : h + k,
|
|
1326
1347
|
height: w,
|
|
1327
1348
|
fill: "transparent",
|
|
1328
1349
|
onMouseEnter: () => f(g.index),
|
|
@@ -1334,34 +1355,34 @@ const it = k.forwardRef(
|
|
|
1334
1355
|
`${g.name}-${g.index}`
|
|
1335
1356
|
))
|
|
1336
1357
|
] }),
|
|
1337
|
-
|
|
1358
|
+
l !== !1 && s && /* @__PURE__ */ e(
|
|
1338
1359
|
"div",
|
|
1339
1360
|
{
|
|
1340
1361
|
className: "pointer-events-none absolute z-10 -translate-x-1/2 -translate-y-full",
|
|
1341
|
-
style: { left:
|
|
1342
|
-
children:
|
|
1362
|
+
style: { left: s.x + s.width / 2, top: s.y - 10 },
|
|
1363
|
+
children: l ? l({
|
|
1343
1364
|
active: !0,
|
|
1344
|
-
label:
|
|
1365
|
+
label: s.name,
|
|
1345
1366
|
items: [
|
|
1346
1367
|
{
|
|
1347
|
-
key:
|
|
1348
|
-
name:
|
|
1349
|
-
value:
|
|
1350
|
-
color:
|
|
1351
|
-
datum:
|
|
1368
|
+
key: s.name,
|
|
1369
|
+
name: s.name,
|
|
1370
|
+
value: s.value,
|
|
1371
|
+
color: J,
|
|
1372
|
+
datum: s.datum
|
|
1352
1373
|
}
|
|
1353
1374
|
],
|
|
1354
1375
|
formatValue: m
|
|
1355
1376
|
}) : /* @__PURE__ */ A("div", { className: "rounded-md bg-foreground px-2.5 py-1.5 text-xs whitespace-nowrap text-background", children: [
|
|
1356
|
-
/* @__PURE__ */ e("div", { className: "text-xs font-normal tracking-wide uppercase text-background/60", children:
|
|
1357
|
-
/* @__PURE__ */ e("div", { className: "font-normal tabular-nums", children: m(
|
|
1377
|
+
/* @__PURE__ */ e("div", { className: "text-xs font-normal tracking-wide uppercase text-background/60", children: s.name }),
|
|
1378
|
+
/* @__PURE__ */ e("div", { className: "font-normal tabular-nums", children: m(s.value) }),
|
|
1358
1379
|
/* @__PURE__ */ A("div", { className: "text-background/70 tabular-nums", children: [
|
|
1359
|
-
Math.round(
|
|
1380
|
+
Math.round(s.conversionFromFirst),
|
|
1360
1381
|
"% of ",
|
|
1361
1382
|
d[0].name,
|
|
1362
|
-
|
|
1383
|
+
s.index > 0 && /* @__PURE__ */ A(K, { children: [
|
|
1363
1384
|
" · −",
|
|
1364
|
-
Math.round(
|
|
1385
|
+
Math.round(s.dropOffFromPrevious),
|
|
1365
1386
|
"% step"
|
|
1366
1387
|
] })
|
|
1367
1388
|
] })
|
|
@@ -1371,18 +1392,18 @@ const it = k.forwardRef(
|
|
|
1371
1392
|
] }) });
|
|
1372
1393
|
}
|
|
1373
1394
|
);
|
|
1374
|
-
|
|
1395
|
+
lt.displayName = "FunnelChart";
|
|
1375
1396
|
export {
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1397
|
+
Xe as AreaChart,
|
|
1398
|
+
Ze as BarChart,
|
|
1399
|
+
ve as ComboChart,
|
|
1400
|
+
Qe as ComposedChart,
|
|
1401
|
+
lt as FunnelChart,
|
|
1402
|
+
Ye as LineChart,
|
|
1382
1403
|
I as MIN_HEIGHT,
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1404
|
+
Je as PieChart,
|
|
1405
|
+
Ke as RadarChart,
|
|
1406
|
+
et as RadialBarChart,
|
|
1407
|
+
qe as ScatterChart,
|
|
1408
|
+
rt as TreemapChart
|
|
1388
1409
|
};
|