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