@rafal.lemieszewski/tide-ui 0.87.9 → 0.88.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/cjs/components/fundamental/button.cjs +1 -1
- package/dist/cjs/components/fundamental/chart.cjs +1 -1
- package/dist/cjs/components/fundamental/separator.cjs +1 -1
- package/dist/es/components/fundamental/button.js +9 -9
- package/dist/es/components/fundamental/chart.js +600 -444
- package/dist/es/components/fundamental/separator.js +38 -37
- package/dist/es/style.css +1 -1
- package/dist/types/components/fundamental/chart.d.cts +12 -2
- package/dist/types/components/fundamental/chart.d.ts +12 -2
- package/dist/types/components/fundamental/separator.d.ts +2 -3
- package/dist/types/components/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { ResponsiveContainer as
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
return
|
|
8
|
-
},
|
|
9
|
-
if (!
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const v =
|
|
14
|
-
typeof v == "number" ?
|
|
15
|
-
typeof
|
|
1
|
+
import { jsxs as d, jsx as r, Fragment as He } from "react/jsx-runtime";
|
|
2
|
+
import S, { useState as Ye, useMemo as $, useCallback as Se } from "react";
|
|
3
|
+
import { ResponsiveContainer as Ne, ComposedChart as er, CartesianGrid as se, XAxis as oe, YAxis as T, Tooltip as ne, Legend as ie, Bar as Le, Area as Te, Line as Oe, ScatterChart as rr, Scatter as tr, LineChart as ar, ReferenceLine as lr, ReferenceDot as sr, BarChart as Re } from "recharts";
|
|
4
|
+
import { cn as or } from "../../lib/utils.js";
|
|
5
|
+
const ce = (n, f = 0) => {
|
|
6
|
+
const p = n.toFixed(f).split("."), u = p[0].replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
7
|
+
return f > 0 && p[1] ? `${u}.${p[1]}` : u;
|
|
8
|
+
}, Ve = (n, f, a, p = 20) => {
|
|
9
|
+
if (!n.length) return p;
|
|
10
|
+
let u = 0;
|
|
11
|
+
n.forEach((N) => {
|
|
12
|
+
f.forEach((o) => {
|
|
13
|
+
const v = N[o];
|
|
14
|
+
typeof v == "number" ? u = Math.max(u, Math.abs(v)) : Array.isArray(v) && v.forEach((i) => {
|
|
15
|
+
typeof i == "number" && (u = Math.max(u, Math.abs(i)));
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
|
-
const
|
|
20
|
-
return Math.max(
|
|
21
|
-
},
|
|
19
|
+
const w = (a ? a(u, 0) : u.toString()).length;
|
|
20
|
+
return Math.max(p, w * 6 + 12);
|
|
21
|
+
}, O = {
|
|
22
22
|
bar: [
|
|
23
23
|
"var(--color-chart-bar-1)",
|
|
24
24
|
// #487D9A - Deep blue-teal
|
|
@@ -93,8 +93,8 @@ const G = (s, c = 0) => {
|
|
|
93
93
|
"#CC0000"
|
|
94
94
|
// High contrast red
|
|
95
95
|
]
|
|
96
|
-
},
|
|
97
|
-
switch (
|
|
96
|
+
}, R = (n) => {
|
|
97
|
+
switch (n) {
|
|
98
98
|
case "dashed":
|
|
99
99
|
return "5 5";
|
|
100
100
|
// 5px line, 5px gap
|
|
@@ -105,92 +105,92 @@ const G = (s, c = 0) => {
|
|
|
105
105
|
default:
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
|
-
},
|
|
109
|
-
const { cx:
|
|
110
|
-
switch (
|
|
108
|
+
}, nr = (n = "circle") => (f) => {
|
|
109
|
+
const { cx: a, cy: p, r: u, fill: g, stroke: w, strokeWidth: N } = f, o = u || 4;
|
|
110
|
+
switch (n) {
|
|
111
111
|
case "triangle":
|
|
112
|
-
const v = o * 1.5,
|
|
113
|
-
return /* @__PURE__ */
|
|
112
|
+
const v = o * 1.5, i = o * 1.3, m = `M ${a},${p - v} L ${a + i},${p + v / 2} L ${a - i},${p + v / 2} Z`;
|
|
113
|
+
return /* @__PURE__ */ r(
|
|
114
114
|
"path",
|
|
115
115
|
{
|
|
116
|
-
d:
|
|
117
|
-
fill:
|
|
118
|
-
stroke:
|
|
119
|
-
strokeWidth:
|
|
116
|
+
d: m,
|
|
117
|
+
fill: g,
|
|
118
|
+
stroke: w,
|
|
119
|
+
strokeWidth: N || 0
|
|
120
120
|
}
|
|
121
121
|
);
|
|
122
122
|
case "square":
|
|
123
|
-
const
|
|
124
|
-
return /* @__PURE__ */
|
|
123
|
+
const C = o * 1.4;
|
|
124
|
+
return /* @__PURE__ */ r(
|
|
125
125
|
"rect",
|
|
126
126
|
{
|
|
127
|
-
x:
|
|
128
|
-
y:
|
|
129
|
-
width:
|
|
130
|
-
height:
|
|
131
|
-
fill:
|
|
132
|
-
stroke:
|
|
133
|
-
strokeWidth:
|
|
127
|
+
x: a - C,
|
|
128
|
+
y: p - C,
|
|
129
|
+
width: C * 2,
|
|
130
|
+
height: C * 2,
|
|
131
|
+
fill: g,
|
|
132
|
+
stroke: w,
|
|
133
|
+
strokeWidth: N || 0
|
|
134
134
|
}
|
|
135
135
|
);
|
|
136
136
|
case "circle":
|
|
137
137
|
default:
|
|
138
|
-
return /* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ r(
|
|
139
139
|
"circle",
|
|
140
140
|
{
|
|
141
|
-
cx:
|
|
142
|
-
cy:
|
|
141
|
+
cx: a,
|
|
142
|
+
cy: p,
|
|
143
143
|
r: o,
|
|
144
|
-
fill:
|
|
145
|
-
stroke:
|
|
146
|
-
strokeWidth:
|
|
144
|
+
fill: g,
|
|
145
|
+
stroke: w,
|
|
146
|
+
strokeWidth: N || 0
|
|
147
147
|
}
|
|
148
148
|
);
|
|
149
149
|
}
|
|
150
|
-
},
|
|
151
|
-
if (!
|
|
150
|
+
}, Be = (n) => ({ verticalAlign: "bottom", align: "center" }), de = ({ active: n, payload: f, label: a, config: p, tooltipMaxWidth: u = "max-w-xs", chartType: g, referenceMarkers: w }) => {
|
|
151
|
+
if (!n || !f || !f.length)
|
|
152
152
|
return null;
|
|
153
|
-
const
|
|
154
|
-
return /* @__PURE__ */
|
|
153
|
+
const N = w?.filter((o) => o.xValue === a) || [];
|
|
154
|
+
return /* @__PURE__ */ d(
|
|
155
155
|
"div",
|
|
156
156
|
{
|
|
157
|
-
className: `rounded-[var(--border-radius-s)] border border-[var(--color-border-primary-medium)] bg-[var(--color-surface-primary)] p-[var(--space-m)] shadow-[var(--shadow-300)] min-w-[120px] ${
|
|
157
|
+
className: `rounded-[var(--border-radius-s)] border border-[var(--color-border-primary-medium)] bg-[var(--color-surface-primary)] p-[var(--space-m)] shadow-[var(--shadow-300)] min-w-[120px] ${u} z-[9999]`,
|
|
158
158
|
role: "tooltip",
|
|
159
159
|
"aria-label": "Chart data tooltip",
|
|
160
160
|
children: [
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
|
|
163
|
-
const
|
|
164
|
-
let
|
|
165
|
-
if (
|
|
166
|
-
const
|
|
167
|
-
Array.isArray(
|
|
161
|
+
/* @__PURE__ */ r("p", { className: "text-label-sm mb-[var(--space-xs)] text-[var(--color-text-primary)]", children: a }),
|
|
162
|
+
f.map((o, v) => {
|
|
163
|
+
const i = p[o.dataKey];
|
|
164
|
+
let m;
|
|
165
|
+
if (i?.type === "range-area" && o.payload) {
|
|
166
|
+
const L = o.payload[o.dataKey];
|
|
167
|
+
Array.isArray(L) && L.length === 2 ? m = `${ce(L[0])} – ${ce(L[1])}` : m = typeof o.value == "number" ? ce(o.value) : o.value;
|
|
168
168
|
} else
|
|
169
|
-
|
|
170
|
-
return /* @__PURE__ */
|
|
169
|
+
m = typeof o.value == "number" ? ce(o.value) : o.value;
|
|
170
|
+
return /* @__PURE__ */ d("div", { className: "flex items-center gap-[var(--space-xs)]", children: [
|
|
171
171
|
(() => {
|
|
172
|
-
switch (
|
|
172
|
+
switch (g) {
|
|
173
173
|
case "line":
|
|
174
|
-
const
|
|
175
|
-
return /* @__PURE__ */
|
|
174
|
+
const L = p[o.dataKey]?.strokeStyle, _ = R(L);
|
|
175
|
+
return /* @__PURE__ */ r(
|
|
176
176
|
"div",
|
|
177
177
|
{
|
|
178
178
|
className: "w-3 h-0.5 flex-shrink-0 relative",
|
|
179
179
|
"aria-hidden": "true",
|
|
180
|
-
children: /* @__PURE__ */
|
|
180
|
+
children: /* @__PURE__ */ r(
|
|
181
181
|
"div",
|
|
182
182
|
{
|
|
183
183
|
className: "w-full h-full",
|
|
184
184
|
style: {
|
|
185
|
-
background:
|
|
186
|
-
backgroundSize:
|
|
185
|
+
background: _ ? `linear-gradient(to right, ${o.color} 50%, transparent 50%)` : o.color,
|
|
186
|
+
backgroundSize: _ === "5 5" ? "6px 100%" : _ === "2 2" ? "2px 100%" : "100% 100%"
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
)
|
|
190
190
|
}
|
|
191
191
|
);
|
|
192
192
|
case "scatter":
|
|
193
|
-
return /* @__PURE__ */
|
|
193
|
+
return /* @__PURE__ */ r(
|
|
194
194
|
"div",
|
|
195
195
|
{
|
|
196
196
|
className: "w-2 h-2 rounded-full flex-shrink-0",
|
|
@@ -199,21 +199,21 @@ const G = (s, c = 0) => {
|
|
|
199
199
|
}
|
|
200
200
|
);
|
|
201
201
|
case "composed":
|
|
202
|
-
switch (
|
|
202
|
+
switch (p[o.dataKey]?.type) {
|
|
203
203
|
case "line":
|
|
204
|
-
const
|
|
205
|
-
return /* @__PURE__ */
|
|
204
|
+
const A = p[o.dataKey]?.strokeStyle, K = R(A);
|
|
205
|
+
return /* @__PURE__ */ r(
|
|
206
206
|
"div",
|
|
207
207
|
{
|
|
208
208
|
className: "w-3 h-0.5 flex-shrink-0 relative",
|
|
209
209
|
"aria-hidden": "true",
|
|
210
|
-
children: /* @__PURE__ */
|
|
210
|
+
children: /* @__PURE__ */ r(
|
|
211
211
|
"div",
|
|
212
212
|
{
|
|
213
213
|
className: "w-full h-full",
|
|
214
214
|
style: {
|
|
215
|
-
background:
|
|
216
|
-
backgroundSize:
|
|
215
|
+
background: K ? `linear-gradient(to right, ${o.color} 50%, transparent 50%)` : o.color,
|
|
216
|
+
backgroundSize: K === "5 5" ? "6px 100%" : K === "2 2" ? "2px 100%" : "100% 100%"
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
)
|
|
@@ -221,7 +221,7 @@ const G = (s, c = 0) => {
|
|
|
221
221
|
);
|
|
222
222
|
case "area":
|
|
223
223
|
case "range-area":
|
|
224
|
-
return /* @__PURE__ */
|
|
224
|
+
return /* @__PURE__ */ r(
|
|
225
225
|
"div",
|
|
226
226
|
{
|
|
227
227
|
className: "w-2.5 h-2.5 flex-shrink-0",
|
|
@@ -231,7 +231,7 @@ const G = (s, c = 0) => {
|
|
|
231
231
|
);
|
|
232
232
|
case "bar":
|
|
233
233
|
default:
|
|
234
|
-
return /* @__PURE__ */
|
|
234
|
+
return /* @__PURE__ */ r(
|
|
235
235
|
"div",
|
|
236
236
|
{
|
|
237
237
|
className: "w-2 h-2 flex-shrink-0",
|
|
@@ -244,7 +244,7 @@ const G = (s, c = 0) => {
|
|
|
244
244
|
case "horizontal-bar":
|
|
245
245
|
case "area":
|
|
246
246
|
default:
|
|
247
|
-
return /* @__PURE__ */
|
|
247
|
+
return /* @__PURE__ */ r(
|
|
248
248
|
"div",
|
|
249
249
|
{
|
|
250
250
|
className: "w-2 h-2 flex-shrink-0",
|
|
@@ -254,171 +254,217 @@ const G = (s, c = 0) => {
|
|
|
254
254
|
);
|
|
255
255
|
}
|
|
256
256
|
})(),
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
|
|
257
|
+
/* @__PURE__ */ d("span", { className: "text-body-sm text-[var(--color-text-primary)] min-w-0 break-words", children: [
|
|
258
|
+
i?.label || o.dataKey,
|
|
259
259
|
":"
|
|
260
260
|
] }),
|
|
261
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ r("span", { className: "text-body-medium-sm text-[var(--color-text-primary)] ml-auto pl-[16px]", children: m })
|
|
262
262
|
] }, v);
|
|
263
263
|
}),
|
|
264
|
-
|
|
265
|
-
/* @__PURE__ */
|
|
266
|
-
|
|
267
|
-
o.tooltipLabel && /* @__PURE__ */
|
|
268
|
-
!o.tooltipLabel && v === 0 && /* @__PURE__ */
|
|
269
|
-
o.dataPoints.map((
|
|
264
|
+
N.length > 0 && /* @__PURE__ */ d(He, { children: [
|
|
265
|
+
/* @__PURE__ */ r("div", { className: "my-[var(--space-m)]" }),
|
|
266
|
+
N.map((o, v) => /* @__PURE__ */ d(S.Fragment, { children: [
|
|
267
|
+
o.tooltipLabel && /* @__PURE__ */ r("p", { className: "text-label-sm mb-[var(--space-xs)] text-[var(--color-text-primary)]", children: o.tooltipLabel }),
|
|
268
|
+
!o.tooltipLabel && v === 0 && /* @__PURE__ */ r("p", { className: "text-label-sm mb-[var(--space-xs)] text-[var(--color-text-primary)]", children: "Reference Markers:" }),
|
|
269
|
+
o.dataPoints.map((i, m) => /* @__PURE__ */ d("div", { className: "flex items-center gap-[var(--space-xs)]", children: [
|
|
270
270
|
(() => {
|
|
271
|
-
switch (
|
|
271
|
+
switch (i.shape || "circle") {
|
|
272
272
|
case "triangle":
|
|
273
|
-
return /* @__PURE__ */
|
|
273
|
+
return /* @__PURE__ */ r("svg", { width: 8, height: 8, className: "flex-shrink-0", viewBox: "0 0 10 10", children: /* @__PURE__ */ r(
|
|
274
274
|
"path",
|
|
275
275
|
{
|
|
276
276
|
d: "M 5,2 L 8,8 L 2,8 Z",
|
|
277
|
-
fill:
|
|
278
|
-
stroke:
|
|
279
|
-
strokeWidth:
|
|
277
|
+
fill: i.fill || "var(--color-chart-line-1)",
|
|
278
|
+
stroke: i.stroke || "transparent",
|
|
279
|
+
strokeWidth: i.strokeWidth || 0
|
|
280
280
|
}
|
|
281
281
|
) });
|
|
282
282
|
case "square":
|
|
283
|
-
return /* @__PURE__ */
|
|
283
|
+
return /* @__PURE__ */ r("svg", { width: 8, height: 8, className: "flex-shrink-0", viewBox: "0 0 10 10", children: /* @__PURE__ */ r(
|
|
284
284
|
"rect",
|
|
285
285
|
{
|
|
286
286
|
x: "2",
|
|
287
287
|
y: "2",
|
|
288
288
|
width: "6",
|
|
289
289
|
height: "6",
|
|
290
|
-
fill:
|
|
291
|
-
stroke:
|
|
292
|
-
strokeWidth:
|
|
290
|
+
fill: i.fill || "var(--color-chart-line-1)",
|
|
291
|
+
stroke: i.stroke || "transparent",
|
|
292
|
+
strokeWidth: i.strokeWidth || 0
|
|
293
293
|
}
|
|
294
294
|
) });
|
|
295
295
|
case "circle":
|
|
296
296
|
default:
|
|
297
|
-
return /* @__PURE__ */
|
|
297
|
+
return /* @__PURE__ */ r(
|
|
298
298
|
"div",
|
|
299
299
|
{
|
|
300
300
|
className: "w-2 h-2 rounded-full flex-shrink-0",
|
|
301
301
|
style: {
|
|
302
|
-
backgroundColor:
|
|
303
|
-
border:
|
|
302
|
+
backgroundColor: i.fill || "var(--color-chart-line-1)",
|
|
303
|
+
border: i.stroke ? `${i.strokeWidth || 1}px solid ${i.stroke}` : "none"
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
);
|
|
307
307
|
}
|
|
308
308
|
})(),
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
|
|
309
|
+
/* @__PURE__ */ d("span", { className: "text-body-sm text-[var(--color-text-primary)] min-w-0 break-words", children: [
|
|
310
|
+
i.label || `Marker ${m + 1}`,
|
|
311
311
|
":"
|
|
312
312
|
] }),
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
] }, `marker-${v}-point-${
|
|
313
|
+
/* @__PURE__ */ r("span", { className: "text-body-medium-sm text-[var(--color-text-primary)] ml-auto pl-[16px]", children: ce(i.yValue) })
|
|
314
|
+
] }, `marker-${v}-point-${m}`))
|
|
315
315
|
] }, `marker-section-${v}`))
|
|
316
316
|
] })
|
|
317
317
|
]
|
|
318
318
|
}
|
|
319
319
|
);
|
|
320
320
|
};
|
|
321
|
-
function
|
|
322
|
-
type:
|
|
323
|
-
data:
|
|
324
|
-
config:
|
|
325
|
-
className:
|
|
326
|
-
height:
|
|
327
|
-
width:
|
|
328
|
-
minWidth:
|
|
329
|
-
onDataPointClick:
|
|
321
|
+
function pr({
|
|
322
|
+
type: n,
|
|
323
|
+
data: f,
|
|
324
|
+
config: a,
|
|
325
|
+
className: p,
|
|
326
|
+
height: u = 300,
|
|
327
|
+
width: g,
|
|
328
|
+
minWidth: w = 300,
|
|
329
|
+
onDataPointClick: N,
|
|
330
330
|
onDataPointHover: o,
|
|
331
331
|
highlightedIndex: v,
|
|
332
|
-
showGrid:
|
|
333
|
-
showLegend:
|
|
334
|
-
showTooltip:
|
|
335
|
-
colorScheme:
|
|
336
|
-
responsive:
|
|
337
|
-
maintainAspectRatio:
|
|
338
|
-
legendHeight:
|
|
339
|
-
margin:
|
|
340
|
-
yAxisWidth:
|
|
341
|
-
yAxisTickCount:
|
|
342
|
-
xAxisTickFormatter:
|
|
343
|
-
yAxisTickFormatter:
|
|
344
|
-
showRightYAxis:
|
|
345
|
-
rightYAxisWidth:
|
|
346
|
-
rightYAxisTickCount:
|
|
347
|
-
rightYAxisDomain:
|
|
348
|
-
rightYAxisTickFormatter:
|
|
349
|
-
title:
|
|
350
|
-
description:
|
|
351
|
-
showDataTable:
|
|
352
|
-
tooltipMaxWidth:
|
|
353
|
-
tooltipAllowEscapeViewBox:
|
|
354
|
-
legendOrder:
|
|
355
|
-
legendPosition:
|
|
356
|
-
referenceMarkers:
|
|
357
|
-
|
|
358
|
-
|
|
332
|
+
showGrid: i = !0,
|
|
333
|
+
showLegend: m = !0,
|
|
334
|
+
showTooltip: C = !0,
|
|
335
|
+
colorScheme: L,
|
|
336
|
+
responsive: _ = !0,
|
|
337
|
+
maintainAspectRatio: je = !1,
|
|
338
|
+
legendHeight: A,
|
|
339
|
+
margin: K,
|
|
340
|
+
yAxisWidth: ve,
|
|
341
|
+
yAxisTickCount: Ie,
|
|
342
|
+
xAxisTickFormatter: qe,
|
|
343
|
+
yAxisTickFormatter: F,
|
|
344
|
+
showRightYAxis: ue = !1,
|
|
345
|
+
rightYAxisWidth: be,
|
|
346
|
+
rightYAxisTickCount: he,
|
|
347
|
+
rightYAxisDomain: fe,
|
|
348
|
+
rightYAxisTickFormatter: pe,
|
|
349
|
+
title: D,
|
|
350
|
+
description: xe,
|
|
351
|
+
showDataTable: _e = !1,
|
|
352
|
+
tooltipMaxWidth: X = "max-w-xs",
|
|
353
|
+
tooltipAllowEscapeViewBox: U,
|
|
354
|
+
legendOrder: V,
|
|
355
|
+
legendPosition: ir = "bottom",
|
|
356
|
+
referenceMarkers: Me,
|
|
357
|
+
todayMarker: W,
|
|
358
|
+
yAxisDomain: B,
|
|
359
|
+
scrollable: E = !1,
|
|
360
|
+
scrollableWidth: $e,
|
|
361
|
+
...Fe
|
|
359
362
|
}) {
|
|
360
|
-
const [
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
363
|
+
const [ze, Xe] = Ye(0), b = S.useRef(null), ke = S.useRef(!1), Ae = S.useRef(0), Ke = S.useRef(0), Ue = S.useCallback((t) => {
|
|
364
|
+
b.current && (ke.current = !0, Ae.current = t.pageX - b.current.offsetLeft, Ke.current = b.current.scrollLeft, b.current.style.cursor = "grabbing");
|
|
365
|
+
}, []), Ze = S.useCallback((t) => {
|
|
366
|
+
if (!ke.current || !b.current) return;
|
|
367
|
+
t.preventDefault();
|
|
368
|
+
const e = t.pageX - b.current.offsetLeft;
|
|
369
|
+
b.current.scrollLeft = Ke.current - (e - Ae.current);
|
|
370
|
+
}, []), We = S.useCallback(() => {
|
|
371
|
+
ke.current = !1, b.current && (b.current.style.cursor = "grab");
|
|
372
|
+
}, []), k = $(() => {
|
|
373
|
+
if (L)
|
|
374
|
+
return O[L];
|
|
375
|
+
switch (n) {
|
|
364
376
|
case "bar":
|
|
365
377
|
case "horizontal-bar":
|
|
366
|
-
return
|
|
378
|
+
return O.bar;
|
|
367
379
|
case "line":
|
|
368
|
-
return
|
|
380
|
+
return O.line;
|
|
369
381
|
case "scatter":
|
|
370
|
-
return
|
|
382
|
+
return O.scatter;
|
|
371
383
|
case "composed":
|
|
372
|
-
return
|
|
384
|
+
return O.bar;
|
|
373
385
|
// Use bar colors for composed charts
|
|
374
386
|
default:
|
|
375
|
-
return
|
|
387
|
+
return O.bar;
|
|
376
388
|
}
|
|
377
|
-
}, [
|
|
378
|
-
const
|
|
379
|
-
return
|
|
380
|
-
if (
|
|
381
|
-
const
|
|
382
|
-
Array.isArray(
|
|
389
|
+
}, [n, L]), h = Object.keys(a).filter((t) => t !== "name"), y = $(() => f.map((t) => {
|
|
390
|
+
const e = { ...t };
|
|
391
|
+
return h.forEach((s) => {
|
|
392
|
+
if (a[s].type === "range-area") {
|
|
393
|
+
const l = t[s];
|
|
394
|
+
Array.isArray(l) && l.length === 2 && (e[s] = l, e[`${s}_min`] = l[0], e[`${s}_max`] = l[1]);
|
|
383
395
|
}
|
|
384
|
-
}),
|
|
385
|
-
}), [
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
396
|
+
}), e;
|
|
397
|
+
}), [f, a, h]), ge = $(() => {
|
|
398
|
+
if (!W) return null;
|
|
399
|
+
const t = y.find((e) => e.name === W.xValue);
|
|
400
|
+
return {
|
|
401
|
+
xValue: W.xValue,
|
|
402
|
+
showLine: !0,
|
|
403
|
+
lineLabel: W.label ?? "Today",
|
|
404
|
+
lineStyle: {
|
|
405
|
+
stroke: "var(--color-border-error-bold)",
|
|
406
|
+
strokeWidth: 2
|
|
407
|
+
},
|
|
408
|
+
dataPoints: h.filter((e) => t && t[e] != null).map((e) => ({
|
|
409
|
+
yValue: t[e],
|
|
410
|
+
yAxisId: a[e].yAxisId || "left",
|
|
411
|
+
fill: "var(--color-background-error-bold)",
|
|
412
|
+
size: 4,
|
|
413
|
+
pulsing: !0
|
|
414
|
+
}))
|
|
415
|
+
};
|
|
416
|
+
}, [W, y, h, a]), we = $(() => [
|
|
417
|
+
...Me ?? [],
|
|
418
|
+
...ge ? [ge] : []
|
|
419
|
+
], [Me, ge]), Z = Se((t) => {
|
|
420
|
+
const e = t?.activeTooltipIndex ?? 0;
|
|
421
|
+
Xe(e), o?.(t?.activePayload?.[0]?.payload, e);
|
|
422
|
+
}, [o]), J = Se(() => {
|
|
389
423
|
o?.(null);
|
|
390
|
-
}, [o]),
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
}, [
|
|
394
|
-
const
|
|
424
|
+
}, [o]), Q = Se((t) => {
|
|
425
|
+
const e = t?.activeTooltipIndex ?? 0;
|
|
426
|
+
N?.(t?.activePayload?.[0]?.payload, e);
|
|
427
|
+
}, [N]), G = $(() => ze >= Math.floor(y.length / 2), [ze, y.length]), me = () => {
|
|
428
|
+
const t = { top: 8, right: 0, left: 0, bottom: 0 };
|
|
395
429
|
return {
|
|
396
|
-
top:
|
|
397
|
-
right:
|
|
430
|
+
top: K?.top ?? t.top,
|
|
431
|
+
right: K?.right ?? t.right,
|
|
398
432
|
// Don't add rightYAxisWidth - Recharts handles it via YAxis width prop
|
|
399
|
-
left:
|
|
400
|
-
bottom:
|
|
433
|
+
left: K?.left ?? t.left,
|
|
434
|
+
bottom: K?.bottom ?? t.bottom
|
|
401
435
|
};
|
|
402
|
-
},
|
|
403
|
-
if (!
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
436
|
+
}, Pe = $(() => ve || Ve(y, h, F, 20), [ve, y, h, F]), j = $(() => {
|
|
437
|
+
if (!E || B) return B;
|
|
438
|
+
const t = y.flatMap(
|
|
439
|
+
(e) => h.map((s) => {
|
|
440
|
+
const l = e[s];
|
|
441
|
+
return Array.isArray(l) || typeof l == "number" ? l : 0;
|
|
442
|
+
}).flat()
|
|
443
|
+
);
|
|
444
|
+
return [Math.min(0, ...t), Math.max(...t)];
|
|
445
|
+
}, [E, B, y, h]), H = $(
|
|
446
|
+
() => E ? $e ?? Math.max(y.length * 60, 600) : void 0,
|
|
447
|
+
[E, $e, y.length]
|
|
448
|
+
), De = $(() => {
|
|
449
|
+
if (!ue) return 0;
|
|
450
|
+
if (be) return be;
|
|
451
|
+
const t = h.filter((e) => a[e].yAxisId === "right");
|
|
452
|
+
return t.length === 0 ? 0 : Ve(y, t, pe, 20);
|
|
453
|
+
}, [ue, be, y, h, a, pe]), Ee = $(() => h.some((e) => (a[e].yAxisId || "left") === "left") ? "left" : "right", [h, a]), Y = A ? {
|
|
454
|
+
...Be(),
|
|
409
455
|
wrapperStyle: {
|
|
410
456
|
position: "absolute",
|
|
411
457
|
bottom: 0,
|
|
412
458
|
left: 0,
|
|
413
459
|
right: 0,
|
|
414
|
-
height:
|
|
460
|
+
height: A,
|
|
415
461
|
paddingTop: 8,
|
|
416
462
|
zIndex: 1
|
|
417
463
|
}
|
|
418
|
-
} :
|
|
419
|
-
data:
|
|
420
|
-
margin:
|
|
421
|
-
},
|
|
464
|
+
} : Be(), ee = {
|
|
465
|
+
data: y,
|
|
466
|
+
margin: me()
|
|
467
|
+
}, re = {
|
|
422
468
|
axisLine: { stroke: "var(--color-border-primary-subtle)", strokeWidth: 2 },
|
|
423
469
|
tickLine: !1,
|
|
424
470
|
tick: {
|
|
@@ -426,8 +472,8 @@ function Hr({
|
|
|
426
472
|
fill: "var(--color-text-tertiary)",
|
|
427
473
|
fontFamily: "Inter, sans-serif"
|
|
428
474
|
},
|
|
429
|
-
tickFormatter:
|
|
430
|
-
},
|
|
475
|
+
tickFormatter: qe
|
|
476
|
+
}, P = {
|
|
431
477
|
axisLine: { stroke: "var(--color-border-primary-subtle)", strokeWidth: 2 },
|
|
432
478
|
tickLine: { stroke: "var(--color-border-primary-subtle)", strokeWidth: 1 },
|
|
433
479
|
tick: {
|
|
@@ -435,77 +481,77 @@ function Hr({
|
|
|
435
481
|
fill: "var(--color-text-tertiary)",
|
|
436
482
|
fontFamily: "Inter, sans-serif"
|
|
437
483
|
},
|
|
438
|
-
width:
|
|
484
|
+
width: Pe,
|
|
439
485
|
// Auto-calculated based on tick formatter, default 20px
|
|
440
|
-
tickFormatter:
|
|
441
|
-
...
|
|
486
|
+
tickFormatter: F,
|
|
487
|
+
...Ie && { tickCount: Ie },
|
|
442
488
|
// Force specific number of ticks when provided
|
|
443
|
-
...
|
|
489
|
+
...B && { domain: B }
|
|
444
490
|
// Custom Y-axis domain when provided
|
|
445
|
-
},
|
|
491
|
+
}, te = {
|
|
446
492
|
stroke: "var(--color-border-primary-subtle)",
|
|
447
493
|
horizontal: !0,
|
|
448
494
|
vertical: !1
|
|
449
|
-
},
|
|
450
|
-
if (!
|
|
451
|
-
const a =
|
|
452
|
-
const
|
|
453
|
-
return
|
|
454
|
-
}) :
|
|
455
|
-
return /* @__PURE__ */
|
|
495
|
+
}, ae = ({ payload: t }) => {
|
|
496
|
+
if (!t || !t.length) return null;
|
|
497
|
+
const e = t.filter((c) => a[c.dataKey]), s = V ? [...e].sort((c, z) => {
|
|
498
|
+
const M = V.indexOf(c.dataKey), I = V.indexOf(z.dataKey);
|
|
499
|
+
return M === -1 ? 1 : I === -1 ? -1 : M - I;
|
|
500
|
+
}) : e, x = me().left + 5;
|
|
501
|
+
return /* @__PURE__ */ r(
|
|
456
502
|
"div",
|
|
457
503
|
{
|
|
458
504
|
style: {
|
|
459
|
-
paddingLeft: `${
|
|
505
|
+
paddingLeft: `${x}px`,
|
|
460
506
|
paddingRight: "16px"
|
|
461
507
|
},
|
|
462
|
-
children: /* @__PURE__ */
|
|
508
|
+
children: /* @__PURE__ */ r("div", { className: "flex flex-wrap justify-start items-start gap-x-[var(--space-m)] gap-y-[var(--space-s)]", children: s.map((c, z) => /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-[var(--space-xs)]", children: [
|
|
463
509
|
(() => {
|
|
464
|
-
switch (
|
|
510
|
+
switch (n) {
|
|
465
511
|
case "line":
|
|
466
|
-
const
|
|
467
|
-
return /* @__PURE__ */
|
|
512
|
+
const I = a[c.dataKey]?.strokeStyle, q = R(I);
|
|
513
|
+
return /* @__PURE__ */ r(
|
|
468
514
|
"div",
|
|
469
515
|
{
|
|
470
516
|
className: "w-[12px] h-[2px] flex-shrink-0 relative",
|
|
471
517
|
"aria-hidden": "true",
|
|
472
|
-
children: /* @__PURE__ */
|
|
518
|
+
children: /* @__PURE__ */ r(
|
|
473
519
|
"div",
|
|
474
520
|
{
|
|
475
521
|
className: "w-full h-full",
|
|
476
522
|
style: {
|
|
477
|
-
background:
|
|
478
|
-
backgroundSize:
|
|
523
|
+
background: q ? `linear-gradient(to right, ${c.color} 50%, transparent 50%)` : c.color,
|
|
524
|
+
backgroundSize: q === "5 5" ? "8px 100%" : q === "2 2" ? "3px 100%" : "100% 100%"
|
|
479
525
|
}
|
|
480
526
|
}
|
|
481
527
|
)
|
|
482
528
|
}
|
|
483
529
|
);
|
|
484
530
|
case "scatter":
|
|
485
|
-
return /* @__PURE__ */
|
|
531
|
+
return /* @__PURE__ */ r(
|
|
486
532
|
"div",
|
|
487
533
|
{
|
|
488
534
|
className: "w-[6px] h-[6px] rounded-full flex-shrink-0",
|
|
489
|
-
style: { backgroundColor:
|
|
535
|
+
style: { backgroundColor: c.color },
|
|
490
536
|
"aria-hidden": "true"
|
|
491
537
|
}
|
|
492
538
|
);
|
|
493
539
|
case "composed":
|
|
494
|
-
switch (
|
|
540
|
+
switch (a[c.dataKey]?.type) {
|
|
495
541
|
case "line":
|
|
496
|
-
const
|
|
497
|
-
return /* @__PURE__ */
|
|
542
|
+
const Ge = a[c.dataKey]?.strokeStyle, Ce = R(Ge);
|
|
543
|
+
return /* @__PURE__ */ r(
|
|
498
544
|
"div",
|
|
499
545
|
{
|
|
500
546
|
className: "w-[12px] h-[2px] flex-shrink-0 relative",
|
|
501
547
|
"aria-hidden": "true",
|
|
502
|
-
children: /* @__PURE__ */
|
|
548
|
+
children: /* @__PURE__ */ r(
|
|
503
549
|
"div",
|
|
504
550
|
{
|
|
505
551
|
className: "w-full h-full",
|
|
506
552
|
style: {
|
|
507
|
-
background:
|
|
508
|
-
backgroundSize:
|
|
553
|
+
background: Ce ? `linear-gradient(to right, ${c.color} 50%, transparent 50%)` : c.color,
|
|
554
|
+
backgroundSize: Ce === "5 5" ? "8px 100%" : Ce === "2 2" ? "3px 100%" : "100% 100%"
|
|
509
555
|
}
|
|
510
556
|
}
|
|
511
557
|
)
|
|
@@ -513,21 +559,21 @@ function Hr({
|
|
|
513
559
|
);
|
|
514
560
|
case "area":
|
|
515
561
|
case "range-area":
|
|
516
|
-
return /* @__PURE__ */
|
|
562
|
+
return /* @__PURE__ */ r(
|
|
517
563
|
"div",
|
|
518
564
|
{
|
|
519
565
|
className: "w-[8px] h-[8px] flex-shrink-0",
|
|
520
|
-
style: { backgroundColor:
|
|
566
|
+
style: { backgroundColor: c.color },
|
|
521
567
|
"aria-hidden": "true"
|
|
522
568
|
}
|
|
523
569
|
);
|
|
524
570
|
case "bar":
|
|
525
571
|
default:
|
|
526
|
-
return /* @__PURE__ */
|
|
572
|
+
return /* @__PURE__ */ r(
|
|
527
573
|
"div",
|
|
528
574
|
{
|
|
529
575
|
className: "w-[6px] h-[6px] flex-shrink-0",
|
|
530
|
-
style: { backgroundColor:
|
|
576
|
+
style: { backgroundColor: c.color },
|
|
531
577
|
"aria-hidden": "true"
|
|
532
578
|
}
|
|
533
579
|
);
|
|
@@ -535,38 +581,66 @@ function Hr({
|
|
|
535
581
|
case "bar":
|
|
536
582
|
case "horizontal-bar":
|
|
537
583
|
default:
|
|
538
|
-
return /* @__PURE__ */
|
|
584
|
+
return /* @__PURE__ */ r(
|
|
539
585
|
"div",
|
|
540
586
|
{
|
|
541
587
|
className: "w-[6px] h-[6px] flex-shrink-0",
|
|
542
|
-
style: { backgroundColor:
|
|
588
|
+
style: { backgroundColor: c.color },
|
|
543
589
|
"aria-hidden": "true"
|
|
544
590
|
}
|
|
545
591
|
);
|
|
546
592
|
}
|
|
547
593
|
})(),
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
] },
|
|
594
|
+
/* @__PURE__ */ r("span", { className: "[&]:text-body-medium-xsm [&]:text-[var(--color-text-secondary)] leading-none whitespace-nowrap", children: c.value })
|
|
595
|
+
] }, z)) })
|
|
550
596
|
}
|
|
551
597
|
);
|
|
552
|
-
},
|
|
553
|
-
|
|
598
|
+
}, Je = () => {
|
|
599
|
+
const t = V ? [...V, ...Object.keys(a).filter((l) => !V.includes(l))] : Object.keys(a), s = me().left + 5;
|
|
600
|
+
return /* @__PURE__ */ r("div", { style: { paddingLeft: `${s}px`, paddingRight: "16px" }, children: /* @__PURE__ */ r("div", { className: "flex flex-wrap justify-start items-start gap-x-[var(--space-m)] gap-y-[var(--space-s)]", children: t.map((l, x) => {
|
|
601
|
+
const c = a[l];
|
|
602
|
+
if (!c) return null;
|
|
603
|
+
const z = c.color ?? "currentColor", M = R(c.strokeStyle), I = /* @__PURE__ */ r("div", { className: "w-[12px] h-[2px] flex-shrink-0 relative", "aria-hidden": "true", children: /* @__PURE__ */ r(
|
|
604
|
+
"div",
|
|
605
|
+
{
|
|
606
|
+
className: "w-full h-full",
|
|
607
|
+
style: {
|
|
608
|
+
background: M ? `linear-gradient(to right, ${z} 50%, transparent 50%)` : z,
|
|
609
|
+
backgroundSize: M === "5 5" ? "8px 100%" : M === "2 2" ? "3px 100%" : "100% 100%"
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
) });
|
|
613
|
+
return /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-[var(--space-xs)]", children: [
|
|
614
|
+
I,
|
|
615
|
+
/* @__PURE__ */ r("span", { className: "[&]:text-body-medium-xsm [&]:text-[var(--color-text-secondary)] leading-none whitespace-nowrap", children: c.label })
|
|
616
|
+
] }, x);
|
|
617
|
+
}) }) });
|
|
618
|
+
}, ye = (t = "full") => {
|
|
619
|
+
switch (n) {
|
|
554
620
|
case "bar":
|
|
555
|
-
return /* @__PURE__ */
|
|
556
|
-
|
|
621
|
+
return /* @__PURE__ */ d(
|
|
622
|
+
Re,
|
|
557
623
|
{
|
|
558
|
-
...
|
|
559
|
-
onMouseMove:
|
|
560
|
-
onMouseLeave:
|
|
561
|
-
onClick:
|
|
624
|
+
...ee,
|
|
625
|
+
onMouseMove: Z,
|
|
626
|
+
onMouseLeave: J,
|
|
627
|
+
onClick: Q,
|
|
562
628
|
children: [
|
|
563
|
-
|
|
564
|
-
/* @__PURE__ */
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
-
|
|
567
|
-
|
|
629
|
+
t !== "yaxis-only" && i && /* @__PURE__ */ r(se, { ...te }),
|
|
630
|
+
/* @__PURE__ */ r(oe, { dataKey: "name", ...re, ...t === "yaxis-only" && { axisLine: !1, tickLine: !1, tick: !1 } }),
|
|
631
|
+
/* @__PURE__ */ r(
|
|
632
|
+
T,
|
|
633
|
+
{
|
|
634
|
+
...P,
|
|
635
|
+
hide: t === "data-only",
|
|
636
|
+
width: t === "data-only" ? 0 : P.width,
|
|
637
|
+
...t !== "full" && j ? { domain: j } : {}
|
|
638
|
+
}
|
|
639
|
+
),
|
|
640
|
+
t !== "yaxis-only" && C && /* @__PURE__ */ r(
|
|
641
|
+
ne,
|
|
568
642
|
{
|
|
569
|
-
content: (
|
|
643
|
+
content: (e) => /* @__PURE__ */ r(de, { ...e, config: a, tooltipMaxWidth: X, chartType: n }),
|
|
570
644
|
cursor: {
|
|
571
645
|
stroke: "var(--color-border-primary)",
|
|
572
646
|
strokeWidth: 1,
|
|
@@ -576,48 +650,49 @@ function Hr({
|
|
|
576
650
|
position: { x: void 0, y: void 0 },
|
|
577
651
|
offset: 10,
|
|
578
652
|
animationDuration: 0,
|
|
579
|
-
allowEscapeViewBox:
|
|
580
|
-
reverseDirection: { x:
|
|
653
|
+
allowEscapeViewBox: U,
|
|
654
|
+
reverseDirection: { x: G },
|
|
581
655
|
wrapperStyle: { zIndex: 100 }
|
|
582
656
|
}
|
|
583
657
|
),
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
const l =
|
|
587
|
-
return /* @__PURE__ */
|
|
588
|
-
|
|
658
|
+
t === "full" && m && /* @__PURE__ */ r(ie, { content: /* @__PURE__ */ r(ae, {}), ...Y }),
|
|
659
|
+
h.map((e, s) => {
|
|
660
|
+
const l = a[e].color || k[s % k.length];
|
|
661
|
+
return /* @__PURE__ */ r(
|
|
662
|
+
Le,
|
|
589
663
|
{
|
|
590
|
-
dataKey:
|
|
591
|
-
name:
|
|
664
|
+
dataKey: e,
|
|
665
|
+
name: a[e].label,
|
|
592
666
|
fill: l,
|
|
667
|
+
fillOpacity: t === "yaxis-only" ? 0 : 1,
|
|
593
668
|
radius: [0, 0, 0, 0],
|
|
594
669
|
className: "cursor-pointer transition-colors",
|
|
595
670
|
isAnimationActive: !1,
|
|
596
671
|
maxBarSize: 60
|
|
597
672
|
},
|
|
598
|
-
|
|
673
|
+
e
|
|
599
674
|
);
|
|
600
675
|
})
|
|
601
676
|
]
|
|
602
677
|
}
|
|
603
678
|
);
|
|
604
679
|
case "horizontal-bar":
|
|
605
|
-
return /* @__PURE__ */
|
|
606
|
-
|
|
680
|
+
return /* @__PURE__ */ d(
|
|
681
|
+
Re,
|
|
607
682
|
{
|
|
608
|
-
...
|
|
683
|
+
...ee,
|
|
609
684
|
layout: "vertical",
|
|
610
|
-
onMouseMove:
|
|
611
|
-
onMouseLeave:
|
|
612
|
-
onClick:
|
|
685
|
+
onMouseMove: Z,
|
|
686
|
+
onMouseLeave: J,
|
|
687
|
+
onClick: Q,
|
|
613
688
|
children: [
|
|
614
|
-
|
|
615
|
-
/* @__PURE__ */
|
|
616
|
-
/* @__PURE__ */
|
|
617
|
-
|
|
618
|
-
|
|
689
|
+
i && /* @__PURE__ */ r(se, { ...te, horizontal: !1, vertical: !0 }),
|
|
690
|
+
/* @__PURE__ */ r(oe, { type: "number", ...re }),
|
|
691
|
+
/* @__PURE__ */ r(T, { type: "category", dataKey: "name", ...P }),
|
|
692
|
+
C && /* @__PURE__ */ r(
|
|
693
|
+
ne,
|
|
619
694
|
{
|
|
620
|
-
content: (
|
|
695
|
+
content: (e) => /* @__PURE__ */ r(de, { ...e, config: a, tooltipMaxWidth: X, chartType: n }),
|
|
621
696
|
cursor: {
|
|
622
697
|
stroke: "var(--color-border-primary)",
|
|
623
698
|
strokeWidth: 1,
|
|
@@ -627,45 +702,54 @@ function Hr({
|
|
|
627
702
|
position: { x: void 0, y: void 0 },
|
|
628
703
|
offset: 10,
|
|
629
704
|
animationDuration: 0,
|
|
630
|
-
allowEscapeViewBox:
|
|
631
|
-
reverseDirection: { x:
|
|
705
|
+
allowEscapeViewBox: U,
|
|
706
|
+
reverseDirection: { x: G },
|
|
632
707
|
wrapperStyle: { zIndex: 100 }
|
|
633
708
|
}
|
|
634
709
|
),
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
const l =
|
|
638
|
-
return /* @__PURE__ */
|
|
639
|
-
|
|
710
|
+
m && /* @__PURE__ */ r(ie, { content: /* @__PURE__ */ r(ae, {}), ...Y }),
|
|
711
|
+
h.map((e, s) => {
|
|
712
|
+
const l = a[e].color || k[s % k.length];
|
|
713
|
+
return /* @__PURE__ */ r(
|
|
714
|
+
Le,
|
|
640
715
|
{
|
|
641
|
-
dataKey:
|
|
642
|
-
name:
|
|
716
|
+
dataKey: e,
|
|
717
|
+
name: a[e].label,
|
|
643
718
|
fill: l,
|
|
644
719
|
radius: [0, 0, 0, 0],
|
|
645
720
|
className: "cursor-pointer transition-colors",
|
|
646
721
|
isAnimationActive: !1,
|
|
647
722
|
maxBarSize: 40
|
|
648
723
|
},
|
|
649
|
-
|
|
724
|
+
e
|
|
650
725
|
);
|
|
651
726
|
})
|
|
652
727
|
]
|
|
653
728
|
}
|
|
654
729
|
);
|
|
655
730
|
case "line":
|
|
656
|
-
return /* @__PURE__ */
|
|
657
|
-
|
|
731
|
+
return /* @__PURE__ */ d(
|
|
732
|
+
ar,
|
|
658
733
|
{
|
|
659
|
-
...
|
|
660
|
-
onMouseMove:
|
|
661
|
-
onMouseLeave:
|
|
662
|
-
onClick:
|
|
734
|
+
...ee,
|
|
735
|
+
onMouseMove: Z,
|
|
736
|
+
onMouseLeave: J,
|
|
737
|
+
onClick: Q,
|
|
663
738
|
children: [
|
|
664
|
-
|
|
665
|
-
/* @__PURE__ */
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
-
|
|
668
|
-
|
|
739
|
+
t !== "yaxis-only" && i && /* @__PURE__ */ r(se, { ...te, yAxisId: Ee }),
|
|
740
|
+
/* @__PURE__ */ r(oe, { dataKey: "name", ...re, ...t === "yaxis-only" && { axisLine: !1, tickLine: !1, tick: !1 } }),
|
|
741
|
+
/* @__PURE__ */ r(
|
|
742
|
+
T,
|
|
743
|
+
{
|
|
744
|
+
yAxisId: "left",
|
|
745
|
+
...P,
|
|
746
|
+
hide: t === "data-only",
|
|
747
|
+
width: t === "data-only" ? 0 : P.width,
|
|
748
|
+
...t !== "full" && j ? { domain: j } : {}
|
|
749
|
+
}
|
|
750
|
+
),
|
|
751
|
+
t !== "yaxis-only" && ue && /* @__PURE__ */ r(
|
|
752
|
+
T,
|
|
669
753
|
{
|
|
670
754
|
yAxisId: "right",
|
|
671
755
|
orientation: "right",
|
|
@@ -676,29 +760,16 @@ function Hr({
|
|
|
676
760
|
fill: "var(--color-text-tertiary)",
|
|
677
761
|
fontFamily: "Inter, sans-serif"
|
|
678
762
|
},
|
|
679
|
-
width:
|
|
680
|
-
tickFormatter:
|
|
681
|
-
...
|
|
682
|
-
...
|
|
763
|
+
width: De,
|
|
764
|
+
tickFormatter: pe,
|
|
765
|
+
...he && { tickCount: he },
|
|
766
|
+
...fe && { domain: fe }
|
|
683
767
|
}
|
|
684
768
|
),
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
qr,
|
|
688
|
-
{
|
|
689
|
-
x: r.xValue,
|
|
690
|
-
yAxisId: "left",
|
|
691
|
-
stroke: r.lineStyle?.stroke || "#000000",
|
|
692
|
-
strokeWidth: r.lineStyle?.strokeWidth || 2,
|
|
693
|
-
strokeDasharray: r.lineStyle?.strokeDasharray
|
|
694
|
-
},
|
|
695
|
-
`marker-line-${a}`
|
|
696
|
-
) : null
|
|
697
|
-
),
|
|
698
|
-
k && /* @__PURE__ */ e(
|
|
699
|
-
J,
|
|
769
|
+
t !== "yaxis-only" && C && /* @__PURE__ */ r(
|
|
770
|
+
ne,
|
|
700
771
|
{
|
|
701
|
-
content: (
|
|
772
|
+
content: (e) => /* @__PURE__ */ r(de, { ...e, config: a, tooltipMaxWidth: X, chartType: n, referenceMarkers: we }),
|
|
702
773
|
cursor: {
|
|
703
774
|
stroke: "var(--color-border-primary)",
|
|
704
775
|
strokeWidth: 1,
|
|
@@ -708,72 +779,111 @@ function Hr({
|
|
|
708
779
|
position: { x: void 0, y: void 0 },
|
|
709
780
|
offset: 10,
|
|
710
781
|
animationDuration: 0,
|
|
711
|
-
allowEscapeViewBox:
|
|
712
|
-
reverseDirection: { x:
|
|
782
|
+
allowEscapeViewBox: U,
|
|
783
|
+
reverseDirection: { x: G },
|
|
713
784
|
wrapperStyle: { zIndex: 100 }
|
|
714
785
|
}
|
|
715
786
|
),
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
const l =
|
|
719
|
-
return /* @__PURE__ */
|
|
720
|
-
|
|
787
|
+
t === "full" && m && /* @__PURE__ */ r(ie, { content: /* @__PURE__ */ r(ae, {}), ...Y }),
|
|
788
|
+
h.map((e, s) => {
|
|
789
|
+
const l = a[e].color || k[s % k.length];
|
|
790
|
+
return /* @__PURE__ */ r(
|
|
791
|
+
Oe,
|
|
721
792
|
{
|
|
722
793
|
type: "linear",
|
|
723
|
-
dataKey:
|
|
724
|
-
name:
|
|
725
|
-
yAxisId:
|
|
794
|
+
dataKey: e,
|
|
795
|
+
name: a[e].label,
|
|
796
|
+
yAxisId: a[e].yAxisId || "left",
|
|
726
797
|
stroke: l,
|
|
727
798
|
strokeWidth: 2,
|
|
728
|
-
|
|
729
|
-
|
|
799
|
+
strokeOpacity: t === "yaxis-only" ? 0 : 1,
|
|
800
|
+
strokeDasharray: R(a[e].strokeStyle),
|
|
801
|
+
dot: t === "yaxis-only" ? !1 : a[e].showDots === !0 ? {
|
|
730
802
|
fill: l,
|
|
731
803
|
strokeWidth: 0,
|
|
732
804
|
r: 3
|
|
733
805
|
} : !1,
|
|
734
|
-
activeDot: {
|
|
806
|
+
activeDot: t === "yaxis-only" ? !1 : {
|
|
735
807
|
r: 5,
|
|
736
808
|
fill: l
|
|
737
809
|
},
|
|
738
810
|
className: "cursor-pointer transition-colors",
|
|
739
811
|
isAnimationActive: !1
|
|
740
812
|
},
|
|
741
|
-
|
|
813
|
+
e
|
|
742
814
|
);
|
|
743
815
|
}),
|
|
744
|
-
|
|
745
|
-
|
|
816
|
+
t !== "yaxis-only" && we.map(
|
|
817
|
+
(e, s) => e.showLine !== !1 ? /* @__PURE__ */ r(
|
|
818
|
+
lr,
|
|
819
|
+
{
|
|
820
|
+
x: e.xValue,
|
|
821
|
+
yAxisId: "left",
|
|
822
|
+
stroke: e.lineStyle?.stroke || "#000000",
|
|
823
|
+
strokeWidth: e.lineStyle?.strokeWidth || 2,
|
|
824
|
+
strokeDasharray: e.lineStyle?.strokeDasharray,
|
|
825
|
+
label: e.lineLabel ? (l) => {
|
|
826
|
+
const { viewBox: x } = l;
|
|
827
|
+
return x ? /* @__PURE__ */ r(
|
|
828
|
+
"text",
|
|
829
|
+
{
|
|
830
|
+
x: x.x + 6,
|
|
831
|
+
y: x.y + 8,
|
|
832
|
+
dominantBaseline: "middle",
|
|
833
|
+
fill: "var(--color-text-error-bold)",
|
|
834
|
+
fontSize: 10,
|
|
835
|
+
fontFamily: "inherit",
|
|
836
|
+
fontWeight: 700,
|
|
837
|
+
children: e.lineLabel
|
|
838
|
+
}
|
|
839
|
+
) : null;
|
|
840
|
+
} : void 0
|
|
841
|
+
},
|
|
842
|
+
`marker-line-${s}`
|
|
843
|
+
) : null
|
|
844
|
+
),
|
|
845
|
+
t !== "yaxis-only" && we.map((e, s) => /* @__PURE__ */ r(S.Fragment, { children: e.dataPoints?.map((l, x) => /* @__PURE__ */ r(
|
|
846
|
+
sr,
|
|
746
847
|
{
|
|
747
|
-
x:
|
|
848
|
+
x: e.xValue,
|
|
748
849
|
y: l.yValue,
|
|
749
|
-
yAxisId: "left",
|
|
850
|
+
yAxisId: l.yAxisId || "left",
|
|
750
851
|
r: l.size || 4,
|
|
751
852
|
fill: l.fill || "var(--color-chart-line-1)",
|
|
752
853
|
stroke: l.stroke || "transparent",
|
|
753
854
|
strokeWidth: l.strokeWidth || 0,
|
|
754
|
-
shape:
|
|
855
|
+
shape: l.pulsing ? (c) => {
|
|
856
|
+
const { cx: z, cy: M } = c, I = l.size || 4, q = l.fill || "var(--color-background-error-bold)";
|
|
857
|
+
return /* @__PURE__ */ d("g", { children: [
|
|
858
|
+
/* @__PURE__ */ d("circle", { cx: z, cy: M, r: I + 1, fill: q, opacity: 0.3, children: [
|
|
859
|
+
/* @__PURE__ */ r("animate", { attributeName: "r", from: String(I + 1), to: String(I + 8), dur: "1.5s", repeatCount: "indefinite" }),
|
|
860
|
+
/* @__PURE__ */ r("animate", { attributeName: "opacity", from: "0.35", to: "0", dur: "1.5s", repeatCount: "indefinite" })
|
|
861
|
+
] }),
|
|
862
|
+
/* @__PURE__ */ r("circle", { cx: z, cy: M, r: I, fill: q })
|
|
863
|
+
] });
|
|
864
|
+
} : nr(l.shape || "circle")
|
|
755
865
|
},
|
|
756
|
-
`marker-${
|
|
757
|
-
)) }, `marker-dots-${
|
|
866
|
+
`marker-${s}-point-${x}`
|
|
867
|
+
)) }, `marker-dots-${s}`))
|
|
758
868
|
]
|
|
759
869
|
}
|
|
760
870
|
);
|
|
761
871
|
case "scatter":
|
|
762
|
-
return /* @__PURE__ */
|
|
763
|
-
|
|
872
|
+
return /* @__PURE__ */ d(
|
|
873
|
+
rr,
|
|
764
874
|
{
|
|
765
|
-
...
|
|
766
|
-
onMouseMove:
|
|
767
|
-
onMouseLeave:
|
|
768
|
-
onClick:
|
|
875
|
+
...ee,
|
|
876
|
+
onMouseMove: Z,
|
|
877
|
+
onMouseLeave: J,
|
|
878
|
+
onClick: Q,
|
|
769
879
|
children: [
|
|
770
|
-
|
|
771
|
-
/* @__PURE__ */
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
|
|
774
|
-
|
|
880
|
+
i && /* @__PURE__ */ r(se, { ...te }),
|
|
881
|
+
/* @__PURE__ */ r(oe, { dataKey: "x", type: "number", ...re }),
|
|
882
|
+
/* @__PURE__ */ r(T, { dataKey: "y", type: "number", ...P }),
|
|
883
|
+
C && /* @__PURE__ */ r(
|
|
884
|
+
ne,
|
|
775
885
|
{
|
|
776
|
-
content: (
|
|
886
|
+
content: (e) => /* @__PURE__ */ r(de, { ...e, config: a, tooltipMaxWidth: X, chartType: n }),
|
|
777
887
|
cursor: {
|
|
778
888
|
stroke: "var(--color-border-primary)",
|
|
779
889
|
strokeWidth: 1,
|
|
@@ -783,43 +893,52 @@ function Hr({
|
|
|
783
893
|
position: { x: void 0, y: void 0 },
|
|
784
894
|
offset: 10,
|
|
785
895
|
animationDuration: 0,
|
|
786
|
-
allowEscapeViewBox:
|
|
787
|
-
reverseDirection: { x:
|
|
896
|
+
allowEscapeViewBox: U,
|
|
897
|
+
reverseDirection: { x: G },
|
|
788
898
|
wrapperStyle: { zIndex: 100 }
|
|
789
899
|
}
|
|
790
900
|
),
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
const l =
|
|
794
|
-
return /* @__PURE__ */
|
|
795
|
-
|
|
901
|
+
m && /* @__PURE__ */ r(ie, { content: /* @__PURE__ */ r(ae, {}), ...Y }),
|
|
902
|
+
h.filter((e) => e !== "x" && e !== "y" && e !== "name").map((e, s) => {
|
|
903
|
+
const l = a[e]?.color || k[s % k.length];
|
|
904
|
+
return /* @__PURE__ */ r(
|
|
905
|
+
tr,
|
|
796
906
|
{
|
|
797
|
-
name:
|
|
798
|
-
data:
|
|
907
|
+
name: a[e]?.label || e,
|
|
908
|
+
data: f.map((x) => ({ x: x.x, y: x.y, [e]: x[e] })),
|
|
799
909
|
fill: l,
|
|
800
910
|
className: "cursor-pointer transition-colors",
|
|
801
911
|
isAnimationActive: !1
|
|
802
912
|
},
|
|
803
|
-
|
|
913
|
+
e
|
|
804
914
|
);
|
|
805
915
|
})
|
|
806
916
|
]
|
|
807
917
|
}
|
|
808
918
|
);
|
|
809
919
|
case "composed":
|
|
810
|
-
return /* @__PURE__ */
|
|
811
|
-
|
|
920
|
+
return /* @__PURE__ */ d(
|
|
921
|
+
er,
|
|
812
922
|
{
|
|
813
|
-
...
|
|
814
|
-
onMouseMove:
|
|
815
|
-
onMouseLeave:
|
|
816
|
-
onClick:
|
|
923
|
+
...ee,
|
|
924
|
+
onMouseMove: Z,
|
|
925
|
+
onMouseLeave: J,
|
|
926
|
+
onClick: Q,
|
|
817
927
|
children: [
|
|
818
|
-
|
|
819
|
-
/* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
|
|
822
|
-
|
|
928
|
+
t !== "yaxis-only" && i && /* @__PURE__ */ r(se, { ...te, yAxisId: Ee }),
|
|
929
|
+
/* @__PURE__ */ r(oe, { dataKey: "name", ...re, ...t === "yaxis-only" && { axisLine: !1, tickLine: !1, tick: !1 } }),
|
|
930
|
+
/* @__PURE__ */ r(
|
|
931
|
+
T,
|
|
932
|
+
{
|
|
933
|
+
yAxisId: "left",
|
|
934
|
+
...P,
|
|
935
|
+
hide: t === "data-only",
|
|
936
|
+
width: t === "data-only" ? 0 : P.width,
|
|
937
|
+
...t !== "full" && j ? { domain: j } : {}
|
|
938
|
+
}
|
|
939
|
+
),
|
|
940
|
+
t !== "yaxis-only" && ue && /* @__PURE__ */ r(
|
|
941
|
+
T,
|
|
823
942
|
{
|
|
824
943
|
yAxisId: "right",
|
|
825
944
|
orientation: "right",
|
|
@@ -830,16 +949,16 @@ function Hr({
|
|
|
830
949
|
fill: "var(--color-text-tertiary)",
|
|
831
950
|
fontFamily: "Inter, sans-serif"
|
|
832
951
|
},
|
|
833
|
-
width:
|
|
834
|
-
tickFormatter:
|
|
835
|
-
...
|
|
836
|
-
...
|
|
952
|
+
width: De,
|
|
953
|
+
tickFormatter: pe,
|
|
954
|
+
...he && { tickCount: he },
|
|
955
|
+
...fe && { domain: fe }
|
|
837
956
|
}
|
|
838
957
|
),
|
|
839
|
-
|
|
840
|
-
|
|
958
|
+
t !== "yaxis-only" && C && /* @__PURE__ */ r(
|
|
959
|
+
ne,
|
|
841
960
|
{
|
|
842
|
-
content: (
|
|
961
|
+
content: (e) => /* @__PURE__ */ r(de, { ...e, config: a, tooltipMaxWidth: X, chartType: n }),
|
|
843
962
|
cursor: {
|
|
844
963
|
stroke: "var(--color-border-primary)",
|
|
845
964
|
strokeWidth: 1,
|
|
@@ -849,158 +968,195 @@ function Hr({
|
|
|
849
968
|
position: { x: void 0, y: void 0 },
|
|
850
969
|
offset: 10,
|
|
851
970
|
animationDuration: 0,
|
|
852
|
-
allowEscapeViewBox:
|
|
853
|
-
reverseDirection: { x:
|
|
971
|
+
allowEscapeViewBox: U,
|
|
972
|
+
reverseDirection: { x: G },
|
|
854
973
|
wrapperStyle: { zIndex: 100 }
|
|
855
974
|
}
|
|
856
975
|
),
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
const l =
|
|
860
|
-
return (
|
|
861
|
-
|
|
976
|
+
t === "full" && m && /* @__PURE__ */ r(ie, { content: /* @__PURE__ */ r(ae, {}), ...Y }),
|
|
977
|
+
h.map((e, s) => {
|
|
978
|
+
const l = a[e].color || k[s % k.length];
|
|
979
|
+
return (a[e].type || "bar") === "bar" ? /* @__PURE__ */ r(
|
|
980
|
+
Le,
|
|
862
981
|
{
|
|
863
|
-
dataKey:
|
|
864
|
-
name:
|
|
865
|
-
yAxisId:
|
|
982
|
+
dataKey: e,
|
|
983
|
+
name: a[e].label,
|
|
984
|
+
yAxisId: a[e].yAxisId || "left",
|
|
866
985
|
fill: l,
|
|
986
|
+
fillOpacity: t === "yaxis-only" ? 0 : 1,
|
|
867
987
|
radius: [0, 0, 0, 0],
|
|
868
988
|
className: "cursor-pointer transition-colors",
|
|
869
989
|
isAnimationActive: !1,
|
|
870
990
|
maxBarSize: 60
|
|
871
991
|
},
|
|
872
|
-
|
|
992
|
+
e
|
|
873
993
|
) : null;
|
|
874
994
|
}),
|
|
875
|
-
|
|
876
|
-
const l =
|
|
877
|
-
return
|
|
878
|
-
|
|
995
|
+
h.map((e, s) => {
|
|
996
|
+
const l = a[e].color || k[s % k.length], x = a[e].type || "bar";
|
|
997
|
+
return x === "area" ? /* @__PURE__ */ r(
|
|
998
|
+
Te,
|
|
879
999
|
{
|
|
880
1000
|
type: "linear",
|
|
881
|
-
dataKey:
|
|
882
|
-
name:
|
|
883
|
-
yAxisId:
|
|
884
|
-
stroke:
|
|
885
|
-
|
|
886
|
-
|
|
1001
|
+
dataKey: e,
|
|
1002
|
+
name: a[e].label,
|
|
1003
|
+
yAxisId: a[e].yAxisId || "left",
|
|
1004
|
+
stroke: a[e].stroke ?? l,
|
|
1005
|
+
strokeOpacity: t === "yaxis-only" ? 0 : 1,
|
|
1006
|
+
fill: a[e].fill ?? l,
|
|
1007
|
+
fillOpacity: t === "yaxis-only" ? 0 : 0.3,
|
|
887
1008
|
className: "cursor-pointer transition-colors",
|
|
888
1009
|
isAnimationActive: !1
|
|
889
1010
|
},
|
|
890
|
-
|
|
891
|
-
) :
|
|
892
|
-
|
|
1011
|
+
e
|
|
1012
|
+
) : x === "range-area" ? /* @__PURE__ */ r(
|
|
1013
|
+
Te,
|
|
893
1014
|
{
|
|
894
1015
|
type: "linear",
|
|
895
|
-
dataKey:
|
|
896
|
-
name:
|
|
897
|
-
yAxisId:
|
|
898
|
-
stroke:
|
|
899
|
-
|
|
900
|
-
|
|
1016
|
+
dataKey: e,
|
|
1017
|
+
name: a[e].label,
|
|
1018
|
+
yAxisId: a[e].yAxisId || "left",
|
|
1019
|
+
stroke: a[e].stroke ?? "none",
|
|
1020
|
+
strokeOpacity: t === "yaxis-only" ? 0 : 1,
|
|
1021
|
+
fill: a[e].fill ?? l,
|
|
1022
|
+
fillOpacity: t === "yaxis-only" ? 0 : 0.3,
|
|
901
1023
|
className: "cursor-pointer transition-colors",
|
|
902
1024
|
isAnimationActive: !1
|
|
903
1025
|
},
|
|
904
|
-
|
|
1026
|
+
e
|
|
905
1027
|
) : null;
|
|
906
1028
|
}),
|
|
907
|
-
|
|
908
|
-
const l =
|
|
909
|
-
return (
|
|
910
|
-
|
|
1029
|
+
h.map((e, s) => {
|
|
1030
|
+
const l = a[e].color || k[s % k.length];
|
|
1031
|
+
return (a[e].type || "bar") === "line" ? /* @__PURE__ */ r(
|
|
1032
|
+
Oe,
|
|
911
1033
|
{
|
|
912
1034
|
type: "linear",
|
|
913
|
-
dataKey:
|
|
914
|
-
name:
|
|
915
|
-
yAxisId:
|
|
1035
|
+
dataKey: e,
|
|
1036
|
+
name: a[e].label,
|
|
1037
|
+
yAxisId: a[e].yAxisId || "left",
|
|
916
1038
|
stroke: l,
|
|
917
1039
|
strokeWidth: 2,
|
|
918
|
-
|
|
919
|
-
|
|
1040
|
+
strokeOpacity: t === "yaxis-only" ? 0 : 1,
|
|
1041
|
+
strokeDasharray: R(a[e].strokeStyle),
|
|
1042
|
+
dot: t === "yaxis-only" ? !1 : a[e].showDots === !0 ? {
|
|
920
1043
|
fill: l,
|
|
921
1044
|
strokeWidth: 0,
|
|
922
1045
|
r: 3
|
|
923
1046
|
} : !1,
|
|
924
|
-
activeDot: {
|
|
1047
|
+
activeDot: t === "yaxis-only" ? !1 : {
|
|
925
1048
|
r: 5,
|
|
926
1049
|
fill: l
|
|
927
1050
|
},
|
|
928
1051
|
className: "cursor-pointer transition-colors",
|
|
929
1052
|
isAnimationActive: !1
|
|
930
1053
|
},
|
|
931
|
-
|
|
1054
|
+
e
|
|
932
1055
|
) : null;
|
|
933
1056
|
})
|
|
934
1057
|
]
|
|
935
1058
|
}
|
|
936
1059
|
);
|
|
937
1060
|
default:
|
|
938
|
-
return /* @__PURE__ */
|
|
1061
|
+
return /* @__PURE__ */ r("div", { children: "Unsupported chart type" });
|
|
939
1062
|
}
|
|
940
|
-
},
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
|
|
943
|
-
|
|
1063
|
+
}, Qe = () => _e ? /* @__PURE__ */ r("div", { className: "sr-only", children: /* @__PURE__ */ d("table", { role: "table", "aria-label": D ? `Data for ${D}` : "Chart data", children: [
|
|
1064
|
+
/* @__PURE__ */ d("caption", { className: "sr-only", children: [
|
|
1065
|
+
D && `${D}. `,
|
|
1066
|
+
xe || `${n} chart showing ${h.length} data series across ${f.length} categories.`
|
|
944
1067
|
] }),
|
|
945
|
-
/* @__PURE__ */
|
|
946
|
-
/* @__PURE__ */
|
|
947
|
-
|
|
1068
|
+
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ d("tr", { children: [
|
|
1069
|
+
/* @__PURE__ */ r("th", { scope: "col", children: "Category" }),
|
|
1070
|
+
h.map((t) => /* @__PURE__ */ r("th", { scope: "col", children: a[t]?.label || t }, t))
|
|
948
1071
|
] }) }),
|
|
949
|
-
/* @__PURE__ */
|
|
950
|
-
/* @__PURE__ */
|
|
951
|
-
|
|
952
|
-
] },
|
|
953
|
-
] }) }) : null,
|
|
954
|
-
return
|
|
955
|
-
const
|
|
956
|
-
if (!
|
|
957
|
-
const
|
|
958
|
-
|
|
959
|
-
const
|
|
960
|
-
|
|
1072
|
+
/* @__PURE__ */ r("tbody", { children: f.map((t, e) => /* @__PURE__ */ d("tr", { children: [
|
|
1073
|
+
/* @__PURE__ */ r("th", { scope: "row", children: t.name || `Item ${e + 1}` }),
|
|
1074
|
+
h.map((s) => /* @__PURE__ */ r("td", { children: F ? F(t[s], e) : t[s] }, s))
|
|
1075
|
+
] }, e)) })
|
|
1076
|
+
] }) }) : null, le = S.useRef(null);
|
|
1077
|
+
return S.useEffect(() => {
|
|
1078
|
+
const t = le.current;
|
|
1079
|
+
if (!t) return;
|
|
1080
|
+
const e = setTimeout(() => {
|
|
1081
|
+
t.querySelectorAll(".recharts-cartesian-axis-tick").forEach((l) => {
|
|
1082
|
+
const x = l.querySelector("text"), c = l.querySelector(".recharts-cartesian-axis-tick-line");
|
|
1083
|
+
x?.textContent?.trim() === "0" && c && c.setAttribute("stroke-width", "2");
|
|
961
1084
|
});
|
|
962
1085
|
}, 100);
|
|
963
|
-
return () => clearTimeout(
|
|
964
|
-
}, [
|
|
1086
|
+
return () => clearTimeout(e);
|
|
1087
|
+
}, [f, n]), S.useEffect(() => {
|
|
1088
|
+
if (!E || !W || !b.current || !H) return;
|
|
1089
|
+
const t = y.findIndex((s) => s.name === W.xValue);
|
|
1090
|
+
if (t < 0) return;
|
|
1091
|
+
const e = setTimeout(() => {
|
|
1092
|
+
if (!b.current) return;
|
|
1093
|
+
const s = b.current.offsetWidth, l = t / (y.length - 1) * H;
|
|
1094
|
+
b.current.scrollLeft = Math.max(0, l - s / 2);
|
|
1095
|
+
}, 50);
|
|
1096
|
+
return () => clearTimeout(e);
|
|
1097
|
+
}, [E, W, H, y]), /* @__PURE__ */ d(
|
|
965
1098
|
"div",
|
|
966
1099
|
{
|
|
967
|
-
ref:
|
|
968
|
-
className:
|
|
969
|
-
style: { minWidth:
|
|
1100
|
+
ref: le,
|
|
1101
|
+
className: or("w-full", p),
|
|
1102
|
+
style: { minWidth: w },
|
|
970
1103
|
role: "img",
|
|
971
|
-
"aria-label":
|
|
972
|
-
"aria-describedby":
|
|
973
|
-
...
|
|
1104
|
+
"aria-label": D || `${n} chart`,
|
|
1105
|
+
"aria-describedby": xe ? `${le.current?.id || "chart"}-desc` : void 0,
|
|
1106
|
+
...Fe,
|
|
974
1107
|
children: [
|
|
975
|
-
|
|
976
|
-
|
|
1108
|
+
D && /* @__PURE__ */ r("h3", { className: "sr-only", id: `${le.current?.id || "chart"}-title`, children: D }),
|
|
1109
|
+
xe && /* @__PURE__ */ r("p", { className: "sr-only", id: `${le.current?.id || "chart"}-desc`, children: xe }),
|
|
977
1110
|
(() => {
|
|
978
|
-
const
|
|
979
|
-
|
|
1111
|
+
const t = A ? u - A : u;
|
|
1112
|
+
if (E && n !== "horizontal-bar" && n !== "scatter") {
|
|
1113
|
+
const s = Pe + (me().left ?? 0);
|
|
1114
|
+
return /* @__PURE__ */ d("div", { style: { height: m && A ? u : t }, children: [
|
|
1115
|
+
/* @__PURE__ */ d("div", { className: "flex w-full", style: { height: t }, children: [
|
|
1116
|
+
/* @__PURE__ */ r("div", { style: { width: s, flexShrink: 0, overflow: "hidden" }, children: /* @__PURE__ */ r(Ne, { width: s, height: t, children: ye("yaxis-only") || /* @__PURE__ */ r("div", { children: "Chart error" }) }) }),
|
|
1117
|
+
/* @__PURE__ */ r(
|
|
1118
|
+
"div",
|
|
1119
|
+
{
|
|
1120
|
+
ref: b,
|
|
1121
|
+
className: "flex-1 overflow-x-scroll overflow-y-hidden scrollbar-hide select-none",
|
|
1122
|
+
style: { cursor: "grab" },
|
|
1123
|
+
onMouseDown: Ue,
|
|
1124
|
+
onMouseMove: Ze,
|
|
1125
|
+
onMouseUp: We,
|
|
1126
|
+
onMouseLeave: We,
|
|
1127
|
+
children: /* @__PURE__ */ r("div", { style: { width: H, height: t }, children: /* @__PURE__ */ r(Ne, { width: H, height: t, children: ye("data-only") || /* @__PURE__ */ r("div", { children: "Chart error" }) }) })
|
|
1128
|
+
}
|
|
1129
|
+
)
|
|
1130
|
+
] }),
|
|
1131
|
+
m && Je()
|
|
1132
|
+
] });
|
|
1133
|
+
}
|
|
1134
|
+
const e = _ ? /* @__PURE__ */ r(
|
|
1135
|
+
Ne,
|
|
980
1136
|
{
|
|
981
|
-
width:
|
|
982
|
-
height:
|
|
983
|
-
children:
|
|
1137
|
+
width: g || "100%",
|
|
1138
|
+
height: t,
|
|
1139
|
+
children: ye() || /* @__PURE__ */ r("div", { children: "Chart error" })
|
|
984
1140
|
}
|
|
985
|
-
) : /* @__PURE__ */
|
|
986
|
-
return
|
|
1141
|
+
) : /* @__PURE__ */ r("div", { style: { width: g || "100%", height: t, minWidth: w }, children: ye() || /* @__PURE__ */ r("div", { children: "Chart error" }) });
|
|
1142
|
+
return A ? /* @__PURE__ */ r("div", { style: { width: g || "100%" }, children: e }) : e;
|
|
987
1143
|
})(),
|
|
988
|
-
/* @__PURE__ */
|
|
1144
|
+
/* @__PURE__ */ r(Qe, {})
|
|
989
1145
|
]
|
|
990
1146
|
}
|
|
991
1147
|
);
|
|
992
1148
|
}
|
|
993
|
-
const
|
|
994
|
-
const
|
|
995
|
-
return Array.from({ length:
|
|
996
|
-
},
|
|
997
|
-
label:
|
|
998
|
-
color:
|
|
999
|
-
},
|
|
1149
|
+
const xr = (n, f = "bar") => {
|
|
1150
|
+
const a = O[f];
|
|
1151
|
+
return Array.from({ length: n }, (p, u) => a[u % a.length]);
|
|
1152
|
+
}, mr = (n, f, a) => Array.isArray(n) ? n.reduce((u, g, w) => (u[g] = {
|
|
1153
|
+
label: f?.[w] || g,
|
|
1154
|
+
color: a?.[w]
|
|
1155
|
+
}, u), {}) : n;
|
|
1000
1156
|
export {
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1157
|
+
pr as Chart,
|
|
1158
|
+
O as chartColorSchemes,
|
|
1159
|
+
mr as createChartConfig,
|
|
1160
|
+
ce as formatNumber,
|
|
1161
|
+
xr as generateChartColors
|
|
1006
1162
|
};
|