@mui/x-charts 8.22.0 → 8.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/BarChart/BarElement.js +1 -1
  2. package/BarChart/BarLabel/BarLabel.types.d.ts +3 -3
  3. package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
  4. package/BarChart/BarLabel/BarLabelPlot.d.ts +9 -9
  5. package/BarChart/BarLabel/getBarLabel.d.ts +3 -3
  6. package/BarChart/FocusedBar.js +1 -1
  7. package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +18 -1
  8. package/BarChart/seriesConfig/bar/keyboardFocusHandler.d.ts +3 -0
  9. package/BarChart/seriesConfig/bar/keyboardFocusHandler.js +23 -0
  10. package/BarChart/seriesConfig/bar/seriesProcessor.js +2 -2
  11. package/BarChart/seriesConfig/index.js +3 -1
  12. package/CHANGELOG.md +202 -0
  13. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +2 -3
  14. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +2 -3
  15. package/ChartsBrushOverlay/ChartsBrushOverlay.js +6 -7
  16. package/ChartsSurface/ChartsSurface.js +7 -8
  17. package/ChartsTooltip/ChartsTooltipContainer.js +4 -5
  18. package/ChartsTooltip/useAxisTooltip.js +3 -4
  19. package/ChartsTooltip/useItemTooltip.js +2 -3
  20. package/ChartsWrapper/ChartsWrapper.js +2 -3
  21. package/LineChart/FocusedLineMark.js +1 -1
  22. package/LineChart/LineHighlightPlot.js +1 -2
  23. package/LineChart/MarkPlot.js +1 -2
  24. package/LineChart/seriesConfig/index.js +3 -1
  25. package/LineChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
  26. package/LineChart/seriesConfig/keyboardFocusHandler.js +23 -0
  27. package/LineChart/seriesConfig/seriesProcessor.js +2 -2
  28. package/PieChart/FocusedPieArc.d.ts +2 -0
  29. package/PieChart/FocusedPieArc.js +58 -0
  30. package/PieChart/PieArcPlot.js +3 -31
  31. package/PieChart/PieChart.js +2 -1
  32. package/PieChart/dataTransform/getModifiedArcProperties.d.ts +11 -0
  33. package/PieChart/dataTransform/getModifiedArcProperties.js +42 -0
  34. package/PieChart/dataTransform/useTransformData.js +16 -21
  35. package/PieChart/seriesConfig/index.js +3 -1
  36. package/PieChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
  37. package/PieChart/seriesConfig/keyboardFocusHandler.js +23 -0
  38. package/PieChart/seriesConfig/tooltipPosition.js +11 -20
  39. package/RadarChart/RadarAxis/useRadarAxis.js +1 -2
  40. package/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +3 -4
  41. package/RadarChart/RadarGrid/useRadarGridData.js +1 -2
  42. package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +1 -2
  43. package/ScatterChart/BatchScatter.js +4 -5
  44. package/ScatterChart/FocusedScatterMark.js +1 -1
  45. package/ScatterChart/Scatter.js +1 -2
  46. package/ScatterChart/seriesConfig/index.js +3 -1
  47. package/ScatterChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
  48. package/ScatterChart/seriesConfig/keyboardFocusHandler.js +23 -0
  49. package/esm/BarChart/BarElement.js +1 -1
  50. package/esm/BarChart/BarLabel/BarLabel.types.d.ts +3 -3
  51. package/esm/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
  52. package/esm/BarChart/BarLabel/BarLabelPlot.d.ts +9 -9
  53. package/esm/BarChart/BarLabel/getBarLabel.d.ts +3 -3
  54. package/esm/BarChart/FocusedBar.js +1 -1
  55. package/esm/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +18 -1
  56. package/esm/BarChart/seriesConfig/bar/keyboardFocusHandler.d.ts +3 -0
  57. package/esm/BarChart/seriesConfig/bar/keyboardFocusHandler.js +17 -0
  58. package/esm/BarChart/seriesConfig/bar/seriesProcessor.js +1 -1
  59. package/esm/BarChart/seriesConfig/index.js +3 -1
  60. package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +2 -3
  61. package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +2 -3
  62. package/esm/ChartsBrushOverlay/ChartsBrushOverlay.js +6 -7
  63. package/esm/ChartsSurface/ChartsSurface.js +7 -8
  64. package/esm/ChartsTooltip/ChartsTooltipContainer.js +4 -5
  65. package/esm/ChartsTooltip/useAxisTooltip.js +3 -4
  66. package/esm/ChartsTooltip/useItemTooltip.js +2 -3
  67. package/esm/ChartsWrapper/ChartsWrapper.js +2 -3
  68. package/esm/LineChart/FocusedLineMark.js +1 -1
  69. package/esm/LineChart/LineHighlightPlot.js +1 -2
  70. package/esm/LineChart/MarkPlot.js +1 -2
  71. package/esm/LineChart/seriesConfig/index.js +3 -1
  72. package/esm/LineChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
  73. package/esm/LineChart/seriesConfig/keyboardFocusHandler.js +17 -0
  74. package/esm/LineChart/seriesConfig/seriesProcessor.js +1 -1
  75. package/esm/PieChart/FocusedPieArc.d.ts +2 -0
  76. package/esm/PieChart/FocusedPieArc.js +51 -0
  77. package/esm/PieChart/PieArcPlot.js +5 -33
  78. package/esm/PieChart/PieChart.js +2 -1
  79. package/esm/PieChart/dataTransform/getModifiedArcProperties.d.ts +11 -0
  80. package/esm/PieChart/dataTransform/getModifiedArcProperties.js +36 -0
  81. package/esm/PieChart/dataTransform/useTransformData.js +16 -21
  82. package/esm/PieChart/seriesConfig/index.js +3 -1
  83. package/esm/PieChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
  84. package/esm/PieChart/seriesConfig/keyboardFocusHandler.js +17 -0
  85. package/esm/PieChart/seriesConfig/tooltipPosition.js +11 -20
  86. package/esm/RadarChart/RadarAxis/useRadarAxis.js +1 -2
  87. package/esm/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +3 -4
  88. package/esm/RadarChart/RadarGrid/useRadarGridData.js +1 -2
  89. package/esm/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +1 -2
  90. package/esm/ScatterChart/BatchScatter.js +4 -5
  91. package/esm/ScatterChart/FocusedScatterMark.js +1 -1
  92. package/esm/ScatterChart/Scatter.js +1 -2
  93. package/esm/ScatterChart/seriesConfig/index.js +3 -1
  94. package/esm/ScatterChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
  95. package/esm/ScatterChart/seriesConfig/keyboardFocusHandler.js +17 -0
  96. package/esm/hooks/useAxis.js +8 -9
  97. package/esm/hooks/useAxisSystem.js +2 -3
  98. package/esm/hooks/useBrush.js +1 -2
  99. package/esm/hooks/useChartId.js +1 -2
  100. package/esm/hooks/useDataset.js +1 -2
  101. package/esm/hooks/useDrawingArea.js +1 -2
  102. package/esm/hooks/useFocusedItem.d.ts +1 -12
  103. package/esm/hooks/useFocusedItem.js +3 -11
  104. package/esm/hooks/useInteractionItemProps.d.ts +3 -2
  105. package/esm/hooks/useInteractionItemProps.js +13 -2
  106. package/esm/hooks/useIsItemFocused.d.ts +4 -3
  107. package/esm/hooks/useIsItemFocused.js +2 -3
  108. package/esm/hooks/useIsItemFocusedGetter.d.ts +3 -2
  109. package/esm/hooks/useIsItemFocusedGetter.js +2 -1
  110. package/esm/hooks/useItemHighlighted.js +2 -3
  111. package/esm/hooks/useItemHighlightedGetter.js +2 -3
  112. package/esm/hooks/useLegend.js +1 -2
  113. package/esm/hooks/usePieSeries.js +1 -2
  114. package/esm/hooks/useSeries.js +1 -2
  115. package/esm/hooks/useSkipAnimation.js +1 -2
  116. package/esm/hooks/useZAxis.js +1 -2
  117. package/esm/index.js +1 -1
  118. package/esm/internals/commonNextFocusItem.d.ts +14 -0
  119. package/esm/internals/commonNextFocusItem.js +84 -0
  120. package/esm/internals/index.d.ts +1 -2
  121. package/esm/internals/index.js +1 -2
  122. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -2
  123. package/esm/internals/plugins/corePlugins/useChartSeries/useColorProcessor.js +1 -2
  124. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +1 -2
  125. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +5 -6
  126. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting.js +1 -2
  127. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +5 -6
  128. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +4 -1
  129. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.d.ts +13 -0
  130. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js +1 -0
  131. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +2 -2
  132. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +12 -105
  133. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +5 -31
  134. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +9 -15
  135. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +6 -21
  136. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.d.ts +15 -0
  137. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.js +45 -0
  138. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.d.ts +11 -0
  139. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.js +40 -0
  140. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +6 -7
  141. package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +1 -9
  142. package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +2 -2
  143. package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.types.d.ts +7 -6
  144. package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +2 -0
  145. package/esm/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
  146. package/esm/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +4 -3
  147. package/esm/internals/plugins/models/seriesConfig/tooltipItemPositionGetter.types.d.ts +3 -2
  148. package/esm/internals/seriesHasData.d.ts +4 -0
  149. package/esm/internals/seriesHasData.js +8 -0
  150. package/esm/internals/seriesSelectorOfType.js +2 -3
  151. package/esm/internals/stacking/index.d.ts +1 -0
  152. package/esm/internals/stacking/index.js +1 -0
  153. package/esm/internals/stacking/offset/index.d.ts +1 -0
  154. package/esm/internals/stacking/offset/index.js +1 -0
  155. package/esm/internals/stacking/offset/offsetDiverging.d.ts +8 -0
  156. package/esm/internals/stacking/offset/offsetDiverging.js +47 -0
  157. package/esm/internals/{stackSeries.d.ts → stacking/stackSeries.d.ts} +8 -8
  158. package/esm/internals/{stackSeries.js → stacking/stackSeries.js} +8 -6
  159. package/esm/models/seriesType/config.d.ts +0 -2
  160. package/esm/models/seriesType/index.d.ts +3 -1
  161. package/hooks/useAxis.js +8 -9
  162. package/hooks/useAxisSystem.js +2 -3
  163. package/hooks/useBrush.js +1 -2
  164. package/hooks/useChartId.js +1 -2
  165. package/hooks/useDataset.js +1 -2
  166. package/hooks/useDrawingArea.js +1 -2
  167. package/hooks/useFocusedItem.d.ts +1 -12
  168. package/hooks/useFocusedItem.js +1 -11
  169. package/hooks/useInteractionItemProps.d.ts +3 -2
  170. package/hooks/useInteractionItemProps.js +13 -2
  171. package/hooks/useIsItemFocused.d.ts +4 -3
  172. package/hooks/useIsItemFocused.js +2 -3
  173. package/hooks/useIsItemFocusedGetter.d.ts +3 -2
  174. package/hooks/useIsItemFocusedGetter.js +2 -1
  175. package/hooks/useItemHighlighted.js +2 -3
  176. package/hooks/useItemHighlightedGetter.js +2 -3
  177. package/hooks/useLegend.js +1 -2
  178. package/hooks/usePieSeries.js +1 -2
  179. package/hooks/useSeries.js +1 -2
  180. package/hooks/useSkipAnimation.js +1 -2
  181. package/hooks/useZAxis.js +1 -2
  182. package/index.js +1 -1
  183. package/internals/commonNextFocusItem.d.ts +14 -0
  184. package/internals/commonNextFocusItem.js +93 -0
  185. package/internals/index.d.ts +1 -2
  186. package/internals/index.js +4 -16
  187. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -2
  188. package/internals/plugins/corePlugins/useChartSeries/useColorProcessor.js +1 -2
  189. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +1 -2
  190. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +5 -6
  191. package/internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting.js +1 -2
  192. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +5 -6
  193. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +4 -1
  194. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.d.ts +13 -0
  195. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js +5 -0
  196. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +2 -2
  197. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +11 -104
  198. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +5 -31
  199. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +10 -16
  200. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +6 -21
  201. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.d.ts +15 -0
  202. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.js +51 -0
  203. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.d.ts +11 -0
  204. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.js +46 -0
  205. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +6 -7
  206. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +1 -9
  207. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +1 -1
  208. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.types.d.ts +7 -6
  209. package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +2 -0
  210. package/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
  211. package/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +4 -3
  212. package/internals/plugins/models/seriesConfig/tooltipItemPositionGetter.types.d.ts +3 -2
  213. package/internals/seriesHasData.d.ts +4 -0
  214. package/internals/seriesHasData.js +14 -0
  215. package/internals/seriesSelectorOfType.js +2 -3
  216. package/internals/stacking/index.d.ts +1 -0
  217. package/internals/stacking/index.js +16 -0
  218. package/internals/stacking/offset/index.d.ts +1 -0
  219. package/internals/stacking/offset/index.js +16 -0
  220. package/internals/stacking/offset/offsetDiverging.d.ts +8 -0
  221. package/internals/stacking/offset/offsetDiverging.js +53 -0
  222. package/internals/{stackSeries.d.ts → stacking/stackSeries.d.ts} +8 -8
  223. package/internals/{stackSeries.js → stacking/stackSeries.js} +3 -1
  224. package/models/seriesType/config.d.ts +0 -2
  225. package/models/seriesType/index.d.ts +3 -1
  226. package/package.json +4 -4
  227. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.d.ts +0 -3
  228. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.js +0 -4
  229. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +0 -21
  230. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +0 -92
  231. package/esm/internals/store/useSelector.d.ts +0 -2
  232. package/esm/internals/store/useSelector.js +0 -2
  233. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.d.ts +0 -3
  234. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.js +0 -10
  235. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +0 -21
  236. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +0 -99
  237. package/internals/store/useSelector.d.ts +0 -2
  238. package/internals/store/useSelector.js +0 -8
