@mui/x-charts 8.7.0 → 8.9.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 (248) hide show
  1. package/BarChart/BarChart.d.ts +4 -3
  2. package/BarChart/BarChart.js +17 -1
  3. package/BarChart/barClasses.d.ts +1 -1
  4. package/BarChart/seriesConfig/seriesProcessor.js +5 -3
  5. package/BarChart/useBarPlotData.js +32 -5
  6. package/CHANGELOG.md +199 -24
  7. package/ChartContainer/ChartContainer.js +22 -0
  8. package/ChartContainer/useChartContainerProps.js +8 -2
  9. package/ChartDataProvider/ChartDataProvider.js +6 -0
  10. package/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
  11. package/ChartDataProvider/useChartDataProviderProps.js +6 -1
  12. package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -1
  13. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +34 -24
  14. package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -1
  15. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +34 -24
  16. package/ChartsLabel/ChartsLabelMark.d.ts +2 -1
  17. package/ChartsLabel/index.d.ts +1 -0
  18. package/ChartsLabel/index.js +18 -0
  19. package/ChartsLegend/chartsLegendClasses.d.ts +1 -1
  20. package/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
  21. package/Gauge/GaugeContainer.d.ts +1 -1
  22. package/LineChart/LineChart.d.ts +3 -2
  23. package/LineChart/LineChart.js +23 -1
  24. package/LineChart/LineHighlightPlot.js +10 -4
  25. package/LineChart/MarkPlot.js +17 -3
  26. package/LineChart/useAreaPlotData.js +3 -2
  27. package/PieChart/PieArcLabelPlot.js +3 -0
  28. package/PieChart/PieArcPlot.js +3 -0
  29. package/PieChart/PieChart.d.ts +4 -3
  30. package/PieChart/PieChart.js +1 -1
  31. package/PieChart/pieClasses.d.ts +1 -1
  32. package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +3 -5
  33. package/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.d.ts +2 -13
  34. package/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +8 -45
  35. package/RadarChart/RadarChart.d.ts +2 -1
  36. package/RadarChart/RadarChart.js +23 -2
  37. package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +4 -3
  38. package/RadarChart/RadarMetricLabels/useRadarMetricData.js +4 -2
  39. package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +19 -3
  40. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +20 -4
  41. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +38 -4
  42. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.ts +32 -3
  43. package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.d.ts +8 -0
  44. package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +38 -0
  45. package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +2 -2
  46. package/RadarChart/index.d.ts +1 -1
  47. package/RadarChart/useRadarChartProps.d.ts +3 -0
  48. package/RadarChart/useRadarChartProps.js +15 -3
  49. package/ScatterChart/ScatterChart.d.ts +4 -3
  50. package/ScatterChart/ScatterChart.js +1 -1
  51. package/ScatterChart/ScatterPlot.js +2 -2
  52. package/ScatterChart/seriesConfig/seriesProcessor.js +3 -0
  53. package/SparkLineChart/SparkLineChart.d.ts +1 -1
  54. package/SparkLineChart/SparkLineChart.js +16 -0
  55. package/esm/BarChart/BarChart.d.ts +4 -3
  56. package/esm/BarChart/BarChart.js +17 -1
  57. package/esm/BarChart/barClasses.d.ts +1 -1
  58. package/esm/BarChart/seriesConfig/seriesProcessor.js +5 -3
  59. package/esm/BarChart/useBarPlotData.js +32 -5
  60. package/esm/ChartContainer/ChartContainer.js +22 -0
  61. package/esm/ChartContainer/useChartContainerProps.js +8 -2
  62. package/esm/ChartDataProvider/ChartDataProvider.js +6 -0
  63. package/esm/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
  64. package/esm/ChartDataProvider/useChartDataProviderProps.js +7 -2
  65. package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -1
  66. package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +36 -26
  67. package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -1
  68. package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +36 -26
  69. package/esm/ChartsLabel/ChartsLabelMark.d.ts +2 -1
  70. package/esm/ChartsLabel/index.d.ts +1 -0
  71. package/esm/ChartsLabel/index.js +1 -0
  72. package/esm/ChartsLegend/chartsLegendClasses.d.ts +1 -1
  73. package/esm/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
  74. package/esm/Gauge/GaugeContainer.d.ts +1 -1
  75. package/esm/LineChart/LineChart.d.ts +3 -2
  76. package/esm/LineChart/LineChart.js +23 -1
  77. package/esm/LineChart/LineHighlightPlot.js +11 -5
  78. package/esm/LineChart/MarkPlot.js +17 -3
  79. package/esm/LineChart/useAreaPlotData.js +3 -2
  80. package/esm/PieChart/PieArcLabelPlot.js +3 -0
  81. package/esm/PieChart/PieArcPlot.js +3 -0
  82. package/esm/PieChart/PieChart.d.ts +4 -3
  83. package/esm/PieChart/PieChart.js +1 -1
  84. package/esm/PieChart/pieClasses.d.ts +1 -1
  85. package/esm/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +3 -5
  86. package/esm/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.d.ts +2 -13
  87. package/esm/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +8 -45
  88. package/esm/RadarChart/RadarChart.d.ts +2 -1
  89. package/esm/RadarChart/RadarChart.js +23 -2
  90. package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +4 -3
  91. package/esm/RadarChart/RadarMetricLabels/useRadarMetricData.js +4 -2
  92. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +19 -3
  93. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +20 -4
  94. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +38 -4
  95. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.ts +32 -3
  96. package/esm/RadarChart/RadarSeriesPlot/useRadarRotationIndex.d.ts +8 -0
  97. package/esm/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +32 -0
  98. package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +2 -2
  99. package/esm/RadarChart/index.d.ts +1 -1
  100. package/esm/RadarChart/useRadarChartProps.d.ts +3 -0
  101. package/esm/RadarChart/useRadarChartProps.js +15 -3
  102. package/esm/ScatterChart/ScatterChart.d.ts +4 -3
  103. package/esm/ScatterChart/ScatterChart.js +1 -1
  104. package/esm/ScatterChart/ScatterPlot.js +2 -2
  105. package/esm/ScatterChart/seriesConfig/seriesProcessor.js +3 -0
  106. package/esm/SparkLineChart/SparkLineChart.d.ts +1 -1
  107. package/esm/SparkLineChart/SparkLineChart.js +16 -0
  108. package/esm/hooks/useAxis.d.ts +2 -2
  109. package/esm/hooks/useTicks.d.ts +6 -1
  110. package/esm/hooks/useTicks.js +94 -58
  111. package/esm/index.js +1 -1
  112. package/esm/internals/constants.d.ts +3 -0
  113. package/esm/internals/constants.js +4 -0
  114. package/esm/internals/getLabel.d.ts +1 -1
  115. package/esm/internals/index.d.ts +1 -0
  116. package/esm/internals/index.js +1 -0
  117. package/esm/internals/plugins/corePlugins/corePlugins.d.ts +3 -2
  118. package/esm/internals/plugins/corePlugins/corePlugins.js +2 -1
  119. package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
  120. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
  121. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/index.d.ts +3 -0
  122. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/index.js +2 -0
  123. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.ts +3 -0
  124. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +27 -0
  125. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +8 -0
  126. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +3 -0
  127. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +21 -0
  128. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js +1 -0
  129. package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
  130. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
  131. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -1
  132. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -2
  133. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +1 -0
  134. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +5 -2
  135. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +7 -0
  136. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.js +14 -0
  137. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
  138. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +2 -0
  139. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
  140. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +46 -3
  141. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +18 -1
  142. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -0
  143. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +76 -0
  144. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -5
  145. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +8 -5
  146. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +47 -0
  147. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +48 -0
  148. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +18 -12
  149. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +16 -2
  150. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +6 -1
  151. package/esm/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.d.ts +1 -1
  152. package/esm/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.js +19 -11
  153. package/esm/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.d.ts +1 -1
  154. package/esm/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.js +19 -11
  155. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +5 -5
  156. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +10 -4
  157. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +4 -4
  158. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
  159. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +44 -1
  160. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
  161. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +8 -1
  162. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +7 -8
  163. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
  164. package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
  165. package/esm/internals/plugins/utils/useLazySelectorEffect.d.ts +7 -0
  166. package/esm/internals/plugins/utils/useLazySelectorEffect.js +70 -0
  167. package/esm/internals/store/useCharts.d.ts +1 -1
  168. package/esm/models/axis.d.ts +42 -1
  169. package/esm/models/axis.js +4 -0
  170. package/esm/models/index.d.ts +1 -1
  171. package/esm/models/seriesType/bar.d.ts +11 -1
  172. package/esm/models/seriesType/common.d.ts +9 -3
  173. package/esm/models/seriesType/line.d.ts +3 -1
  174. package/esm/models/seriesType/scatter.d.ts +14 -2
  175. package/esm/tests/web-components.js +49 -0
  176. package/esm/themeAugmentation/components.d.ts +3 -0
  177. package/esm/themeAugmentation/props.d.ts +2 -0
  178. package/hooks/useAxis.d.ts +2 -2
  179. package/hooks/useTicks.d.ts +6 -1
  180. package/hooks/useTicks.js +95 -58
  181. package/index.js +1 -1
  182. package/internals/constants.d.ts +3 -0
  183. package/internals/constants.js +5 -1
  184. package/internals/getLabel.d.ts +1 -1
  185. package/internals/index.d.ts +1 -0
  186. package/internals/index.js +8 -0
  187. package/internals/plugins/corePlugins/corePlugins.d.ts +3 -2
  188. package/internals/plugins/corePlugins/corePlugins.js +2 -1
  189. package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
  190. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
  191. package/internals/plugins/corePlugins/useChartExperimentalFeature/index.d.ts +3 -0
  192. package/internals/plugins/corePlugins/useChartExperimentalFeature/index.js +27 -0
  193. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.ts +3 -0
  194. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +34 -0
  195. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +8 -0
  196. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +10 -0
  197. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +21 -0
  198. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js +5 -0
  199. package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
  200. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
  201. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -1
  202. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -2
  203. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +1 -0
  204. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +4 -1
  205. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +7 -0
  206. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.js +21 -0
  207. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
  208. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +24 -0
  209. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
  210. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +46 -3
  211. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +18 -1
  212. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -0
  213. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +82 -0
  214. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -5
  215. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +9 -6
  216. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +47 -0
  217. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +55 -0
  218. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +18 -12
  219. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +18 -3
  220. package/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +6 -1
  221. package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.d.ts +1 -1
  222. package/internals/plugins/featurePlugins/useChartHighlight/createIsFaded.js +20 -13
  223. package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.d.ts +1 -1
  224. package/internals/plugins/featurePlugins/useChartHighlight/createIsHighlighted.js +20 -13
  225. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +5 -5
  226. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +10 -4
  227. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +4 -4
  228. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
  229. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +44 -1
  230. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
  231. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +8 -1
  232. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +7 -8
  233. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
  234. package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
  235. package/internals/plugins/utils/useLazySelectorEffect.d.ts +7 -0
  236. package/internals/plugins/utils/useLazySelectorEffect.js +77 -0
  237. package/internals/store/useCharts.d.ts +1 -1
  238. package/models/axis.d.ts +42 -1
  239. package/models/axis.js +4 -0
  240. package/models/index.d.ts +1 -1
  241. package/models/seriesType/bar.d.ts +11 -1
  242. package/models/seriesType/common.d.ts +9 -3
  243. package/models/seriesType/line.d.ts +3 -1
  244. package/models/seriesType/scatter.d.ts +14 -2
  245. package/package.json +5 -5
  246. package/tests/web-components.js +55 -0
  247. package/themeAugmentation/components.d.ts +3 -0
  248. package/themeAugmentation/props.d.ts +2 -0
