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