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