@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.
Files changed (222) hide show
  1. package/dist/area-chart-gradient.d.mts +1 -1
  2. package/dist/area-chart-gradient.d.ts +1 -1
  3. package/dist/area-chart-gradient.js +5 -5
  4. package/dist/area-chart-gradient.js.map +1 -1
  5. package/dist/area-chart-gradient.mjs +1 -1
  6. package/dist/area-chart-split.d.mts +1 -1
  7. package/dist/area-chart-split.d.ts +1 -1
  8. package/dist/area-chart-split.js +2 -2
  9. package/dist/area-chart-split.js.map +1 -1
  10. package/dist/area-chart-split.mjs +1 -1
  11. package/dist/area-chart.d.mts +8 -8
  12. package/dist/area-chart.d.ts +8 -8
  13. package/dist/area-chart.js +180 -175
  14. package/dist/area-chart.js.map +1 -1
  15. package/dist/area-chart.mjs +13 -13
  16. package/dist/bar-chart.d.mts +8 -8
  17. package/dist/bar-chart.d.ts +8 -8
  18. package/dist/bar-chart.js +137 -127
  19. package/dist/bar-chart.js.map +1 -1
  20. package/dist/bar-chart.mjs +11 -11
  21. package/dist/chart-legend.d.mts +1 -1
  22. package/dist/chart-legend.d.ts +1 -1
  23. package/dist/chart-legend.js +2 -2
  24. package/dist/chart-legend.js.map +1 -1
  25. package/dist/chart-legend.mjs +3 -3
  26. package/dist/chart-tooltip.d.mts +4 -4
  27. package/dist/chart-tooltip.d.ts +4 -4
  28. package/dist/chart-tooltip.js +7 -7
  29. package/dist/chart-tooltip.js.map +1 -1
  30. package/dist/chart-tooltip.mjs +3 -3
  31. package/dist/chart-utils.js.map +1 -1
  32. package/dist/chart-utils.mjs +1 -1
  33. package/dist/chart.types.d.mts +14 -14
  34. package/dist/chart.types.d.ts +14 -14
  35. package/dist/chart.types.js.map +1 -1
  36. package/dist/{chunk-YSPGYMRF.mjs → chunk-5VLSGWQD.mjs} +8 -8
  37. package/dist/{chunk-YSPGYMRF.mjs.map → chunk-5VLSGWQD.mjs.map} +1 -1
  38. package/dist/{chunk-XYUYAHJX.mjs → chunk-6JRMEI6J.mjs} +2 -2
  39. package/dist/chunk-6JRMEI6J.mjs.map +1 -0
  40. package/dist/{chunk-VKBRU4Z4.mjs → chunk-AYVTBRCS.mjs} +29 -28
  41. package/dist/chunk-AYVTBRCS.mjs.map +1 -0
  42. package/dist/{chunk-6O5G3WYP.mjs → chunk-EZG52466.mjs} +29 -21
  43. package/dist/chunk-EZG52466.mjs.map +1 -0
  44. package/dist/{chunk-VEFEKDMH.mjs → chunk-FDALM73K.mjs} +15 -14
  45. package/dist/chunk-FDALM73K.mjs.map +1 -0
  46. package/dist/{chunk-2GQHI23M.mjs → chunk-GU4SGNWX.mjs} +5 -5
  47. package/dist/chunk-GU4SGNWX.mjs.map +1 -0
  48. package/dist/{chunk-MVRWZTQ5.mjs → chunk-NLXYCM5J.mjs} +2 -2
  49. package/dist/chunk-NLXYCM5J.mjs.map +1 -0
  50. package/dist/{chunk-54WAXZP7.mjs → chunk-NMPNNSBN.mjs} +74 -74
  51. package/dist/chunk-NMPNNSBN.mjs.map +1 -0
  52. package/dist/{chunk-OEM3VCHN.mjs → chunk-NQPC5LPY.mjs} +82 -82
  53. package/dist/chunk-NQPC5LPY.mjs.map +1 -0
  54. package/dist/{chunk-AYVZF37W.mjs → chunk-OG5CVPPV.mjs} +3 -3
  55. package/dist/chunk-OG5CVPPV.mjs.map +1 -0
  56. package/dist/{chunk-X6CD7LHX.mjs → chunk-OUIKA4AX.mjs} +3 -3
  57. package/dist/{chunk-X6CD7LHX.mjs.map → chunk-OUIKA4AX.mjs.map} +1 -1
  58. package/dist/{chunk-3EHZJFIA.mjs → chunk-PKQB4BFG.mjs} +28 -28
  59. package/dist/chunk-PKQB4BFG.mjs.map +1 -0
  60. package/dist/{chunk-C3ZYUDXE.mjs → chunk-QPMW56KA.mjs} +52 -48
  61. package/dist/chunk-QPMW56KA.mjs.map +1 -0
  62. package/dist/{chunk-IJRYXT4V.mjs → chunk-R2LOTDR3.mjs} +2 -2
  63. package/dist/{chunk-IJRYXT4V.mjs.map → chunk-R2LOTDR3.mjs.map} +1 -1
  64. package/dist/{chunk-6OYWQ3NO.mjs → chunk-SCY5V45W.mjs} +56 -56
  65. package/dist/chunk-SCY5V45W.mjs.map +1 -0
  66. package/dist/{chunk-CQTRL3BW.mjs → chunk-SYBJTMPL.mjs} +90 -90
  67. package/dist/chunk-SYBJTMPL.mjs.map +1 -0
  68. package/dist/{chunk-XKVM7WUW.mjs → chunk-TA7YJAW4.mjs} +47 -47
  69. package/dist/{chunk-XKVM7WUW.mjs.map → chunk-TA7YJAW4.mjs.map} +1 -1
  70. package/dist/{chunk-O3LMKYXK.mjs → chunk-TU6MKMMV.mjs} +29 -28
  71. package/dist/chunk-TU6MKMMV.mjs.map +1 -0
  72. package/dist/{chunk-QL3DB7OJ.mjs → chunk-TXNC7GLT.mjs} +1 -1
  73. package/dist/{chunk-QL3DB7OJ.mjs.map → chunk-TXNC7GLT.mjs.map} +1 -1
  74. package/dist/{chunk-EE6KEX6V.mjs → chunk-U325CYNR.mjs} +6 -6
  75. package/dist/chunk-U325CYNR.mjs.map +1 -0
  76. package/dist/{chunk-OPPMMNGP.mjs → chunk-UER5GW4M.mjs} +33 -24
  77. package/dist/chunk-UER5GW4M.mjs.map +1 -0
  78. package/dist/{chunk-FYAC4RRZ.mjs → chunk-UTD4XZDM.mjs} +11 -10
  79. package/dist/chunk-UTD4XZDM.mjs.map +1 -0
  80. package/dist/{chunk-A3IWA366.mjs → chunk-VK65X6Q2.mjs} +4 -4
  81. package/dist/chunk-VK65X6Q2.mjs.map +1 -0
  82. package/dist/{chunk-OJ2MLZZ7.mjs → chunk-X6PIY2M3.mjs} +7 -7
  83. package/dist/chunk-X6PIY2M3.mjs.map +1 -0
  84. package/dist/{chunk-MSG3WFBO.mjs → chunk-YIAK5DIM.mjs} +7 -6
  85. package/dist/chunk-YIAK5DIM.mjs.map +1 -0
  86. package/dist/{chunk-NETTMC2D.mjs → chunk-YTUEG4IY.mjs} +45 -45
  87. package/dist/chunk-YTUEG4IY.mjs.map +1 -0
  88. package/dist/{chunk-VUTCH2CU.mjs → chunk-YX23LEQ7.mjs} +13 -13
  89. package/dist/chunk-YX23LEQ7.mjs.map +1 -0
  90. package/dist/{chunk-DZL5KQOJ.mjs → chunk-ZRV4LO67.mjs} +42 -42
  91. package/dist/chunk-ZRV4LO67.mjs.map +1 -0
  92. package/dist/donut-chart.js +91 -89
  93. package/dist/donut-chart.js.map +1 -1
  94. package/dist/donut-chart.mjs +10 -10
  95. package/dist/index.d.mts +14 -14
  96. package/dist/index.d.ts +14 -14
  97. package/dist/index.js +2069 -2043
  98. package/dist/index.js.map +1 -1
  99. package/dist/index.mjs +28 -28
  100. package/dist/index.mjs.map +1 -1
  101. package/dist/line-chart.d.mts +7 -7
  102. package/dist/line-chart.d.ts +7 -7
  103. package/dist/line-chart.js +140 -138
  104. package/dist/line-chart.js.map +1 -1
  105. package/dist/line-chart.mjs +11 -11
  106. package/dist/pie-chart-label.d.mts +9 -9
  107. package/dist/pie-chart-label.d.ts +9 -9
  108. package/dist/pie-chart-label.js +14 -13
  109. package/dist/pie-chart-label.js.map +1 -1
  110. package/dist/pie-chart-label.mjs +1 -1
  111. package/dist/pie-chart.d.mts +11 -11
  112. package/dist/pie-chart.d.ts +11 -11
  113. package/dist/pie-chart.js +89 -87
  114. package/dist/pie-chart.js.map +1 -1
  115. package/dist/pie-chart.mjs +9 -9
  116. package/dist/radar-chart.d.mts +11 -11
  117. package/dist/radar-chart.d.ts +11 -11
  118. package/dist/radar-chart.js +81 -73
  119. package/dist/radar-chart.js.map +1 -1
  120. package/dist/radar-chart.mjs +9 -9
  121. package/dist/radial-chart.d.mts +10 -10
  122. package/dist/radial-chart.d.ts +10 -10
  123. package/dist/radial-chart.js +63 -62
  124. package/dist/radial-chart.js.map +1 -1
  125. package/dist/radial-chart.mjs +10 -10
  126. package/dist/use-area-chart.d.mts +53 -53
  127. package/dist/use-area-chart.d.ts +53 -53
  128. package/dist/use-area-chart.js +50 -46
  129. package/dist/use-area-chart.js.map +1 -1
  130. package/dist/use-area-chart.mjs +2 -2
  131. package/dist/use-bar-chart.d.mts +32 -32
  132. package/dist/use-bar-chart.d.ts +32 -32
  133. package/dist/use-bar-chart.js +30 -21
  134. package/dist/use-bar-chart.js.map +1 -1
  135. package/dist/use-bar-chart.mjs +2 -2
  136. package/dist/use-chart-axis.d.mts +27 -27
  137. package/dist/use-chart-axis.d.ts +27 -27
  138. package/dist/use-chart-axis.js +26 -26
  139. package/dist/use-chart-axis.js.map +1 -1
  140. package/dist/use-chart-axis.mjs +2 -2
  141. package/dist/use-chart-grid.d.mts +8 -8
  142. package/dist/use-chart-grid.d.ts +8 -8
  143. package/dist/use-chart-grid.js +3 -3
  144. package/dist/use-chart-grid.js.map +1 -1
  145. package/dist/use-chart-grid.mjs +2 -2
  146. package/dist/use-chart-label-list.d.mts +4 -4
  147. package/dist/use-chart-label-list.d.ts +4 -4
  148. package/dist/use-chart-label-list.js +5 -4
  149. package/dist/use-chart-label-list.js.map +1 -1
  150. package/dist/use-chart-label-list.mjs +2 -2
  151. package/dist/use-chart-label.d.mts +1 -1
  152. package/dist/use-chart-label.d.ts +1 -1
  153. package/dist/use-chart-label.js.map +1 -1
  154. package/dist/use-chart-label.mjs +2 -2
  155. package/dist/use-chart-legend.d.mts +1 -1
  156. package/dist/use-chart-legend.d.ts +1 -1
  157. package/dist/use-chart-legend.js +1 -1
  158. package/dist/use-chart-legend.js.map +1 -1
  159. package/dist/use-chart-legend.mjs +1 -1
  160. package/dist/use-chart-reference-line.d.mts +4 -4
  161. package/dist/use-chart-reference-line.d.ts +4 -4
  162. package/dist/use-chart-reference-line.js +8 -7
  163. package/dist/use-chart-reference-line.js.map +1 -1
  164. package/dist/use-chart-reference-line.mjs +2 -2
  165. package/dist/use-chart-tooltip.d.mts +7 -7
  166. package/dist/use-chart-tooltip.d.ts +7 -7
  167. package/dist/use-chart-tooltip.js +4 -4
  168. package/dist/use-chart-tooltip.js.map +1 -1
  169. package/dist/use-chart-tooltip.mjs +2 -2
  170. package/dist/use-chart.d.mts +6 -10
  171. package/dist/use-chart.d.ts +6 -10
  172. package/dist/use-chart.js +2 -2
  173. package/dist/use-chart.js.map +1 -1
  174. package/dist/use-chart.mjs +2 -2
  175. package/dist/use-line-chart.d.mts +43 -43
  176. package/dist/use-line-chart.d.ts +43 -43
  177. package/dist/use-line-chart.js +26 -25
  178. package/dist/use-line-chart.js.map +1 -1
  179. package/dist/use-line-chart.mjs +2 -2
  180. package/dist/use-pie-chart.d.mts +47 -47
  181. package/dist/use-pie-chart.d.ts +47 -47
  182. package/dist/use-pie-chart.js +40 -38
  183. package/dist/use-pie-chart.js.map +1 -1
  184. package/dist/use-pie-chart.mjs +3 -3
  185. package/dist/use-polar-grid.d.mts +5 -5
  186. package/dist/use-polar-grid.d.ts +5 -5
  187. package/dist/use-polar-grid.js.map +1 -1
  188. package/dist/use-polar-grid.mjs +2 -2
  189. package/dist/use-radar-chart.d.mts +41 -41
  190. package/dist/use-radar-chart.d.ts +41 -41
  191. package/dist/use-radar-chart.js +27 -19
  192. package/dist/use-radar-chart.js.map +1 -1
  193. package/dist/use-radar-chart.mjs +2 -2
  194. package/dist/use-radial-chart.d.mts +17 -17
  195. package/dist/use-radial-chart.d.ts +17 -17
  196. package/dist/use-radial-chart.js +11 -11
  197. package/dist/use-radial-chart.js.map +1 -1
  198. package/dist/use-radial-chart.mjs +2 -2
  199. package/package.json +3 -3
  200. package/dist/chunk-2GQHI23M.mjs.map +0 -1
  201. package/dist/chunk-3EHZJFIA.mjs.map +0 -1
  202. package/dist/chunk-54WAXZP7.mjs.map +0 -1
  203. package/dist/chunk-6O5G3WYP.mjs.map +0 -1
  204. package/dist/chunk-6OYWQ3NO.mjs.map +0 -1
  205. package/dist/chunk-A3IWA366.mjs.map +0 -1
  206. package/dist/chunk-AYVZF37W.mjs.map +0 -1
  207. package/dist/chunk-C3ZYUDXE.mjs.map +0 -1
  208. package/dist/chunk-CQTRL3BW.mjs.map +0 -1
  209. package/dist/chunk-DZL5KQOJ.mjs.map +0 -1
  210. package/dist/chunk-EE6KEX6V.mjs.map +0 -1
  211. package/dist/chunk-FYAC4RRZ.mjs.map +0 -1
  212. package/dist/chunk-MSG3WFBO.mjs.map +0 -1
  213. package/dist/chunk-MVRWZTQ5.mjs.map +0 -1
  214. package/dist/chunk-NETTMC2D.mjs.map +0 -1
  215. package/dist/chunk-O3LMKYXK.mjs.map +0 -1
  216. package/dist/chunk-OEM3VCHN.mjs.map +0 -1
  217. package/dist/chunk-OJ2MLZZ7.mjs.map +0 -1
  218. package/dist/chunk-OPPMMNGP.mjs.map +0 -1
  219. package/dist/chunk-VEFEKDMH.mjs.map +0 -1
  220. package/dist/chunk-VKBRU4Z4.mjs.map +0 -1
  221. package/dist/chunk-VUTCH2CU.mjs.map +0 -1
  222. package/dist/chunk-XYUYAHJX.mjs.map +0 -1
