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