@@ -42,6 +42,8 @@ const RadarChart = exports.RadarChart = /*#__PURE__*/React.forwardRef(function R
42
42
  chartsSurfaceProps,
43
43
  radarDataProviderProps,
44
44
  radarGrid,
45
+ radarSeriesAreaProps,
46
+ radarSeriesMarksProps,
45
47
  overlayProps,
46
48
  legendProps,
47
49
  highlight,
@@ -53,7 +55,7 @@ const RadarChart = exports.RadarChart = /*#__PURE__*/React.forwardRef(function R
53
55
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
54
56
  children: [props.showToolbar && Toolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
55
57
  ref: ref,
56
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarGrid.RadarGrid, (0, _extends2.default)({}, radarGrid)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarMetricLabels.RadarMetricLabels, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarSeriesPlot.RadarSeriesArea, {}), highlight === 'axis' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarAxisHighlight.RadarAxisHighlight, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarSeriesPlot.RadarSeriesMarks, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), children]
58
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarGrid.RadarGrid, (0, _extends2.default)({}, radarGrid)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarMetricLabels.RadarMetricLabels, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarSeriesPlot.RadarSeriesArea, (0, _extends2.default)({}, radarSeriesAreaProps)), highlight === 'axis' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarAxisHighlight.RadarAxisHighlight, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarSeriesPlot.RadarSeriesMarks, (0, _extends2.default)({}, radarSeriesMarksProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), children]
57
59
  })), !props.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, props.slotProps?.tooltip))]
