@yamada-ui/charts 1.5.4-next-20241005220055 → 1.5.4-next-20241008193728
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/area-chart-gradient.d.mts +2 -2
- package/dist/area-chart-gradient.d.ts +2 -2
- package/dist/area-chart-gradient.js +7 -5
- package/dist/area-chart-gradient.js.map +1 -1
- package/dist/area-chart-gradient.mjs +1 -1
- package/dist/area-chart-split.d.mts +2 -2
- package/dist/area-chart-split.d.ts +2 -2
- 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 +8 -8
- package/dist/area-chart.d.ts +8 -8
- package/dist/area-chart.js +190 -175
- package/dist/area-chart.js.map +1 -1
- package/dist/area-chart.mjs +13 -13
- package/dist/bar-chart.d.mts +8 -8
- package/dist/bar-chart.d.ts +8 -8
- package/dist/bar-chart.js +143 -127
- package/dist/bar-chart.js.map +1 -1
- package/dist/bar-chart.mjs +11 -11
- package/dist/chart-legend.d.mts +1 -1
- package/dist/chart-legend.d.ts +1 -1
- package/dist/chart-legend.js +4 -2
- package/dist/chart-legend.js.map +1 -1
- package/dist/chart-legend.mjs +3 -3
- package/dist/chart-tooltip.d.mts +4 -4
- package/dist/chart-tooltip.d.ts +4 -4
- package/dist/chart-tooltip.js +9 -7
- package/dist/chart-tooltip.js.map +1 -1
- package/dist/chart-tooltip.mjs +3 -3
- package/dist/chart-utils.js.map +1 -1
- package/dist/chart-utils.mjs +1 -1
- package/dist/chart.types.d.mts +14 -14
- package/dist/chart.types.d.ts +14 -14
- package/dist/chart.types.js.map +1 -1
- package/dist/{chunk-UANITMH7.mjs → chunk-5VLSGWQD.mjs} +10 -8
- package/dist/chunk-5VLSGWQD.mjs.map +1 -0
- package/dist/{chunk-XYUYAHJX.mjs → chunk-6JRMEI6J.mjs} +2 -2
- package/dist/chunk-6JRMEI6J.mjs.map +1 -0
- package/dist/{chunk-VKBRU4Z4.mjs → chunk-AYVTBRCS.mjs} +29 -28
- package/dist/chunk-AYVTBRCS.mjs.map +1 -0
- package/dist/{chunk-6O5G3WYP.mjs → chunk-EZG52466.mjs} +29 -21
- package/dist/chunk-EZG52466.mjs.map +1 -0
- package/dist/{chunk-VEFEKDMH.mjs → chunk-FDALM73K.mjs} +15 -14
- package/dist/chunk-FDALM73K.mjs.map +1 -0
- package/dist/{chunk-2GQHI23M.mjs → chunk-GU4SGNWX.mjs} +5 -5
- package/dist/chunk-GU4SGNWX.mjs.map +1 -0
- package/dist/{chunk-MVRWZTQ5.mjs → chunk-NLXYCM5J.mjs} +2 -2
- package/dist/chunk-NLXYCM5J.mjs.map +1 -0
- package/dist/{chunk-EXBYAVSP.mjs → chunk-NMPNNSBN.mjs} +76 -74
- package/dist/chunk-NMPNNSBN.mjs.map +1 -0
- package/dist/{chunk-AL4MDJ4U.mjs → chunk-NQPC5LPY.mjs} +84 -82
- package/dist/chunk-NQPC5LPY.mjs.map +1 -0
- package/dist/{chunk-MN7T76SY.mjs → chunk-OG5CVPPV.mjs} +5 -3
- package/dist/chunk-OG5CVPPV.mjs.map +1 -0
- package/dist/{chunk-LLOU2WIV.mjs → chunk-OUIKA4AX.mjs} +5 -3
- package/dist/chunk-OUIKA4AX.mjs.map +1 -0
- package/dist/{chunk-3EHZJFIA.mjs → chunk-PKQB4BFG.mjs} +28 -28
- package/dist/chunk-PKQB4BFG.mjs.map +1 -0
- package/dist/{chunk-C3ZYUDXE.mjs → chunk-QPMW56KA.mjs} +52 -48
- package/dist/chunk-QPMW56KA.mjs.map +1 -0
- package/dist/{chunk-IJRYXT4V.mjs → chunk-R2LOTDR3.mjs} +2 -2
- package/dist/{chunk-IJRYXT4V.mjs.map → chunk-R2LOTDR3.mjs.map} +1 -1
- package/dist/{chunk-LSCPL7PM.mjs → chunk-SCY5V45W.mjs} +58 -56
- package/dist/chunk-SCY5V45W.mjs.map +1 -0
- package/dist/{chunk-VGNCWS23.mjs → chunk-SYBJTMPL.mjs} +92 -90
- package/dist/chunk-SYBJTMPL.mjs.map +1 -0
- package/dist/{chunk-ZGXEF3LO.mjs → chunk-TA7YJAW4.mjs} +49 -47
- package/dist/chunk-TA7YJAW4.mjs.map +1 -0
- package/dist/{chunk-O3LMKYXK.mjs → chunk-TU6MKMMV.mjs} +29 -28
- package/dist/chunk-TU6MKMMV.mjs.map +1 -0
- package/dist/{chunk-QL3DB7OJ.mjs → chunk-TXNC7GLT.mjs} +1 -1
- package/dist/{chunk-QL3DB7OJ.mjs.map → chunk-TXNC7GLT.mjs.map} +1 -1
- package/dist/{chunk-NHHJ5XFF.mjs → chunk-U325CYNR.mjs} +8 -6
- package/dist/chunk-U325CYNR.mjs.map +1 -0
- package/dist/{chunk-OPPMMNGP.mjs → chunk-UER5GW4M.mjs} +33 -24
- package/dist/chunk-UER5GW4M.mjs.map +1 -0
- package/dist/{chunk-FYAC4RRZ.mjs → chunk-UTD4XZDM.mjs} +11 -10
- package/dist/chunk-UTD4XZDM.mjs.map +1 -0
- package/dist/{chunk-A3IWA366.mjs → chunk-VK65X6Q2.mjs} +4 -4
- package/dist/chunk-VK65X6Q2.mjs.map +1 -0
- package/dist/{chunk-OJ2MLZZ7.mjs → chunk-X6PIY2M3.mjs} +7 -7
- package/dist/chunk-X6PIY2M3.mjs.map +1 -0
- package/dist/{chunk-MSG3WFBO.mjs → chunk-YIAK5DIM.mjs} +7 -6
- package/dist/chunk-YIAK5DIM.mjs.map +1 -0
- package/dist/{chunk-ZXBE4ERW.mjs → chunk-YTUEG4IY.mjs} +47 -45
- package/dist/chunk-YTUEG4IY.mjs.map +1 -0
- package/dist/{chunk-VUTCH2CU.mjs → chunk-YX23LEQ7.mjs} +13 -13
- package/dist/chunk-YX23LEQ7.mjs.map +1 -0
- package/dist/{chunk-BQT5TIKZ.mjs → chunk-ZRV4LO67.mjs} +44 -42
- package/dist/chunk-ZRV4LO67.mjs.map +1 -0
- package/dist/donut-chart.js +97 -89
- package/dist/donut-chart.js.map +1 -1
- package/dist/donut-chart.mjs +10 -10
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.js +2084 -2036
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -28
- package/dist/index.mjs.map +1 -1
- package/dist/line-chart.d.mts +7 -7
- package/dist/line-chart.d.ts +7 -7
- package/dist/line-chart.js +146 -138
- package/dist/line-chart.js.map +1 -1
- package/dist/line-chart.mjs +11 -11
- package/dist/pie-chart-label.d.mts +9 -9
- package/dist/pie-chart-label.d.ts +9 -9
- package/dist/pie-chart-label.js +14 -13
- package/dist/pie-chart-label.js.map +1 -1
- package/dist/pie-chart-label.mjs +1 -1
- package/dist/pie-chart.d.mts +11 -11
- package/dist/pie-chart.d.ts +11 -11
- package/dist/pie-chart.js +95 -87
- package/dist/pie-chart.js.map +1 -1
- package/dist/pie-chart.mjs +9 -9
- package/dist/radar-chart.d.mts +11 -11
- package/dist/radar-chart.d.ts +11 -11
- package/dist/radar-chart.js +87 -73
- package/dist/radar-chart.js.map +1 -1
- package/dist/radar-chart.mjs +9 -9
- package/dist/radial-chart.d.mts +10 -10
- package/dist/radial-chart.d.ts +10 -10
- package/dist/radial-chart.js +69 -62
- package/dist/radial-chart.js.map +1 -1
- package/dist/radial-chart.mjs +10 -10
- package/dist/use-area-chart.d.mts +53 -53
- package/dist/use-area-chart.d.ts +53 -53
- package/dist/use-area-chart.js +50 -46
- package/dist/use-area-chart.js.map +1 -1
- package/dist/use-area-chart.mjs +2 -2
- package/dist/use-bar-chart.d.mts +32 -32
- package/dist/use-bar-chart.d.ts +32 -32
- package/dist/use-bar-chart.js +30 -21
- package/dist/use-bar-chart.js.map +1 -1
- package/dist/use-bar-chart.mjs +2 -2
- package/dist/use-chart-axis.d.mts +27 -27
- package/dist/use-chart-axis.d.ts +27 -27
- package/dist/use-chart-axis.js +26 -26
- package/dist/use-chart-axis.js.map +1 -1
- package/dist/use-chart-axis.mjs +2 -2
- package/dist/use-chart-grid.d.mts +8 -8
- package/dist/use-chart-grid.d.ts +8 -8
- package/dist/use-chart-grid.js +3 -3
- 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 +4 -4
- package/dist/use-chart-label-list.d.ts +4 -4
- package/dist/use-chart-label-list.js +5 -4
- package/dist/use-chart-label-list.js.map +1 -1
- package/dist/use-chart-label-list.mjs +2 -2
- package/dist/use-chart-label.d.mts +1 -1
- package/dist/use-chart-label.d.ts +1 -1
- package/dist/use-chart-label.js.map +1 -1
- package/dist/use-chart-label.mjs +2 -2
- package/dist/use-chart-legend.d.mts +1 -1
- package/dist/use-chart-legend.d.ts +1 -1
- package/dist/use-chart-legend.js +1 -1
- package/dist/use-chart-legend.js.map +1 -1
- package/dist/use-chart-legend.mjs +1 -1
- package/dist/use-chart-reference-line.d.mts +4 -4
- package/dist/use-chart-reference-line.d.ts +4 -4
- package/dist/use-chart-reference-line.js +8 -7
- 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 +7 -7
- package/dist/use-chart-tooltip.d.ts +7 -7
- package/dist/use-chart-tooltip.js +4 -4
- package/dist/use-chart-tooltip.js.map +1 -1
- package/dist/use-chart-tooltip.mjs +2 -2
- package/dist/use-chart.d.mts +6 -10
- package/dist/use-chart.d.ts +6 -10
- package/dist/use-chart.js +2 -2
- package/dist/use-chart.js.map +1 -1
- package/dist/use-chart.mjs +2 -2
- package/dist/use-line-chart.d.mts +43 -43
- package/dist/use-line-chart.d.ts +43 -43
- package/dist/use-line-chart.js +26 -25
- package/dist/use-line-chart.js.map +1 -1
- package/dist/use-line-chart.mjs +2 -2
- package/dist/use-pie-chart.d.mts +47 -47
- package/dist/use-pie-chart.d.ts +47 -47
- package/dist/use-pie-chart.js +40 -38
- package/dist/use-pie-chart.js.map +1 -1
- package/dist/use-pie-chart.mjs +3 -3
- package/dist/use-polar-grid.d.mts +5 -5
- package/dist/use-polar-grid.d.ts +5 -5
- package/dist/use-polar-grid.js.map +1 -1
- package/dist/use-polar-grid.mjs +2 -2
- package/dist/use-radar-chart.d.mts +41 -41
- package/dist/use-radar-chart.d.ts +41 -41
- package/dist/use-radar-chart.js +27 -19
- package/dist/use-radar-chart.js.map +1 -1
- package/dist/use-radar-chart.mjs +2 -2
- package/dist/use-radial-chart.d.mts +17 -17
- package/dist/use-radial-chart.d.ts +17 -17
- package/dist/use-radial-chart.js +11 -11
- package/dist/use-radial-chart.js.map +1 -1
- package/dist/use-radial-chart.mjs +2 -2
- package/package.json +3 -3
- package/dist/chunk-2GQHI23M.mjs.map +0 -1
- package/dist/chunk-3EHZJFIA.mjs.map +0 -1
- package/dist/chunk-6O5G3WYP.mjs.map +0 -1
- package/dist/chunk-A3IWA366.mjs.map +0 -1
- package/dist/chunk-AL4MDJ4U.mjs.map +0 -1
- package/dist/chunk-BQT5TIKZ.mjs.map +0 -1
- package/dist/chunk-C3ZYUDXE.mjs.map +0 -1
- package/dist/chunk-EXBYAVSP.mjs.map +0 -1
- package/dist/chunk-FYAC4RRZ.mjs.map +0 -1
- package/dist/chunk-LLOU2WIV.mjs.map +0 -1
- package/dist/chunk-LSCPL7PM.mjs.map +0 -1
- package/dist/chunk-MN7T76SY.mjs.map +0 -1
- package/dist/chunk-MSG3WFBO.mjs.map +0 -1
- package/dist/chunk-MVRWZTQ5.mjs.map +0 -1
- package/dist/chunk-NHHJ5XFF.mjs.map +0 -1
- package/dist/chunk-O3LMKYXK.mjs.map +0 -1
- package/dist/chunk-OJ2MLZZ7.mjs.map +0 -1
- package/dist/chunk-OPPMMNGP.mjs.map +0 -1
- package/dist/chunk-UANITMH7.mjs.map +0 -1
- package/dist/chunk-VEFEKDMH.mjs.map +0 -1
- package/dist/chunk-VGNCWS23.mjs.map +0 -1
- package/dist/chunk-VKBRU4Z4.mjs.map +0 -1
- package/dist/chunk-VUTCH2CU.mjs.map +0 -1
- package/dist/chunk-XYUYAHJX.mjs.map +0 -1
- package/dist/chunk-ZGXEF3LO.mjs.map +0 -1
- package/dist/chunk-ZXBE4ERW.mjs.map +0 -1
package/dist/donut-chart.js
CHANGED
@@ -178,13 +178,13 @@ var useChart = ({ containerProps = {} }) => {
|
|
178
178
|
getContainerProps
|
179
179
|
};
|
180
180
|
};
|
181
|
-
var useLegend = (
|
181
|
+
var useLegend = () => {
|
182
182
|
const { styles } = useChartContext();
|
183
183
|
return {
|
184
184
|
styles
|
185
185
|
};
|
186
186
|
};
|
187
|
-
var useTooltip = (
|
187
|
+
var useTooltip = () => {
|
188
188
|
const { styles } = useChartContext();
|
189
189
|
return {
|
190
190
|
styles
|
@@ -196,7 +196,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
196
196
|
var ChartLegend = (0, import_core3.forwardRef)(
|
197
197
|
({ className, payload = [], onHighlight, ...rest }, ref) => {
|
198
198
|
const { styles } = useLegend();
|
199
|
-
const items = payload.map(({ dataKey, value: valueProp
|
199
|
+
const items = payload.map(({ color, dataKey, value: valueProp }, index) => {
|
200
200
|
const value = dataKey != null ? dataKey : valueProp;
|
201
201
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
202
202
|
import_core3.ui.div,
|
@@ -232,6 +232,8 @@ var ChartLegend = (0, import_core3.forwardRef)(
|
|
232
232
|
);
|
233
233
|
}
|
234
234
|
);
|
235
|
+
ChartLegend.displayName = "ChartLegend";
|
236
|
+
ChartLegend.__ui__ = "ChartLegend";
|
235
237
|
|
236
238
|
// src/chart-tooltip.tsx
|
237
239
|
var import_core4 = require("@yamada-ui/core");
|
@@ -239,22 +241,22 @@ var import_utils4 = require("@yamada-ui/utils");
|
|
239
241
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
240
242
|
var ChartTooltip = (0, import_core4.forwardRef)(
|
241
243
|
({
|
242
|
-
label,
|
243
|
-
dataKey = "value",
|
244
244
|
className,
|
245
|
-
|
246
|
-
|
245
|
+
dataKey = "value",
|
246
|
+
isRadialChart,
|
247
|
+
label,
|
247
248
|
labelFormatter,
|
249
|
+
payload = [],
|
248
250
|
unit,
|
249
|
-
|
251
|
+
valueFormatter,
|
250
252
|
...rest
|
251
253
|
}, ref) => {
|
252
254
|
var _a;
|
253
255
|
const { styles } = useTooltip();
|
254
256
|
const items = payload.map(
|
255
257
|
({
|
256
|
-
color: colorProp,
|
257
258
|
name: nameProp,
|
259
|
+
color: colorProp,
|
258
260
|
[dataKey]: valueProp,
|
259
261
|
payload: payload2
|
260
262
|
} = {}, index) => {
|
@@ -324,6 +326,8 @@ var ChartTooltip = (0, import_core4.forwardRef)(
|
|
324
326
|
);
|
325
327
|
}
|
326
328
|
);
|
329
|
+
ChartTooltip.displayName = "ChartTooltip";
|
330
|
+
ChartTooltip.__ui__ = "ChartTooltip";
|
327
331
|
|
328
332
|
// src/use-chart-label.ts
|
329
333
|
var import_core5 = require("@yamada-ui/core");
|
@@ -371,7 +375,7 @@ var useChartLegend = ({
|
|
371
375
|
},
|
372
376
|
[rest]
|
373
377
|
);
|
374
|
-
return {
|
378
|
+
return { getLegendProps, legendProps };
|
375
379
|
};
|
376
380
|
|
377
381
|
// src/use-chart-tooltip.ts
|
@@ -379,9 +383,9 @@ var import_core6 = require("@yamada-ui/core");
|
|
379
383
|
var import_utils7 = require("@yamada-ui/utils");
|
380
384
|
var import_react4 = require("react");
|
381
385
|
var useChartTooltip = ({
|
382
|
-
|
386
|
+
styles,
|
383
387
|
tooltipAnimationDuration = 0,
|
384
|
-
|
388
|
+
tooltipProps: _tooltipProps = {}
|
385
389
|
}) => {
|
386
390
|
const { theme } = (0, import_core6.useTheme)();
|
387
391
|
const { cursor, ...rest } = _tooltipProps;
|
@@ -397,16 +401,16 @@ var useChartTooltip = ({
|
|
397
401
|
(props, ref = null) => ({
|
398
402
|
ref,
|
399
403
|
animationDuration: tooltipAnimationDuration,
|
400
|
-
isAnimationActive: (tooltipAnimationDuration || 0) > 0,
|
401
404
|
cursor: {
|
402
405
|
className: (0, import_utils7.cx)("ui-chart__cursor", cursorClassName)
|
403
406
|
},
|
407
|
+
isAnimationActive: (tooltipAnimationDuration || 0) > 0,
|
404
408
|
...props,
|
405
409
|
...tooltipProps
|
406
410
|
}),
|
407
411
|
[cursorClassName, tooltipAnimationDuration, tooltipProps]
|
408
412
|
);
|
409
|
-
return { tooltipProps: tooltipUIProps
|
413
|
+
return { getTooltipProps, tooltipProps: tooltipUIProps };
|
410
414
|
};
|
411
415
|
|
412
416
|
// src/use-pie-chart.ts
|
@@ -424,17 +428,17 @@ var pieChartLabel = ({
|
|
424
428
|
className: cellClassName,
|
425
429
|
cx: cxProp = 0,
|
426
430
|
cy: cyProp = 0,
|
427
|
-
midAngle = 0,
|
428
431
|
innerRadius = 0,
|
429
|
-
|
432
|
+
isPercent,
|
433
|
+
labelFormatter,
|
434
|
+
labelOffset: labelOffsetProp,
|
435
|
+
midAngle = 0,
|
430
436
|
middleRadius = 0,
|
437
|
+
outerRadius = 0,
|
431
438
|
percent = 0,
|
439
|
+
styles,
|
432
440
|
value = 0,
|
433
|
-
|
434
|
-
isPercent,
|
435
|
-
labelProps,
|
436
|
-
labelFormatter,
|
437
|
-
styles
|
441
|
+
labelProps
|
438
442
|
}) => {
|
439
443
|
const labelOffset = labelOffsetProp != null ? labelOffsetProp : (outerRadius - innerRadius) * 0.5 + DEFAULT_LABEL_OFFSET;
|
440
444
|
const x = cxProp + (middleRadius + labelOffset) * Math.cos(-midAngle * RADIAN);
|
@@ -453,10 +457,10 @@ var pieChartLabel = ({
|
|
453
457
|
import_core7.ui.text,
|
454
458
|
{
|
455
459
|
className: (0, import_utils8.cx)(cellClassName, "ui-chart__label"),
|
460
|
+
dominantBaseline: "central",
|
461
|
+
textAnchor,
|
456
462
|
x,
|
457
463
|
y,
|
458
|
-
textAnchor,
|
459
|
-
dominantBaseline: "central",
|
460
464
|
__css: styles,
|
461
465
|
...labelProps,
|
462
466
|
children: displayLabel()
|
@@ -468,18 +472,19 @@ var pieChartLabelLine = ({
|
|
468
472
|
cx: cxProp = 0,
|
469
473
|
cy: cyProp = 0,
|
470
474
|
innerRadius = 0,
|
475
|
+
labelOffset: labelOffsetProp,
|
471
476
|
midAngle = 0,
|
472
477
|
middleRadius = 0,
|
473
478
|
outerRadius = 0,
|
474
479
|
points = [{ x: 0, y: 0 }],
|
475
|
-
|
476
|
-
labelLineProps
|
477
|
-
styles
|
480
|
+
styles,
|
481
|
+
labelLineProps
|
478
482
|
}) => {
|
483
|
+
var _a, _b;
|
479
484
|
const labelOffset = labelOffsetProp != null ? labelOffsetProp : (outerRadius - innerRadius) * 0.5 + DEFAULT_LABEL_OFFSET;
|
480
485
|
const x = cxProp + (middleRadius + labelOffset) * Math.cos(-midAngle * RADIAN);
|
481
486
|
const y = cyProp + (middleRadius + labelOffset) * Math.sin(-midAngle * RADIAN);
|
482
|
-
const d = `M ${points[0].x} ${points[0].y} L ${x} ${y}`;
|
487
|
+
const d = `M ${(_a = points[0]) == null ? void 0 : _a.x} ${(_b = points[0]) == null ? void 0 : _b.y} L ${x} ${y}`;
|
483
488
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
484
489
|
import_core7.ui.path,
|
485
490
|
{
|
@@ -494,19 +499,19 @@ var pieChartLabelLine = ({
|
|
494
499
|
// src/use-pie-chart.ts
|
495
500
|
var usePieChart = ({
|
496
501
|
data,
|
497
|
-
|
498
|
-
withLabelLines = false,
|
499
|
-
labelOffset,
|
500
|
-
isPercent = false,
|
501
|
-
strokeWidth = 1,
|
502
|
+
endAngle = -270,
|
502
503
|
fillOpacity = 1,
|
503
504
|
innerRadius = "0%",
|
505
|
+
isPercent = false,
|
506
|
+
labelFormatter,
|
507
|
+
labelOffset,
|
508
|
+
withLabels = false,
|
504
509
|
outerRadius = withLabels ? "80%" : "100%",
|
505
510
|
paddingAngle = 0,
|
506
511
|
startAngle = 90,
|
507
|
-
|
508
|
-
labelFormatter,
|
512
|
+
strokeWidth = 1,
|
509
513
|
styles,
|
514
|
+
withLabelLines = false,
|
510
515
|
...rest
|
511
516
|
}) => {
|
512
517
|
var _a, _b;
|
@@ -581,11 +586,11 @@ var usePieChart = ({
|
|
581
586
|
);
|
582
587
|
const label = (0, import_react5.useCallback)(
|
583
588
|
(props) => pieChartLabel({
|
584
|
-
labelOffset,
|
585
589
|
isPercent,
|
586
|
-
labelProps,
|
587
590
|
labelFormatter,
|
591
|
+
labelOffset,
|
588
592
|
styles: styles.label,
|
593
|
+
labelProps,
|
589
594
|
...props
|
590
595
|
}),
|
591
596
|
[isPercent, labelOffset, labelProps, styles.label, labelFormatter]
|
@@ -594,8 +599,8 @@ var usePieChart = ({
|
|
594
599
|
(props) => {
|
595
600
|
return pieChartLabelLine({
|
596
601
|
labelOffset,
|
597
|
-
labelLineProps,
|
598
602
|
styles: styles.labelLine,
|
603
|
+
labelLineProps,
|
599
604
|
...props
|
600
605
|
});
|
601
606
|
},
|
@@ -618,8 +623,8 @@ var usePieChart = ({
|
|
618
623
|
dimmed ? dimCellClassName : void 0
|
619
624
|
)(theme);
|
620
625
|
return {
|
621
|
-
|
622
|
-
|
626
|
+
className,
|
627
|
+
color
|
623
628
|
};
|
624
629
|
}),
|
625
630
|
[
|
@@ -644,19 +649,19 @@ var usePieChart = ({
|
|
644
649
|
({ className, ...props }, ref = null) => ({
|
645
650
|
ref,
|
646
651
|
className: (0, import_utils9.cx)(className, pieClassName),
|
647
|
-
|
652
|
+
activeShape: activeShapeProps,
|
648
653
|
data,
|
649
|
-
|
650
|
-
outerRadius,
|
651
|
-
innerRadius,
|
652
|
-
paddingAngle,
|
653
|
-
startAngle,
|
654
|
+
dataKey: "value",
|
654
655
|
endAngle,
|
656
|
+
inactiveShape: inactiveShapeProps,
|
657
|
+
innerRadius,
|
655
658
|
isAnimationActive: false,
|
656
659
|
label: withLabels ? label : false,
|
657
660
|
labelLine: withLabelLines ? labelLine : false,
|
658
|
-
|
659
|
-
|
661
|
+
outerRadius,
|
662
|
+
paddingAngle,
|
663
|
+
rootTabIndex: -1,
|
664
|
+
startAngle,
|
660
665
|
...props,
|
661
666
|
...pieProps
|
662
667
|
}),
|
@@ -678,8 +683,9 @@ var usePieChart = ({
|
|
678
683
|
]
|
679
684
|
);
|
680
685
|
const getCellProps = (0, import_react5.useCallback)(
|
681
|
-
({
|
682
|
-
|
686
|
+
({ className: classNameProp, index, ...props }, ref = null) => {
|
687
|
+
var _a2;
|
688
|
+
const { className, color } = (_a2 = cellPropList[index]) != null ? _a2 : {};
|
683
689
|
return {
|
684
690
|
ref,
|
685
691
|
className: (0, import_utils9.cx)(classNameProp, className),
|
@@ -693,10 +699,10 @@ var usePieChart = ({
|
|
693
699
|
);
|
694
700
|
return {
|
695
701
|
pieVars,
|
696
|
-
|
697
|
-
getPieChartProps,
|
702
|
+
setHighlightedArea,
|
698
703
|
getCellProps,
|
699
|
-
|
704
|
+
getPieChartProps,
|
705
|
+
getPieProps
|
700
706
|
};
|
701
707
|
};
|
702
708
|
|
@@ -707,71 +713,71 @@ var DonutChart = (0, import_core9.forwardRef)((props, ref) => {
|
|
707
713
|
const {
|
708
714
|
className,
|
709
715
|
data,
|
710
|
-
pieProps,
|
711
|
-
chartProps,
|
712
|
-
cellProps,
|
713
|
-
containerProps,
|
714
|
-
withTooltip = true,
|
715
|
-
withLegend = false,
|
716
|
-
tooltipProps,
|
717
|
-
tooltipAnimationDuration,
|
718
|
-
tooltipDataSource = "all",
|
719
|
-
valueFormatter,
|
720
|
-
labelFormatter,
|
721
|
-
unit,
|
722
|
-
paddingAngle,
|
723
|
-
startAngle,
|
724
716
|
endAngle,
|
725
717
|
withLabels,
|
726
|
-
withLabelLines,
|
727
|
-
labelOffset,
|
728
|
-
isPercent,
|
729
718
|
innerRadius = withLabels ? "60%" : "80%",
|
719
|
+
isPercent,
|
720
|
+
labelFormatter,
|
721
|
+
labelOffset,
|
730
722
|
outerRadius,
|
723
|
+
paddingAngle,
|
724
|
+
startAngle,
|
731
725
|
strokeWidth,
|
732
|
-
|
726
|
+
tooltipAnimationDuration,
|
727
|
+
tooltipDataSource = "all",
|
728
|
+
unit,
|
729
|
+
valueFormatter,
|
730
|
+
withLabelLines,
|
731
|
+
withLegend = false,
|
732
|
+
withTooltip = true,
|
733
|
+
cellProps,
|
734
|
+
chartProps,
|
735
|
+
containerProps,
|
733
736
|
labelProps,
|
737
|
+
legendProps,
|
738
|
+
pieProps,
|
739
|
+
tooltipProps,
|
734
740
|
...rest
|
735
741
|
} = (0, import_core9.omitThemeProps)(mergedProps);
|
736
742
|
const {
|
737
743
|
pieVars,
|
738
|
-
|
739
|
-
getPieChartProps,
|
744
|
+
setHighlightedArea,
|
740
745
|
getCellProps,
|
741
|
-
|
746
|
+
getPieChartProps,
|
747
|
+
getPieProps
|
742
748
|
} = usePieChart({
|
743
749
|
data,
|
744
|
-
|
745
|
-
chartProps,
|
746
|
-
cellProps,
|
750
|
+
endAngle,
|
747
751
|
innerRadius,
|
752
|
+
isPercent,
|
753
|
+
labelFormatter,
|
754
|
+
labelOffset,
|
748
755
|
outerRadius,
|
749
756
|
paddingAngle,
|
750
757
|
startAngle,
|
751
|
-
endAngle,
|
752
758
|
strokeWidth,
|
753
|
-
|
759
|
+
styles,
|
754
760
|
withLabelLines,
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
761
|
+
withLabels,
|
762
|
+
cellProps,
|
763
|
+
chartProps,
|
764
|
+
pieProps
|
759
765
|
});
|
760
766
|
const { getContainerProps } = useChart({ containerProps });
|
761
|
-
const { tooltipProps: computedTooltipProps
|
762
|
-
|
767
|
+
const { getTooltipProps, tooltipProps: computedTooltipProps } = useChartTooltip({
|
768
|
+
styles,
|
763
769
|
tooltipAnimationDuration,
|
764
|
-
|
770
|
+
tooltipProps
|
765
771
|
});
|
766
|
-
const { legendProps: computedLegendProps
|
772
|
+
const { getLegendProps, legendProps: computedLegendProps } = useChartLegend({
|
767
773
|
legendProps
|
768
774
|
});
|
769
|
-
const { getLabelProps } = useChartLabel({
|
775
|
+
const { getLabelProps } = useChartLabel({ styles, labelProps });
|
770
776
|
const cells = (0, import_react6.useMemo)(
|
771
777
|
() => data.map(({ name }, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
772
778
|
import_recharts.Cell,
|
773
779
|
{
|
774
|
-
...getCellProps({
|
780
|
+
...getCellProps({ className: "ui-donut-chart__cell", index })
|
775
781
|
},
|
776
782
|
`donut-cell-${name}`
|
777
783
|
)),
|
@@ -834,8 +840,8 @@ var DonutChart = (0, import_core9.forwardRef)((props, ref) => {
|
|
834
840
|
className: "ui-donut-chart__tooltip",
|
835
841
|
label,
|
836
842
|
payload: tooltipDataSource === "segment" ? payload : data,
|
837
|
-
valueFormatter,
|
838
843
|
unit,
|
844
|
+
valueFormatter,
|
839
845
|
...computedTooltipProps
|
840
846
|
}
|
841
847
|
),
|
@@ -850,6 +856,8 @@ var DonutChart = (0, import_core9.forwardRef)((props, ref) => {
|
|
850
856
|
}
|
851
857
|
) });
|
852
858
|
});
|
859
|
+
DonutChart.displayName = "DonutChart";
|
860
|
+
DonutChart.__ui__ = "DonutChart";
|
853
861
|
// Annotate the CommonJS export names for ESM import in node:
|
854
862
|
0 && (module.exports = {
|
855
863
|
DonutChart
|