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