58
60
  }))
59
61
  }));
@@ -132,12 +134,31 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
132
134
  right: _propTypes.default.number,
133
135
  top: _propTypes.default.number
134
136
  })]),
137
+ /**
138
+ * Callback fired when an area is clicked.
139
+ * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
140
+ * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
141
+ */
142
+ onAreaClick: _propTypes.default.func,
143
+ /**
144
+ * The function called for onClick events.
145
+ * The second argument contains information about all line/bar elements at the current mouse position.
146
+ * @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
147
+ * @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
148
+ */
149
+ onAxisClick: _propTypes.default.func,
135
150
  /**
136
151
  * The callback fired when the highlighted item changes.
137
152
  *
138
153
  * @param {HighlightItemData | null} highlightedItem The newly highlighted item.
139
154
  */
140
155
  onHighlightChange: _propTypes.default.func,
156
+ /**
157
+ * Callback fired when a mark is clicked.
158
+ * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
159
+ * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
160
+ */
161
+ onMarkClick: _propTypes.default.func,
141
162
  /**
142
163
  * The configuration of the radar scales.
143
164
  */
@@ -154,7 +175,7 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
154
175
  }).isRequired,
155
176
  /**
156
177
  * The series to display in the bar chart.
157
- * An array of [[RadarSeriesType]] objects.
178
+ * An array of [[RadarSeries]] objects.
158
179
  */
159
180
  series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
160
181
  /**
@@ -5,12 +5,13 @@ import { RadarSeriesType } from "../../models/seriesType/radar.js";
5
5
  import { ChartDataProviderProps } from "../../ChartDataProvider/index.js";
6
6
  import { RadarConfig } from "./radar.types.js";
7
7
  import { ChartAnyPluginSignature } from "../../internals/plugins/models/plugin.js";
8
- export type RadarDataProviderProps<TSignatures extends readonly ChartAnyPluginSignature[] = RadarChartPluginsSignatures> = Omit<ChartDataProviderProps<'radar', TSignatures>, 'series' | 'rotationAxis' | 'radiusAxis' | 'dataset'> & {
8
+ export type RadarSeries = MakeOptional<RadarSeriesType, 'type'>;
9
+ export type RadarDataProviderProps<TSignatures extends readonly ChartAnyPluginSignature[] = RadarChartPluginsSignatures> = Omit<ChartDataProviderProps<'radar', TSignatures>, 'series' | 'rotationAxis' | 'radiusAxis' | 'dataset' | 'experimentalFeatures'> & {
9
10
  /**
10
11
  * The series to display in the bar chart.
11
- * An array of [[RadarSeriesType]] objects.
12
+ * An array of [[RadarSeries]] objects.
12
13
  */
13
- series: Readonly<MakeOptional<RadarSeriesType, 'type'>>[];
14
+ series: Readonly<RadarSeries>[];
14
15
  /**
15
16
  * The configuration of the radar scales.
16
17
  */
