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