@@ -67,7 +67,7 @@ export type BarLabelItemProps<V extends BarValueType | null> = Omit<BarLabelOwne
67
67
  * @param {BarLabelContext} context data about the bar.
68
68
  * @returns {string} The formatted label.
69
69
  */
70
- barLabel?: 'value' | ((item: BarItem<V>, context: BarLabelContext) => string | null | undefined);
70
+ barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
71
71
  /**
72
72
  * The placement of the bar label.
73
73
  * It controls whether the label is rendered in the center or outside the bar.
@@ -3,29 +3,29 @@ import { type BarLabelItemProps } from "./BarLabelItem.js";
3
3
  import type { SeriesId } from "../../models/seriesType/common.js";
4
4
  import { type BarSeriesType, type BarValueType } from "../../models/seriesType/bar.js";
5
5
  import { type BarLabelFunction } from "./BarLabel.types.js";
6
- interface BarLabelPlotProps<V extends BarValueType | null = BarValueType | null> {
7
- processedSeries: ProcessedBarLabelSeriesData<V>;
6
+ interface BarLabelPlotProps {
7
+ processedSeries: ProcessedBarLabelSeriesData;
8
8
  className: string;
9
9
  skipAnimation?: boolean;
10
- barLabel?: BarLabelItemProps<V | null>['barLabel'];
10
+ barLabel?: BarLabelItemProps<BarValueType | null>['barLabel'];
11
11
  }
12
- export interface ProcessedBarLabelSeriesData<V extends BarValueType | null> {
12
+ export interface ProcessedBarLabelSeriesData {
13
13
  seriesId: SeriesId;
14
- data: ProcessedBarLabelData<V>[];
15
- barLabel?: 'value' | BarLabelFunction<V>;
14
+ data: ProcessedBarLabelData[];
15
+ barLabel?: 'value' | BarLabelFunction;
16
16
  barLabelPlacement?: BarSeriesType['barLabelPlacement'];
17
17
  layout?: 'vertical' | 'horizontal';
18
18
  xOrigin: number;
19
19
  yOrigin: number;
20
20
  }
21
- export interface ProcessedBarLabelData<V extends BarValueType | null> extends AnimationData {
21
+ export interface ProcessedBarLabelData extends AnimationData {
22
22
  seriesId: SeriesId;
23
23
  dataIndex: number;
24
24
  color: string;
25
- value: V;
25
+ value: BarValueType | null;
26
26
  }
27
27
  /**
28
28
  * @ignore - internal component.
29
29
  */