@@ -27,14 +27,16 @@ function useRadarMetricData() {
27
27
  const radiusScale = radiusAxis[metric].scale;
28
28
  const r = radiusScale.range()[1] + labelGap;
29
29
  const angle = angles[dataIndex];
30
+ const defaultTickLabel = metric;
30
31
  return {
31
32
  x: cx + r * Math.sin(angle),
32
33
  y: cy - r * Math.cos(angle),
33
34
  angle: (0, _angleConversion.rad2deg)(angle),
34
35
  label: valueFormatter?.(metric, {
35
36
  location: 'tick',
36
- scale: rotationScale
37
- }) ?? metric
37
+ scale: rotationScale,
38
+ defaultTickLabel
39
+ }) ?? defaultTickLabel
38
40
  };
39
41
  })
40
42
  };
@@ -17,8 +17,9 @@ var _getAreaPath = require("./getAreaPath");
17
17
  var _radarSeriesPlotClasses = require("./radarSeriesPlotClasses");
18
18
  var _useItemHighlightedGetter = require("../../hooks/useItemHighlightedGetter");
19
19
  var _useInteractionItemProps = require("../../hooks/useInteractionItemProps");
20
+ var _useRadarRotationIndex = require("./useRadarRotationIndex");
20
21
  var _jsxRuntime = require("react/jsx-runtime");
21
- const _excluded = ["seriesId"];
22
+ const _excluded = ["seriesId", "onItemClick"];
22
23
  function getPathProps(params) {
23
24
  const {
24
25
  isHighlighted,
@@ -47,10 +48,12 @@ function getPathProps(params) {
47
48
  }
48
49
  function RadarSeriesArea(props) {
49
50
  const {
50
- seriesId
51
+ seriesId,
52
+ onItemClick
51
53
  } = props,
52
54
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
53
55
  const seriesCoordinates = (0, _useRadarSeriesData.useRadarSeriesData)(seriesId);
56
+ const getRotationIndex = (0, _useRadarRotationIndex.useRadarRotationIndex)();
54
57
  const interactionProps = (0, _useInteractionItemProps.useInteractionAllItemProps)(seriesCoordinates);
55
58
  const {
56
59
  isFaded,
@@ -72,7 +75,14 @@ function RadarSeriesArea(props) {
72
75
  isFaded,
73
76
  isHighlighted,
74
77
  classes
75
- }), interactionProps[seriesIndex], other), id);
78
+ }), {
79
+ onClick: event => onItemClick?.(event, {
80
+ type: 'radar',
81
+ seriesId: id,
82
+ dataIndex: getRotationIndex(event)
83
+ }),
84
+ cursor: onItemClick ? 'pointer' : 'unset'
85
+ }, interactionProps[seriesIndex], other), id);
76
86
  })
77
87
  });
78
88
  }
