@yamada-ui/charts 1.5.4-dev-20241005224505 → 1.5.4-dev-20241006000212
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/area-chart-gradient.d.mts +1 -1
- package/dist/area-chart-gradient.d.ts +1 -1
- package/dist/area-chart-gradient.js +5 -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 +1 -1
- package/dist/area-chart-split.d.ts +1 -1
- package/dist/area-chart-split.js +2 -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 +180 -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 +137 -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 +2 -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 +7 -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-YSPGYMRF.mjs → chunk-5VLSGWQD.mjs} +8 -8
- package/dist/{chunk-YSPGYMRF.mjs.map → chunk-5VLSGWQD.mjs.map} +1 -1
- 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-54WAXZP7.mjs → chunk-NMPNNSBN.mjs} +74 -74
- package/dist/chunk-NMPNNSBN.mjs.map +1 -0
- package/dist/{chunk-OEM3VCHN.mjs → chunk-NQPC5LPY.mjs} +82 -82
- package/dist/chunk-NQPC5LPY.mjs.map +1 -0
- package/dist/{chunk-AYVZF37W.mjs → chunk-OG5CVPPV.mjs} +3 -3
- package/dist/chunk-OG5CVPPV.mjs.map +1 -0
- package/dist/{chunk-X6CD7LHX.mjs → chunk-OUIKA4AX.mjs} +3 -3
- package/dist/{chunk-X6CD7LHX.mjs.map → chunk-OUIKA4AX.mjs.map} +1 -1
- 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-6OYWQ3NO.mjs → chunk-SCY5V45W.mjs} +56 -56
- package/dist/chunk-SCY5V45W.mjs.map +1 -0
- package/dist/{chunk-CQTRL3BW.mjs → chunk-SYBJTMPL.mjs} +90 -90
- package/dist/chunk-SYBJTMPL.mjs.map +1 -0
- package/dist/{chunk-XKVM7WUW.mjs → chunk-TA7YJAW4.mjs} +47 -47
- package/dist/{chunk-XKVM7WUW.mjs.map → chunk-TA7YJAW4.mjs.map} +1 -1
- 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-EE6KEX6V.mjs → chunk-U325CYNR.mjs} +6 -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-NETTMC2D.mjs → chunk-YTUEG4IY.mjs} +45 -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-DZL5KQOJ.mjs → chunk-ZRV4LO67.mjs} +42 -42
- package/dist/chunk-ZRV4LO67.mjs.map +1 -0
- package/dist/donut-chart.js +91 -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 +2069 -2043
- 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 +140 -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 +89 -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 +81 -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 +63 -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-54WAXZP7.mjs.map +0 -1
- package/dist/chunk-6O5G3WYP.mjs.map +0 -1
- package/dist/chunk-6OYWQ3NO.mjs.map +0 -1
- package/dist/chunk-A3IWA366.mjs.map +0 -1
- package/dist/chunk-AYVZF37W.mjs.map +0 -1
- package/dist/chunk-C3ZYUDXE.mjs.map +0 -1
- package/dist/chunk-CQTRL3BW.mjs.map +0 -1
- package/dist/chunk-DZL5KQOJ.mjs.map +0 -1
- package/dist/chunk-EE6KEX6V.mjs.map +0 -1
- package/dist/chunk-FYAC4RRZ.mjs.map +0 -1
- package/dist/chunk-MSG3WFBO.mjs.map +0 -1
- package/dist/chunk-MVRWZTQ5.mjs.map +0 -1
- package/dist/chunk-NETTMC2D.mjs.map +0 -1
- package/dist/chunk-O3LMKYXK.mjs.map +0 -1
- package/dist/chunk-OEM3VCHN.mjs.map +0 -1
- package/dist/chunk-OJ2MLZZ7.mjs.map +0 -1
- package/dist/chunk-OPPMMNGP.mjs.map +0 -1
- package/dist/chunk-VEFEKDMH.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/radar-chart.mjs
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
RadarChart
|
4
|
-
} from "./chunk-
|
5
|
-
import "./chunk-
|
6
|
-
import "./chunk-
|
7
|
-
import "./chunk-
|
8
|
-
import "./chunk-
|
9
|
-
import "./chunk-
|
10
|
-
import "./chunk-
|
11
|
-
import "./chunk-
|
4
|
+
} from "./chunk-SCY5V45W.mjs";
|
5
|
+
import "./chunk-EZG52466.mjs";
|
6
|
+
import "./chunk-6JRMEI6J.mjs";
|
7
|
+
import "./chunk-X6PIY2M3.mjs";
|
8
|
+
import "./chunk-R2LOTDR3.mjs";
|
9
|
+
import "./chunk-OUIKA4AX.mjs";
|
10
|
+
import "./chunk-5VLSGWQD.mjs";
|
11
|
+
import "./chunk-VK65X6Q2.mjs";
|
12
12
|
import "./chunk-6YUJLLGN.mjs";
|
13
|
-
import "./chunk-
|
13
|
+
import "./chunk-TXNC7GLT.mjs";
|
14
14
|
export {
|
15
15
|
RadarChart
|
16
16
|
};
|
package/dist/radial-chart.d.mts
CHANGED
@@ -14,11 +14,15 @@ import 'recharts/types/chart/generateCategoricalChart';
|
|
14
14
|
|
15
15
|
interface RadialChartOptions {
|
16
16
|
/**
|
17
|
-
*
|
17
|
+
* Determines which data is displayed in the tooltip.
|
18
18
|
*
|
19
|
-
* @default
|
19
|
+
* @default 'all'
|
20
20
|
*/
|
21
|
-
|
21
|
+
tooltipDataSource?: TooltipDataSourceType;
|
22
|
+
/**
|
23
|
+
* Unit displayed next to each value in tooltip.
|
24
|
+
*/
|
25
|
+
unit?: string;
|
22
26
|
/**
|
23
27
|
* If `true`, legend is visible.
|
24
28
|
*
|
@@ -32,15 +36,11 @@ interface RadialChartOptions {
|
|
32
36
|
*/
|
33
37
|
withPolarGrid?: boolean;
|
34
38
|
/**
|
35
|
-
*
|
39
|
+
* If `true`, tooltip is visible.
|
36
40
|
*
|
37
|
-
* @default
|
38
|
-
*/
|
39
|
-
tooltipDataSource?: TooltipDataSourceType;
|
40
|
-
/**
|
41
|
-
* Unit displayed next to each value in tooltip.
|
41
|
+
* @default true
|
42
42
|
*/
|
43
|
-
|
43
|
+
withTooltip?: boolean;
|
44
44
|
}
|
45
45
|
interface RadialChartProps extends Omit<HTMLUIProps, "fillOpacity" | "strokeDasharray">, ThemeProps<"radialChart">, RadialChartOptions, UseRadialChartOptions, UseChartTooltipOptions, UseChartLegendProps, UseChartLabelListOptions, UsePolarGridOptions, UseChartProps {
|
46
46
|
}
|
package/dist/radial-chart.d.ts
CHANGED
@@ -14,11 +14,15 @@ import 'recharts/types/chart/generateCategoricalChart';
|
|
14
14
|
|
15
15
|
interface RadialChartOptions {
|
16
16
|
/**
|
17
|
-
*
|
17
|
+
* Determines which data is displayed in the tooltip.
|
18
18
|
*
|
19
|
-
* @default
|
19
|
+
* @default 'all'
|
20
20
|
*/
|
21
|
-
|
21
|
+
tooltipDataSource?: TooltipDataSourceType;
|
22
|
+
/**
|
23
|
+
* Unit displayed next to each value in tooltip.
|
24
|
+
*/
|
25
|
+
unit?: string;
|
22
26
|
/**
|
23
27
|
* If `true`, legend is visible.
|
24
28
|
*
|
@@ -32,15 +36,11 @@ interface RadialChartOptions {
|
|
32
36
|
*/
|
33
37
|
withPolarGrid?: boolean;
|
34
38
|
/**
|
35
|
-
*
|
39
|
+
* If `true`, tooltip is visible.
|
36
40
|
*
|
37
|
-
* @default
|
38
|
-
*/
|
39
|
-
tooltipDataSource?: TooltipDataSourceType;
|
40
|
-
/**
|
41
|
-
* Unit displayed next to each value in tooltip.
|
41
|
+
* @default true
|
42
42
|
*/
|
43
|
-
|
43
|
+
withTooltip?: boolean;
|
44
44
|
}
|
45
45
|
interface RadialChartProps extends Omit<HTMLUIProps, "fillOpacity" | "strokeDasharray">, ThemeProps<"radialChart">, RadialChartOptions, UseRadialChartOptions, UseChartTooltipOptions, UseChartLegendProps, UseChartLabelListOptions, UsePolarGridOptions, UseChartProps {
|
46
46
|
}
|
package/dist/radial-chart.js
CHANGED
@@ -196,13 +196,13 @@ var useChart = ({ containerProps = {} }) => {
|
|
196
196
|
getContainerProps
|
197
197
|
};
|
198
198
|
};
|
199
|
-
var useLegend = (
|
199
|
+
var useLegend = () => {
|
200
200
|
const { styles } = useChartContext();
|
201
201
|
return {
|
202
202
|
styles
|
203
203
|
};
|
204
204
|
};
|
205
|
-
var useTooltip = (
|
205
|
+
var useTooltip = () => {
|
206
206
|
const { styles } = useChartContext();
|
207
207
|
return {
|
208
208
|
styles
|
@@ -214,7 +214,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
214
214
|
var ChartLegend = (0, import_core3.forwardRef)(
|
215
215
|
({ className, payload = [], onHighlight, ...rest }, ref) => {
|
216
216
|
const { styles } = useLegend();
|
217
|
-
const items = payload.map(({ dataKey, value: valueProp
|
217
|
+
const items = payload.map(({ color, dataKey, value: valueProp }, index) => {
|
218
218
|
const value = dataKey != null ? dataKey : valueProp;
|
219
219
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
220
220
|
import_core3.ui.div,
|
@@ -259,22 +259,22 @@ var import_utils4 = require("@yamada-ui/utils");
|
|
259
259
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
260
260
|
var ChartTooltip = (0, import_core4.forwardRef)(
|
261
261
|
({
|
262
|
-
label,
|
263
|
-
dataKey = "value",
|
264
262
|
className,
|
265
|
-
|
266
|
-
|
263
|
+
dataKey = "value",
|
264
|
+
isRadialChart,
|
265
|
+
label,
|
267
266
|
labelFormatter,
|
267
|
+
payload = [],
|
268
268
|
unit,
|
269
|
-
|
269
|
+
valueFormatter,
|
270
270
|
...rest
|
271
271
|
}, ref) => {
|
272
272
|
var _a;
|
273
273
|
const { styles } = useTooltip();
|
274
274
|
const items = payload.map(
|
275
275
|
({
|
276
|
-
color: colorProp,
|
277
276
|
name: nameProp,
|
277
|
+
color: colorProp,
|
278
278
|
[dataKey]: valueProp,
|
279
279
|
payload: payload2
|
280
280
|
} = {}, index) => {
|
@@ -352,8 +352,8 @@ var import_core5 = require("@yamada-ui/core");
|
|
352
352
|
var import_utils5 = require("@yamada-ui/utils");
|
353
353
|
var import_react2 = require("react");
|
354
354
|
var useChartLabelList = ({
|
355
|
-
|
356
|
-
|
355
|
+
styles,
|
356
|
+
labelListProps = []
|
357
357
|
}) => {
|
358
358
|
const { theme } = (0, import_core5.useTheme)();
|
359
359
|
const styleClassName = (0, import_core5.getCSS)(styles.labelList)(theme);
|
@@ -367,8 +367,9 @@ var useChartLabelList = ({
|
|
367
367
|
[labelListProps, styleClassName, theme]
|
368
368
|
);
|
369
369
|
const getLabelLineProps = (0, import_react2.useCallback)(
|
370
|
-
({
|
371
|
-
|
370
|
+
({ className, index, ...props }, ref = null) => {
|
371
|
+
var _a;
|
372
|
+
const { className: propClassName, ...rest } = (_a = propList[index]) != null ? _a : {};
|
372
373
|
return {
|
373
374
|
ref,
|
374
375
|
className: (0, import_utils5.cx)(className, propClassName),
|
@@ -402,7 +403,7 @@ var useChartLegend = ({
|
|
402
403
|
},
|
403
404
|
[rest]
|
404
405
|
);
|
405
|
-
return {
|
406
|
+
return { getLegendProps, legendProps };
|
406
407
|
};
|
407
408
|
|
408
409
|
// src/use-chart-tooltip.ts
|
@@ -410,9 +411,9 @@ var import_core6 = require("@yamada-ui/core");
|
|
410
411
|
var import_utils7 = require("@yamada-ui/utils");
|
411
412
|
var import_react4 = require("react");
|
412
413
|
var useChartTooltip = ({
|
413
|
-
|
414
|
+
styles,
|
414
415
|
tooltipAnimationDuration = 0,
|
415
|
-
|
416
|
+
tooltipProps: _tooltipProps = {}
|
416
417
|
}) => {
|
417
418
|
const { theme } = (0, import_core6.useTheme)();
|
418
419
|
const { cursor, ...rest } = _tooltipProps;
|
@@ -428,16 +429,16 @@ var useChartTooltip = ({
|
|
428
429
|
(props, ref = null) => ({
|
429
430
|
ref,
|
430
431
|
animationDuration: tooltipAnimationDuration,
|
431
|
-
isAnimationActive: (tooltipAnimationDuration || 0) > 0,
|
432
432
|
cursor: {
|
433
433
|
className: (0, import_utils7.cx)("ui-chart__cursor", cursorClassName)
|
434
434
|
},
|
435
|
+
isAnimationActive: (tooltipAnimationDuration || 0) > 0,
|
435
436
|
...props,
|
436
437
|
...tooltipProps
|
437
438
|
}),
|
438
439
|
[cursorClassName, tooltipAnimationDuration, tooltipProps]
|
439
440
|
);
|
440
|
-
return { tooltipProps: tooltipUIProps
|
441
|
+
return { getTooltipProps, tooltipProps: tooltipUIProps };
|
441
442
|
};
|
442
443
|
|
443
444
|
// src/use-polar-grid.tsx
|
@@ -480,11 +481,11 @@ var import_react6 = require("react");
|
|
480
481
|
var useRadialChart = ({
|
481
482
|
data: dataProp,
|
482
483
|
dataKey = "value",
|
484
|
+
endAngle = -180,
|
485
|
+
fillOpacity = 1,
|
483
486
|
innerRadius = "10%",
|
484
487
|
outerRadius = "80%",
|
485
488
|
startAngle = 90,
|
486
|
-
endAngle = -180,
|
487
|
-
fillOpacity = 1,
|
488
489
|
styles,
|
489
490
|
...rest
|
490
491
|
}) => {
|
@@ -532,7 +533,7 @@ var useRadialChart = ({
|
|
532
533
|
);
|
533
534
|
const [radialBarProps, radialBarClassName] = (0, import_react6.useMemo)(
|
534
535
|
() => getComponentProps(
|
535
|
-
[computedRadialBarProps
|
536
|
+
[computedRadialBarProps, radialBarProperties],
|
536
537
|
styles.radialBar
|
537
538
|
)(theme),
|
538
539
|
[computedRadialBarProps, styles.radialBar, theme]
|
@@ -541,9 +542,9 @@ var useRadialChart = ({
|
|
541
542
|
() => dataProp.map((props, index) => {
|
542
543
|
const {
|
543
544
|
name,
|
544
|
-
value,
|
545
545
|
color,
|
546
546
|
dimRadialBar = {},
|
547
|
+
value,
|
547
548
|
...computedProps
|
548
549
|
} = props;
|
549
550
|
const dimmed = shouldHighlight && highlightedArea !== name;
|
@@ -556,11 +557,11 @@ var useRadialChart = ({
|
|
556
557
|
dimmed ? dimRadialBarClassName : void 0
|
557
558
|
)(theme);
|
558
559
|
return {
|
560
|
+
name,
|
559
561
|
className,
|
562
|
+
color,
|
560
563
|
fill: (0, import_core8.getVar)(`radial-bar-${index}`)(theme),
|
561
|
-
|
562
|
-
value,
|
563
|
-
color
|
564
|
+
value
|
564
565
|
};
|
565
566
|
}),
|
566
567
|
[
|
@@ -577,10 +578,10 @@ var useRadialChart = ({
|
|
577
578
|
ref,
|
578
579
|
className: (0, import_utils9.cx)(className, chartClassName),
|
579
580
|
data,
|
581
|
+
endAngle,
|
580
582
|
innerRadius,
|
581
583
|
outerRadius,
|
582
584
|
startAngle,
|
583
|
-
endAngle,
|
584
585
|
...props,
|
585
586
|
...chartProps
|
586
587
|
}),
|
@@ -598,9 +599,9 @@ var useRadialChart = ({
|
|
598
599
|
({ className, ...props }, ref = null) => ({
|
599
600
|
ref,
|
600
601
|
className: (0, import_utils9.cx)(className, radialBarClassName),
|
602
|
+
background,
|
601
603
|
dataKey,
|
602
604
|
isAnimationActive: false,
|
603
|
-
background,
|
604
605
|
...props,
|
605
606
|
...radialBarProps
|
606
607
|
}),
|
@@ -609,8 +610,8 @@ var useRadialChart = ({
|
|
609
610
|
return {
|
610
611
|
radialVars,
|
611
612
|
setHighlightedArea,
|
612
|
-
|
613
|
-
|
613
|
+
getRadialBarProps,
|
614
|
+
getRadialChartProps
|
614
615
|
};
|
615
616
|
};
|
616
617
|
|
@@ -622,67 +623,67 @@ var RadialChart = (0, import_core9.forwardRef)((props, ref) => {
|
|
622
623
|
className,
|
623
624
|
data,
|
624
625
|
dataKey,
|
625
|
-
|
626
|
-
|
627
|
-
containerProps,
|
628
|
-
withPolarGrid = false,
|
629
|
-
withTooltip = true,
|
630
|
-
withLegend = false,
|
631
|
-
tooltipProps,
|
632
|
-
tooltipAnimationDuration,
|
633
|
-
tooltipDataSource = "all",
|
634
|
-
valueFormatter,
|
635
|
-
unit,
|
636
|
-
legendProps,
|
626
|
+
endAngle,
|
627
|
+
fillOpacity,
|
637
628
|
innerRadius,
|
638
629
|
outerRadius,
|
639
630
|
startAngle,
|
640
|
-
|
641
|
-
|
631
|
+
strokeDasharray,
|
632
|
+
tooltipAnimationDuration,
|
633
|
+
tooltipDataSource = "all",
|
634
|
+
unit,
|
635
|
+
valueFormatter,
|
636
|
+
withLegend = false,
|
637
|
+
withPolarGrid = false,
|
638
|
+
withTooltip = true,
|
639
|
+
chartProps,
|
640
|
+
containerProps,
|
642
641
|
labelListProps = [],
|
642
|
+
legendProps,
|
643
643
|
polarGridProps,
|
644
|
-
|
644
|
+
radialBarProps,
|
645
|
+
tooltipProps,
|
645
646
|
...rest
|
646
647
|
} = (0, import_core9.omitThemeProps)(mergedProps);
|
647
648
|
const {
|
648
|
-
getRadialChartProps,
|
649
|
-
getRadialBarProps,
|
650
649
|
radialVars,
|
651
|
-
setHighlightedArea
|
650
|
+
setHighlightedArea,
|
651
|
+
getRadialBarProps,
|
652
|
+
getRadialChartProps
|
652
653
|
} = useRadialChart({
|
653
654
|
data,
|
654
655
|
dataKey,
|
655
|
-
|
656
|
-
|
657
|
-
radialBarProps,
|
656
|
+
endAngle,
|
657
|
+
fillOpacity,
|
658
658
|
innerRadius,
|
659
659
|
outerRadius,
|
660
660
|
startAngle,
|
661
|
-
|
662
|
-
|
661
|
+
styles,
|
662
|
+
chartProps,
|
663
|
+
radialBarProps
|
663
664
|
});
|
664
665
|
const { getContainerProps } = useChart({ containerProps });
|
665
|
-
const { tooltipProps: computedTooltipProps
|
666
|
-
|
666
|
+
const { getTooltipProps, tooltipProps: computedTooltipProps } = useChartTooltip({
|
667
|
+
styles,
|
667
668
|
tooltipAnimationDuration,
|
668
|
-
|
669
|
+
tooltipProps
|
669
670
|
});
|
670
|
-
const { legendProps: computedLegendProps
|
671
|
+
const { getLegendProps, legendProps: computedLegendProps } = useChartLegend({
|
671
672
|
legendProps
|
672
673
|
});
|
673
|
-
const { getLabelLineProps } = useChartLabelList({
|
674
|
+
const { getLabelLineProps } = useChartLabelList({ styles, labelListProps });
|
674
675
|
const { getPolarGridProps } = usePolarGrid({
|
675
|
-
polarGridProps,
|
676
676
|
strokeDasharray,
|
677
|
-
styles
|
677
|
+
styles,
|
678
|
+
polarGridProps
|
678
679
|
});
|
679
680
|
const labelLists = (0, import_react7.useMemo)(
|
680
681
|
() => labelListProps.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
681
682
|
import_recharts.LabelList,
|
682
683
|
{
|
683
684
|
...getLabelLineProps({
|
684
|
-
|
685
|
-
|
685
|
+
className: "ui-radial-chart__label-list",
|
686
|
+
index
|
686
687
|
})
|
687
688
|
},
|
688
689
|
`labelList-${index}`
|
@@ -748,8 +749,8 @@ var RadialChart = (0, import_core9.forwardRef)((props, ref) => {
|
|
748
749
|
className: "ui-radial-chart__tooltip",
|
749
750
|
isRadialChart: tooltipDataSource === "segment" ? true : false,
|
750
751
|
payload: tooltipDataSource === "segment" ? payload : data,
|
751
|
-
valueFormatter,
|
752
752
|
unit,
|
753
|
+
valueFormatter,
|
753
754
|
...computedTooltipProps
|
754
755
|
}
|
755
756
|
),
|