@@ -12,11 +12,15 @@ import 'recharts/types/chart/generateCategoricalChart';
12
12
 
13
13
  interface PieChartOptions {
14
14
  /**
15
- * If `true`, tooltip is visible.
15
+ * Determines which data is displayed in the tooltip.
16
16
  *
17
- * @default true
17
+ * @default 'all'
18
18
  */
19
- withTooltip?: boolean;
19
+ tooltipDataSource?: TooltipDataSourceType;
20
+ /**
21
+ * Unit displayed next to each value in tooltip.
22
+ */
23
+ unit?: string;
20
24
  /**
21
25
  * If `true`, legend is visible.
22
26
  *
@@ -24,17 +28,13 @@ interface PieChartOptions {
24
28
  */
25
29
  withLegend?: boolean;
26
30
  /**
27
- * Determines which data is displayed in the tooltip.
31
+ * If `true`, tooltip is visible.
28
32
  *
29
- * @default 'all'
30
- */
31
- tooltipDataSource?: TooltipDataSourceType;
32
- /**
33
- * Unit displayed next to each value in tooltip.
33
+ * @default true
34
34
  */
35
- unit?: string;
35
+ withTooltip?: boolean;
36
36
  }
37
- interface PieChartProps extends Omit<HTMLUIProps, "strokeWidth" | "fillOpacity">, ThemeProps<"pieChart">, PieChartOptions, UsePieChartOptions, Omit<UseChartTooltipOptions, "labelFormatter">, UseChartLegendProps, UseChartProps {
37
+ interface PieChartProps extends Omit<HTMLUIProps, "fillOpacity" | "strokeWidth">, ThemeProps<"pieChart">, PieChartOptions, UsePieChartOptions, Omit<UseChartTooltipOptions, "labelFormatter">, UseChartLegendProps, UseChartProps {
38
38
  }
39
39
  /**
40
40
  * `PieChart` is a component for drawing pie charts to compare multiple sets of data.
@@ -12,11 +12,15 @@ import 'recharts/types/chart/generateCategoricalChart';
12
12
 
13
13
  interface PieChartOptions {
14
14
  /**
15
- * If `true`, tooltip is visible.
15
+ * Determines which data is displayed in the tooltip.
16
16
  *
17
- * @default true
17
+ * @default 'all'
18
18
  */
19
- withTooltip?: boolean;
19
+ tooltipDataSource?: TooltipDataSourceType;
20
+ /**
21
+ * Unit displayed next to each value in tooltip.
22
+ */
23
+ unit?: string;
20
24
  /**
21
25
  * If `true`, legend is visible.
22
26
  *
@@ -24,17 +28,13 @@ interface PieChartOptions {
24
28
  */
25
29
  withLegend?: boolean;
26
30
  /**
27
- * Determines which data is displayed in the tooltip.
31
+ * If `true`, tooltip is visible.
28
32
  *
29
- * @default 'all'
30
- */
31
- tooltipDataSource?: TooltipDataSourceType;
32
- /**
33
- * Unit displayed next to each value in tooltip.
33
+ * @default true
34
34
  */
35
- unit?: string;
35
+ withTooltip?: boolean;
36
36
  }