@@ -85,6 +95,12 @@ process.env.NODE_ENV !== "production" ? RadarSeriesArea.propTypes = {
85
95
  * Override or extend the styles applied to the component.
86
96
  */
87
97
  classes: _propTypes.default.object,
98
+ /**
99
+ * Callback fired when an area is clicked.
100
+ * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
101
+ * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
102
+ */
103
+ onItemClick: _propTypes.default.func,
88
104
  /**
89
105
  * The id of the series to display.
90
106
  * If undefined all series are displayed.
@@ -16,7 +16,7 @@ var _useRadarSeriesData = require("./useRadarSeriesData");
16
16
  var _useItemHighlightedGetter = require("../../hooks/useItemHighlightedGetter");
17
17
  var _radarSeriesPlotClasses = require("./radarSeriesPlotClasses");
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
- const _excluded = ["seriesId"];
19
+ const _excluded = ["seriesId", "onItemClick"];
20
20
  function getCircleProps(params) {
21
21
  const {
22
22
  isHighlighted,
@@ -40,12 +40,14 @@ function getCircleProps(params) {
40
40
  fill: color,
41
41
  stroke: color,
42
42
  opacity: fillArea && isItemFaded ? 0.5 : 1,
43
- pointerEvents: 'none',
44
43
  className: (0, _clsx.clsx)(classes.mark, isItemHighlighted && classes.highlighted || isItemFaded && classes.faded)
45
44
  };
46
45
  }
47
46
  function RadarSeriesMarks(props) {
48
- const other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
47
+ const {
48
+ onItemClick
49
+ } = props,
50
+ other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
49
51
  const seriesCoordinates = (0, _useRadarSeriesData.useRadarSeriesData)(props.seriesId);
50
52
  const classes = (0, _radarSeriesPlotClasses.useUtilityClasses)(props.classes);
51
53
  const {
@@ -72,7 +74,15 @@ function RadarSeriesMarks(props) {
72
74
  isFaded,
73
75
  isHighlighted,
74
76
  classes
75
- }), other), index))
77
+ }), {
78
+ pointerEvents: onItemClick ? undefined : 'none',
79
+ onClick: event => onItemClick?.(event, {
80
+ type: 'radar',
81
+ seriesId: id,
82
+ dataIndex: index
83
+ }),
84
+ cursor: onItemClick ? 'pointer' : 'unset'
85
+ }, other), index))
76
86
  }, id);
77
87
  })
78
88
  });
@@ -86,6 +96,12 @@ process.env.NODE_ENV !== "production" ? RadarSeriesMarks.propTypes = {
86
96
  * Override or extend the styles applied to the component.
87
97
  */
88
98
  classes: _propTypes.default.object,
99
+ /**
100
+ * Callback fired when a mark is clicked.
101
+ * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
102
+ * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
103
+ */
104
+ onItemClick: _propTypes.default.func,
89
105
  /**
90
106
  * The id of the series to display.
91
107
  * If undefined all series are displayed.
@@ -15,15 +15,23 @@ var _useItemHighlightedGetter = require("../../hooks/useItemHighlightedGetter");
15
15
  var _radarSeriesPlotClasses = require("./radarSeriesPlotClasses");
16
16
  var _RadarSeriesArea = require("./RadarSeriesArea");
17
17
  var _RadarSeriesMarks = require("./RadarSeriesMarks");
18
+ var _useRadarRotationIndex = require("./useRadarRotationIndex");
18
19
  var _jsxRuntime = require("react/jsx-runtime");
19
20
  function RadarSeriesPlot(props) {
20
- const seriesCoordinates = (0, _useRadarSeriesData.useRadarSeriesData)(props.seriesId);
21
+ const {
22
+ seriesId: inSeriesId,
23
+ classes: inClasses,
24
+ onAreaClick,
25
+ onMarkClick
26
+ } = props;
27
+ const seriesCoordinates = (0, _useRadarSeriesData.useRadarSeriesData)(inSeriesId);
28
+ const getRotationIndex = (0, _useRadarRotationIndex.useRadarRotationIndex)();
21
29
  const interactionProps = (0, _useInteractionItemProps.useInteractionAllItemProps)(seriesCoordinates);
22
30
  const {
23
31
  isFaded,
24
32
  isHighlighted
25
33
  } = (0, _useItemHighlightedGetter.useItemHighlightedGetter)();
26
- const classes = (0, _radarSeriesPlotClasses.useUtilityClasses)(props.classes);
34
+ const classes = (0, _radarSeriesPlotClasses.useUtilityClasses)(inClasses);
27
35
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
28
36
  className: classes.root,
29
37
  children: seriesCoordinates?.map(({
@@ -42,7 +50,14 @@ function RadarSeriesPlot(props) {
42
50
  isFaded,
43
51
  isHighlighted,
44
52
  classes
45
- }), interactionProps[seriesIndex]), seriesId), !hideMark && points.map((point, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)("circle", (0, _extends2.default)({}, (0, _RadarSeriesMarks.getCircleProps)({
53
+ }), {
54
+ onClick: event => onAreaClick?.(event, {
55
+ type: 'radar',
56
+ seriesId,
57
+ dataIndex: getRotationIndex(event)
58
+ }),
59
+ cursor: onAreaClick ? 'pointer' : 'unset'
60
+ }, interactionProps[seriesIndex]), seriesId), !hideMark && points.map((point, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)("circle", (0, _extends2.default)({}, (0, _RadarSeriesMarks.getCircleProps)({
46
61
  seriesId,
47
62
  point,
48
63
  color,
@@ -50,7 +65,14 @@ function RadarSeriesPlot(props) {
50
65
  isFaded,
51
66
  isHighlighted,
52
67
  classes
53
- })), index))]
68
+ }), {
69
+ onClick: event => onMarkClick?.(event, {
70
+ type: 'radar',
71
+ seriesId,
72
+ dataIndex: index
73
+ }),
74
+ cursor: onMarkClick ? 'pointer' : 'unset'
75
+ }), index))]
54
76
  }, seriesId);
55
77
  })
56
78
  });
@@ -64,6 +86,18 @@ process.env.NODE_ENV !== "production" ? RadarSeriesPlot.propTypes = {
64
86
  * Override or extend the styles applied to the component.
65
87
  */
66
88
  classes: _propTypes.default.object,
89
+ /**
90
+ * Callback fired when an area is clicked.
91
+ * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
92
+ * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
93
+ */
94
+ onAreaClick: _propTypes.default.func,
95
+ /**
96
+ * Callback fired when a mark is clicked.
97
+ * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
98
+ * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
99
+ */
100
+ onMarkClick: _propTypes.default.func,
67
101
  /**
68
102
  * The id of the series to display.
69
103
  * If undefined all series are displayed.
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { RadarSeriesPlotClasses } from "./radarSeriesPlotClasses.js";
3
+ import { RadarItemIdentifier } from "../../models/seriesType/radar.js";
3
4
  interface CommonRadarSeriesPlotProps {
4
5
  /**
5
6
  * The id of the series to display.
@@ -11,7 +12,35 @@ interface CommonRadarSeriesPlotProps {
11
12
  */
12
13
  classes?: Partial<RadarSeriesPlotClasses>;
13
14
  }
14
- export interface RadarSeriesPlotProps extends CommonRadarSeriesPlotProps {}
15
- export interface RadarSeriesMarksProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGCircleElement> {}
16
- export interface RadarSeriesAreaProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGPathElement> {}
15
+ export interface RadarSeriesPlotProps extends CommonRadarSeriesPlotProps {
16
+ /**
17
+ * Callback fired when an area is clicked.
18
+ * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
19
+ * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
20
+ */
21
+ onAreaClick?: RadarSeriesAreaProps['onItemClick'];
22
+ /**
23
+ * Callback fired when a mark is clicked.
24
+ * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
25
+ * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
26
+ */
27
+ onMarkClick?: RadarSeriesMarksProps['onItemClick'];
28
+ }
29
+ type RadarClickIdentifier = Required<RadarItemIdentifier>;
30
+ export interface RadarSeriesMarksProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGCircleElement> {
31
+ /**
32
+ * Callback fired when a mark is clicked.
33
+ * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
34
+ * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
35
+ */
36
+ onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, radarItemIdentifier: RadarClickIdentifier) => void;
37
+ }
38
+ export interface RadarSeriesAreaProps extends CommonRadarSeriesPlotProps, React.SVGAttributes<SVGPathElement> {
39
+ /**
40
+ * Callback fired when an area is clicked.
41
+ * @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
42
+ * @param {RadarItemIdentifier} radarItemIdentifier The radar item identifier.
43
+ */
44
+ onItemClick?: (event: React.MouseEvent<SVGElement, MouseEvent>, radarItemIdentifier: RadarClickIdentifier) => void;
45
+ }
17
46
  export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This hook provides a function that from pointer event returns the rotation index.
