@mui/x-charts 9.10.1 → 9.11.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 (177) hide show
  1. package/BarChart/BarChart.js +4 -2
  2. package/BarChart/BarChart.mjs +4 -2
  3. package/BarChart/BarPlot.d.mts +3 -3
  4. package/BarChart/BarPlot.d.ts +3 -3
  5. package/BarChart/BarPlot.js +1 -1
  6. package/BarChart/BarPlot.mjs +1 -1
  7. package/BarChart/BatchBarPlot/BatchBarPlot.d.mts +2 -2
  8. package/BarChart/BatchBarPlot/BatchBarPlot.d.ts +2 -2
  9. package/BarChart/IndividualBarPlot.d.mts +2 -2
  10. package/BarChart/IndividualBarPlot.d.ts +2 -2
  11. package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.mts +4 -4
  12. package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +4 -4
  13. package/BarChart/useRegisterItemClickHandlers.d.mts +2 -1
  14. package/BarChart/useRegisterItemClickHandlers.d.ts +2 -1
  15. package/BarChart/useRegisterItemClickHandlers.js +8 -0
  16. package/BarChart/useRegisterItemClickHandlers.mjs +8 -1
  17. package/CHANGELOG.md +118 -0
  18. package/ChartsContainer/ChartsContainer.js +4 -2
  19. package/ChartsContainer/ChartsContainer.mjs +4 -2
  20. package/ChartsDataProvider/ChartsDataProvider.js +3 -1
  21. package/ChartsDataProvider/ChartsDataProvider.mjs +3 -1
  22. package/ChartsRadialDataProvider/ChartsRadialDataProvider.js +3 -1
  23. package/ChartsRadialDataProvider/ChartsRadialDataProvider.mjs +3 -1
  24. package/ChartsXAxis/useAxisTicksProps.d.mts +101 -101
  25. package/ChartsXAxis/useAxisTicksProps.d.ts +101 -101
  26. package/ChartsYAxis/useAxisTicksProps.d.mts +101 -101
  27. package/ChartsYAxis/useAxisTicksProps.d.ts +101 -101
  28. package/LineChart/AreaPlot.d.mts +3 -2
  29. package/LineChart/AreaPlot.d.ts +3 -2
  30. package/LineChart/AreaPlot.js +8 -2
  31. package/LineChart/AreaPlot.mjs +9 -3
  32. package/LineChart/LineChart.js +2 -1
  33. package/LineChart/LineChart.mjs +2 -1
  34. package/LineChart/LinePlot.d.mts +3 -2
  35. package/LineChart/LinePlot.d.ts +3 -2
  36. package/LineChart/LinePlot.js +2 -2
  37. package/LineChart/LinePlot.mjs +3 -3
  38. package/LineChart/MarkPlot.d.mts +5 -4
  39. package/LineChart/MarkPlot.d.ts +5 -4
  40. package/LineChart/MarkPlot.js +17 -8
  41. package/LineChart/MarkPlot.mjs +17 -8
  42. package/LineChart/useLineItemClickHandler.d.mts +25 -1
  43. package/LineChart/useLineItemClickHandler.d.ts +25 -1
  44. package/LineChart/useLineItemClickHandler.js +48 -1
  45. package/LineChart/useLineItemClickHandler.mjs +47 -1
  46. package/PieChart/PieArcPlot.d.mts +3 -2
  47. package/PieChart/PieArcPlot.d.ts +3 -2
  48. package/PieChart/PieArcPlot.js +16 -1
  49. package/PieChart/PieArcPlot.mjs +16 -1
  50. package/PieChart/PieChart.js +3 -1
  51. package/PieChart/PieChart.mjs +3 -1
  52. package/PieChart/PiePlot.js +1 -1
  53. package/PieChart/PiePlot.mjs +1 -1
  54. package/README.md +1 -11
  55. package/RadarChart/RadarAxis/RadarAxis.utils.d.mts +1 -1
  56. package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +1 -1
  57. package/RadarChart/RadarChart.js +3 -1
  58. package/RadarChart/RadarChart.mjs +3 -1
  59. package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +3 -1
  60. package/RadarChart/RadarSeriesPlot/RadarSeriesArea.mjs +3 -1
  61. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +4 -1
  62. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.mjs +4 -1
  63. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.mts +5 -4
  64. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.ts +5 -4
  65. package/RadarChart/RadarSeriesPlot/useRegisterRadarItemActivation.d.mts +15 -0
  66. package/RadarChart/RadarSeriesPlot/useRegisterRadarItemActivation.d.ts +15 -0
  67. package/RadarChart/RadarSeriesPlot/useRegisterRadarItemActivation.js +32 -0
  68. package/RadarChart/RadarSeriesPlot/useRegisterRadarItemActivation.mjs +26 -0
  69. package/RadarChart/useRadarChartProps.js +5 -1
  70. package/RadarChart/useRadarChartProps.mjs +5 -1
  71. package/ScatterChart/Scatter.d.mts +3 -2
  72. package/ScatterChart/Scatter.d.ts +3 -2
  73. package/ScatterChart/Scatter.js +10 -1
  74. package/ScatterChart/Scatter.mjs +10 -1
  75. package/ScatterChart/ScatterChart.js +1 -0
  76. package/ScatterChart/ScatterChart.mjs +1 -0
  77. package/ScatterChart/async/ScatterAsync.js +9 -0
  78. package/ScatterChart/async/ScatterAsync.mjs +9 -0
  79. package/SparkLineChart/SparkLineChart.js +2 -1
  80. package/SparkLineChart/SparkLineChart.mjs +2 -1
  81. package/Toolbar/ToolbarButton.js +1 -1
  82. package/Toolbar/ToolbarButton.mjs +1 -1
  83. package/hooks/useFocusedItem.d.mts +1 -1
  84. package/hooks/useFocusedItem.d.ts +1 -1
  85. package/hooks/useItemHighlightStateGetter.d.mts +1 -1
  86. package/hooks/useItemHighlightStateGetter.d.ts +1 -1
  87. package/index.js +1 -1
  88. package/index.mjs +1 -1
  89. package/internals/createCommonKeyboardFocusHandler.d.mts +2 -2
  90. package/internals/createCommonKeyboardFocusHandler.d.ts +2 -2
  91. package/internals/index.d.mts +1 -0
  92. package/internals/index.d.ts +1 -0
  93. package/internals/index.js +8 -0
  94. package/internals/index.mjs +1 -0
  95. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.mts +8 -1
  96. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +8 -1
  97. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +11 -3
  98. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.mjs +11 -3
  99. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.mts +1 -0
  100. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +1 -0
  101. package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemWithData.types.d.mts +12 -0
  102. package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemWithData.types.d.ts +12 -0
  103. package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemWithData.types.js +5 -0
  104. package/internals/plugins/corePlugins/useChartSeriesConfig/types/getItemWithData.types.mjs +1 -0
  105. package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.mts +1 -0
  106. package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.ts +1 -0
  107. package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.js +11 -0
  108. package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.mjs +1 -0
  109. package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.mts +6 -0
  110. package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.ts +6 -0
  111. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisClickPayload.d.mts +21 -0
  112. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisClickPayload.d.ts +21 -0
  113. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisClickPayload.js +46 -0
  114. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisClickPayload.mjs +40 -0
  115. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +13 -31
  116. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.mjs +13 -31
  117. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.mts +2 -2
  118. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -2
  119. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +11 -11
  120. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +11 -11
  121. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.mts +4 -4
  122. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +4 -4
  123. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +19 -0
  124. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.mjs +19 -0
  125. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.mts +5 -3
  126. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.ts +5 -3
  127. package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.js +15 -0
  128. package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.mjs +14 -0
  129. package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.d.mts +5 -2
  130. package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.d.ts +5 -2
  131. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.mts +2 -1
  132. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +2 -1
  133. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +10 -2
  134. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.mjs +2 -1
  135. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/itemActivation.d.mts +13 -0
  136. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/itemActivation.d.ts +13 -0
  137. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/itemActivation.js +39 -0
  138. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/itemActivation.mjs +32 -0
  139. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +47 -7
  140. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.mjs +47 -7
  141. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.mts +3 -0
  142. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +3 -0
  143. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +3 -1
  144. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.mjs +2 -0
  145. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.mts +39 -2
  146. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +39 -2
  147. package/internals/plugins/featurePlugins/useChartPolarAxis/getPolarAxisClickPayload.d.mts +27 -0
  148. package/internals/plugins/featurePlugins/useChartPolarAxis/getPolarAxisClickPayload.d.ts +27 -0
  149. package/internals/plugins/featurePlugins/useChartPolarAxis/getPolarAxisClickPayload.js +36 -0
  150. package/internals/plugins/featurePlugins/useChartPolarAxis/getPolarAxisClickPayload.mjs +30 -0
  151. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +19 -20
  152. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.mjs +19 -20
  153. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.mts +2 -2
  154. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +2 -2
  155. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.mts +1 -1
  156. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +1 -1
  157. package/internals/seriesSelectorOfType.d.mts +4 -4
  158. package/internals/seriesSelectorOfType.d.ts +4 -4
  159. package/internals/useRegisterItemActivation.d.mts +23 -0
  160. package/internals/useRegisterItemActivation.d.ts +23 -0
  161. package/internals/useRegisterItemActivation.js +53 -0
  162. package/internals/useRegisterItemActivation.mjs +46 -0
  163. package/models/axis.d.mts +1 -1
  164. package/models/axis.d.ts +1 -1
  165. package/models/events.d.mts +11 -0
  166. package/models/events.d.ts +11 -0
  167. package/models/events.js +5 -0
  168. package/models/events.mjs +1 -0
  169. package/models/index.d.mts +1 -0
  170. package/models/index.d.ts +1 -0
  171. package/moduleAugmentation/barChartBatchRendererOnItemClick.d.mts +3 -4
  172. package/moduleAugmentation/barChartBatchRendererOnItemClick.d.ts +3 -4
  173. package/moduleAugmentation/keyboardActivation.d.mts +7 -0
  174. package/moduleAugmentation/keyboardActivation.d.ts +7 -0
  175. package/moduleAugmentation/keyboardActivation.js +8 -0
  176. package/moduleAugmentation/keyboardActivation.mjs +2 -0
  177. package/package.json +18 -4
