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