3
+ * @return {(event: { clientX: number; clientY: number }) => number | null} rotationIndexGetter Returns the rotation data index.
4
+ */
5
+ export declare function useRadarRotationIndex(): (event: {
6
+ clientX: number;
7
+ clientY: number;
8
+ }) => number;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.useRadarRotationIndex = useRadarRotationIndex;
8
+ var React = _interopRequireWildcard(require("react"));
9
+ var _useChartPolarAxis = require("../../internals/plugins/featurePlugins/useChartPolarAxis");
10
+ var _getSVGPoint = require("../../internals/getSVGPoint");
11
+ var _coordinateTransformation = require("../../internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation");
12
+ var _useSelector = require("../../internals/store/useSelector");
13
+ var _getAxisIndex = require("../../internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex");
14
+ var _useStore = require("../../internals/store/useStore");
15
+ var _useSvgRef = require("../../hooks/useSvgRef");
16
+ var _useAxis = require("../../hooks/useAxis");
17
+ /**
18
+ * This hook provides a function that from pointer event returns the rotation index.
19
+ * @return {(event: { clientX: number; clientY: number }) => number | null} rotationIndexGetter Returns the rotation data index.
20
+ */
21
+ function useRadarRotationIndex() {
22
+ const svgRef = (0, _useSvgRef.useSvgRef)();
23
+ const store = (0, _useStore.useStore)();
24
+ const rotationAxis = (0, _useAxis.useRotationAxis)();
25
+ const center = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartPolarCenter);
26
+ const rotationIndexGetter = React.useCallback(function rotationIndexGetter(event) {
27
+ const element = svgRef.current;
28
+ if (!element || !rotationAxis) {
29
+ // Should never append
30
+ throw new Error(`MUI X Charts: The ${!element ? 'SVG' : 'rotation axis'} was not found to compute radar dataIndex.`);
31
+ }
32
+ const svgPoint = (0, _getSVGPoint.getSVGPoint)(element, event);
33
+ const rotation = (0, _coordinateTransformation.generateSvg2rotation)(center)(svgPoint.x, svgPoint.y);
34
+ const rotationIndex = (0, _getAxisIndex.getAxisIndex)(rotationAxis, rotation);
35
+ return rotationIndex;
36
+ }, [center, rotationAxis, svgRef]);
37
+ return rotationIndexGetter;
38
+ }
@@ -17,8 +17,8 @@ export declare function useRadarSeriesData(querySeriesId?: SeriesId): {
17
17
  }[];
18
18
  type: "radar";
19
19
  label?: string | ((location: "tooltip" | "legend") => string) | undefined;
20
- highlightScope?: Partial<import("../../index.js").HighlightScope> | undefined;
21
- labelMarkType?: "line" | "square" | "circle" | import("react").ComponentType<import("../../index.js").ChartsLabelCustomMarkProps> | undefined;
20
+ highlightScope?: import("../../index.js").HighlightScope | undefined;
21
+ labelMarkType?: import("../../internals/index.js").ChartsLabelMarkType | undefined;
22
22
  hideMark?: boolean | undefined;
23
23
  fillArea?: boolean | undefined;
24
24
  data: number[];
@@ -3,7 +3,7 @@ export { RadarChart } from "./RadarChart.js";
3
3
  export { RadarDataProvider as Unstable_RadarDataProvider } from "./RadarDataProvider/index.js";
4
4
  export { RadarDataProvider } from "./RadarDataProvider/index.js";
5
5
  export type { RadarChartProps, RadarChartSlots, RadarChartSlotProps } from "./RadarChart.js";
6
- export type { RadarDataProviderProps } from "./RadarDataProvider/index.js";
6
+ export type { RadarDataProviderProps, RadarSeries } from "./RadarDataProvider/index.js";
7
7
  export * from "./RadarGrid/index.js";
8
8
  export * from "./RadarAxisHighlight/index.js";
9
9
  export * from "./RadarMetricLabels/index.js";
@@ -6,6 +6,7 @@ import { RadarDataProviderProps } from "./RadarDataProvider/RadarDataProvider.js
6
6
  import { ChartsSurfaceProps } from "../ChartsSurface/index.js";
7
7
  import { RadarGridProps } from "./RadarGrid/index.js";
8
8
  import { RadarChartPluginsSignatures } from "./RadarChart.plugins.js";
