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