@acronis-platform/ui-react 5.2.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/area-chart/area-chart.js +107 -107
- package/dist/components/ui/area-chart/area-chart.js.map +1 -1
- package/dist/components/ui/bar-chart/bar-chart.js +162 -162
- package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
- package/dist/components/ui/category-bar/category-bar.js +50 -50
- package/dist/components/ui/category-bar/category-bar.js.map +1 -1
- package/dist/components/ui/chart/chart.js +53 -40
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/composed-chart/composed-chart.js +146 -146
- package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
- package/dist/components/ui/confidence-cone/confidence-cone.js +97 -97
- package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
- package/dist/components/ui/funnel-chart/funnel-chart.js +120 -120
- package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
- package/dist/components/ui/histogram/histogram.js +58 -58
- package/dist/components/ui/histogram/histogram.js.map +1 -1
- package/dist/components/ui/line-chart/line-chart.js +91 -91
- package/dist/components/ui/line-chart/line-chart.js.map +1 -1
- package/dist/components/ui/pie-chart/pie-chart.js +92 -92
- package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
- package/dist/components/ui/radar-chart/radar-chart.js +37 -37
- package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +112 -112
- package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
- package/dist/components/ui/sankey-chart/sankey-chart.js +78 -78
- package/dist/components/ui/sankey-chart/sankey-chart.js.map +1 -1
- package/dist/components/ui/scatter-chart/scatter-chart.js +57 -57
- package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
- package/dist/components/ui/treemap/treemap.js +87 -87
- package/dist/components/ui/treemap/treemap.js.map +1 -1
- package/dist/index.js +111 -111
- package/dist/llms.txt +1 -1
- package/dist/react.js +111 -111
- package/dist/src/components/ui/chart/chart.d.ts +1 -0
- package/dist/src/components/ui/chart/index.d.ts +1 -1
- package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +3 -2
- package/dist/src/components/ui/sankey-chart/sankey-chart.d.ts +1 -1
- package/dist/src/components/ui/treemap/treemap.d.ts +3 -2
- package/package.json +1 -1
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { cn as e } from "../../../lib/utils.js";
|
|
3
3
|
import { cva as t } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
4
4
|
import { Tooltip as n, TooltipContent as r, TooltipTrigger as i } from "../tooltip/tooltip.js";
|
|
5
|
-
import { ChartContainer as a, ChartLegend as o, ChartLegendContent as s, ChartTooltip as c, ChartTooltipContent as l, resolveChartColors as u } from "../chart/chart.js";
|
|
6
|
-
import { resolveAnimation as
|
|
7
|
-
import * as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { Bar as
|
|
10
|
-
import { Meter as
|
|
5
|
+
import { ChartContainer as a, ChartLegend as o, ChartLegendContent as s, ChartTooltip as c, ChartTooltipContent as l, resolveChartColors as u, toCssKey as d } from "../chart/chart.js";
|
|
6
|
+
import { resolveAnimation as f, resolveAxisDomain as p, resolveBrushProps as m, resolveCartesianLabelPosition as h, resolveCategoryRange as g, resolveChartReferenceValue as _, resolveLabelFillClass as v, resolveReferenceLineProps as ee, resolveRotatedTickAnchor as te, resolveXAxisHeight as ne, resolveXAxisTitle as re, resolveYAxisTitle as ie, toLabelFormatter as ae, toReferenceLineList as oe } from "../chart/chart-format.js";
|
|
7
|
+
import * as y from "react";
|
|
8
|
+
import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
9
|
+
import { Bar as C, BarChart as se, Brush as ce, CartesianGrid as le, Cell as w, LabelList as ue, Rectangle as T, ReferenceArea as de, ReferenceLine as fe, Text as pe, XAxis as me, YAxis as he } from "recharts";
|
|
10
|
+
import { Meter as E } from "@base-ui/react/meter";
|
|
11
11
|
//#region src/components/ui/bar-chart/bar-chart.tsx
|
|
12
12
|
var ge = t("", {
|
|
13
13
|
variants: {
|
|
@@ -24,39 +24,39 @@ var ge = t("", {
|
|
|
24
24
|
orientation: "vertical",
|
|
25
25
|
layout: "grouped"
|
|
26
26
|
}
|
|
27
|
-
}),
|
|
28
|
-
function
|
|
29
|
-
let n = e?.filter((e) => !String(e.dataKey).startsWith(
|
|
27
|
+
}), D = "__headroom_";
|
|
28
|
+
function O(e, t) {
|
|
29
|
+
let n = e?.filter((e) => !String(e.dataKey).startsWith(D));
|
|
30
30
|
return t ? n?.slice().sort((e, n) => t.indexOf(String(e.dataKey)) - t.indexOf(String(n.dataKey))) : n;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function k(e) {
|
|
33
33
|
return e?.map((e) => e.color?.startsWith("url(") ? {
|
|
34
34
|
...e,
|
|
35
|
-
color: `var(--color-${String(e.dataKey)})`
|
|
35
|
+
color: `var(--color-${d(String(e.dataKey))})`
|
|
36
36
|
} : e);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function A({ content: e, dataKeys: t, ...n }) {
|
|
39
39
|
let r = {
|
|
40
40
|
...n,
|
|
41
|
-
payload: O(
|
|
41
|
+
payload: k(O(n.payload, t))
|
|
42
42
|
};
|
|
43
|
-
return e ? typeof e == "function" ?
|
|
43
|
+
return e ? typeof e == "function" ? y.createElement(e, r) : y.cloneElement(e, r) : /* @__PURE__ */ x(l, { ...r });
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
return /* @__PURE__ */
|
|
45
|
+
function j({ dataKeys: e, ...t }) {
|
|
46
|
+
return /* @__PURE__ */ x(s, {
|
|
47
47
|
verticalAlign: t.verticalAlign,
|
|
48
|
-
payload: O(
|
|
48
|
+
payload: k(O(t.payload, e))
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
return /* @__PURE__ */
|
|
51
|
+
function M({ bar: e, track: t, trackFill: n, paint: r }) {
|
|
52
|
+
return /* @__PURE__ */ S(b, { children: [t && /* @__PURE__ */ x(T, {
|
|
53
53
|
className: "recharts-bar-background-rectangle",
|
|
54
54
|
x: t.x ?? void 0,
|
|
55
55
|
y: t.y ?? void 0,
|
|
56
56
|
width: t.width ?? void 0,
|
|
57
57
|
height: t.height ?? void 0,
|
|
58
58
|
fill: n
|
|
59
|
-
}), /* @__PURE__ */
|
|
59
|
+
}), /* @__PURE__ */ x(T, {
|
|
60
60
|
x: e.x ?? void 0,
|
|
61
61
|
y: e.y ?? void 0,
|
|
62
62
|
width: e.width ?? void 0,
|
|
@@ -69,8 +69,8 @@ function j({ bar: e, track: t, trackFill: n, paint: r }) {
|
|
|
69
69
|
strokeDasharray: e.strokeDasharray
|
|
70
70
|
})] });
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return ({ background: r, index: i, ...a }) =>
|
|
72
|
+
function N({ inRange: e, trackFill: t, paint: n }) {
|
|
73
|
+
return ({ background: r, index: i, ...a }) => M({
|
|
74
74
|
bar: a,
|
|
75
75
|
track: e(i) ? r : void 0,
|
|
76
76
|
trackFill: t,
|
|
@@ -79,11 +79,11 @@ function M({ inRange: e, trackFill: t, paint: n }) {
|
|
|
79
79
|
}
|
|
80
80
|
function _e({ rangeBackground: e, inRange: t, trackFill: n, activeBarOption: r }) {
|
|
81
81
|
return e ? {
|
|
82
|
-
shape:
|
|
82
|
+
shape: N({
|
|
83
83
|
inRange: t,
|
|
84
84
|
trackFill: n
|
|
85
85
|
}),
|
|
86
|
-
activeBar: r &&
|
|
86
|
+
activeBar: r && N({
|
|
87
87
|
inRange: t,
|
|
88
88
|
trackFill: n,
|
|
89
89
|
paint: r
|
|
@@ -93,9 +93,9 @@ function _e({ rangeBackground: e, inRange: t, trackFill: n, activeBarOption: r }
|
|
|
93
93
|
activeBar: r
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function P(e) {
|
|
97
97
|
let { x: t = 0, y: n = 0, width: r = 0, height: i = 0, fill: a, fillOpacity: o } = e;
|
|
98
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(T, {
|
|
99
99
|
className: "recharts-reference-area-rect",
|
|
100
100
|
x: t,
|
|
101
101
|
y: n,
|
|
@@ -103,7 +103,7 @@ function N(e) {
|
|
|
103
103
|
height: i,
|
|
104
104
|
fill: a,
|
|
105
105
|
fillOpacity: o
|
|
106
|
-
}), /* @__PURE__ */
|
|
106
|
+
}), /* @__PURE__ */ x("line", {
|
|
107
107
|
x1: t,
|
|
108
108
|
y1: n,
|
|
109
109
|
x2: t,
|
|
@@ -113,7 +113,7 @@ function N(e) {
|
|
|
113
113
|
})] });
|
|
114
114
|
}
|
|
115
115
|
function ve(e) {
|
|
116
|
-
if (e) return
|
|
116
|
+
if (e) return P;
|
|
117
117
|
}
|
|
118
118
|
function ye(e) {
|
|
119
119
|
return e ? {
|
|
@@ -125,76 +125,76 @@ function ye(e) {
|
|
|
125
125
|
}
|
|
126
126
|
function be({ id: e, dataKeys: t, shapes: n }) {
|
|
127
127
|
let r = n.has("gradient"), i = n.has("pattern");
|
|
128
|
-
return !r && !i ? null : /* @__PURE__ */
|
|
129
|
-
id: `${e}-gradient-${t}`,
|
|
128
|
+
return !r && !i ? null : /* @__PURE__ */ x("defs", { children: t.map((t) => /* @__PURE__ */ S(y.Fragment, { children: [r && /* @__PURE__ */ S("linearGradient", {
|
|
129
|
+
id: `${e}-gradient-${d(t)}`,
|
|
130
130
|
x1: "0",
|
|
131
131
|
y1: "0",
|
|
132
132
|
x2: "0",
|
|
133
133
|
y2: "1",
|
|
134
|
-
children: [/* @__PURE__ */
|
|
134
|
+
children: [/* @__PURE__ */ x("stop", {
|
|
135
135
|
offset: "0%",
|
|
136
|
-
stopColor: `var(--color-${t})`,
|
|
136
|
+
stopColor: `var(--color-${d(t)})`,
|
|
137
137
|
stopOpacity: 1
|
|
138
|
-
}), /* @__PURE__ */
|
|
138
|
+
}), /* @__PURE__ */ x("stop", {
|
|
139
139
|
offset: "100%",
|
|
140
|
-
stopColor: `var(--color-${t})`,
|
|
140
|
+
stopColor: `var(--color-${d(t)})`,
|
|
141
141
|
stopOpacity: .35
|
|
142
142
|
})]
|
|
143
|
-
}), i && /* @__PURE__ */
|
|
144
|
-
id: `${e}-pattern-${t}`,
|
|
143
|
+
}), i && /* @__PURE__ */ S("pattern", {
|
|
144
|
+
id: `${e}-pattern-${d(t)}`,
|
|
145
145
|
patternUnits: "userSpaceOnUse",
|
|
146
146
|
width: 6,
|
|
147
147
|
height: 6,
|
|
148
148
|
patternTransform: "rotate(45)",
|
|
149
|
-
children: [/* @__PURE__ */
|
|
149
|
+
children: [/* @__PURE__ */ x("rect", {
|
|
150
150
|
width: 6,
|
|
151
151
|
height: 6,
|
|
152
|
-
fill: `var(--color-${t})`,
|
|
152
|
+
fill: `var(--color-${d(t)})`,
|
|
153
153
|
fillOpacity: .25
|
|
154
|
-
}), /* @__PURE__ */
|
|
154
|
+
}), /* @__PURE__ */ x("line", {
|
|
155
155
|
x1: 0,
|
|
156
156
|
y1: 0,
|
|
157
157
|
x2: 0,
|
|
158
158
|
y2: 6,
|
|
159
|
-
stroke: `var(--color-${t})`,
|
|
159
|
+
stroke: `var(--color-${d(t)})`,
|
|
160
160
|
strokeWidth: 3
|
|
161
161
|
})]
|
|
162
162
|
})] }, t)) });
|
|
163
163
|
}
|
|
164
164
|
function xe({ data: e, chartData: t, xKey: n, seriesKey: r, settings: i, range: a, headroomKey: o, barShape: s, rounded: c, fillOf: l, radiusFor: u }) {
|
|
165
|
-
let { fill:
|
|
166
|
-
return e.map((e,
|
|
167
|
-
let
|
|
168
|
-
return /* @__PURE__ */
|
|
169
|
-
fill:
|
|
170
|
-
fillOpacity:
|
|
171
|
-
stroke:
|
|
172
|
-
strokeWidth:
|
|
173
|
-
strokeDasharray:
|
|
174
|
-
radius:
|
|
175
|
-
}, `${r}-${String(e[n])}-${
|
|
165
|
+
let { fill: f, opacity: p, dashed: m } = i;
|
|
166
|
+
return e.map((e, h) => {
|
|
167
|
+
let g = h >= a[0] && h <= a[1], _ = g && i.shape || s, v = o !== void 0 && Number(t[h]?.[`${D}${r}`]) > 0;
|
|
168
|
+
return /* @__PURE__ */ x(w, {
|
|
169
|
+
fill: g ? f ?? l(r, _) : l(r, s),
|
|
170
|
+
fillOpacity: g ? p : void 0,
|
|
171
|
+
stroke: g && m ? `var(--color-${d(r)})` : void 0,
|
|
172
|
+
strokeWidth: g && m ? 1 : void 0,
|
|
173
|
+
strokeDasharray: g && m ? "4 3" : void 0,
|
|
174
|
+
radius: v ? void 0 : u(_, c)
|
|
175
|
+
}, `${r}-${String(e[n])}-${h}`);
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
var
|
|
179
|
-
function
|
|
180
|
-
let { label: u, value: d, forecast: f } = t, p = a, m = o > 0 ? Math.round(d / o * 100) : 0, h = f != null && f > d, g = /* @__PURE__ */
|
|
178
|
+
var F = (e) => e.toLocaleString();
|
|
179
|
+
function I({ item: t, resolvedColor: a, max: o, valueFormatter: s, showTooltip: c, tooltip: l }) {
|
|
180
|
+
let { label: u, value: d, forecast: f } = t, p = a, m = o > 0 ? Math.round(d / o * 100) : 0, h = f != null && f > d, g = /* @__PURE__ */ S(E.Root, {
|
|
181
181
|
value: d,
|
|
182
182
|
max: o,
|
|
183
183
|
"aria-valuemax": o,
|
|
184
184
|
"aria-valuetext": h ? `${s(d)} of ${s(o)} (${m}%), forecast ${s(f)}` : `${s(d)} of ${s(o)} (${m}%)`,
|
|
185
185
|
tabIndex: c ? 0 : void 0,
|
|
186
186
|
className: "flex w-full flex-col gap-1.5",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
187
|
+
children: [/* @__PURE__ */ S("div", {
|
|
188
188
|
className: "flex items-baseline justify-between gap-2 text-sm leading-none",
|
|
189
|
-
children: [/* @__PURE__ */
|
|
189
|
+
children: [/* @__PURE__ */ x(E.Label, {
|
|
190
190
|
className: "truncate font-semibold",
|
|
191
191
|
children: u
|
|
192
|
-
}), /* @__PURE__ */
|
|
192
|
+
}), /* @__PURE__ */ S("span", {
|
|
193
193
|
className: "shrink-0 tabular-nums",
|
|
194
|
-
children: [/* @__PURE__ */
|
|
194
|
+
children: [/* @__PURE__ */ x("span", {
|
|
195
195
|
className: "font-semibold text-[var(--ui-text-on-surface-link-idle)]",
|
|
196
196
|
children: s(d)
|
|
197
|
-
}), /* @__PURE__ */
|
|
197
|
+
}), /* @__PURE__ */ S("span", {
|
|
198
198
|
className: "text-muted-foreground",
|
|
199
199
|
children: [
|
|
200
200
|
" ",
|
|
@@ -203,9 +203,9 @@ function F({ item: t, resolvedColor: a, max: o, valueFormatter: s, showTooltip:
|
|
|
203
203
|
]
|
|
204
204
|
})]
|
|
205
205
|
})]
|
|
206
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ S(E.Track, {
|
|
207
207
|
className: "relative h-2 w-full overflow-hidden rounded-full bg-[var(--ui-background-status-neutral-pressed)]",
|
|
208
|
-
children: [h && /* @__PURE__ */
|
|
208
|
+
children: [h && /* @__PURE__ */ x("div", {
|
|
209
209
|
"data-forecast": !0,
|
|
210
210
|
className: "absolute inset-y-0 start-0 rounded-full",
|
|
211
211
|
style: {
|
|
@@ -213,24 +213,24 @@ function F({ item: t, resolvedColor: a, max: o, valueFormatter: s, showTooltip:
|
|
|
213
213
|
opacity: .3,
|
|
214
214
|
width: `${f / o * 100}%`
|
|
215
215
|
}
|
|
216
|
-
}), /* @__PURE__ */
|
|
216
|
+
}), /* @__PURE__ */ x(E.Indicator, {
|
|
217
217
|
className: "relative rounded-full",
|
|
218
218
|
style: { backgroundColor: p }
|
|
219
219
|
})]
|
|
220
220
|
})]
|
|
221
221
|
});
|
|
222
|
-
return c ? /* @__PURE__ */
|
|
222
|
+
return c ? /* @__PURE__ */ S(n, { children: [/* @__PURE__ */ x(i, { render: g }), /* @__PURE__ */ x(r, {
|
|
223
223
|
className: e("border border-border bg-background text-foreground shadow-md", !l && "flex items-center gap-2"),
|
|
224
|
-
children: l ?? /* @__PURE__ */
|
|
225
|
-
/* @__PURE__ */
|
|
224
|
+
children: l ?? /* @__PURE__ */ S(b, { children: [
|
|
225
|
+
/* @__PURE__ */ x("span", {
|
|
226
226
|
className: "size-2.5 shrink-0 rounded-full",
|
|
227
227
|
style: { backgroundColor: p }
|
|
228
228
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ x("span", {
|
|
230
230
|
className: "font-semibold",
|
|
231
231
|
children: u
|
|
232
232
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ S("span", {
|
|
234
234
|
className: "text-muted-foreground",
|
|
235
235
|
children: [
|
|
236
236
|
s(d),
|
|
@@ -244,8 +244,8 @@ function F({ item: t, resolvedColor: a, max: o, valueFormatter: s, showTooltip:
|
|
|
244
244
|
] })
|
|
245
245
|
})] }) : g;
|
|
246
246
|
}
|
|
247
|
-
var
|
|
248
|
-
let d = n !== void 0 && n > 0 ? n : t.reduce((e, t) => e + t.value, 0) || 1, f =
|
|
247
|
+
var L = y.forwardRef(({ items: t, max: n, palette: r, valueFormatter: i = F, showTooltip: a = !0, tooltip: o, className: s, ...c }, l) => {
|
|
248
|
+
let d = n !== void 0 && n > 0 ? n : t.reduce((e, t) => e + t.value, 0) || 1, f = y.useMemo(() => {
|
|
249
249
|
if (!r) return null;
|
|
250
250
|
let e = Object.fromEntries(t.map((e, t) => [`item${t}`, {
|
|
251
251
|
label: e.label,
|
|
@@ -253,12 +253,12 @@ var I = v.forwardRef(({ items: t, max: n, palette: r, valueFormatter: i = P, sho
|
|
|
253
253
|
}])), n = u(e, r);
|
|
254
254
|
return t.map((e, t) => e.color ?? n[`item${t}`]?.color ?? "");
|
|
255
255
|
}, [t, r]);
|
|
256
|
-
return /* @__PURE__ */
|
|
256
|
+
return /* @__PURE__ */ x("div", {
|
|
257
257
|
ref: l,
|
|
258
258
|
"data-orientation": "horizontal",
|
|
259
259
|
className: e("flex flex-col gap-4", s),
|
|
260
260
|
...c,
|
|
261
|
-
children: t.map((e, t) => /* @__PURE__ */
|
|
261
|
+
children: t.map((e, t) => /* @__PURE__ */ x(I, {
|
|
262
262
|
item: e,
|
|
263
263
|
resolvedColor: f ? f[t] ?? "" : e.color ?? "",
|
|
264
264
|
max: d,
|
|
@@ -268,35 +268,35 @@ var I = v.forwardRef(({ items: t, max: n, palette: r, valueFormatter: i = P, sho
|
|
|
268
268
|
}, `${t}-${e.label}`))
|
|
269
269
|
});
|
|
270
270
|
});
|
|
271
|
-
|
|
272
|
-
var
|
|
273
|
-
let r =
|
|
271
|
+
L.displayName = "HorizontalBarLayout";
|
|
272
|
+
var R = y.forwardRef((t, n) => {
|
|
273
|
+
let r = y.useId().replace(/:/g, "");
|
|
274
274
|
if (t.orientation === "horizontal") {
|
|
275
275
|
let { orientation: e, ...r } = t;
|
|
276
|
-
return /* @__PURE__ */
|
|
276
|
+
return /* @__PURE__ */ x(L, {
|
|
277
277
|
...r,
|
|
278
278
|
ref: n
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
|
-
let { className: i, config: s, palette: l, data: u, dataKeys:
|
|
281
|
+
let { className: i, config: s, palette: l, data: u, dataKeys: w, xKey: T, referenceLine: E, referenceArea: O, barSettings: k, xAxisLabel: M, yAxisLabel: N, yUnit: P, orientation: F = "vertical", layout: I = "grouped", barRadius: R = 8, barShape: z = "rounded", barSize: Se = 8, maxBarSize: Ce, barGap: we = 4, barCategoryGap: Te, minPointSize: B, showBackground: Ee = !1, backgroundFill: V = "var(--ui-background-surface-secondary)", showActiveBar: De = !1, activeBar: H, showGrid: Oe = !0, showTooltip: ke = !0, showLegend: Ae = !0, showXAxis: je = !0, showYAxis: Me = !0, xTickFormatter: U, yTickFormatter: Ne, xAxisAngle: W, xAxisInterval: Pe, yAxisTickCount: Fe, yAxisDomain: Ie, gridDashed: Le = !0, gridHorizontal: Re, gridVertical: ze, tooltipContent: Be, animate: Ve, animationDuration: He, animationBegin: Ue, animationEasing: We, showLabels: Ge = !1, labelPosition: Ke, labelFormatter: qe, showBrush: Je = !1, brushHeight: Ye, brushAriaLabel: Xe, ...Ze } = t, G = f({
|
|
282
282
|
animate: Ve,
|
|
283
283
|
animationDuration: He,
|
|
284
284
|
animationBegin: Ue,
|
|
285
285
|
animationEasing: We
|
|
286
|
-
}),
|
|
286
|
+
}), K = I === "stacked", q = h({
|
|
287
287
|
labelPosition: Ke,
|
|
288
|
-
isStacked:
|
|
288
|
+
isStacked: K,
|
|
289
289
|
growingEnd: "top"
|
|
290
|
-
}), Qe = oe(
|
|
290
|
+
}), Qe = oe(E), $e = (O ? Array.isArray(O) ? O : [O] : []).map((e) => ({
|
|
291
291
|
area: e,
|
|
292
|
-
range:
|
|
293
|
-
})).filter((e) => e.range !== void 0), J = new Map(
|
|
294
|
-
let t =
|
|
292
|
+
range: g(e, u, T)
|
|
293
|
+
})).filter((e) => e.range !== void 0), J = new Map(w.flatMap((e) => {
|
|
294
|
+
let t = k?.[e], n = t ? g(t, u, T) : void 0;
|
|
295
295
|
return t && n ? [[e, {
|
|
296
296
|
settings: t,
|
|
297
297
|
range: n
|
|
298
298
|
}]] : [];
|
|
299
|
-
})), Y = new Map(
|
|
299
|
+
})), Y = new Map(K ? [] : Array.from(J, ([e, t]) => typeof t.settings.background == "string" ? [e, t.settings.background] : void 0).filter((e) => e !== void 0)), X = Y.size ? u.map((e, t) => {
|
|
300
300
|
let n = {};
|
|
301
301
|
return Y.forEach((r, i) => {
|
|
302
302
|
let a = J.get(i);
|
|
@@ -304,139 +304,139 @@ var L = v.forwardRef((t, n) => {
|
|
|
304
304
|
let [o, s] = a.range;
|
|
305
305
|
if (t < o || t > s) return;
|
|
306
306
|
let c = e[i], l = e[r];
|
|
307
|
-
typeof c == "number" && typeof l == "number" && (n[`${
|
|
307
|
+
typeof c == "number" && typeof l == "number" && (n[`${D}${i}`] = Math.max(0, l - c));
|
|
308
308
|
}), {
|
|
309
309
|
...e,
|
|
310
310
|
...n
|
|
311
311
|
};
|
|
312
|
-
}) : u, Z = new Set(
|
|
313
|
-
let i =
|
|
314
|
-
return /* @__PURE__ */
|
|
312
|
+
}) : u, Z = new Set($e.filter(({ area: e }) => e.highlightTicks !== !1).flatMap(({ range: e }) => u.slice(e[0], e[1] + 1).map((e) => e[T]))), et = Z.size ? ({ payload: t, index: n, ...r }) => {
|
|
313
|
+
let i = U ? U(t.value, n) : t.value;
|
|
314
|
+
return /* @__PURE__ */ x(pe, {
|
|
315
315
|
...r,
|
|
316
316
|
className: e("fill-muted-foreground", Z.has(t.value) && "fill-primary italic"),
|
|
317
317
|
fontSize: 12,
|
|
318
318
|
children: i
|
|
319
319
|
});
|
|
320
|
-
} : void 0,
|
|
321
|
-
...
|
|
322
|
-
fillOpacity:
|
|
323
|
-
} : !1, Q = `bar-${r}`,
|
|
320
|
+
} : void 0, tt = De ? {
|
|
321
|
+
...H?.fill === void 0 ? {} : { fill: H.fill },
|
|
322
|
+
fillOpacity: H?.opacity ?? .85
|
|
323
|
+
} : !1, Q = `bar-${r}`, nt = /* @__PURE__ */ new Set([z]);
|
|
324
324
|
J.forEach(({ settings: e }) => {
|
|
325
|
-
e.shape &&
|
|
325
|
+
e.shape && nt.add(e.shape);
|
|
326
326
|
});
|
|
327
|
-
let
|
|
328
|
-
let r =
|
|
329
|
-
return typeof r == "number" && r !== 0 ?
|
|
330
|
-
},
|
|
331
|
-
|
|
332
|
-
|
|
327
|
+
let rt = (e) => B === void 0 ? void 0 : (t, n) => {
|
|
328
|
+
let r = K ? X[n]?.[e] : t;
|
|
329
|
+
return typeof r == "number" && r !== 0 ? B : 0;
|
|
330
|
+
}, it = (e, t) => t === "gradient" ? `url(#${Q}-gradient-${d(e)})` : t === "pattern" ? `url(#${Q}-pattern-${d(e)})` : `var(--color-${d(e)})`, at = re(M), ot = ie(N), st = p(Ie), ct = ne(M, W), lt = [
|
|
331
|
+
R,
|
|
332
|
+
R,
|
|
333
333
|
0,
|
|
334
334
|
0
|
|
335
|
-
], $ = (e, t) => e === "pill" ? 9999 :
|
|
335
|
+
], $ = (e, t) => e === "pill" ? 9999 : R > 0 && t ? lt : void 0, ut = /* @__PURE__ */ x(A, {
|
|
336
336
|
content: Be,
|
|
337
|
-
dataKeys:
|
|
338
|
-
}),
|
|
339
|
-
dataKey:
|
|
337
|
+
dataKeys: w
|
|
338
|
+
}), dt = /* @__PURE__ */ x(j, { dataKeys: w }), ft = () => /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(me, {
|
|
339
|
+
dataKey: T,
|
|
340
340
|
type: "category",
|
|
341
341
|
hide: !je,
|
|
342
342
|
tickLine: !1,
|
|
343
343
|
axisLine: !1,
|
|
344
|
-
tick:
|
|
345
|
-
tickFormatter:
|
|
346
|
-
angle:
|
|
344
|
+
tick: et,
|
|
345
|
+
tickFormatter: U,
|
|
346
|
+
angle: W,
|
|
347
347
|
interval: Pe,
|
|
348
|
-
textAnchor: te(
|
|
349
|
-
height:
|
|
350
|
-
label:
|
|
351
|
-
}), /* @__PURE__ */
|
|
348
|
+
textAnchor: te(W),
|
|
349
|
+
height: ct,
|
|
350
|
+
label: at
|
|
351
|
+
}), /* @__PURE__ */ x(he, {
|
|
352
352
|
type: "number",
|
|
353
353
|
hide: !Me,
|
|
354
354
|
tickLine: !1,
|
|
355
355
|
axisLine: !1,
|
|
356
|
-
unit:
|
|
356
|
+
unit: P,
|
|
357
357
|
tickFormatter: Ne,
|
|
358
358
|
tickCount: Fe,
|
|
359
|
-
domain:
|
|
360
|
-
width:
|
|
361
|
-
label:
|
|
362
|
-
})] }),
|
|
363
|
-
let n = !
|
|
359
|
+
domain: st,
|
|
360
|
+
width: N ? 72 : void 0,
|
|
361
|
+
label: ot
|
|
362
|
+
})] }), pt = () => w.map((e, t) => {
|
|
363
|
+
let n = !K || t === w.length - 1, r = J.get(e), i = (e) => r !== void 0 && e >= r.range[0] && e <= r.range[1], a = Y.get(e), { shape: o, activeBar: s } = _e({
|
|
364
364
|
rangeBackground: r?.settings.background === !0,
|
|
365
365
|
inRange: i,
|
|
366
|
-
trackFill:
|
|
367
|
-
activeBarOption:
|
|
366
|
+
trackFill: V,
|
|
367
|
+
activeBarOption: tt
|
|
368
368
|
}), c = r && xe({
|
|
369
369
|
data: u,
|
|
370
370
|
chartData: X,
|
|
371
|
-
xKey:
|
|
371
|
+
xKey: T,
|
|
372
372
|
seriesKey: e,
|
|
373
373
|
settings: r.settings,
|
|
374
374
|
range: r.range,
|
|
375
375
|
headroomKey: a,
|
|
376
|
-
barShape:
|
|
376
|
+
barShape: z,
|
|
377
377
|
rounded: n,
|
|
378
|
-
fillOf:
|
|
378
|
+
fillOf: it,
|
|
379
379
|
radiusFor: $
|
|
380
|
-
}), l = Ge && /* @__PURE__ */
|
|
380
|
+
}), l = Ge && /* @__PURE__ */ x(ue, {
|
|
381
381
|
dataKey: e,
|
|
382
|
-
position:
|
|
382
|
+
position: q,
|
|
383
383
|
formatter: ae(qe),
|
|
384
|
-
className:
|
|
384
|
+
className: v(q),
|
|
385
385
|
fontSize: 12
|
|
386
386
|
});
|
|
387
|
-
return /* @__PURE__ */
|
|
387
|
+
return /* @__PURE__ */ S(y.Fragment, { children: [/* @__PURE__ */ S(C, {
|
|
388
388
|
dataKey: e,
|
|
389
|
-
fill:
|
|
390
|
-
stackId:
|
|
391
|
-
radius: $(
|
|
392
|
-
minPointSize:
|
|
393
|
-
background: Ee ? { fill:
|
|
389
|
+
fill: it(e, z),
|
|
390
|
+
stackId: K ? "a" : a ? e : void 0,
|
|
391
|
+
radius: $(z, n),
|
|
392
|
+
minPointSize: rt(e),
|
|
393
|
+
background: Ee ? { fill: V } : void 0,
|
|
394
394
|
shape: o,
|
|
395
395
|
activeBar: s,
|
|
396
|
-
...
|
|
396
|
+
...G,
|
|
397
397
|
children: [c, l]
|
|
398
|
-
}), a && /* @__PURE__ */
|
|
399
|
-
dataKey: `${
|
|
398
|
+
}), a && /* @__PURE__ */ x(C, {
|
|
399
|
+
dataKey: `${D}${e}`,
|
|
400
400
|
stackId: e,
|
|
401
|
-
fill: `var(--color-${e})`,
|
|
401
|
+
fill: `var(--color-${d(e)})`,
|
|
402
402
|
fillOpacity: .25,
|
|
403
|
-
radius: $(
|
|
403
|
+
radius: $(z, !0),
|
|
404
404
|
legendType: "none",
|
|
405
405
|
tooltipType: "none",
|
|
406
|
-
...
|
|
406
|
+
...G
|
|
407
407
|
})] }, e);
|
|
408
|
-
}),
|
|
408
|
+
}), mt = () => $e.map(({ area: e, range: t }, n) => {
|
|
409
409
|
let [r, i] = t;
|
|
410
|
-
return /* @__PURE__ */
|
|
411
|
-
x1: u[r]?.[
|
|
412
|
-
x2: u[i]?.[
|
|
410
|
+
return /* @__PURE__ */ x(de, {
|
|
411
|
+
x1: u[r]?.[T],
|
|
412
|
+
x2: u[i]?.[T],
|
|
413
413
|
fill: "var(--ui-background-surface-secondary)",
|
|
414
414
|
fillOpacity: .6,
|
|
415
415
|
ifOverflow: "extendDomain",
|
|
416
416
|
shape: ve(e.divider),
|
|
417
417
|
label: ye(e.label)
|
|
418
418
|
}, `${e.label ?? "area"}-${n}`);
|
|
419
|
-
}),
|
|
420
|
-
let n =
|
|
421
|
-
return n === void 0 ? null : /* @__PURE__ */
|
|
419
|
+
}), ht = () => Qe.map((e, t) => {
|
|
420
|
+
let n = _(e, u, w);
|
|
421
|
+
return n === void 0 ? null : /* @__PURE__ */ x(fe, {
|
|
422
422
|
y: n,
|
|
423
423
|
...ee(e.label, e.labelPosition ?? "insideTopRight")
|
|
424
424
|
}, `${e.label ?? "ref"}-${t}`);
|
|
425
425
|
});
|
|
426
|
-
return /* @__PURE__ */
|
|
426
|
+
return /* @__PURE__ */ x("div", {
|
|
427
427
|
ref: n,
|
|
428
|
-
"data-orientation":
|
|
429
|
-
"data-layout":
|
|
428
|
+
"data-orientation": F,
|
|
429
|
+
"data-layout": I,
|
|
430
430
|
className: e(ge({
|
|
431
|
-
orientation:
|
|
432
|
-
layout:
|
|
431
|
+
orientation: F,
|
|
432
|
+
layout: I
|
|
433
433
|
}), i),
|
|
434
434
|
...Ze,
|
|
435
|
-
children: /* @__PURE__ */
|
|
435
|
+
children: /* @__PURE__ */ x(a, {
|
|
436
436
|
config: s,
|
|
437
437
|
palette: l,
|
|
438
438
|
className: "size-full [&_.recharts-label]:fill-foreground",
|
|
439
|
-
children: /* @__PURE__ */
|
|
439
|
+
children: /* @__PURE__ */ S(se, {
|
|
440
440
|
data: X,
|
|
441
441
|
layout: "horizontal",
|
|
442
442
|
barSize: Se,
|
|
@@ -444,26 +444,26 @@ var L = v.forwardRef((t, n) => {
|
|
|
444
444
|
barGap: we,
|
|
445
445
|
barCategoryGap: Te,
|
|
446
446
|
children: [
|
|
447
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ x(be, {
|
|
448
448
|
id: Q,
|
|
449
|
-
dataKeys:
|
|
450
|
-
shapes:
|
|
449
|
+
dataKeys: w,
|
|
450
|
+
shapes: nt
|
|
451
451
|
}),
|
|
452
|
-
Oe && /* @__PURE__ */
|
|
452
|
+
Oe && /* @__PURE__ */ x(le, {
|
|
453
453
|
horizontal: Re ?? !0,
|
|
454
454
|
vertical: ze ?? !1,
|
|
455
455
|
strokeDasharray: Le ? "3 3" : void 0
|
|
456
456
|
}),
|
|
457
|
-
dt(),
|
|
458
|
-
ke && /* @__PURE__ */ b(c, { content: lt }),
|
|
459
|
-
Ae && /* @__PURE__ */ b(o, { content: ut }),
|
|
460
457
|
ft(),
|
|
458
|
+
ke && /* @__PURE__ */ x(c, { content: ut }),
|
|
459
|
+
Ae && /* @__PURE__ */ x(o, { content: dt }),
|
|
461
460
|
pt(),
|
|
462
461
|
mt(),
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
462
|
+
ht(),
|
|
463
|
+
Je && /* @__PURE__ */ x(ce, {
|
|
464
|
+
dataKey: T,
|
|
465
|
+
tickFormatter: U,
|
|
466
|
+
...m({
|
|
467
467
|
brushHeight: Ye,
|
|
468
468
|
brushAriaLabel: Xe
|
|
469
469
|
})
|
|
@@ -473,8 +473,8 @@ var L = v.forwardRef((t, n) => {
|
|
|
473
473
|
})
|
|
474
474
|
});
|
|
475
475
|
});
|
|
476
|
-
|
|
476
|
+
R.displayName = "BarChart";
|
|
477
477
|
//#endregion
|
|
478
|
-
export {
|
|
478
|
+
export { R as BarChart, j as NormalizedLegendContent, A as NormalizedTooltipContent, ge as barChartVariants, N as createTrackShape, O as dropHeadroomSeries, k as withSeriesColor };
|
|
479
479
|
|
|
480
480
|
//# sourceMappingURL=bar-chart.js.map
|