9
+ import { RadarSeriesAreaProps, RadarSeriesMarksProps } from "./RadarSeriesPlot/index.js";
9
10
  /**
10
11
  * A helper function that extracts RadarChartProps from the input props
11
12
  * and returns an object with props for the children components of RadarChart.
@@ -19,6 +20,8 @@ export declare const useRadarChartProps: (props: RadarChartProps) => {
19
20
  chartsSurfaceProps: ChartsSurfaceProps;
20
21
  radarDataProviderProps: RadarDataProviderProps<RadarChartPluginsSignatures>;
21
22
  radarGrid: RadarGridProps;
23
+ radarSeriesAreaProps: RadarSeriesAreaProps;
24
+ radarSeriesMarksProps: RadarSeriesMarksProps;
22
25
  overlayProps: ChartsOverlayProps;
23
26
  legendProps: ChartsLegendSlotExtension;
24
27
  children: import("react").ReactNode;
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.useRadarChartProps = void 0;
9
9
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
- const _excluded = ["apiRef", "series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions", "shape", "stripeColor", "highlight", "showToolbar"];
10
+ 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"];
11
11
  /**
12
12
  * A helper function that extracts RadarChartProps from the input props
13
13
  * and returns an object with props for the children components of RadarChart.
@@ -35,7 +35,10 @@ const useRadarChartProps = props => {
35
35
  divisions,
36
36
  shape,
37
37
  stripeColor,
38
- highlight = 'axis'
38
+ highlight = 'axis',
39
+ onAxisClick,
40
+ onAreaClick,
41
+ onMarkClick
39
42
  } = props,
40
43
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
41
44
  const radarDataProviderProps = {
@@ -49,7 +52,8 @@ const useRadarChartProps = props => {
49
52
  colors,
50
53
  highlightedItem,
51
54
  onHighlightChange,
52
- skipAnimation
55
+ skipAnimation,
56
+ onAxisClick
53
57
  };
54
58
  const overlayProps = {
55
59
  slots,
@@ -68,6 +72,12 @@ const useRadarChartProps = props => {
68
72
  shape,
69
73
  stripeColor
70
74
  };
75
+ const radarSeriesAreaProps = {
76
+ onItemClick: onAreaClick
77
+ };
78
+ const radarSeriesMarksProps = {
79
+ onItemClick: onMarkClick
80
+ };
71
81
  const chartsSurfaceProps = other;
72
82
  return {
73
83
  highlight,
@@ -75,6 +85,8 @@ const useRadarChartProps = props => {
75
85
  chartsSurfaceProps,
76
86
  radarDataProviderProps,
77
87
  radarGrid,
88
+ radarSeriesAreaProps,
89
+ radarSeriesMarksProps,
78
90
  overlayProps,
79
91
  legendProps,
80
92
  children
@@ -16,12 +16,13 @@ import { UseChartVoronoiSignature } from "../internals/plugins/featurePlugins/us
16
16
  import { ScatterChartPluginsSignatures } from "./ScatterChart.plugins.js";
17
17
  export interface ScatterChartSlots extends ChartsAxisSlots, ScatterPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
18
18
  export interface ScatterChartSlotProps extends ChartsAxisSlotProps, ScatterPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
19
- export interface ScatterChartProps extends Omit<ChartContainerProps<'scatter', ScatterChartPluginsSignatures>, 'series' | 'plugins' | 'onItemClick'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
19
+ export type ScatterSeries = MakeOptional<ScatterSeriesType, 'type'>;
20
+ export interface ScatterChartProps extends Omit<ChartContainerProps<'scatter', ScatterChartPluginsSignatures>, 'series' | 'plugins' | 'onItemClick' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
20
21
  /**
21
22
  * The series to display in the scatter chart.
22
- * An array of [[ScatterSeriesType]] objects.
23
+ * An array of [[ScatterSeries]] objects.
23
24
  */
24
- series: Readonly<MakeOptional<ScatterSeriesType, 'type'>[]>;
25
+ series: Readonly<ScatterSeries[]>;
25
26
  /**
26
27
  * The configuration of axes highlight.
27
28
  * @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
@@ -180,7 +180,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
180
180
  onItemClick: _propTypes.default.func,
181
181
  /**
182
182
  * The series to display in the scatter chart.
183
- * An array of [[ScatterSeriesType]] objects.
183
+ * An array of [[ScatterSeries]] objects.
184
184
  */
185
185
  series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
186
186
  /**
@@ -12,9 +12,9 @@ var React = _interopRequireWildcard(require("react"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var _Scatter = require("./Scatter");
14
14
  var _useScatterSeries = require("../hooks/useScatterSeries");
15
- var _getColor = _interopRequireDefault(require("./seriesConfig/getColor"));
16
15
  var _hooks = require("../hooks");
17
16
  var _useZAxis = require("../hooks/useZAxis");
17
+ var _seriesConfig = require("./seriesConfig");
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
19
  /**
20
20
  * Demos:
@@ -65,7 +65,7 @@ function ScatterPlot(props) {
65
65
  zAxisId,
66
66
  color
67
67
  } = series[seriesId];
68
- const colorGetter = (0, _getColor.default)(series[seriesId], xAxis[xAxisId ?? defaultXAxisId], yAxis[yAxisId ?? defaultYAxisId], zAxis[zAxisId ?? defaultZAxisId]);
68
+ const colorGetter = _seriesConfig.seriesConfig.colorProcessor(series[seriesId], xAxis[xAxisId ?? defaultXAxisId], yAxis[yAxisId ?? defaultYAxisId], zAxis[zAxisId ?? defaultZAxisId]);
69
69
  const xScale = xAxis[xAxisId ?? defaultXAxisId].scale;
70
70
  const yScale = yAxis[yAxisId ?? defaultYAxisId].scale;
71
71
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(ScatterItems, (0, _extends2.default)({
@@ -28,6 +28,9 @@ const seriesProcessor = ({
28
28
  labelMarkType: 'circle',
29
29
  markerSize: 4
30
30
  }, seriesData, {
31
+ preview: (0, _extends2.default)({
32
+ markerSize: 1
33
+ }, seriesData?.preview),
31
34
  data,
32
35
  valueFormatter: seriesData.valueFormatter ?? (v => v && `(${v.x}, ${v.y})`)
33
36
  })];
@@ -13,7 +13,7 @@ import { BarPlotSlots, BarPlotSlotProps } from "../BarChart/BarPlot.js";
13
13
  import { ChartMargin } from "../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.js";
14
14
  export interface SparkLineChartSlots extends AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, Omit<BarPlotSlots, 'barLabel'>, ChartsTooltipSlots {}
15
15
  export interface SparkLineChartSlotProps extends AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, BarPlotSlotProps, ChartsTooltipSlotProps {}
16
- export interface SparkLineChartProps extends Omit<ChartContainerProps, 'series' | 'xAxis' | 'yAxis' | 'zAxis' | 'radiusAxis' | 'rotationAxis' | 'margin' | 'plugins' | 'colors' | 'slots' | 'slotProps'> {
16
+ export interface SparkLineChartProps extends Omit<ChartContainerProps, 'series' | 'xAxis' | 'yAxis' | 'zAxis' | 'radiusAxis' | 'rotationAxis' | 'margin' | 'plugins' | 'colors' | 'slots' | 'slotProps' | 'experimentalFeatures'> {
17
17
  /**
18
18
  * The xAxis configuration.
19
19
  * Notice it is a single [[AxisConfig]] object, not an array of configuration.
@@ -213,6 +213,14 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
213
213
  * The height of the chart in px. If not defined, it takes the height of the parent element.
214
214
  */