37
- interface PieChartProps extends Omit<HTMLUIProps, "strokeWidth" | "fillOpacity">, ThemeProps<"pieChart">, PieChartOptions, UsePieChartOptions, Omit<UseChartTooltipOptions, "labelFormatter">, UseChartLegendProps, UseChartProps {
37
+ interface PieChartProps extends Omit<HTMLUIProps, "fillOpacity" | "strokeWidth">, ThemeProps<"pieChart">, PieChartOptions, UsePieChartOptions, Omit<UseChartTooltipOptions, "labelFormatter">, UseChartLegendProps, UseChartProps {
38
38
  }
39
39
  /**
40
40
  * `PieChart` is a component for drawing pie charts to compare multiple sets of data.
package/dist/pie-chart.js CHANGED
@@ -168,13 +168,13 @@ var useChart = ({ containerProps = {} }) => {
168
168
  getContainerProps
169
169
  };
170
170
  };
171
- var useLegend = ({} = {}) => {
171
+ var useLegend = () => {
172
172
  const { styles } = useChartContext();
173
173
  return {
174
174
  styles
175
175
  };
176
176
  };
177
- var useTooltip = ({} = {}) => {
177
+ var useTooltip = () => {
178
178
  const { styles } = useChartContext();
179
179
  return {
180
180
  styles
@@ -186,7 +186,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
186
186
  var ChartLegend = (0, import_core3.forwardRef)(
187
187
  ({ className, payload = [], onHighlight, ...rest }, ref) => {
188
188
  const { styles } = useLegend();
189
- const items = payload.map(({ dataKey, value: valueProp, color }, index) => {
189
+ const items = payload.map(({ color, dataKey, value: valueProp }, index) => {
190
190
  const value = dataKey != null ? dataKey : valueProp;
191
191
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
192
192
  import_core3.ui.div,
@@ -231,22 +231,22 @@ var import_utils4 = require("@yamada-ui/utils");
231
231
  var import_jsx_runtime2 = require("react/jsx-runtime");
232
232
  var ChartTooltip = (0, import_core4.forwardRef)(
233
233
  ({
234
- label,
235
- dataKey = "value",
236
234
  className,
237
- payload = [],
238
- valueFormatter,
235
+ dataKey = "value",
236
+ isRadialChart,
237
+ label,
239
238
  labelFormatter,
239
+ payload = [],
240
240
  unit,
241
- isRadialChart,
241
+ valueFormatter,
242
242
  ...rest
243
243
  }, ref) => {
244
244
  var _a;
245
245
  const { styles } = useTooltip();
246
246
  const items = payload.map(
247
247
  ({
248
- color: colorProp,
249
248
  name: nameProp,
249
+ color: colorProp,
250
250
  [dataKey]: valueProp,
251
251
  payload: payload2
252
252
  } = {}, index) => {
@@ -340,7 +340,7 @@ var useChartLegend = ({
340
340
  },
341
341
  [rest]
342
342
  );
343
- return { legendProps, getLegendProps };
343
+ return { getLegendProps, legendProps };
344
344
  };
345
345
 
346
346
  // src/use-chart-tooltip.ts
@@ -348,9 +348,9 @@ var import_core5 = require("@yamada-ui/core");
348
348
  var import_utils6 = require("@yamada-ui/utils");
349
349
  var import_react3 = require("react");
350
350
  var useChartTooltip = ({
351
- tooltipProps: _tooltipProps = {},
351
+ styles,
352
352
  tooltipAnimationDuration = 0,
353
- styles
353
+ tooltipProps: _tooltipProps = {}
354
354
  }) => {
355
355
  const { theme } = (0, import_core5.useTheme)();
356
356
  const { cursor, ...rest } = _tooltipProps;
@@ -366,16 +366,16 @@ var useChartTooltip = ({
366
366
  (props, ref = null) => ({
367
367
  ref,
368
368
  animationDuration: tooltipAnimationDuration,
369
- isAnimationActive: (tooltipAnimationDuration || 0) > 0,
370
369
  cursor: {
371
370
  className: (0, import_utils6.cx)("ui-chart__cursor", cursorClassName)
372
371
  },
372
+ isAnimationActive: (tooltipAnimationDuration || 0) > 0,
373
373
  ...props,
374
374
  ...tooltipProps
375
375
  }),
376
376
  [cursorClassName, tooltipAnimationDuration, tooltipProps]
377
377
  );
378
- return { tooltipProps: tooltipUIProps, getTooltipProps };
378
+ return { getTooltipProps, tooltipProps: tooltipUIProps };
379
379
  };
380
380
 
381
381
  // src/use-pie-chart.ts
@@ -393,17 +393,17 @@ var pieChartLabel = ({
393
393
  className: cellClassName,
394
394
  cx: cxProp = 0,
395
395
  cy: cyProp = 0,
396
- midAngle = 0,
397
396
  innerRadius = 0,
398
- outerRadius = 0,
397
+ isPercent,
398
+ labelFormatter,
399
+ labelOffset: labelOffsetProp,
400
+ midAngle = 0,
399
401
  middleRadius = 0,
402
+ outerRadius = 0,
400
403
  percent = 0,
404
+ styles,
401
405
  value = 0,
402
- labelOffset: labelOffsetProp,
403
- isPercent,
404
- labelProps,
405
- labelFormatter,
406
- styles
406
+ labelProps
407
407
  }) => {
408
408
  const labelOffset = labelOffsetProp != null ? labelOffsetProp : (outerRadius - innerRadius) * 0.5 + DEFAULT_LABEL_OFFSET;
409
409
  const x = cxProp + (middleRadius + labelOffset) * Math.cos(-midAngle * RADIAN);
@@ -422,10 +422,10 @@ var pieChartLabel = ({
422
422
  import_core6.ui.text,
423
423
  {
424
424
  className: (0, import_utils7.cx)(cellClassName, "ui-chart__label"),
425
+ dominantBaseline: "central",
426
+ textAnchor,
425
427
  x,
426
428
  y,
427
- textAnchor,
428
- dominantBaseline: "central",
429
429
  __css: styles,
430
430
  ...labelProps,
431
431
  children: displayLabel()
@@ -437,18 +437,19 @@ var pieChartLabelLine = ({
437
437
  cx: cxProp = 0,
438
438
  cy: cyProp = 0,
439
439
  innerRadius = 0,
440
+ labelOffset: labelOffsetProp,
440
441
  midAngle = 0,
441
442
  middleRadius = 0,
442
443
  outerRadius = 0,
443
444
  points = [{ x: 0, y: 0 }],
444
- labelOffset: labelOffsetProp,
445
- labelLineProps,
446
- styles
445
+ styles,
446
+ labelLineProps
447
447
  }) => {
448
+ var _a, _b;
448
449
  const labelOffset = labelOffsetProp != null ? labelOffsetProp : (outerRadius - innerRadius) * 0.5 + DEFAULT_LABEL_OFFSET;
449
450
  const x = cxProp + (middleRadius + labelOffset) * Math.cos(-midAngle * RADIAN);
450
451
  const y = cyProp + (middleRadius + labelOffset) * Math.sin(-midAngle * RADIAN);
451
- const d = `M ${points[0].x} ${points[0].y} L ${x} ${y}`;
452
+ const d = `M ${(_a = points[0]) == null ? void 0 : _a.x} ${(_b = points[0]) == null ? void 0 : _b.y} L ${x} ${y}`;
452
453
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
453
454
  import_core6.ui.path,
454
455
  {
@@ -463,19 +464,19 @@ var pieChartLabelLine = ({
463
464
  // src/use-pie-chart.ts
464
465
  var usePieChart = ({
465
466
  data,
466
- withLabels = false,
467
- withLabelLines = false,
468
- labelOffset,
469
- isPercent = false,
470
- strokeWidth = 1,
467
+ endAngle = -270,
471
468
  fillOpacity = 1,
472
469
  innerRadius = "0%",
470
+ isPercent = false,
471
+ labelFormatter,
472
+ labelOffset,
473
+ withLabels = false,
473
474
  outerRadius = withLabels ? "80%" : "100%",
474
475
  paddingAngle = 0,
475
476
  startAngle = 90,
476
- endAngle = -270,
477
- labelFormatter,
477
+ strokeWidth = 1,
478
478
  styles,
479
+ withLabelLines = false,
479
480
  ...rest
480
481
  }) => {
481
482
  var _a, _b;
@@ -550,11 +551,11 @@ var usePieChart = ({
550
551
  );
551
552
  const label = (0, import_react4.useCallback)(
552
553
  (props) => pieChartLabel({
553
- labelOffset,
554
554
  isPercent,
555
- labelProps,
556
555
  labelFormatter,
556
+ labelOffset,
557
557
  styles: styles.label,
558
+ labelProps,
558
559
  ...props
559
560
  }),
560
561
  [isPercent, labelOffset, labelProps, styles.label, labelFormatter]
@@ -563,8 +564,8 @@ var usePieChart = ({
563
564
  (props) => {
564
565
  return pieChartLabelLine({
565
566
  labelOffset,
566
- labelLineProps,
567
567
  styles: styles.labelLine,
568
+ labelLineProps,
568
569
  ...props
569
570
  });
570
571
  },
@@ -587,8 +588,8 @@ var usePieChart = ({
587
588
  dimmed ? dimCellClassName : void 0
588
589
  )(theme);
589
590
  return {
590
- color,
591
- className
591
+ className,
592
+ color
592
593
  };
593
594
  }),
594
595
  [
@@ -613,19 +614,19 @@ var usePieChart = ({
613
614
  ({ className, ...props }, ref = null) => ({
614
615
  ref,
615
616
  className: (0, import_utils8.cx)(className, pieClassName),
616
- dataKey: "value",
617
+ activeShape: activeShapeProps,
617
618
  data,
618
- rootTabIndex: -1,
619
- outerRadius,
620
- innerRadius,
621
- paddingAngle,
622
- startAngle,
619
+ dataKey: "value",
623
620
  endAngle,
621
+ inactiveShape: inactiveShapeProps,
622
+ innerRadius,
624
623
  isAnimationActive: false,
625
624
  label: withLabels ? label : false,
626
625
  labelLine: withLabelLines ? labelLine : false,
627
- activeShape: activeShapeProps,
628
- inactiveShape: inactiveShapeProps,
626
+ outerRadius,
627
+ paddingAngle,
628
+ rootTabIndex: -1,
629
+ startAngle,
629
630
  ...props,
630
631
  ...pieProps
631
632
  }),
@@ -647,8 +648,9 @@ var usePieChart = ({
647
648
  ]
648
649
  );
649
650
  const getCellProps = (0, import_react4.useCallback)(
650
- ({ index, className: classNameProp, ...props }, ref = null) => {
651
- const { className, color } = cellPropList[index];
651
+ ({ className: classNameProp, index, ...props }, ref = null) => {
652
+ var _a2;
653
+ const { className, color } = (_a2 = cellPropList[index]) != null ? _a2 : {};
652
654
  return {
653
655
  ref,
654
656
  className: (0, import_utils8.cx)(classNameProp, className),
@@ -662,10 +664,10 @@ var usePieChart = ({
662
664
  );
663
665
  return {
664
666
  pieVars,
665
- getPieProps,
666
- getPieChartProps,
667
+ setHighlightedArea,
667
668
  getCellProps,
668
- setHighlightedArea
669
+ getPieChartProps,
670
+ getPieProps
669
671
  };
670
672
  };
671
673
 
@@ -676,69 +678,69 @@ var PieChart = (0, import_core8.forwardRef)((props, ref) => {
676
678
  const {
677
679
  className,
678
680
  data,
679
- pieProps,
680
- chartProps,
681
- cellProps,
682
- containerProps,
683
- withTooltip = true,
684
- withLegend = false,
685
- tooltipProps,
686
- tooltipAnimationDuration,
687
- tooltipDataSource = "all",
688
- valueFormatter,
689
- labelFormatter,
690
- unit,
681
+ endAngle,
691
682
  innerRadius,
683
+ isPercent,
684
+ labelFormatter,
685
+ labelOffset,
692
686
  outerRadius,
693
687
  paddingAngle,
694
688
  startAngle,
695
- endAngle,
696
- withLabels,
697
- withLabelLines,
698
- labelOffset,
699
- isPercent,
700
689
  strokeWidth,
690
+ tooltipAnimationDuration,
691
+ tooltipDataSource = "all",
692
+ unit,
693
+ valueFormatter,
694
+ withLabelLines,
695
+ withLabels,
696
+ withLegend = false,
697
+ withTooltip = true,
698
+ cellProps,
699
+ chartProps,
700
+ containerProps,
701
701
  legendProps,
702
+ pieProps,
703
+ tooltipProps,
702
704
  ...rest
703
705
  } = (0, import_core8.omitThemeProps)(mergedProps);
704
706
  const {
705
707
  pieVars,
706
- getPieProps,
707
- getPieChartProps,
708
+ setHighlightedArea,
708
709
  getCellProps,
709
- setHighlightedArea
710
+ getPieChartProps,
711
+ getPieProps
710
712
  } = usePieChart({
711
713
  data,
712
- pieProps,
713
- chartProps,
714
- cellProps,
714
+ endAngle,
715
715
  innerRadius,
716
+ isPercent,
717
+ labelFormatter,
718
+ labelOffset,
716
719
  outerRadius,
717
720
  paddingAngle,
718
721
  startAngle,
719
- endAngle,
720
722
  strokeWidth,
721
- withLabels,
723
+ styles,
722
724
  withLabelLines,
723
- labelOffset,
724
- isPercent,
725
- labelFormatter,
726
- styles
725
+ withLabels,
726
+ cellProps,
727
+ chartProps,
728
+ pieProps
727
729
  });
728
730
  const { getContainerProps } = useChart({ containerProps });
729
- const { tooltipProps: computedTooltipProps, getTooltipProps } = useChartTooltip({
730
- tooltipProps,
731
+ const { getTooltipProps, tooltipProps: computedTooltipProps } = useChartTooltip({
732
+ styles,
731
733
  tooltipAnimationDuration,
732
- styles
734
+ tooltipProps
733
735
  });
734
- const { legendProps: computedLegendProps, getLegendProps } = useChartLegend({
736
+ const { getLegendProps, legendProps: computedLegendProps } = useChartLegend({
735
737
  legendProps
736
738
  });
737
739
  const cells = (0, import_react5.useMemo)(
738
740
  () => data.map(({ name }, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
739
741
  import_recharts.Cell,
740
742
  {
741
- ...getCellProps({ index, className: "ui-pie-chart__cell" })
743
+ ...getCellProps({ className: "ui-pie-chart__cell", index })
742
744
  },
743
745
  `pie-cell-${name}`
744
746
  )),
@@ -793,8 +795,8 @@ var PieChart = (0, import_core8.forwardRef)((props, ref) => {
793
795
  className: "ui-pie-chart__tooltip",
794
796
  label,
795
797
  payload: tooltipDataSource === "segment" ? payload : data,
796
- valueFormatter,
797
798
  unit,
799
+ valueFormatter,
798
800
  ...computedTooltipProps
799
801
  }
800
802
  ),