@@ -14,6 +14,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
14
14
  var _styles = require("@mui/material/styles");
15
15
  var _PieArc = require("./PieArc");
16
16
  var _useTransformData = require("./dataTransform/useTransformData");
17
+ var _useRegisterItemActivation = require("../internals/useRegisterItemActivation");
17
18
  var _jsxRuntime = require("react/jsx-runtime");
18
19
  const _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRadius", "paddingAngle", "seriesId", "highlighted", "faded", "data", "onItemClick", "skipAnimation"];
19
20
  const PieArcPlotRoot = (0, _styles.styled)('g', {
@@ -48,6 +49,20 @@ function PieArcPlot(props) {
48
49
  faded,
49
50
  data
50
51
  });
52
+ (0, _useRegisterItemActivation.useRegisterItemActivation)({
53
+ type: 'pie',
54
+ seriesId
55
+ }, onItemClick && ((event, focusedItem) => {
56
+ const item = transformedData[focusedItem.dataIndex];
57
+ if (item === undefined) {
58
+ return;
59
+ }
60
+ onItemClick(event, {
61
+ type: 'pie',
62
+ seriesId,
63
+ dataIndex: focusedItem.dataIndex
64
+ }, item);
65
+ }));
51
66
  if (data.length === 0) {
52
67
  return null;
53
68
  }
@@ -137,7 +152,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes /* remove-proptypes
137
152
  innerRadius: _propTypes.default.number,
138
153
  /**
139
154
  * Callback fired when a pie item is clicked.
140
- * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
155
+ * @param {ChartsActivationEvent<SVGPathElement>} event The event source of the callback.
141
156
  * @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
142
157
  * @param {DefaultizedPieValueType} item The pie item.
143
158
  */
@@ -8,6 +8,7 @@ import PropTypes from 'prop-types';
8
8
  import { styled } from '@mui/material/styles';
9
9
  import { PieArc } from "./PieArc.mjs";
10
10
  import { useTransformData } from "./dataTransform/useTransformData.mjs";
11
+ import { useRegisterItemActivation } from "../internals/useRegisterItemActivation.mjs";
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  const PieArcPlotRoot = styled('g', {
13
14
  name: 'MuiPieArcPlot',
@@ -41,6 +42,20 @@ function PieArcPlot(props) {
41
42
  faded,
42
43
  data
43
44
  });
45
+ useRegisterItemActivation({
46
+ type: 'pie',
47
+ seriesId
48
+ }, onItemClick && ((event, focusedItem) => {
49
+ const item = transformedData[focusedItem.dataIndex];
50
+ if (item === undefined) {
51
+ return;
52
+ }
53
+ onItemClick(event, {
54
+ type: 'pie',
55
+ seriesId,
56
+ dataIndex: focusedItem.dataIndex
57
+ }, item);
58
+ }));
44
59
  if (data.length === 0) {
45
60
  return null;
46
61
  }
@@ -130,7 +145,7 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes /* remove-proptypes
130
145
  innerRadius: PropTypes.number,
131
146
  /**
132
147
  * Callback fired when a pie item is clicked.
133
- * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
148
+ * @param {ChartsActivationEvent<SVGPathElement>} event The event source of the callback.
134
149
  * @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
135
150
  * @param {DefaultizedPieValueType} item The pie item.
136
151
  */
@@ -140,7 +140,9 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes /* remove-proptypes *
140
140
  /**
141
141
  * Options to enable features planned for the next major.
142
142
  */
143
- experimentalFeatures: _propTypes.default.object,
143
+ experimentalFeatures: _propTypes.default.shape({
144
+ keyboardActivation: _propTypes.default.bool
145
+ }),
144
146
  /**
145
147
  * The height of the chart in px. If not defined, it takes the height of the parent element.
146
148
  */
@@ -133,7 +133,9 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes /* remove-proptypes *
133
133
  /**
134
134
  * Options to enable features planned for the next major.
135
135
  */
136
- experimentalFeatures: PropTypes.object,
136
+ experimentalFeatures: PropTypes.shape({
137
+ keyboardActivation: PropTypes.bool
138
+ }),
137
139
  /**
138
140
  * The height of the chart in px. If not defined, it takes the height of the parent element.
139
141
  */
@@ -110,7 +110,7 @@ process.env.NODE_ENV !== "production" ? PiePlot.propTypes /* remove-proptypes */
110
110
  className: _propTypes.default.string,
111
111
  /**
112
112
  * Callback fired when a pie item is clicked.
113
- * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
113
+ * @param {ChartsActivationEvent<SVGPathElement>} event The event source of the callback.
114
114
  * @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
115
115
  * @param {DefaultizedPieValueType} item The pie item.
116
116
  */
@@ -104,7 +104,7 @@ process.env.NODE_ENV !== "production" ? PiePlot.propTypes /* remove-proptypes */
104
104
  className: PropTypes.string,
105
105
  /**
106
106
  * Callback fired when a pie item is clicked.
107
- * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
107
+ * @param {ChartsActivationEvent<SVGPathElement>} event The event source of the callback.
108
108
  * @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
109
109
  * @param {DefaultizedPieValueType} item The pie item.
110
110
  */
package/README.md CHANGED
@@ -8,17 +8,7 @@ It's part of [MUI X](https://mui.com/x/), an open-core extension of our Core li
8
8
  Install the package in your project directory with:
9
9
 
10
10
  ```bash
11
- npm install @mui/x-charts
12
- ```
13
-
14
- This component has the following peer dependencies that you need to install as well.
15
-
16
- ```json
17
- "peerDependencies": {
18
- "@mui/material": "^5.15.14 || ^6.0.0 || ^7.0.0",
19
- "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
20
- "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
21
- },
11
+ npm install @mui/x-charts @mui/material @emotion/react @emotion/styled
22
12
  ```
23
13
 
24
14
  ## Documentation
@@ -5,11 +5,11 @@ interface GetLabelAttributesParams extends Required<Pick<RadarAxisProps, 'labelO
5
5
  angle: number;
6
6
  }
7
7
  export declare function getLabelAttributes(params: GetLabelAttributesParams): {
8
+ transform?: undefined;
8
9
  x: number;
9
10
  y: number;
10
11
  textAnchor: "end" | "inherit" | "middle" | "start" | undefined;
11
12
  dominantBaseline: "alphabetic" | "auto" | "central" | "hanging" | "ideographic" | "inherit" | "mathematical" | "middle" | "no-change" | "reset-size" | "text-after-edge" | "text-before-edge" | "use-script" | undefined;
12
- transform?: undefined;
13
13
  } | {
14
14
  x: number;
15
15
  y: number;
@@ -5,11 +5,11 @@ interface GetLabelAttributesParams extends Required<Pick<RadarAxisProps, 'labelO
5
5
  angle: number;
6
6
  }
7
7
  export declare function getLabelAttributes(params: GetLabelAttributesParams): {
8
+ transform?: undefined;
8
9
  x: number;
9
10
  y: number;
10
11
  textAnchor: "end" | "inherit" | "middle" | "start" | undefined;
11
12
  dominantBaseline: "alphabetic" | "auto" | "central" | "hanging" | "ideographic" | "inherit" | "mathematical" | "middle" | "no-change" | "reset-size" | "text-after-edge" | "text-before-edge" | "use-script" | undefined;
12
- transform?: undefined;
13
13
  } | {
14
14
  x: number;
15
15
  y: number;
@@ -102,7 +102,9 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes /* remove-proptypes
102
102
  /**
103
103
  * Options to enable features planned for the next major.
104
104
  */
105
- experimentalFeatures: _propTypes.default.object,
105
+ experimentalFeatures: _propTypes.default.shape({
106
+ keyboardActivation: _propTypes.default.bool
107
+ }),
106
108
  /**
107
109
  * The height of the chart in px. If not defined, it takes the height of the parent element.
108
110
  */
@@ -95,7 +95,9 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes /* remove-proptypes
95
95
  /**
96
96
  * Options to enable features planned for the next major.
97
97
  */
98
- experimentalFeatures: PropTypes.object,
98
+ experimentalFeatures: PropTypes.shape({
99
+ keyboardActivation: PropTypes.bool
100
+ }),
99
101
  /**
100
102
  * The height of the chart in px. If not defined, it takes the height of the parent element.
101
103
  */
@@ -17,6 +17,7 @@ var _radarClasses = require("../radarClasses");
17
17
  var _useItemHighlightStateGetter = require("../../hooks/useItemHighlightStateGetter");
18
18
  var _useInteractionAllItemProps = require("./useInteractionAllItemProps");
19
19
  var _useRadarRotationIndex = require("./useRadarRotationIndex");
20
+ var _useRegisterRadarItemActivation = require("./useRegisterRadarItemActivation");
20
21
  var _jsxRuntime = require("react/jsx-runtime");
21
22
  const _excluded = ["seriesId", "onItemClick", "classes"];
22
23
  function getPathProps(params) {
@@ -58,6 +59,7 @@ function RadarSeriesArea(props) {
58
59
  const interactionProps = (0, _useInteractionAllItemProps.useInteractionAllItemProps)(seriesCoordinates);
59
60
  const getHighlightState = (0, _useItemHighlightStateGetter.useItemHighlightStateGetter)();
60
61
  const classes = (0, _radarClasses.useUtilityClasses)(inClasses);
62
+ (0, _useRegisterRadarItemActivation.useRegisterRadarItemActivation)(seriesId, onItemClick, _useRegisterRadarItemActivation.RADAR_ACTIVATION_PRIORITY.area);
61
63
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
62
64
  children: seriesCoordinates?.map(({
63
65
  seriesId: id,
@@ -104,7 +106,7 @@ process.env.NODE_ENV !== "production" ? RadarSeriesArea.propTypes /* remove-prop
104
106
  className: _propTypes.default.string,
105
107
  /**
106
108
  * Callback fired when an area is clicked.
107
- * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
109
+ * @param {ChartsActivationEvent<SVGElement>} event The event source of the callback.
108
110
  * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
109
111
  */
110
112
  onItemClick: _propTypes.default.func,
@@ -9,6 +9,7 @@ import { useUtilityClasses } from "../radarClasses.mjs";
9
9
  import { useItemHighlightStateGetter } from "../../hooks/useItemHighlightStateGetter.mjs";
10
10
  import { useInteractionAllItemProps } from "./useInteractionAllItemProps.mjs";
11
11
  import { useRadarRotationIndex } from "./useRadarRotationIndex.mjs";
12
+ import { RADAR_ACTIVATION_PRIORITY, useRegisterRadarItemActivation } from "./useRegisterRadarItemActivation.mjs";
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  export function getPathProps(params) {
14
15
  const {
@@ -49,6 +50,7 @@ function RadarSeriesArea(props) {
49
50
  const interactionProps = useInteractionAllItemProps(seriesCoordinates);
50
51
  const getHighlightState = useItemHighlightStateGetter();
51
52
  const classes = useUtilityClasses(inClasses);
53
+ useRegisterRadarItemActivation(seriesId, onItemClick, RADAR_ACTIVATION_PRIORITY.area);
52
54
  return /*#__PURE__*/_jsx(React.Fragment, {
53
55
  children: seriesCoordinates?.map(({
54
56
  seriesId: id,
@@ -95,7 +97,7 @@ process.env.NODE_ENV !== "production" ? RadarSeriesArea.propTypes /* remove-prop
95
97
  className: PropTypes.string,
96
98
  /**
97
99
  * Callback fired when an area is clicked.
98
- * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
100
+ * @param {ChartsActivationEvent<SVGElement>} event The event source of the callback.
99
101
  * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
100
102
  */
101
103
  onItemClick: PropTypes.func,
@@ -14,6 +14,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
14
14
  var _useRadarSeriesData = require("./useRadarSeriesData");
15
15
  var _radarClasses = require("../radarClasses");
16
16
  var _useItemHighlightStateGetter = require("../../hooks/useItemHighlightStateGetter");
17
+ var _useRegisterRadarItemActivation = require("./useRegisterRadarItemActivation");
17
18
  var _jsxRuntime = require("react/jsx-runtime");
18
19
  const _excluded = ["seriesId", "onItemClick", "classes"];
19
20
  function getCircleProps(params) {
@@ -45,6 +46,7 @@ function getCircleProps(params) {
45
46
  }
46
47
  function RadarSeriesMarks(props) {
47
48
  const {
49
+ seriesId,
48
50
  onItemClick,
49
51
  classes: inClasses
50
52
  } = props,
@@ -52,6 +54,7 @@ function RadarSeriesMarks(props) {
52
54
  const seriesCoordinates = (0, _useRadarSeriesData.useRadarSeriesData)(props.seriesId);
53
55
  const classes = (0, _radarClasses.useUtilityClasses)(inClasses);
54
56
  const getHighlightState = (0, _useItemHighlightStateGetter.useItemHighlightStateGetter)();
57
+ (0, _useRegisterRadarItemActivation.useRegisterRadarItemActivation)(seriesId, onItemClick, _useRegisterRadarItemActivation.RADAR_ACTIVATION_PRIORITY.mark);
55
58
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
56
59
  children: seriesCoordinates?.map(({
57
60
  seriesId: id,
@@ -100,7 +103,7 @@ process.env.NODE_ENV !== "production" ? RadarSeriesMarks.propTypes /* remove-pro
100
103
  className: _propTypes.default.string,
101
104
  /**
102
105
  * Callback fired when a mark is clicked.
103
- * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
106
+ * @param {ChartsActivationEvent<SVGElement>} event The event source of the callback.
104
107
  * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
105
108
  */
106
109
  onItemClick: _propTypes.default.func,
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
6
6
  import { useRadarSeriesData } from "./useRadarSeriesData.mjs";
7
7
  import { useUtilityClasses } from "../radarClasses.mjs";
8
8
  import { useItemHighlightStateGetter } from "../../hooks/useItemHighlightStateGetter.mjs";
9
+ import { RADAR_ACTIVATION_PRIORITY, useRegisterRadarItemActivation } from "./useRegisterRadarItemActivation.mjs";
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
10
11
  export function getCircleProps(params) {
11
12
  const {
@@ -36,6 +37,7 @@ export function getCircleProps(params) {
36
37
  }
37
38
  function RadarSeriesMarks(props) {
38
39
  const {
40
+ seriesId,
39
41
  onItemClick,
40
42
  classes: inClasses
41
43
  } = props,
@@ -43,6 +45,7 @@ function RadarSeriesMarks(props) {
43
45
  const seriesCoordinates = useRadarSeriesData(props.seriesId);
44
46
  const classes = useUtilityClasses(inClasses);
45
47
  const getHighlightState = useItemHighlightStateGetter();
48
+ useRegisterRadarItemActivation(seriesId, onItemClick, RADAR_ACTIVATION_PRIORITY.mark);
46
49
  return /*#__PURE__*/_jsx(React.Fragment, {
47
50
  children: seriesCoordinates?.map(({
48
51
  seriesId: id,
@@ -91,7 +94,7 @@ process.env.NODE_ENV !== "production" ? RadarSeriesMarks.propTypes /* remove-pro
91
94
  className: PropTypes.string,
92
95
  /**
93
96
  * Callback fired when a mark is clicked.
94
- * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
97
+ * @param {ChartsActivationEvent<SVGElement>} event The event source of the callback.
95
98
  * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
96
99
  */
97
100
  onItemClick: PropTypes.func,
@@ -1,6 +1,7 @@
1
1
  import type * as React from 'react';
2
2
  import type { RadarClasses } from "../radarClasses.mjs";
3
3
  import type { RadarItemIdentifier } from "../../models/seriesType/radar.mjs";
4
+ import type { ChartsActivationEvent } from "../../models/events.mjs";
4
5
  interface CommonRadarSeriesPlotProps {
5
6
  /**
6
7
  * A CSS class name applied to the root element.
@@ -34,17 +35,17 @@ type RadarClickIdentifier = Required<RadarItemIdentifier>;
34
35
  export interface RadarSeriesMarksProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGCircleElement> {
35
36
  /**
36
37
  * Callback fired when a mark is clicked.
37
- * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
38
+ * @param {ChartsActivationEvent<SVGElement>} event The event source of the callback.
38
39
  * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
39
40
  */
40
- onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, radarItemIdentifier: RadarClickIdentifier) => void;
41
+ onItemClick?: (event: ChartsActivationEvent<SVGElement>, radarItemIdentifier: RadarClickIdentifier) => void;
41
42
  }
42
43
  export interface RadarSeriesAreaProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGPathElement> {
43
44
  /**
44
45
  * Callback fired when an area is clicked.
45
- * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
46
+ * @param {ChartsActivationEvent<SVGElement>} event The event source of the callback.
46
47
  * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
47
48
  */
48
- onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, radarItemIdentifier: RadarClickIdentifier) => void;
49
+ onItemClick?: (event: ChartsActivationEvent<SVGElement>, radarItemIdentifier: RadarClickIdentifier) => void;
49
50
  }
50
51
  export {};
@@ -1,6 +1,7 @@
1
1
  import type * as React from 'react';
2
2
  import type { RadarClasses } from "../radarClasses.js";
3
3
  import type { RadarItemIdentifier } from "../../models/seriesType/radar.js";
4
+ import type { ChartsActivationEvent } from "../../models/events.js";
4
5
  interface CommonRadarSeriesPlotProps {
5
6
  /**
6
7
  * A CSS class name applied to the root element.
@@ -34,17 +35,17 @@ type RadarClickIdentifier = Required<RadarItemIdentifier>;
34
35
  export interface RadarSeriesMarksProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGCircleElement> {
35
36
  /**
36
37
  * Callback fired when a mark is clicked.
37
- * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
38
+ * @param {ChartsActivationEvent<SVGElement>} event The event source of the callback.
38
39
  * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
39
40
  */
40
- onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, radarItemIdentifier: RadarClickIdentifier) => void;
41
+ onItemClick?: (event: ChartsActivationEvent<SVGElement>, radarItemIdentifier: RadarClickIdentifier) => void;
41
42
  }
42
43
  export interface RadarSeriesAreaProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGPathElement> {
43
44
  /**
44
45
  * Callback fired when an area is clicked.
45
- * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
46
+ * @param {ChartsActivationEvent<SVGElement>} event The event source of the callback.
46
47
  * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
47
48
  */
48
- onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, radarItemIdentifier: RadarClickIdentifier) => void;
49
+ onItemClick?: (event: ChartsActivationEvent<SVGElement>, radarItemIdentifier: RadarClickIdentifier) => void;
49
50
  }
50
51
  export {};
@@ -0,0 +1,15 @@
1
+ import type { SeriesId } from "../../models/seriesType/common.mjs";
2
+ import type { RadarItemIdentifier } from "../../models/seriesType/radar.mjs";
3
+ import type { ChartsActivationEvent } from "../../models/events.mjs";
4
+ /**
5
+ * Priorities matching the pointer hit-testing order: marks sit above areas.
6
+ * The topmost callback a pointer would reach is the one keyboard activation fires.
7
+ */
8
+ export declare const RADAR_ACTIVATION_PRIORITY: {
9
+ mark: number;
10
+ area: number;
11
+ };
12
+ /**
13
+ * Registers <kbd>Enter</kbd>/<kbd>Space</kbd> activation of the focused radar item.
14
+ */
15
+ export declare function useRegisterRadarItemActivation(seriesId: SeriesId | undefined, onItemClick: ((event: ChartsActivationEvent<SVGElement>, radarItemIdentifier: Required<RadarItemIdentifier>) => void) | undefined, priority: number): void;
@@ -0,0 +1,15 @@
1
+ import type { SeriesId } from "../../models/seriesType/common.js";
2
+ import type { RadarItemIdentifier } from "../../models/seriesType/radar.js";
3
+ import type { ChartsActivationEvent } from "../../models/events.js";
4
+ /**
5
+ * Priorities matching the pointer hit-testing order: marks sit above areas.
6
+ * The topmost callback a pointer would reach is the one keyboard activation fires.
7
+ */
8
+ export declare const RADAR_ACTIVATION_PRIORITY: {
9
+ mark: number;
10
+ area: number;
11
+ };
12
+ /**
13
+ * Registers <kbd>Enter</kbd>/<kbd>Space</kbd> activation of the focused radar item.
14
+ */
15
+ export declare function useRegisterRadarItemActivation(seriesId: SeriesId | undefined, onItemClick: ((event: ChartsActivationEvent<SVGElement>, radarItemIdentifier: Required<RadarItemIdentifier>) => void) | undefined, priority: number): void;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.RADAR_ACTIVATION_PRIORITY = void 0;
8
+ exports.useRegisterRadarItemActivation = useRegisterRadarItemActivation;
9
+ var _useRegisterItemActivation = require("../../internals/useRegisterItemActivation");
10
+ /**
11
+ * Priorities matching the pointer hit-testing order: marks sit above areas.
12
+ * The topmost callback a pointer would reach is the one keyboard activation fires.
13
+ */
14
+ const RADAR_ACTIVATION_PRIORITY = exports.RADAR_ACTIVATION_PRIORITY = {
15
+ mark: 2,
16
+ area: 1
17
+ };
18
+
19
+ /**
20
+ * Registers <kbd>Enter</kbd>/<kbd>Space</kbd> activation of the focused radar item.
21
+ */
22
+ function useRegisterRadarItemActivation(seriesId, onItemClick, priority) {
23
+ (0, _useRegisterItemActivation.useRegisterItemActivation)({
24
+ type: 'radar',
25
+ seriesId,
26
+ priority
27
+ }, onItemClick && ((event, item) => onItemClick(event, {
28
+ type: 'radar',
29
+ seriesId: item.seriesId,
30
+ dataIndex: item.dataIndex
31
+ })));
32
+ }
@@ -0,0 +1,26 @@
1
+ 'use client';
2
+
3
+ import { useRegisterItemActivation } from "../../internals/useRegisterItemActivation.mjs";
4
+ /**
5
+ * Priorities matching the pointer hit-testing order: marks sit above areas.
6
+ * The topmost callback a pointer would reach is the one keyboard activation fires.
7
+ */
8
+ export const RADAR_ACTIVATION_PRIORITY = {
9
+ mark: 2,
10
+ area: 1
11
+ };
12
+
13
+ /**
14
+ * Registers <kbd>Enter</kbd>/<kbd>Space</kbd> activation of the focused radar item.
15
+ */
16
+ export function useRegisterRadarItemActivation(seriesId, onItemClick, priority) {
17
+ useRegisterItemActivation({
18
+ type: 'radar',
19
+ seriesId,
20
+ priority
21
+ }, onItemClick && ((event, item) => onItemClick(event, {
22
+ type: 'radar',
23
+ seriesId: item.seriesId,
24
+ dataIndex: item.dataIndex
25
+ })));
26
+ }
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.useRadarChartProps = void 0;
9
9
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
10
  var _RadarChart = require("./RadarChart.plugins");
11
- const _excluded = ["apiRef", "series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions", "shape", "stripeColor", "highlight", "showToolbar", "onAxisClick", "onAreaClick", "onMarkClick", "disableKeyboardNavigation", "className"];
11
+ const _excluded = ["apiRef", "series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions", "shape", "stripeColor", "highlight", "showToolbar", "onAxisClick", "onAreaClick", "onMarkClick", "disableKeyboardNavigation", "experimentalFeatures", "className"];
12
12
  /**
13
13
  * A helper function that extracts RadarChartProps from the input props
14
14
  * and returns an object with props for the children components of RadarChart.
@@ -41,6 +41,7 @@ const useRadarChartProps = props => {
41
41
  onAreaClick,
42
42
  onMarkClick,
43
43
  disableKeyboardNavigation,
44
+ experimentalFeatures,
44
45
  className
45
46
  } = props,
46
47
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
@@ -58,6 +59,7 @@ const useRadarChartProps = props => {
58
59
  skipAnimation,
59
60
  onAxisClick,
60
61
  disableKeyboardNavigation,
62
+ experimentalFeatures,
61
63
  plugins: _RadarChart.RADAR_PLUGINS
62
64
  };
63
65
  const overlayProps = {
@@ -71,6 +73,8 @@ const useRadarChartProps = props => {
71
73
  };
72
74
  const chartsWrapperProps = {
73
75
  sx,
76
+ legendPosition: props.slotProps?.legend?.position,
77
+ legendDirection: props.slotProps?.legend?.direction,
74
78
  hideLegend: props.hideLegend ?? false,
75
79
  className
76
80
  };
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
- const _excluded = ["apiRef", "series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions", "shape", "stripeColor", "highlight", "showToolbar", "onAxisClick", "onAreaClick", "onMarkClick", "disableKeyboardNavigation", "className"];
4
+ const _excluded = ["apiRef", "series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions", "shape", "stripeColor", "highlight", "showToolbar", "onAxisClick", "onAreaClick", "onMarkClick", "disableKeyboardNavigation", "experimentalFeatures", "className"];
5
5
  import { RADAR_PLUGINS } from "./RadarChart.plugins.mjs";
6
6
  /**
7
7
  * A helper function that extracts RadarChartProps from the input props
@@ -35,6 +35,7 @@ export const useRadarChartProps = props => {
35
35
  onAreaClick,
36
36
  onMarkClick,
37
37
  disableKeyboardNavigation,
38
+ experimentalFeatures,
38
39
  className
39
40
  } = props,
40
41
  other = _objectWithoutPropertiesLoose(props, _excluded);
@@ -52,6 +53,7 @@ export const useRadarChartProps = props => {
52
53
  skipAnimation,
53
54
  onAxisClick,
54
55
  disableKeyboardNavigation,
56
+ experimentalFeatures,
55
57
  plugins: RADAR_PLUGINS
56
58
  };
57
59
  const overlayProps = {
@@ -65,6 +67,8 @@ export const useRadarChartProps = props => {
65
67
  };
66
68
  const chartsWrapperProps = {
67
69
  sx,
70
+ legendPosition: props.slotProps?.legend?.position,
71
+ legendDirection: props.slotProps?.legend?.direction,
68
72
  hideLegend: props.hideLegend ?? false,
69
73
  className
70
74
  };
@@ -5,6 +5,7 @@ import type { D3Scale } from "../models/axis.mjs";
5
5
  import type { ColorGetter } from "../internals/plugins/corePlugins/useChartSeriesConfig/index.mjs";
6
6
  import type { ScatterSizeGetter } from "./seriesConfig/getMarkerSize.mjs";
7
7
  import type { ScatterClasses } from "./scatterClasses.mjs";
8
+ import type { ChartsActivationEvent } from "../models/events.mjs";
8
9
  /**
9
10
  * @deprecated The `Scatter` component is an internal implementation detail of `ScatterPlot` and will be removed from the public API in v10. Use `ScatterPlot` instead.
10
11
  */
@@ -25,10 +26,10 @@ export interface ScatterProps {
25
26
  sizeGetter: ScatterSizeGetter;
26
27
  /**
27
28
  * Callback fired when clicking on a scatter item.
28
- * @param {MouseEvent} event Mouse event recorded on the `<svg/>` element.
29
+ * @param {ChartsActivationEvent<SVGElement>} event Event recorded on the `<svg/>` element.
29
30
  * @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
30
31
  */
31
- onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, scatterItemIdentifier: ScatterItemIdentifier) => void;
32
+ onItemClick?: (event: ChartsActivationEvent<SVGElement>, scatterItemIdentifier: ScatterItemIdentifier) => void;
32
33
  classes?: Partial<ScatterClasses>;
33
34
  slots?: ScatterSlots;
34
35
  slotProps?: ScatterSlotProps;
@@ -5,6 +5,7 @@ import type { D3Scale } from "../models/axis.js";
5
5
  import type { ColorGetter } from "../internals/plugins/corePlugins/useChartSeriesConfig/index.js";
6
6
  import type { ScatterSizeGetter } from "./seriesConfig/getMarkerSize.js";
7
7
  import type { ScatterClasses } from "./scatterClasses.js";
8
+ import type { ChartsActivationEvent } from "../models/events.js";
8
9
  /**
9
10
  * @deprecated The `Scatter` component is an internal implementation detail of `ScatterPlot` and will be removed from the public API in v10. Use `ScatterPlot` instead.
10
11
  */
@@ -25,10 +26,10 @@ export interface ScatterProps {
25
26
  sizeGetter: ScatterSizeGetter;
26
27
  /**
27
28
  * Callback fired when clicking on a scatter item.
28
- * @param {MouseEvent} event Mouse event recorded on the `<svg/>` element.
29
+ * @param {ChartsActivationEvent<SVGElement>} event Event recorded on the `<svg/>` element.
29
30
  * @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
30
31
  */
31
- onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, scatterItemIdentifier: ScatterItemIdentifier) => void;
32
+ onItemClick?: (event: ChartsActivationEvent<SVGElement>, scatterItemIdentifier: ScatterItemIdentifier) => void;
32
33
  classes?: Partial<ScatterClasses>;
33
34
  slots?: ScatterSlots;
34
35
  slotProps?: ScatterSlotProps;
@@ -19,6 +19,7 @@ var _useItemHighlightStateGetter = require("../hooks/useItemHighlightStateGetter
19
19
  var _useChartClosestPoint = require("../internals/plugins/featurePlugins/useChartClosestPoint");
20
20
  var _ScatterMarker = require("./ScatterMarker");
21
21
  var _scatterClasses = require("./scatterClasses");
22
+ var _useRegisterItemActivation = require("../internals/useRegisterItemActivation");
22
23
  var _useScatterPlotData = require("./useScatterPlotData");
23
24
  var _ChartsProvider = require("../context/ChartsProvider");
24
25
  var _jsxRuntime = require("react/jsx-runtime");
@@ -77,6 +78,14 @@ function Scatter(props) {
77
78
  const classes = (0, _scatterClasses.useUtilityClasses)({
78
79
  classes: inClasses
79
80
  });
81
+ (0, _useRegisterItemActivation.useRegisterItemActivation)({
82
+ type: 'scatter',
83
+ seriesId: series.id
84
+ }, onItemClick && ((event, item) => onItemClick(event, {
85
+ type: 'scatter',
86
+ seriesId: series.id,
87
+ dataIndex: item.dataIndex
88
+ })));
80
89
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
81
90
  "data-series": series.id,
82
91
  className: classes.series,
@@ -119,7 +128,7 @@ process.env.NODE_ENV !== "production" ? Scatter.propTypes /* remove-proptypes */
119
128
  colorGetter: _propTypes.default.func.isRequired,
120
129
  /**
121
130
  * Callback fired when clicking on a scatter item.
122
- * @param {MouseEvent} event Mouse event recorded on the `<svg/>` element.
131
+ * @param {ChartsActivationEvent<SVGElement>} event Event recorded on the `<svg/>` element.
123
132
  * @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
124
133
  */
125
134
  onItemClick: _propTypes.default.func,
@@ -13,6 +13,7 @@ import { useItemHighlightStateGetter } from "../hooks/useItemHighlightStateGette
13
13
  import { selectorChartsIsVoronoiEnabled } from "../internals/plugins/featurePlugins/useChartClosestPoint/index.mjs";
14
14
  import { ScatterMarker } from "./ScatterMarker.mjs";
15
15
  import { useUtilityClasses } from "./scatterClasses.mjs";
16
+ import { useRegisterItemActivation } from "../internals/useRegisterItemActivation.mjs";
16
17
  import { useScatterPlotData } from "./useScatterPlotData.mjs";
17
18
  import { useChartsContext } from "../context/ChartsProvider/index.mjs";
18
19
 
@@ -73,6 +74,14 @@ function Scatter(props) {
73
74
  const classes = useUtilityClasses({
74
75
  classes: inClasses
75
76
  });
77
+ useRegisterItemActivation({
78
+ type: 'scatter',
79
+ seriesId: series.id
80
+ }, onItemClick && ((event, item) => onItemClick(event, {
81
+ type: 'scatter',
82
+ seriesId: series.id,
83
+ dataIndex: item.dataIndex
84
+ })));
76
85
  return /*#__PURE__*/_jsx("g", {
77
86
  "data-series": series.id,
78
87
  className: classes.series,
@@ -115,7 +124,7 @@ process.env.NODE_ENV !== "production" ? Scatter.propTypes /* remove-proptypes */
115
124
  colorGetter: PropTypes.func.isRequired,
116
125
  /**
117
126
  * Callback fired when clicking on a scatter item.
118
- * @param {MouseEvent} event Mouse event recorded on the `<svg/>` element.
127
+ * @param {ChartsActivationEvent<SVGElement>} event Event recorded on the `<svg/>` element.
119
128
  * @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
120
129
  */
121
130
  onItemClick: PropTypes.func,