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