@yamada-ui/charts 2.0.0-next-20240820160301 → 2.0.0-next-20240908154823
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -13
- package/dist/area-chart-split.js +4 -2
- package/dist/area-chart-split.js.map +1 -1
- package/dist/area-chart-split.mjs +1 -1
- package/dist/area-chart.d.mts +1 -2
- package/dist/area-chart.d.ts +1 -2
- package/dist/area-chart.js +57 -50
- package/dist/area-chart.js.map +1 -1
- package/dist/area-chart.mjs +12 -12
- package/dist/bar-chart.d.mts +1 -2
- package/dist/bar-chart.d.ts +1 -2
- package/dist/bar-chart.js +15 -9
- package/dist/bar-chart.js.map +1 -1
- package/dist/bar-chart.mjs +11 -11
- package/dist/chart-legend.mjs +3 -3
- package/dist/chart-tooltip.d.mts +3 -1
- package/dist/chart-tooltip.d.ts +3 -1
- package/dist/chart-tooltip.js +9 -1
- package/dist/chart-tooltip.js.map +1 -1
- package/dist/chart-tooltip.mjs +3 -3
- package/dist/chart.types.d.mts +12 -5
- package/dist/chart.types.d.ts +12 -5
- package/dist/chart.types.js.map +1 -1
- package/dist/{chunk-STBYN5JW.mjs → chunk-3AOICU4Q.mjs} +2 -2
- package/dist/chunk-3HQ2UC3I.mjs +45 -0
- package/dist/chunk-3HQ2UC3I.mjs.map +1 -0
- package/dist/{chunk-FALZDKAW.mjs → chunk-3VKCTSPC.mjs} +10 -11
- package/dist/chunk-3VKCTSPC.mjs.map +1 -0
- package/dist/{chunk-S5NKKKV5.mjs → chunk-5PSRSNGH.mjs} +7 -8
- package/dist/chunk-5PSRSNGH.mjs.map +1 -0
- package/dist/{chunk-F34FV5DY.mjs → chunk-6YUJLLGN.mjs} +59 -3
- package/dist/chunk-6YUJLLGN.mjs.map +1 -0
- package/dist/{chunk-KBBHISBO.mjs → chunk-BYL7HWNN.mjs} +13 -14
- package/dist/chunk-BYL7HWNN.mjs.map +1 -0
- package/dist/chunk-D5IRVU4W.mjs +46 -0
- package/dist/chunk-D5IRVU4W.mjs.map +1 -0
- package/dist/{chunk-DGOXJ373.mjs → chunk-EL2VTGFB.mjs} +2 -2
- package/dist/{chunk-6L73M52L.mjs → chunk-FPFCMFCJ.mjs} +7 -9
- package/dist/chunk-FPFCMFCJ.mjs.map +1 -0
- package/dist/{chunk-Q7CCSKX3.mjs → chunk-JTQ5QCML.mjs} +4 -4
- package/dist/chunk-JTQ5QCML.mjs.map +1 -0
- package/dist/chunk-KVE6VXTJ.mjs +37 -0
- package/dist/chunk-KVE6VXTJ.mjs.map +1 -0
- package/dist/{chunk-PNE3JG54.mjs → chunk-MGTMKKSH.mjs} +5 -3
- package/dist/chunk-MGTMKKSH.mjs.map +1 -0
- package/dist/chunk-PG7ZV76C.mjs +155 -0
- package/dist/chunk-PG7ZV76C.mjs.map +1 -0
- package/dist/{chunk-D7EZKGCJ.mjs → chunk-PPBHLDVN.mjs} +2 -2
- package/dist/{chunk-AODYT4HF.mjs → chunk-RKO6KM3T.mjs} +13 -14
- package/dist/chunk-RKO6KM3T.mjs.map +1 -0
- package/dist/chunk-SBPKRYF2.mjs +199 -0
- package/dist/chunk-SBPKRYF2.mjs.map +1 -0
- package/dist/{chunk-FCMP6QEZ.mjs → chunk-SWATR7CU.mjs} +14 -15
- package/dist/chunk-SWATR7CU.mjs.map +1 -0
- package/dist/{chunk-MT5JI4OR.mjs → chunk-T5DNDBW6.mjs} +11 -3
- package/dist/chunk-T5DNDBW6.mjs.map +1 -0
- package/dist/{chunk-5Q6O726L.mjs → chunk-TCSYDMC7.mjs} +2 -2
- package/dist/{chunk-UHQ6WE5D.mjs → chunk-TMHSYM3V.mjs} +17 -13
- package/dist/chunk-TMHSYM3V.mjs.map +1 -0
- package/dist/{chunk-AOGTJ4EN.mjs → chunk-VMBRDEM2.mjs} +2 -2
- package/dist/{chunk-XUAAKVRL.mjs → chunk-WMG5U5AU.mjs} +26 -13
- package/dist/chunk-WMG5U5AU.mjs.map +1 -0
- package/dist/{chunk-6BNJZIBK.mjs → chunk-X7XFG7TS.mjs} +10 -12
- package/dist/chunk-X7XFG7TS.mjs.map +1 -0
- package/dist/{chunk-MOFNE6PO.mjs → chunk-XRF3TNSQ.mjs} +6 -30
- package/dist/chunk-XRF3TNSQ.mjs.map +1 -0
- package/dist/{chunk-VK4VQQYY.mjs → chunk-YNJ423BR.mjs} +2 -2
- package/dist/{chunk-BGMNYKQY.mjs → chunk-ZQWVMOT6.mjs} +9 -7
- package/dist/chunk-ZQWVMOT6.mjs.map +1 -0
- package/dist/donut-chart.d.mts +3 -3
- package/dist/donut-chart.d.ts +3 -3
- package/dist/donut-chart.js +109 -58
- package/dist/donut-chart.js.map +1 -1
- package/dist/donut-chart.mjs +9 -8
- package/dist/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +599 -167
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -22
- package/dist/index.mjs.map +1 -1
- package/dist/line-chart.d.mts +1 -2
- package/dist/line-chart.d.ts +1 -2
- package/dist/line-chart.js +15 -10
- package/dist/line-chart.js.map +1 -1
- package/dist/line-chart.mjs +11 -11
- package/dist/pie-chart.d.mts +2 -3
- package/dist/pie-chart.d.ts +2 -3
- package/dist/pie-chart.js +13 -7
- package/dist/pie-chart.js.map +1 -1
- package/dist/pie-chart.mjs +8 -8
- package/dist/radar-chart.d.mts +3 -3
- package/dist/radar-chart.d.ts +3 -3
- package/dist/radar-chart.js +90 -70
- package/dist/radar-chart.js.map +1 -1
- package/dist/radar-chart.mjs +9 -8
- package/dist/radial-chart.d.mts +53 -0
- package/dist/radial-chart.d.ts +53 -0
- package/dist/radial-chart.js +767 -0
- package/dist/radial-chart.js.map +1 -0
- package/dist/radial-chart.mjs +18 -0
- package/dist/radial-chart.mjs.map +1 -0
- package/dist/rechart-properties.d.mts +5 -1
- package/dist/rechart-properties.d.ts +5 -1
- package/dist/rechart-properties.js +60 -1
- package/dist/rechart-properties.js.map +1 -1
- package/dist/rechart-properties.mjs +7 -1
- package/dist/use-area-chart.d.mts +1 -2
- package/dist/use-area-chart.d.ts +1 -2
- package/dist/use-area-chart.js +7 -9
- package/dist/use-area-chart.js.map +1 -1
- package/dist/use-area-chart.mjs +2 -2
- package/dist/use-bar-chart.d.mts +1 -2
- package/dist/use-bar-chart.d.ts +1 -2
- package/dist/use-bar-chart.js +4 -5
- package/dist/use-bar-chart.js.map +1 -1
- package/dist/use-bar-chart.mjs +2 -2
- package/dist/use-chart-axis.d.mts +0 -1
- package/dist/use-chart-axis.d.ts +0 -1
- package/dist/use-chart-axis.js.map +1 -1
- package/dist/use-chart-axis.mjs +2 -2
- package/dist/use-chart-grid.d.mts +0 -1
- package/dist/use-chart-grid.d.ts +0 -1
- package/dist/use-chart-grid.js.map +1 -1
- package/dist/use-chart-grid.mjs +2 -2
- package/dist/use-chart-label-list.d.mts +22 -0
- package/dist/use-chart-label-list.d.ts +22 -0
- package/dist/use-chart-label-list.js +93 -0
- package/dist/use-chart-label-list.js.map +1 -0
- package/dist/use-chart-label-list.mjs +10 -0
- package/dist/use-chart-label-list.mjs.map +1 -0
- package/dist/use-chart-label.d.mts +20 -0
- package/dist/use-chart-label.d.ts +20 -0
- package/dist/use-chart-label.js +82 -0
- package/dist/use-chart-label.js.map +1 -0
- package/dist/use-chart-label.mjs +10 -0
- package/dist/use-chart-label.mjs.map +1 -0
- package/dist/use-chart-legend.d.mts +0 -1
- package/dist/use-chart-legend.d.ts +0 -1
- package/dist/use-chart-legend.js.map +1 -1
- package/dist/use-chart-legend.mjs +2 -2
- package/dist/use-chart-reference-line.d.mts +0 -1
- package/dist/use-chart-reference-line.d.ts +0 -1
- package/dist/use-chart-reference-line.js +1 -1
- package/dist/use-chart-reference-line.js.map +1 -1
- package/dist/use-chart-reference-line.mjs +2 -2
- package/dist/use-chart-tooltip.d.mts +0 -1
- package/dist/use-chart-tooltip.d.ts +0 -1
- package/dist/use-chart-tooltip.js.map +1 -1
- package/dist/use-chart-tooltip.mjs +2 -2
- package/dist/use-chart.d.mts +0 -1
- package/dist/use-chart.d.ts +0 -1
- package/dist/use-chart.js.map +1 -1
- package/dist/use-chart.mjs +2 -2
- package/dist/use-line-chart.d.mts +1 -2
- package/dist/use-line-chart.d.ts +1 -2
- package/dist/use-line-chart.js +4 -6
- package/dist/use-line-chart.js.map +1 -1
- package/dist/use-line-chart.mjs +2 -2
- package/dist/use-pie-chart.d.mts +1 -2
- package/dist/use-pie-chart.d.ts +1 -2
- package/dist/use-pie-chart.js +3 -4
- package/dist/use-pie-chart.js.map +1 -1
- package/dist/use-pie-chart.mjs +2 -2
- package/dist/use-polar-grid.d.mts +24 -0
- package/dist/use-polar-grid.d.ts +24 -0
- package/dist/use-polar-grid.js +90 -0
- package/dist/use-polar-grid.js.map +1 -0
- package/dist/use-polar-grid.mjs +10 -0
- package/dist/use-polar-grid.mjs.map +1 -0
- package/dist/use-radar-chart.d.mts +3 -13
- package/dist/use-radar-chart.d.ts +3 -13
- package/dist/use-radar-chart.js +3 -35
- package/dist/use-radar-chart.js.map +1 -1
- package/dist/use-radar-chart.mjs +2 -2
- package/dist/use-radial-chart.d.mts +80 -0
- package/dist/use-radial-chart.d.ts +80 -0
- package/dist/use-radial-chart.js +228 -0
- package/dist/use-radial-chart.js.map +1 -0
- package/dist/use-radial-chart.mjs +10 -0
- package/dist/use-radial-chart.mjs.map +1 -0
- package/package.json +4 -4
- package/dist/chunk-6BNJZIBK.mjs.map +0 -1
- package/dist/chunk-6L73M52L.mjs.map +0 -1
- package/dist/chunk-AODYT4HF.mjs.map +0 -1
- package/dist/chunk-BGMNYKQY.mjs.map +0 -1
- package/dist/chunk-F34FV5DY.mjs.map +0 -1
- package/dist/chunk-FALZDKAW.mjs.map +0 -1
- package/dist/chunk-FCMP6QEZ.mjs.map +0 -1
- package/dist/chunk-KBBHISBO.mjs.map +0 -1
- package/dist/chunk-MOFNE6PO.mjs.map +0 -1
- package/dist/chunk-MT5JI4OR.mjs.map +0 -1
- package/dist/chunk-PNE3JG54.mjs.map +0 -1
- package/dist/chunk-Q7CCSKX3.mjs.map +0 -1
- package/dist/chunk-S5NKKKV5.mjs.map +0 -1
- package/dist/chunk-UHQ6WE5D.mjs.map +0 -1
- package/dist/chunk-XUAAKVRL.mjs.map +0 -1
- /package/dist/{chunk-STBYN5JW.mjs.map → chunk-3AOICU4Q.mjs.map} +0 -0
- /package/dist/{chunk-DGOXJ373.mjs.map → chunk-EL2VTGFB.mjs.map} +0 -0
- /package/dist/{chunk-D7EZKGCJ.mjs.map → chunk-PPBHLDVN.mjs.map} +0 -0
- /package/dist/{chunk-5Q6O726L.mjs.map → chunk-TCSYDMC7.mjs.map} +0 -0
- /package/dist/{chunk-AOGTJ4EN.mjs.map → chunk-VMBRDEM2.mjs.map} +0 -0
- /package/dist/{chunk-VK4VQQYY.mjs.map → chunk-YNJ423BR.mjs.map} +0 -0
package/dist/radar-chart.js
CHANGED
@@ -24,9 +24,9 @@ __export(radar_chart_exports, {
|
|
24
24
|
RadarChart: () => RadarChart
|
25
25
|
});
|
26
26
|
module.exports = __toCommonJS(radar_chart_exports);
|
27
|
-
var
|
28
|
-
var
|
29
|
-
var
|
27
|
+
var import_core8 = require("@yamada-ui/core");
|
28
|
+
var import_utils9 = require("@yamada-ui/utils");
|
29
|
+
var import_react6 = require("react");
|
30
30
|
var import_recharts = require("recharts");
|
31
31
|
|
32
32
|
// src/chart-legend.tsx
|
@@ -158,7 +158,8 @@ var polarGridProperties = [
|
|
158
158
|
"outerRadius",
|
159
159
|
"polarAngles",
|
160
160
|
"polarRadius",
|
161
|
-
"gridType"
|
161
|
+
"gridType",
|
162
|
+
"radialLines"
|
162
163
|
];
|
163
164
|
var polarAngleAxisProperties = [
|
164
165
|
"dataKey",
|
@@ -296,18 +297,26 @@ var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
296
297
|
var ChartTooltip = (0, import_core4.forwardRef)(
|
297
298
|
({
|
298
299
|
label,
|
300
|
+
dataKey = "value",
|
299
301
|
className,
|
300
302
|
payload = [],
|
301
303
|
valueFormatter,
|
302
304
|
labelFormatter,
|
303
305
|
unit,
|
306
|
+
isRadialChart,
|
304
307
|
...rest
|
305
308
|
}, ref) => {
|
306
309
|
var _a;
|
307
310
|
const { styles } = useTooltip();
|
308
311
|
const items = payload.map(
|
309
|
-
({
|
312
|
+
({
|
313
|
+
color: colorProp,
|
314
|
+
name: nameProp,
|
315
|
+
[dataKey]: valueProp,
|
316
|
+
payload: payload2
|
317
|
+
} = {}, index) => {
|
310
318
|
var _a2;
|
319
|
+
const name = isRadialChart ? payload2 == null ? void 0 : payload2.name : nameProp;
|
311
320
|
const color = colorProp != null ? colorProp : payload2 == null ? void 0 : payload2.color;
|
312
321
|
let value;
|
313
322
|
if ((0, import_utils4.isArray)(valueProp)) {
|
@@ -432,10 +441,43 @@ var useChartTooltip = ({
|
|
432
441
|
return { tooltipProps: tooltipUIProps, getTooltipProps };
|
433
442
|
};
|
434
443
|
|
435
|
-
// src/use-
|
444
|
+
// src/use-polar-grid.tsx
|
436
445
|
var import_core6 = require("@yamada-ui/core");
|
437
446
|
var import_utils7 = require("@yamada-ui/utils");
|
438
447
|
var import_react4 = require("react");
|
448
|
+
var usePolarGrid = ({
|
449
|
+
strokeDasharray,
|
450
|
+
styles,
|
451
|
+
...rest
|
452
|
+
}) => {
|
453
|
+
const { theme } = (0, import_core6.useTheme)();
|
454
|
+
const [polarGridProps, polarGridClassName] = (0, import_react4.useMemo)(
|
455
|
+
() => {
|
456
|
+
var _a;
|
457
|
+
return getComponentProps(
|
458
|
+
[(_a = rest.polarGridProps) != null ? _a : {}, polarGridProperties],
|
459
|
+
styles.polarGrid
|
460
|
+
)(theme);
|
461
|
+
},
|
462
|
+
[rest.polarGridProps, styles.polarGrid, theme]
|
463
|
+
);
|
464
|
+
const getPolarGridProps = (0, import_react4.useCallback)(
|
465
|
+
({ className, ...props } = {}, ref = null) => ({
|
466
|
+
ref,
|
467
|
+
className: (0, import_utils7.cx)(className, polarGridClassName),
|
468
|
+
strokeDasharray,
|
469
|
+
...props,
|
470
|
+
...polarGridProps
|
471
|
+
}),
|
472
|
+
[polarGridClassName, polarGridProps, strokeDasharray]
|
473
|
+
);
|
474
|
+
return { getPolarGridProps };
|
475
|
+
};
|
476
|
+
|
477
|
+
// src/use-radar-chart.ts
|
478
|
+
var import_core7 = require("@yamada-ui/core");
|
479
|
+
var import_utils8 = require("@yamada-ui/utils");
|
480
|
+
var import_react5 = require("react");
|
439
481
|
var useRadarChart = ({
|
440
482
|
data,
|
441
483
|
series,
|
@@ -446,13 +488,12 @@ var useRadarChart = ({
|
|
446
488
|
fillOpacity = 0.4,
|
447
489
|
polarAngleAxisTickFormatter,
|
448
490
|
polarRadiusAxisTickFormatter,
|
449
|
-
strokeDasharray,
|
450
491
|
styles,
|
451
492
|
...rest
|
452
493
|
}) => {
|
453
494
|
var _a;
|
454
|
-
const { theme } = (0,
|
455
|
-
const [highlightedArea, setHighlightedArea] = (0,
|
495
|
+
const { theme } = (0, import_core7.useTheme)();
|
496
|
+
const [highlightedArea, setHighlightedArea] = (0, import_react5.useState)(null);
|
456
497
|
const shouldHighlight = highlightedArea !== null;
|
457
498
|
const {
|
458
499
|
dot = {},
|
@@ -461,23 +502,22 @@ var useRadarChart = ({
|
|
461
502
|
dimRadar = {},
|
462
503
|
...computedRadarProps
|
463
504
|
} = (_a = rest.radarProps) != null ? _a : {};
|
464
|
-
const radarColors = (0,
|
505
|
+
const radarColors = (0, import_react5.useMemo)(
|
465
506
|
() => series.map(({ color }, index) => ({
|
466
|
-
__prefix: "ui",
|
467
507
|
name: `radar-${index}`,
|
468
508
|
token: "colors",
|
469
509
|
value: color != null ? color : "transparent"
|
470
510
|
})),
|
471
511
|
[series]
|
472
512
|
);
|
473
|
-
const radarVars = (0,
|
513
|
+
const radarVars = (0, import_react5.useMemo)(
|
474
514
|
() => [
|
475
515
|
...radarColors,
|
476
|
-
{
|
516
|
+
{ name: "fill-opacity", value: fillOpacity }
|
477
517
|
],
|
478
518
|
[fillOpacity, radarColors]
|
479
519
|
);
|
480
|
-
const [chartProps, radarChartClassName] = (0,
|
520
|
+
const [chartProps, radarChartClassName] = (0, import_react5.useMemo)(
|
481
521
|
() => {
|
482
522
|
var _a2;
|
483
523
|
return getComponentProps(
|
@@ -487,17 +527,7 @@ var useRadarChart = ({
|
|
487
527
|
},
|
488
528
|
[rest.chartProps, styles.chart, theme]
|
489
529
|
);
|
490
|
-
const [
|
491
|
-
() => {
|
492
|
-
var _a2;
|
493
|
-
return getComponentProps(
|
494
|
-
[(_a2 = rest.polarGridProps) != null ? _a2 : {}, polarGridProperties],
|
495
|
-
styles.polarGrid
|
496
|
-
)(theme);
|
497
|
-
},
|
498
|
-
[rest.polarGridProps, styles.polarGrid, theme]
|
499
|
-
);
|
500
|
-
const [polarAngleAxisProps, polarAngleAxisClassName] = (0, import_react4.useMemo)(
|
530
|
+
const [polarAngleAxisProps, polarAngleAxisClassName] = (0, import_react5.useMemo)(
|
501
531
|
() => {
|
502
532
|
var _a2;
|
503
533
|
return getComponentProps(
|
@@ -507,14 +537,14 @@ var useRadarChart = ({
|
|
507
537
|
},
|
508
538
|
[rest.polarAngleAxisProps, styles.polarAngleAxis, theme]
|
509
539
|
);
|
510
|
-
const polarAngleAxisTickClassName = (0,
|
540
|
+
const polarAngleAxisTickClassName = (0, import_react5.useMemo)(
|
511
541
|
() => getClassName({
|
512
542
|
...styles.polarAngleAxisTick,
|
513
543
|
...rest.polarAngleAxisTickProps
|
514
544
|
})(theme),
|
515
545
|
[rest.polarAngleAxisTickProps, styles.polarAngleAxisTick, theme]
|
516
546
|
);
|
517
|
-
const [polarRadiusAxisProps, polarRadiusAxisClassName] = (0,
|
547
|
+
const [polarRadiusAxisProps, polarRadiusAxisClassName] = (0, import_react5.useMemo)(
|
518
548
|
() => {
|
519
549
|
var _a2;
|
520
550
|
return getComponentProps(
|
@@ -524,16 +554,16 @@ var useRadarChart = ({
|
|
524
554
|
},
|
525
555
|
[rest.polarRadiusAxisProps, styles.polarRadiusAxis, theme]
|
526
556
|
);
|
527
|
-
const polarRadiusAxisTickClassName = (0,
|
557
|
+
const polarRadiusAxisTickClassName = (0, import_react5.useMemo)(
|
528
558
|
() => getClassName({
|
529
559
|
...styles.polarRadiusAxisTick,
|
530
560
|
...rest.polarRadiusAxisTickProps
|
531
561
|
})(theme),
|
532
562
|
[rest.polarRadiusAxisTickProps, styles.polarRadiusAxisTick, theme]
|
533
563
|
);
|
534
|
-
const [radarProps, radarClassName] = (0,
|
564
|
+
const [radarProps, radarClassName] = (0, import_react5.useMemo)(() => {
|
535
565
|
const resolvedRadarProps = {
|
536
|
-
fillOpacity: "
|
566
|
+
fillOpacity: "$fill-opacity",
|
537
567
|
...computedRadarProps
|
538
568
|
};
|
539
569
|
return getComponentProps(
|
@@ -541,32 +571,32 @@ var useRadarChart = ({
|
|
541
571
|
styles.radar
|
542
572
|
)(theme);
|
543
573
|
}, [computedRadarProps, styles.radar, theme]);
|
544
|
-
const [dimRadarProps, dimRadarClassName] = (0,
|
574
|
+
const [dimRadarProps, dimRadarClassName] = (0, import_react5.useMemo)(
|
545
575
|
() => getComponentProps(
|
546
576
|
[dimRadar, radarProperties],
|
547
577
|
styles.dimRadar
|
548
578
|
)(theme),
|
549
579
|
[dimRadar, styles.dimRadar, theme]
|
550
580
|
);
|
551
|
-
const [dotProps, dotClassName] = (0,
|
581
|
+
const [dotProps, dotClassName] = (0, import_react5.useMemo)(
|
552
582
|
() => getComponentProps([dot, dotProperties], styles.dot)(theme),
|
553
583
|
[dot, styles.dot, theme]
|
554
584
|
);
|
555
|
-
const [activeDotProps, activeDotClassName] = (0,
|
585
|
+
const [activeDotProps, activeDotClassName] = (0, import_react5.useMemo)(
|
556
586
|
() => getComponentProps(
|
557
587
|
[activeDot, dotProperties],
|
558
588
|
styles.activeDot
|
559
589
|
)(theme),
|
560
590
|
[activeDot, styles.activeDot, theme]
|
561
591
|
);
|
562
|
-
const [dimDotProps, dimDotClassName] = (0,
|
592
|
+
const [dimDotProps, dimDotClassName] = (0, import_react5.useMemo)(
|
563
593
|
() => getComponentProps(
|
564
594
|
[dimDot, dotProperties],
|
565
595
|
styles.dimDot
|
566
596
|
)(theme),
|
567
597
|
[dimDot, styles.dimDot, theme]
|
568
598
|
);
|
569
|
-
const radarPropList = (0,
|
599
|
+
const radarPropList = (0, import_react5.useMemo)(
|
570
600
|
() => series.map((props, index) => {
|
571
601
|
const {
|
572
602
|
dataKey: dataKey2,
|
@@ -576,7 +606,7 @@ var useRadarChart = ({
|
|
576
606
|
dimRadar: dimRadar2 = {},
|
577
607
|
...computedProps
|
578
608
|
} = props;
|
579
|
-
const color = `
|
609
|
+
const color = (0, import_core7.getVar)(`radar-${index}`)(theme);
|
580
610
|
const dimmed = shouldHighlight && highlightedArea !== dataKey2;
|
581
611
|
const computedDimRadar = { ...dimRadarProps, ...dimRadar2 };
|
582
612
|
const resolvedProps = {
|
@@ -600,7 +630,7 @@ var useRadarChart = ({
|
|
600
630
|
activeDotClassName
|
601
631
|
)(theme);
|
602
632
|
resolvedActiveDot = {
|
603
|
-
className: (0,
|
633
|
+
className: (0, import_utils8.cx)(
|
604
634
|
"ui-radar-chart__dot",
|
605
635
|
"ui-radar-chart__dot--active",
|
606
636
|
className
|
@@ -627,7 +657,7 @@ var useRadarChart = ({
|
|
627
657
|
dimmed ? dimDotClassName : void 0
|
628
658
|
)(theme);
|
629
659
|
resolvedDot = {
|
630
|
-
className: (0,
|
660
|
+
className: (0, import_utils8.cx)("ui-radar-chart__dot", className),
|
631
661
|
fill: color,
|
632
662
|
r: 4,
|
633
663
|
...rest3
|
@@ -662,22 +692,22 @@ var useRadarChart = ({
|
|
662
692
|
withDots
|
663
693
|
]
|
664
694
|
);
|
665
|
-
const getRadarChartProps = (0,
|
695
|
+
const getRadarChartProps = (0, import_react5.useCallback)(
|
666
696
|
({ className, ...props } = {}, ref = null) => ({
|
667
697
|
ref,
|
668
|
-
className: (0,
|
698
|
+
className: (0, import_utils8.cx)(className, radarChartClassName),
|
669
699
|
data,
|
670
700
|
...props,
|
671
701
|
...chartProps
|
672
702
|
}),
|
673
703
|
[data, radarChartClassName, chartProps]
|
674
704
|
);
|
675
|
-
const getRadarProps = (0,
|
705
|
+
const getRadarProps = (0, import_react5.useCallback)(
|
676
706
|
({ index, className: classNameProp, ...props }, ref = null) => {
|
677
707
|
const { color, className, dataKey: dataKey2, activeDot: activeDot2, dot: dot2, ...rest2 } = radarPropList[index];
|
678
708
|
return {
|
679
709
|
ref,
|
680
|
-
className: (0,
|
710
|
+
className: (0, import_utils8.cx)(classNameProp, className),
|
681
711
|
activeDot: activeDot2,
|
682
712
|
dot: dot2,
|
683
713
|
name: dataKey2,
|
@@ -692,23 +722,13 @@ var useRadarChart = ({
|
|
692
722
|
},
|
693
723
|
[radarPropList, strokeWidth]
|
694
724
|
);
|
695
|
-
const
|
696
|
-
({ className, ...props } = {}, ref = null) => ({
|
697
|
-
ref,
|
698
|
-
className: (0, import_utils7.cx)(className, polarGridClassName),
|
699
|
-
strokeDasharray,
|
700
|
-
...props,
|
701
|
-
...polarGridProps
|
702
|
-
}),
|
703
|
-
[polarGridClassName, polarGridProps, strokeDasharray]
|
704
|
-
);
|
705
|
-
const getPolarAngleAxisProps = (0, import_react4.useCallback)(
|
725
|
+
const getPolarAngleAxisProps = (0, import_react5.useCallback)(
|
706
726
|
({ className, ...props } = {}, ref = null) => ({
|
707
727
|
ref,
|
708
|
-
className: (0,
|
728
|
+
className: (0, import_utils8.cx)(className, polarAngleAxisClassName),
|
709
729
|
dataKey,
|
710
730
|
tick: {
|
711
|
-
className: (0,
|
731
|
+
className: (0, import_utils8.cx)(
|
712
732
|
"ui-radar-chart__polar-angle-axis-tick",
|
713
733
|
polarAngleAxisTickClassName
|
714
734
|
)
|
@@ -726,12 +746,12 @@ var useRadarChart = ({
|
|
726
746
|
polarAngleAxisTickFormatter
|
727
747
|
]
|
728
748
|
);
|
729
|
-
const getPolarRadiusAxisProps = (0,
|
749
|
+
const getPolarRadiusAxisProps = (0, import_react5.useCallback)(
|
730
750
|
({ className, ...props } = {}, ref = null) => ({
|
731
751
|
ref,
|
732
|
-
className: (0,
|
752
|
+
className: (0, import_utils8.cx)(className, polarRadiusAxisClassName),
|
733
753
|
tick: {
|
734
|
-
className: (0,
|
754
|
+
className: (0, import_utils8.cx)(
|
735
755
|
"ui-radar-chart__polar-radius-axis-tick",
|
736
756
|
polarRadiusAxisTickClassName
|
737
757
|
)
|
@@ -751,7 +771,6 @@ var useRadarChart = ({
|
|
751
771
|
radarVars,
|
752
772
|
getRadarChartProps,
|
753
773
|
getRadarProps,
|
754
|
-
getPolarGridProps,
|
755
774
|
getPolarAngleAxisProps,
|
756
775
|
getPolarRadiusAxisProps,
|
757
776
|
setHighlightedArea
|
@@ -760,8 +779,8 @@ var useRadarChart = ({
|
|
760
779
|
|
761
780
|
// src/radar-chart.tsx
|
762
781
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
763
|
-
var RadarChart = (0,
|
764
|
-
const [styles, mergedProps] = (0,
|
782
|
+
var RadarChart = (0, import_core8.forwardRef)((props, ref) => {
|
783
|
+
const [styles, mergedProps] = (0, import_core8.useMultiComponentStyle)("RadarChart", props);
|
765
784
|
const {
|
766
785
|
className,
|
767
786
|
data,
|
@@ -793,11 +812,10 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
|
|
793
812
|
withPolarAngleAxis = true,
|
794
813
|
withPolarRadiusAxis = false,
|
795
814
|
...rest
|
796
|
-
} = (0,
|
815
|
+
} = (0, import_core8.omitThemeProps)(mergedProps);
|
797
816
|
const {
|
798
817
|
getRadarProps,
|
799
818
|
getRadarChartProps,
|
800
|
-
getPolarGridProps,
|
801
819
|
getPolarAngleAxisProps,
|
802
820
|
getPolarRadiusAxisProps,
|
803
821
|
radarVars,
|
@@ -808,7 +826,6 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
|
|
808
826
|
dataKey,
|
809
827
|
radarProps,
|
810
828
|
chartProps,
|
811
|
-
polarGridProps,
|
812
829
|
polarAngleAxisProps,
|
813
830
|
polarAngleAxisTickProps,
|
814
831
|
polarRadiusAxisProps,
|
@@ -819,7 +836,6 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
|
|
819
836
|
fillOpacity,
|
820
837
|
polarAngleAxisTickFormatter,
|
821
838
|
polarRadiusAxisTickFormatter,
|
822
|
-
strokeDasharray,
|
823
839
|
styles
|
824
840
|
});
|
825
841
|
const { getContainerProps } = useChart({ containerProps });
|
@@ -831,7 +847,12 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
|
|
831
847
|
const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({
|
832
848
|
legendProps
|
833
849
|
});
|
834
|
-
const
|
850
|
+
const { getPolarGridProps } = usePolarGrid({
|
851
|
+
polarGridProps,
|
852
|
+
strokeDasharray,
|
853
|
+
styles
|
854
|
+
});
|
855
|
+
const radars = (0, import_react6.useMemo)(
|
835
856
|
() => series.map(({ dataKey: dataKey2 }, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
836
857
|
import_recharts.Radar,
|
837
858
|
{
|
@@ -842,12 +863,11 @@ var RadarChart = (0, import_core7.forwardRef)((props, ref) => {
|
|
842
863
|
[getRadarProps, series]
|
843
864
|
);
|
844
865
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChartProvider, { value: { styles }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
845
|
-
|
866
|
+
import_core8.ui.div,
|
846
867
|
{
|
847
868
|
ref,
|
848
|
-
className: (0,
|
849
|
-
|
850
|
-
__css: { ...styles.container },
|
869
|
+
className: (0, import_utils9.cx)("ui-radar-chart", className),
|
870
|
+
__css: { maxW: "full", vars: radarVars, ...styles.container },
|
851
871
|
...rest,
|
852
872
|
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
853
873
|
import_recharts.ResponsiveContainer,
|