215
215
  height: _propTypes.default.number,
216
+ /**
217
+ * The controlled axis highlight.
218
+ * Identified by the axis id, and data index.
219
+ */
220
+ highlightedAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
221
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
222
+ dataIndex: _propTypes.default.number.isRequired
223
+ })),
216
224
  /**
217
225
  * The highlighted item.
218
226
  * Used when the highlight is controlled.
@@ -256,6 +264,14 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
256
264
  * @param {HighlightItemData | null} highlightedItem The newly highlighted item.
257
265
  */
258
266
  onHighlightChange: _propTypes.default.func,
267
+ /**
268
+ * The function called when the pointer position corresponds to a new axis data item.
269
+ * This update can either be caused by a pointer movement, or an axis update.
270
+ * In case of multiple axes, the function is called if at least one axis is updated.
271
+ * The argument contains the identifier for all axes with a `data` property.
272
+ * @param {AxisItemIdentifier[]} axisItems The array of axes item identifiers.
273
+ */
274
+ onHighlightedAxisChange: _propTypes.default.func,
259
275
  /**
260
276
  * Callback fired when clicking close to an item.
261
277
  * This is only available for scatter plot for now.
@@ -15,12 +15,13 @@ import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "
15
15
  import { BarChartPluginsSignatures } from "./BarChart.plugins.js";
16
16
  export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
17
17
  export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
18
- export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
18
+ export type BarSeries = MakeOptional<BarSeriesType, 'type'>;
19
+ export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis' | 'experimentalFeatures'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
19
20
  /**
20
21
  * The series to display in the bar chart.
21
- * An array of [[BarSeriesType]] objects.
22
+ * An array of [[BarSeries]] objects.
22
23
  */
23
- series: Readonly<MakeOptional<BarSeriesType, 'type'>[]>;
24
+ series: Readonly<BarSeries[]>;
24
25
  /**
25
26
  * Option to display a cartesian grid in the background.
26
27
  */
@@ -127,6 +127,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
127
127
  * If `true`, the legend is not rendered.
128
128
  */
129
129
  hideLegend: PropTypes.bool,
130
+ /**
131
+ * The controlled axis highlight.
132
+ * Identified by the axis id, and data index.
133
+ */
134
+ highlightedAxis: PropTypes.arrayOf(PropTypes.shape({
135
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
136
+ dataIndex: PropTypes.number.isRequired
137
+ })),
130
138
  /**
131
139
  * The highlighted item.
132
140
  * Used when the highlight is controlled.
@@ -179,6 +187,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
179
187
  * @param {HighlightItemData | null} highlightedItem The newly highlighted item.
180
188
  */
181
189
  onHighlightChange: PropTypes.func,
190
+ /**
191
+ * The function called when the pointer position corresponds to a new axis data item.
192
+ * This update can either be caused by a pointer movement, or an axis update.
193
+ * In case of multiple axes, the function is called if at least one axis is updated.
194
+ * The argument contains the identifier for all axes with a `data` property.
195
+ * @param {AxisItemIdentifier[]} axisItems The array of axes item identifiers.
196
+ */
197
+ onHighlightedAxisChange: PropTypes.func,
182
198
  /**
183
199
  * Callback fired when a bar item is clicked.
184
200
  * @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
@@ -187,7 +203,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
187
203
  onItemClick: PropTypes.func,
188
204
  /**
189
205
  * The series to display in the bar chart.
190
- * An array of [[BarSeriesType]] objects.
206
+ * An array of [[BarSeries]] objects.
191
207
  */
192
208
  series: PropTypes.arrayOf(PropTypes.object).isRequired,
193
209
  /**
@@ -9,4 +9,4 @@ export interface BarClasses {
9
9
  export type BarClassKey = keyof BarClasses;
10
10
  export declare function getBarUtilityClass(slot: string): string;
11
11
  export declare const barClasses: BarClasses;
12
- export declare const useUtilityClasses: (classes?: Partial<BarClasses>) => Record<"root" | "series" | "seriesLabels", string>;
12
+ export declare const useUtilityClasses: (classes?: Partial<BarClasses>) => Record<"series" | "root" | "seriesLabels", string>;