30
- declare function BarLabelPlot<V extends BarValueType | null = BarValueType | null>(props: BarLabelPlotProps<V>): import("react/jsx-runtime").JSX.Element | null;
30
+ declare function BarLabelPlot(props: BarLabelPlotProps): import("react/jsx-runtime").JSX.Element | null;
31
31
  export { BarLabelPlot };
@@ -1,9 +1,9 @@
1
1
  import { type SeriesId } from "../../models/seriesType/common.js";
2
2
  import { type BarLabelFunction } from "./BarLabel.types.js";
3
3
  import { type BarValueType } from "../../models/seriesType/bar.js";
4
- export declare function getBarLabel<V extends BarValueType | null = BarValueType | null>(options: {
5
- barLabel: 'value' | BarLabelFunction<V>;
6
- value: V;
4
+ export declare function getBarLabel(options: {
5
+ barLabel: 'value' | BarLabelFunction;
6
+ value: BarValueType | null;
7
7
  dataIndex: number;
8
8
  seriesId: SeriesId;
9
9
  height: number;
@@ -19,7 +19,7 @@ export function FocusedBar(props) {
19
19
  yAxis,
20
20
  yAxisIds
21
21
  } = useYAxes();
22
- if (focusedItem === null || focusedItem.seriesType !== 'bar' || !barSeries) {
22
+ if (focusedItem === null || focusedItem.type !== 'bar' || !barSeries) {
23
23
  return null;
24
24
  }
25
25
  const series = barSeries?.series[focusedItem.seriesId];
@@ -1,5 +1,22 @@
1
1
  import { type AllSeriesType } from "../../../models/seriesType/index.js";
2
- export declare function getSeriesWithDefaultValues<T extends 'bar'>(seriesData: AllSeriesType<T>, seriesIndex: number, colors: readonly string[]): AllSeriesType<T> & {
2
+ export declare function getSeriesWithDefaultValues(seriesData: AllSeriesType<'bar'>, seriesIndex: number, colors: readonly string[]): {
3
3
  id: import("../../../index.js").SeriesId;
4
4
  color: string;
5
+ type: "bar";
6
+ data?: ReadonlyArray<import("../../../index.js").BarValueType | null>;
7
+ dataKey?: string;
8
+ label?: string | ((location: "tooltip" | "legend") => string);
9
+ layout?: "horizontal" | "vertical";
10
+ stackOffset?: import("../../../index.js").StackOffsetType;
11
+ minBarSize?: number;
12
+ barLabel?: "value" | ((item: import("../../index.js").BarItem, context: import("../../index.js").BarLabelContext) => string | null | undefined);
13
+ barLabelPlacement?: "center" | "outside";
14
+ valueFormatter?: import("../../../internals/index.js").SeriesValueFormatter<number | null> | undefined;
15
+ highlightScope?: import("../../../index.js").HighlightScope;
16
+ labelMarkType?: import("../../../internals/index.js").ChartsLabelMarkType;
17
+ colorGetter?: ((data: import("../../../internals/index.js").ColorCallbackValue<number | null>) => string) | undefined;
18
+ xAxisId?: import("../../../internals/index.js").AxisId;
19
+ yAxisId?: import("../../../internals/index.js").AxisId;
20
+ stack?: string;
21
+ stackOrder?: import("../../../index.js").StackOrderType;
5
22
  };
@@ -0,0 +1,3 @@
1
+ import type { KeyboardFocusHandler } from "../../../internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js";
2
+ declare const keyboardFocusHandler: KeyboardFocusHandler<'bar', 'bar' | 'line' | 'scatter'>;
3
+ export default keyboardFocusHandler;
@@ -0,0 +1,17 @@
1
+ import { createGetNextIndexFocusedItem, createGetPreviousIndexFocusedItem, createGetNextSeriesFocusedItem, createGetPreviousSeriesFocusedItem } from "../../../internals/commonNextFocusItem.js";
2
+ const outSeriesTypes = new Set(['bar', 'line', 'scatter']);
3
+ const keyboardFocusHandler = event => {
4
+ switch (event.key) {
5
+ case 'ArrowRight':
6
+ return createGetNextIndexFocusedItem(outSeriesTypes);
7
+ case 'ArrowLeft':
8
+ return createGetPreviousIndexFocusedItem(outSeriesTypes);
9
+ case 'ArrowDown':
10
+ return createGetPreviousSeriesFocusedItem(outSeriesTypes);
11
+ case 'ArrowUp':
12
+ return createGetNextSeriesFocusedItem(outSeriesTypes);
13
+ default:
14
+ return null;
15
+ }
16
+ };
17
+ export default keyboardFocusHandler;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
3
3
  import { warnOnce } from '@mui/x-internals/warning';
4
- import { getStackingGroups } from "../../../internals/stackSeries.js";
4
+ import { getStackingGroups } from "../../../internals/stacking/index.js";
5
5
  const barValueFormatter = v => v == null ? '' : v.toLocaleString();
6
6
  const seriesProcessor = (params, dataset) => {
7
7
  const {
@@ -2,6 +2,7 @@ import { getExtremumX, getExtremumY } from "./bar/extremums.js";
2
2
  import seriesProcessor from "./bar/seriesProcessor.js";
3
3
  import legendGetter from "./bar/legend.js";
4
4
  import getColor from "./bar/getColor.js";
5
+ import keyboardFocusHandler from "./bar/keyboardFocusHandler.js";
5
6
  import tooltipGetter, { axisTooltipGetter } from "./bar/tooltip.js";
6
7
  import tooltipItemPositionGetter from "./bar/tooltipPosition.js";
7
8
  import { getSeriesWithDefaultValues } from "./bar/getSeriesWithDefaultValues.js";
@@ -14,5 +15,6 @@ export const barSeriesConfig = {
14
15
  axisTooltipGetter,
15
16
  xExtremumGetter: getExtremumX,
16
17
  yExtremumGetter: getExtremumY,
17
- getSeriesWithDefaultValues
18
+ getSeriesWithDefaultValues,
19
+ keyboardFocusHandler
18
20
  };
@@ -3,7 +3,6 @@
3
3
  import * as React from 'react';
4
4
  import { getValueToPositionMapper } from "../hooks/useScale.js";
5
5
  import { isOrdinalScale } from "../internals/scaleGuards.js";
6
- import { useSelector } from "../internals/store/useSelector.js";
7
6
  import { useStore } from "../internals/store/useStore.js";
8
7
  import { selectorChartsHighlightXAxisValue, selectorChartXAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
9
8
  import { useDrawingArea } from "../hooks/index.js";
@@ -22,8 +21,8 @@ export default function ChartsXHighlight(props) {
22
21
  height
23
22
  } = useDrawingArea();
24
23
  const store = useStore();
25
- const axisXValues = useSelector(store, selectorChartsHighlightXAxisValue);
26
- const xAxes = useSelector(store, selectorChartXAxis);
24
+ const axisXValues = store.use(selectorChartsHighlightXAxisValue);
25
+ const xAxes = store.use(selectorChartXAxis);
27
26
  if (axisXValues.length === 0) {
28
27
  return null;
29
28
  }
@@ -3,7 +3,6 @@
3
3
  import * as React from 'react';
4
4
  import { getValueToPositionMapper } from "../hooks/useScale.js";
5
5
  import { isOrdinalScale } from "../internals/scaleGuards.js";
6
- import { useSelector } from "../internals/store/useSelector.js";
7
6
  import { useStore } from "../internals/store/useStore.js";
8
7
  import { selectorChartsHighlightYAxisValue, selectorChartYAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
9
8
  import { useDrawingArea } from "../hooks/index.js";
@@ -22,8 +21,8 @@ export default function ChartsYHighlight(props) {
22
21
  width
23
22
  } = useDrawingArea();
24
23
  const store = useStore();
25
- const axisYValues = useSelector(store, selectorChartsHighlightYAxisValue);
26
- const yAxes = useSelector(store, selectorChartYAxis);
24
+ const axisYValues = store.use(selectorChartsHighlightYAxisValue);
25
+ const yAxes = store.use(selectorChartYAxis);
27
26
  if (axisYValues.length === 0) {
28
27
  return null;
29
28
  }
@@ -7,7 +7,6 @@ import { useTheme } from '@mui/material/styles';
7
7
  import { brushOverlayClasses } from "./ChartsBrushOverlay.classes.js";
8
8
  import { selectorChartDrawingArea } from "../internals/plugins/corePlugins/useChartDimensions/index.js";
9
9
  import { selectorBrushStartX, selectorBrushStartY, selectorBrushCurrentX, selectorBrushCurrentY, selectorBrushConfig } from "../internals/plugins/featurePlugins/useChartBrush/index.js";
10
- import { useSelector } from "../internals/store/useSelector.js";
11
10
  import { useStore } from "../internals/store/useStore.js";
12
11
  import { jsx as _jsx } from "react/jsx-runtime";
13
12
  function BrushRect(props) {
@@ -23,13 +22,13 @@ function BrushRect(props) {
23
22
  */
24
23
  export function ChartsBrushOverlay(props) {
25
24
  const store = useStore();
26
- const drawingArea = useSelector(store, selectorChartDrawingArea);
25
+ const drawingArea = store.use(selectorChartDrawingArea);
27
26
  const theme = useTheme();
28
- const brushStartX = useSelector(store, selectorBrushStartX);
29
- const brushStartY = useSelector(store, selectorBrushStartY);
30
- const brushCurrentX = useSelector(store, selectorBrushCurrentX);
31
- const brushCurrentY = useSelector(store, selectorBrushCurrentY);
32
- const brushConfig = useSelector(store, selectorBrushConfig);
27
+ const brushStartX = store.use(selectorBrushStartX);
28
+ const brushStartY = store.use(selectorBrushStartY);
29
+ const brushCurrentX = store.use(selectorBrushCurrentX);
30
+ const brushCurrentY = store.use(selectorBrushCurrentY);
31
+ const brushConfig = store.use(selectorBrushConfig);
33
32
  if (brushStartX === null || brushStartY === null || brushCurrentX === null || brushCurrentY === null) {
34
33
  return null;
35
34
  }
@@ -10,7 +10,6 @@ import useForkRef from '@mui/utils/useForkRef';
10
10
  import clsx from 'clsx';
11
11
  import { ChartsAxesGradients } from "../internals/components/ChartsAxesGradients/index.js";
12
12
  import { useSvgRef } from "../hooks/useSvgRef.js";
13
- import { useSelector } from "../internals/store/useSelector.js";
14
13
  import { useStore } from "../internals/store/useStore.js";
15
14
  import { selectorChartPropsHeight, selectorChartPropsWidth, selectorChartSvgWidth, selectorChartSvgHeight } from "../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js";
16
15
  import { selectorChartsHasFocusedItem, selectorChartsIsKeyboardNavigationEnabled } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
@@ -57,13 +56,13 @@ const ChartsSurfaceStyles = styled('svg', {
57
56
  */
58
57
  const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inProps, ref) {
59
58
  const store = useStore();
60
- const svgWidth = useSelector(store, selectorChartSvgWidth);
61
- const svgHeight = useSelector(store, selectorChartSvgHeight);
62
- const propsWidth = useSelector(store, selectorChartPropsWidth);
63
- const propsHeight = useSelector(store, selectorChartPropsHeight);
64
- const isKeyboardNavigationEnabled = useSelector(store, selectorChartsIsKeyboardNavigationEnabled);
65
- const hasFocusedItem = useSelector(store, selectorChartsHasFocusedItem);
66
- const hasZoom = useSelector(store, selectorChartHasZoom);
59
+ const svgWidth = store.use(selectorChartSvgWidth);
60
+ const svgHeight = store.use(selectorChartSvgHeight);
61
+ const propsWidth = store.use(selectorChartPropsWidth);
62
+ const propsHeight = store.use(selectorChartPropsHeight);
63
+ const isKeyboardNavigationEnabled = store.use(selectorChartsIsKeyboardNavigationEnabled);
64
+ const hasFocusedItem = store.use(selectorChartsHasFocusedItem);
65
+ const hasZoom = store.use(selectorChartHasZoom);
67
66
  const svgRef = useSvgRef();
68
67
  const handleRef = useForkRef(svgRef, ref);
69
68
  const themeProps = useThemeProps({
@@ -13,7 +13,6 @@ import NoSsr from '@mui/material/NoSsr';
13
13
  import { rafThrottle } from '@mui/x-internals/rafThrottle';
14
14
  import { useIsFineMainPointer, usePointerType } from "./utils.js";
15
15
  import { useUtilityClasses } from "./chartsTooltipClasses.js";
16
- import { useSelector } from "../internals/store/useSelector.js";
17
16
  import { useStore } from "../internals/store/useStore.js";
18
17
  import { selectorChartsLastInteraction } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
19
18
  import { selectorChartsTooltipItemIsDefined, selectorChartsTooltipItemPosition } from "../internals/plugins/featurePlugins/useChartTooltip/index.js";
@@ -83,11 +82,11 @@ function ChartsTooltipContainer(inProps) {
83
82
  }));
84
83
  const axisSystem = useAxisSystem();
85
84
  const store = useStore();
86
- const shouldPreventBecauseOfBrush = useSelector(store, selectorBrushShouldPreventTooltip);
87
- const isOpen = useSelector(store, getIsOpenSelector(trigger, axisSystem, shouldPreventBecauseOfBrush));
88
- const lastInteraction = useSelector(store, selectorChartsLastInteraction);
85
+ const shouldPreventBecauseOfBrush = store.use(selectorBrushShouldPreventTooltip);
86
+ const isOpen = store.use(getIsOpenSelector(trigger, axisSystem, shouldPreventBecauseOfBrush));
87
+ const lastInteraction = store.use(selectorChartsLastInteraction);
89
88
  const computedAnchor = lastInteraction === 'keyboard' ? 'node' : anchor;
90
- const itemPosition = useSelector(store, trigger === 'item' && computedAnchor === 'node' ? selectorChartsTooltipItemPosition : selectorReturnNull, position);
89
+ const itemPosition = store.use(trigger === 'item' && computedAnchor === 'node' ? selectorChartsTooltipItemPosition : selectorReturnNull, position);
91
90
  React.useEffect(() => {
92
91
  const svgElement = svgRef.current;
93
92
  if (svgElement === null) {
@@ -3,7 +3,6 @@
3
3
  import { useSeries } from "../hooks/useSeries.js";
4
4
  import { useColorProcessor } from "../internals/plugins/corePlugins/useChartSeries/useColorProcessor.js";
5
5
  import { useStore } from "../internals/store/useStore.js";
6
- import { useSelector } from "../internals/store/useSelector.js";
7
6
  import { getLabel } from "../internals/getLabel.js";
8
7
  import { isCartesianSeriesType } from "../internals/isCartesian.js";
9
8
  import { utcFormatter } from "./utils.js";
@@ -43,9 +42,9 @@ export function useAxisTooltip(params = {}) {
43
42
  const defaultYAxis = useYAxis();
44
43
  const defaultRotationAxis = useRotationAxis();
45
44
  const store = useStore();
46
- const tooltipXAxes = useSelector(store, selectorChartsInteractionTooltipXAxes);
47
- const tooltipYAxes = useSelector(store, selectorChartsInteractionTooltipYAxes);
48
- const tooltipRotationAxes = useSelector(store, selectorChartsInteractionTooltipRotationAxes);
45
+ const tooltipXAxes = store.use(selectorChartsInteractionTooltipXAxes);
46
+ const tooltipYAxes = store.use(selectorChartsInteractionTooltipYAxes);
47
+ const tooltipRotationAxes = store.use(selectorChartsInteractionTooltipRotationAxes);
49
48
  const series = useSeries();
50
49
  const {
51
50
  xAxis
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { useSeries } from "../hooks/useSeries.js";
4
4
  import { selectorChartsTooltipItem } from "../internals/plugins/featurePlugins/useChartTooltip/index.js";
5
- import { useSelector } from "../internals/store/useSelector.js";
6
5
  import { useStore } from "../internals/store/useStore.js";
7
6
  import { useRotationAxes, useXAxes, useYAxes } from "../hooks/useAxis.js";
8
7
  import { useZAxes } from "../hooks/useZAxis.js";
@@ -10,8 +9,8 @@ import { selectorChartSeriesConfig } from "../internals/plugins/corePlugins/useC
10
9
  import { isCartesianSeries } from "../internals/isCartesian.js";
11
10
  export function useInternalItemTooltip() {
12
11
  const store = useStore();
13
- const identifier = useSelector(store, selectorChartsTooltipItem);
14
- const seriesConfig = useSelector(store, selectorChartSeriesConfig);
12
+ const identifier = store.use(selectorChartsTooltipItem);
13
+ const seriesConfig = store.use(selectorChartSeriesConfig);
15
14
  const series = useSeries();
16
15
  const {
17
16
  xAxis,
@@ -4,7 +4,6 @@ import { styled } from '@mui/material/styles';
4
4
  import { shouldForwardProp } from '@mui/system/createStyled';
5
5
  import { useChartRootRef } from "../hooks/useChartRootRef.js";
6
6
  import { useStore } from "../internals/store/useStore.js";
7
- import { useSelector } from "../internals/store/useSelector.js";
8
7
  import { selectorChartPropsHeight, selectorChartPropsWidth } from "../internals/plugins/corePlugins/useChartDimensions/index.js";
9
8
  import { chartsToolbarClasses } from "../Toolbar/index.js";
10
9
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -117,8 +116,8 @@ function ChartsWrapper(props) {
117
116
  } = props;
118
117
  const chartRootRef = useChartRootRef();
119
118
  const store = useStore();
120
- const propsWidth = useSelector(store, selectorChartPropsWidth);
121
- const propsHeight = useSelector(store, selectorChartPropsHeight);
119
+ const propsWidth = store.use(selectorChartPropsWidth);
120
+ const propsHeight = store.use(selectorChartPropsHeight);
122
121
  return /*#__PURE__*/_jsx(Root, {
123
122
  ref: chartRootRef,
124
123
  ownerState: props,
@@ -17,7 +17,7 @@ export function FocusedLineMark() {
17
17
  yAxis,
18
18
  yAxisIds
19
19
  } = useYAxes();
20
- if (focusedItem === null || focusedItem.seriesType !== 'line' || !lineSeries) {
20
+ if (focusedItem === null || focusedItem.type !== 'line' || !lineSeries) {
21
21
  return null;
22
22
  }
23
23
  const series = lineSeries?.series[focusedItem.seriesId];
@@ -6,7 +6,6 @@ const _excluded = ["slots", "slotProps"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { useStore } from "../internals/store/useStore.js";
9
- import { useSelector } from "../internals/store/useSelector.js";
10
9
  import { LineHighlightElement } from "./LineHighlightElement.js";
11
10
  import { getValueToPositionMapper } from "../hooks/useScale.js";
12
11
  import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
@@ -45,7 +44,7 @@ function LineHighlightPlot(props) {
45
44
  instance
46
45
  } = useChartContext();
47
46
  const store = useStore();
48
- const highlightedIndexes = useSelector(store, selectorChartsHighlightXAxisIndex);
47
+ const highlightedIndexes = store.use(selectorChartsHighlightXAxisIndex);
49
48
  if (highlightedIndexes.length === 0) {
50
49
  return null;
51
50
  }
@@ -11,7 +11,6 @@ import { MarkElement } from "./MarkElement.js";
11
11
  import { useItemHighlightedGetter, useXAxes, useYAxes } from "../hooks/index.js";
12
12
  import { useInternalIsZoomInteracting } from "../internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting.js";
13
13
  import { selectorChartsHighlightXAxisIndex } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
14
- import { useSelector } from "../internals/store/useSelector.js";
15
14
  import { useChartContext } from "../context/ChartProvider/index.js";
16
15
  import { useMarkPlotData } from "./useMarkPlotData.js";
17
16
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -48,7 +47,7 @@ function MarkPlot(props) {
48
47
  isFaded,
49
48
  isHighlighted
50
49
  } = useItemHighlightedGetter();
51
- const xAxisHighlightIndexes = useSelector(store, selectorChartsHighlightXAxisIndex);
50
+ const xAxisHighlightIndexes = store.use(selectorChartsHighlightXAxisIndex);
52
51
  const highlightedItems = React.useMemo(() => {
53
52
  const rep = {};
54
53
  for (const {
@@ -5,6 +5,7 @@ import legendGetter from "./legend.js";
5
5
  import tooltipGetter, { axisTooltipGetter } from "./tooltip.js";
6
6
  import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
7
7
  import tooltipItemPositionGetter from "./tooltipPosition.js";
8
+ import keyboardFocusHandler from "./keyboardFocusHandler.js";
8
9
  export const lineSeriesConfig = {
9
10
  colorProcessor: getColor,
10
11
  seriesProcessor,
@@ -14,5 +15,6 @@ export const lineSeriesConfig = {
14
15
  axisTooltipGetter,
15
16
  xExtremumGetter: getExtremumX,
16
17
  yExtremumGetter: getExtremumY,
17
- getSeriesWithDefaultValues
18
+ getSeriesWithDefaultValues,
19
+ keyboardFocusHandler
18
20
  };
@@ -0,0 +1,3 @@
1
+ import type { KeyboardFocusHandler } from "../../internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js";
2
+ declare const keyboardFocusHandler: KeyboardFocusHandler<'line', 'bar' | 'line' | 'scatter'>;
3
+ export default keyboardFocusHandler;
@@ -0,0 +1,17 @@
1
+ import { createGetNextIndexFocusedItem, createGetPreviousIndexFocusedItem, createGetNextSeriesFocusedItem, createGetPreviousSeriesFocusedItem } from "../../internals/commonNextFocusItem.js";
2
+ const outSeriesTypes = new Set(['bar', 'line', 'scatter']);
3
+ const keyboardFocusHandler = event => {
4
+ switch (event.key) {
5
+ case 'ArrowRight':
6
+ return createGetNextIndexFocusedItem(outSeriesTypes);
7
+ case 'ArrowLeft':
8
+ return createGetPreviousIndexFocusedItem(outSeriesTypes);
9
+ case 'ArrowDown':
10
+ return createGetPreviousSeriesFocusedItem(outSeriesTypes);
11
+ case 'ArrowUp':
12
+ return createGetNextSeriesFocusedItem(outSeriesTypes);
13
+ default:
14
+ return null;
15
+ }
16
+ };
17
+ export default keyboardFocusHandler;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
3
3
  import { warnOnce } from '@mui/x-internals/warning';
4
- import { getStackingGroups } from "../../internals/stackSeries.js";
4
+ import { getStackingGroups } from "../../internals/stacking/index.js";
5
5
  const seriesProcessor = (params, dataset) => {
6
6
  const {
7
7
  seriesOrder,
@@ -0,0 +1,2 @@
1
+ import { type PieArcProps } from "./PieArc.js";
2
+ export declare function FocusedPieArc(props: Partial<Omit<PieArcProps, 'startAngle' | 'endAngle' | 'id' | 'dataIndex' | 'isFaded' | 'isHighlighted' | 'isFocused'>>): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,51 @@
1
+ 'use client';
2
+
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import * as React from 'react';
5
+ import { useTheme } from '@mui/material/styles';
6
+ import { useFocusedItem } from "../hooks/useFocusedItem.js";
7
+ import { usePieSeriesContext, usePieSeriesLayout } from "../hooks/usePieSeries.js";
8
+ import { PieArc, pieArcClasses } from "./PieArc.js";
9
+ import { useItemHighlighted } from "../hooks/useItemHighlighted.js";
10
+ import { getModifiedArcProperties } from "./dataTransform/getModifiedArcProperties.js";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ export function FocusedPieArc(props) {
13
+ const theme = useTheme();
14
+ const focusedItem = useFocusedItem();
15
+ const pieSeriesLayout = usePieSeriesLayout();
16
+ const {
17
+ isHighlighted,
18
+ isFaded
19
+ } = useItemHighlighted(focusedItem);
20
+ const pieSeries = usePieSeriesContext();
21
+ if (focusedItem === null || focusedItem.type !== 'pie' || !pieSeries) {
22
+ return null;
23
+ }
24
+ const series = pieSeries?.series[focusedItem.seriesId];
25
+ const {
26
+ center,
27
+ radius
28
+ } = pieSeriesLayout[focusedItem.seriesId];
29
+ if (!series || !center || !radius) {
30
+ return null;
31
+ }
32
+ const item = series.data[focusedItem.dataIndex];
33
+ const arcSizes = getModifiedArcProperties(series, pieSeriesLayout[focusedItem.seriesId], isHighlighted, isFaded);
34
+ return /*#__PURE__*/_jsx(PieArc, _extends({
35
+ transform: `translate(${pieSeriesLayout[series.id].center.x}, ${pieSeriesLayout[series.id].center.y})`,
36
+ startAngle: item.startAngle,
37
+ endAngle: item.endAngle,
38
+ color: "transparent",
39
+ pointerEvents: "none",
40
+ skipInteraction: true,
41
+ skipAnimation: true,
42
+ stroke: (theme.vars ?? theme).palette.text.primary,
43
+ id: series.id,
44
+ className: pieArcClasses.focusIndicator,
45
+ dataIndex: focusedItem.dataIndex,
46
+ isFaded: false,
47
+ isHighlighted: false,
48
+ isFocused: false,
49
+ strokeWidth: 3
50
+ }, arcSizes, props));
51
+ }
@@ -5,11 +5,9 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
5
5
  const _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRadius", "paddingAngle", "id", "highlighted", "faded", "data", "onItemClick", "skipAnimation"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
- import { useTheme } from '@mui/material/styles';
9
- import { useFocusedItem } from "../hooks/useFocusedItem.js";
10
- import { PieArc, pieArcClasses } from "./PieArc.js";
8
+ import { PieArc } from "./PieArc.js";
11
9
  import { useTransformData } from "./dataTransform/useTransformData.js";
12
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
13
11
  function PieArcPlot(props) {
14
12
  const {
15
13
  slots,
@@ -28,7 +26,6 @@ function PieArcPlot(props) {
28
26
  skipAnimation
29
27
  } = props,
30
28
  other = _objectWithoutPropertiesLoose(props, _excluded);
31
- const theme = useTheme();
32
29
  const transformedData = useTransformData({
33
30
  innerRadius,
34
31
  outerRadius,
@@ -39,18 +36,12 @@ function PieArcPlot(props) {
39
36
  faded,
40
37
  data
41
38
  });
42
- const {
43
- dataIndex,
44
- seriesId,
45
- seriesType
46
- } = useFocusedItem() ?? {};
47
- const focusedItem = dataIndex !== undefined && seriesId === id && seriesType === 'pie' ? transformedData[dataIndex] : null;
48
39
  if (data.length === 0) {
49
40
  return null;
50
41
  }
51
42
  const Arc = slots?.pieArc ?? PieArc;
52
- return /*#__PURE__*/_jsxs("g", _extends({}, other, {
53
- children: [transformedData.map((item, index) => /*#__PURE__*/_jsx(Arc, _extends({
43
+ return /*#__PURE__*/_jsx("g", _extends({}, other, {
44
+ children: transformedData.map((item, index) => /*#__PURE__*/_jsx(Arc, _extends({
54
45
  startAngle: item.startAngle,
55
46
  endAngle: item.endAngle,
56
47
  paddingAngle: item.paddingAngle,
@@ -71,26 +62,7 @@ function PieArcPlot(props) {
71
62
  dataIndex: index
72
63
  }, item);
73
64
  })
74
- }, slotProps?.pieArc), item.dataIndex)), focusedItem && /*#__PURE__*/_jsx(Arc, {
75
- startAngle: focusedItem.startAngle,
76
- endAngle: focusedItem.endAngle,
77
- paddingAngle: focusedItem.paddingAngle,
78
- innerRadius: focusedItem.innerRadius,
79
- color: "transparent",
80
- pointerEvents: "none",
81
- skipInteraction: true,
82
- outerRadius: focusedItem.outerRadius,
83
- cornerRadius: focusedItem.cornerRadius,
84
- skipAnimation: true,
85
- stroke: (theme.vars ?? theme).palette.text.primary,
86
- id: id,
87
- className: pieArcClasses.focusIndicator,
88
- dataIndex: focusedItem.dataIndex,
89
- isFaded: false,
90
- isHighlighted: false,
91
- isFocused: false,
92
- strokeWidth: 3
93
- })]
65
+ }, slotProps?.pieArc), item.dataIndex))
94
66
  }));
95
67
  }
96
68
  process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
@@ -17,6 +17,7 @@ import { useChartContainerProps } from "../ChartContainer/useChartContainerProps
17
17
  import { ChartsWrapper } from "../ChartsWrapper/index.js";
18
18
  import { PIE_CHART_PLUGINS } from "./PieChart.plugins.js";
19
19
  import { defaultizeMargin } from "../internals/defaultizeMargin.js";
20
+ import { FocusedPieArc } from "./FocusedPieArc.js";
20
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
21
22
  /**
22
23
  * Demos:
@@ -88,7 +89,7 @@ const PieChart = /*#__PURE__*/React.forwardRef(function PieChart(inProps, ref) {
88
89
  slots: slots,
89
90
  slotProps: slotProps,
90
91
  onItemClick: onItemClick
91
- }), /*#__PURE__*/_jsx(ChartsOverlay, {
92
+ }), /*#__PURE__*/_jsx(FocusedPieArc, {}), /*#__PURE__*/_jsx(ChartsOverlay, {
92
93
  loading: loading,
93
94
  slots: slots,
94
95
  slotProps: slotProps
@@ -0,0 +1,11 @@
1
+ import type { DefaultizedPieSeriesType, PieSeriesLayout } from "../../models/seriesType/pie.js";
2
+ /**
3
+ * Function that returns arc properties after applying transformation from highlight/fade states.
4
+ */
5
+ export declare function getModifiedArcProperties(seriesDef: Pick<DefaultizedPieSeriesType, 'cornerRadius' | 'paddingAngle' | 'id' | 'highlighted' | 'faded' | 'data'>, seriesLayout: Pick<PieSeriesLayout, 'radius'>, isHighlighted: boolean, isFaded: boolean): {
6
+ paddingAngle: number;
7
+ innerRadius: number;
8
+ outerRadius: number;
9
+ cornerRadius: number;
10
+ arcLabelRadius: number;
11
+ };
@@ -0,0 +1,36 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import { deg2rad } from "../../internals/angleConversion.js";
3
+
4
+ /**
5
+ * Function that returns arc properties after applying transformation from highlight/fade states.
6
+ */
7
+ export function getModifiedArcProperties(seriesDef, seriesLayout, isHighlighted, isFaded) {
8
+ const {
9
+ faded,
10
+ highlighted,
11
+ paddingAngle: basePaddingAngle = 0,
12
+ cornerRadius: baseCornerRadius = 0
13
+ } = seriesDef;
14
+ const {
15
+ radius: {
16
+ inner: baseInnerRadius = 0,
17
+ label: baseArcLabelRadius,
18
+ outer: baseOuterRadius
19
+ }
20
+ } = seriesLayout;
21
+ const attributesOverride = _extends({
22
+ additionalRadius: 0
23
+ }, isFaded && faded || isHighlighted && highlighted || {});
24
+ const paddingAngle = Math.max(0, deg2rad(attributesOverride.paddingAngle ?? basePaddingAngle));
25
+ const innerRadius = Math.max(0, attributesOverride.innerRadius ?? baseInnerRadius);
26
+ const outerRadius = Math.max(0, attributesOverride.outerRadius ?? baseOuterRadius + attributesOverride.additionalRadius);
27
+ const cornerRadius = attributesOverride.cornerRadius ?? baseCornerRadius;
28
+ const arcLabelRadius = attributesOverride.arcLabelRadius ?? baseArcLabelRadius ?? (innerRadius + outerRadius) / 2;
29
+ return {
30
+ paddingAngle,
31
+ innerRadius,
32
+ outerRadius,
33
+ cornerRadius,
34
+ arcLabelRadius
35
+ };
36
+ }