@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
@@ -11,7 +11,12 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
11
11
  var _styles = require("@mui/material/styles");
12
12
  var _allPlugins = require("../internals/plugins/allPlugins");
13
13
  const _excluded = ["children", "localeText", "plugins", "seriesConfig", "slots", "slotProps"];
14
- const useChartDataProviderProps = props => {
14
+ const useChartDataProviderProps = inProps => {
15
+ // eslint-disable-next-line material-ui/mui-name-matches-component-name
16
+ const props = (0, _styles.useThemeProps)({
17
+ props: inProps,
18
+ name: 'MuiChartDataProvider'
19
+ });
15
20
  const {
16
21
  children,
17
22
  localeText,
@@ -7,4 +7,4 @@ import { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.js";
7
7
  export default function ChartsXHighlight(props: {
8
8
  type: ChartsAxisHighlightType;
9
9
  classes: ChartsAxisHighlightClasses;
10
- }): React.JSX.Element;
10
+ }): React.JSX.Element[] | null;
@@ -26,32 +26,42 @@ var _jsxRuntime = require("react/jsx-runtime");
26
26
  top,
27
27
  height
28
28
  } = (0, _hooks.useDrawingArea)();
29
- const xScale = (0, _useScale.useXScale)();
30
29
  const store = (0, _useStore.useStore)();
31
- const axisXValue = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsInteractionXAxisValue);
32
- const getXPosition = (0, _useScale.getValueToPositionMapper)(xScale);
33
- const isBandScaleX = type === 'band' && axisXValue !== null && (0, _isBandScale.isBandScale)(xScale);
34
- if (process.env.NODE_ENV !== 'production') {
35
- const isError = isBandScaleX && xScale(axisXValue) === undefined;
36
- if (isError) {
37
- console.error([`MUI X Charts: The position value provided for the axis is not valid for the current scale.`, `This probably means something is wrong with the data passed to the chart.`, `The ChartsAxisHighlight component will not be displayed.`].join('\n'));
38
- }
30
+ const axisXValues = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsHighlightXAxisValue);
31
+ const xAxes = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartXAxis);
32
+ if (axisXValues.length === 0) {
33
+ return null;
39
34
  }
40
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
41
- children: [isBandScaleX && xScale(axisXValue) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath
42
- // @ts-expect-error, xScale value is checked in the statement above
43
- , {
44
- d: `M ${xScale(axisXValue) - (xScale.step() - xScale.bandwidth()) / 2} ${top} l ${xScale.step()} 0 l 0 ${height} l ${-xScale.step()} 0 Z`,
45
- className: classes.root,
46
- ownerState: {
47
- axisHighlight: 'band'
48
- }
49
- }), type === 'line' && axisXValue !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath, {
50
- d: `M ${getXPosition(axisXValue)} ${top} L ${getXPosition(axisXValue)} ${top + height}`,
51
- className: classes.root,
52
- ownerState: {
53
- axisHighlight: 'line'
35
+ return axisXValues.map(({
36
+ axisId,
37
+ value
38
+ }) => {
39
+ const xAxis = xAxes.axis[axisId];
40
+ const xScale = xAxis.scale;
41
+ const getXPosition = (0, _useScale.getValueToPositionMapper)(xScale);
42
+ const isBandScaleX = type === 'band' && value !== null && (0, _isBandScale.isBandScale)(xScale);
43
+ if (process.env.NODE_ENV !== 'production') {
44
+ const isError = isBandScaleX && xScale(value) === undefined;
45
+ if (isError) {
46
+ console.error([`MUI X Charts: The position value provided for the axis is not valid for the current scale.`, `This probably means something is wrong with the data passed to the chart.`, `The ChartsAxisHighlight component will not be displayed.`].join('\n'));
54
47
  }
55
- })]
48
+ }
49
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
50
+ children: [isBandScaleX && xScale(value) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath
51
+ // @ts-expect-error, xScale value is checked in the statement above
52
+ , {
53
+ d: `M ${xScale(value) - (xScale.step() - xScale.bandwidth()) / 2} ${top} l ${xScale.step()} 0 l 0 ${height} l ${-xScale.step()} 0 Z`,
54
+ className: classes.root,
55
+ ownerState: {
56
+ axisHighlight: 'band'
57
+ }
58
+ }), type === 'line' && value !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath, {
59
+ d: `M ${getXPosition(value)} ${top} L ${getXPosition(value)} ${top + height}`,
60
+ className: classes.root,
61
+ ownerState: {
62
+ axisHighlight: 'line'
63
+ }
64
+ })]
65
+ }, `${axisId}-${value}`);
56
66
  });
57
67
  }
@@ -7,4 +7,4 @@ import { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.js";
7
7
  export default function ChartsYHighlight(props: {
8
8
  type: ChartsAxisHighlightType;
9
9
  classes: ChartsAxisHighlightClasses;
10
- }): React.JSX.Element;
10
+ }): React.JSX.Element[] | null;
@@ -26,32 +26,42 @@ var _jsxRuntime = require("react/jsx-runtime");
26
26
  left,
27
27
  width
28
28
  } = (0, _hooks.useDrawingArea)();
29
- const yScale = (0, _useScale.useYScale)();
30
29
  const store = (0, _useStore.useStore)();
31
- const axisYValue = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsInteractionYAxisValue);
32
- const getYPosition = (0, _useScale.getValueToPositionMapper)(yScale);
33
- const isBandScaleY = type === 'band' && axisYValue !== null && (0, _isBandScale.isBandScale)(yScale);
34
- if (process.env.NODE_ENV !== 'production') {
35
- const isError = isBandScaleY && yScale(axisYValue) === undefined;
36
- if (isError) {
37
- console.error([`MUI X Charts: The position value provided for the axis is not valid for the current scale.`, `This probably means something is wrong with the data passed to the chart.`, `The ChartsAxisHighlight component will not be displayed.`].join('\n'));
38
- }
30
+ const axisYValues = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsHighlightYAxisValue);
31
+ const yAxes = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartYAxis);
32
+ if (axisYValues.length === 0) {
33
+ return null;
39
34
  }
40
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
41
- children: [isBandScaleY && yScale(axisYValue) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath, {
42
- d: `M ${left} ${
43
- // @ts-expect-error, yScale value is checked in the statement above
44
- yScale(axisYValue) - (yScale.step() - yScale.bandwidth()) / 2} l 0 ${yScale.step()} l ${width} 0 l 0 ${-yScale.step()} Z`,
45
- className: classes.root,
46
- ownerState: {
47
- axisHighlight: 'band'
48
- }
49
- }), type === 'line' && axisYValue !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath, {
50
- d: `M ${left} ${getYPosition(axisYValue)} L ${left + width} ${getYPosition(axisYValue)}`,
51
- className: classes.root,
52
- ownerState: {
53
- axisHighlight: 'line'
35
+ return axisYValues.map(({
36
+ axisId,
37
+ value
38
+ }) => {
39
+ const yAxis = yAxes.axis[axisId];
40
+ const yScale = yAxis.scale;
41
+ const getYPosition = (0, _useScale.getValueToPositionMapper)(yScale);
42
+ const isBandScaleY = type === 'band' && value !== null && (0, _isBandScale.isBandScale)(yScale);
43
+ if (process.env.NODE_ENV !== 'production') {
44
+ const isError = isBandScaleY && yScale(value) === undefined;
45
+ if (isError) {
46
+ console.error([`MUI X Charts: The position value provided for the axis is not valid for the current scale.`, `This probably means something is wrong with the data passed to the chart.`, `The ChartsAxisHighlight component will not be displayed.`].join('\n'));
54
47
  }
55
- })]
48
+ }
49
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
50
+ children: [isBandScaleY && yScale(value) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath, {
51
+ d: `M ${left} ${
52
+ // @ts-expect-error, yScale value is checked in the statement above
53
+ yScale(value) - (yScale.step() - yScale.bandwidth()) / 2} l 0 ${yScale.step()} l ${width} 0 l 0 ${-yScale.step()} Z`,
54
+ className: classes.root,
55
+ ownerState: {
56
+ axisHighlight: 'band'
57
+ }
58
+ }), type === 'line' && value !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath, {
59
+ d: `M ${left} ${getYPosition(value)} L ${left + width} ${getYPosition(value)}`,
60
+ className: classes.root,
61
+ ownerState: {
62
+ axisHighlight: 'line'
63
+ }
64
+ })]
65
+ }, `${axisId}-${value}`);
56
66
  });
57
67
  }
@@ -6,12 +6,13 @@ export interface ChartsLabelCustomMarkProps {
6
6
  /** Color of the series this mark refers to. */
7
7
  color?: string;
8
8
  }
9
+ export type ChartsLabelMarkType = 'square' | 'circle' | 'line' | React.ComponentType<ChartsLabelCustomMarkProps>;
9
10
  export interface ChartsLabelMarkProps {
10
11
  /**
11
12
  * The type of the mark.
12
13
  * @default 'square'
13
14
  */
14
- type?: 'square' | 'circle' | 'line' | React.ComponentType<ChartsLabelCustomMarkProps>;
15
+ type?: ChartsLabelMarkType;
15
16
  /**
16
17
  * The color of the mark.
17
18
  */
@@ -1,3 +1,4 @@
1
+ export * from "./ChartsLabel.js";
1
2
  export type { ChartsLabelMarkProps, ChartsLabelCustomMarkProps } from "./ChartsLabelMark.js";
2
3
  export { ChartsLabelMark } from "./ChartsLabelMark.js";
3
4
  export { labelClasses } from "./labelClasses.js";
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ var _exportNames = {
7
+ ChartsLabelMark: true,
8
+ labelClasses: true,
9
+ labelMarkClasses: true,
10
+ labelGradientClasses: true
11
+ };
6
12
  Object.defineProperty(exports, "ChartsLabelMark", {
7
13
  enumerable: true,
8
14
  get: function () {
@@ -27,6 +33,18 @@ Object.defineProperty(exports, "labelMarkClasses", {
27
33
  return _labelMarkClasses.labelMarkClasses;
28
34
  }
29
35
  });
36
+ var _ChartsLabel = require("./ChartsLabel");
37
+ Object.keys(_ChartsLabel).forEach(function (key) {
38
+ if (key === "default" || key === "__esModule") return;
39
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
40
+ if (key in exports && exports[key] === _ChartsLabel[key]) return;
41
+ Object.defineProperty(exports, key, {
42
+ enumerable: true,
43
+ get: function () {
44
+ return _ChartsLabel[key];
45
+ }
46
+ });
47
+ });
30
48
  var _ChartsLabelMark = require("./ChartsLabelMark");
31
49
  var _labelClasses = require("./labelClasses");
32
50
  var _labelMarkClasses = require("./labelMarkClasses");
@@ -16,5 +16,5 @@ export interface ChartsLegendClasses {
16
16
  /** Styles applied to the legend in row layout. */
17
17
  horizontal: string;
18
18
  }
19
- export declare const useUtilityClasses: (props: ChartsLegendProps & ChartsLegendSlotExtension) => Record<"root" | "label" | "mark" | "item" | "series", string>;
19
+ export declare const useUtilityClasses: (props: ChartsLegendProps & ChartsLegendSlotExtension) => Record<"item" | "series" | "root" | "label" | "mark", string>;
20
20
  export declare const legendClasses: ChartsLegendClasses;
@@ -24,5 +24,5 @@ export interface PiecewiseColorLegendClasses {
24
24
  /** Styles applied to the series label. */
25
25
  label: string;
26
26
  }
27
- export declare const useUtilityClasses: (props: PiecewiseColorLegendProps & ChartsLegendSlotExtension) => Record<"root" | "label" | "mark" | "item" | "minLabel" | "maxLabel", string>;
27
+ export declare const useUtilityClasses: (props: PiecewiseColorLegendProps & ChartsLegendSlotExtension) => Record<"item" | "root" | "label" | "mark" | "minLabel" | "maxLabel", string>;
28
28
  export declare const piecewiseColorLegendClasses: PiecewiseColorLegendClasses;
@@ -3,7 +3,7 @@ import { ChartsSurfaceProps } from "../ChartsSurface/index.js";
3
3
  import { GaugeProviderProps } from "./GaugeProvider.js";
4
4
  import { MergeSignaturesProperty } from "../internals/plugins/models/index.js";
5
5
  import { ChartCorePluginSignatures } from "../internals/plugins/corePlugins/index.js";
6
- export interface GaugeContainerProps extends Omit<ChartsSurfaceProps, 'children'>, Omit<MergeSignaturesProperty<ChartCorePluginSignatures, 'params'>, 'series' | 'dataset' | 'colors' | 'theme'>, Omit<GaugeProviderProps, 'children'>, Omit<React.SVGProps<SVGSVGElement>, 'width' | 'height'> {
6
+ export interface GaugeContainerProps extends Omit<ChartsSurfaceProps, 'children'>, Omit<MergeSignaturesProperty<ChartCorePluginSignatures, 'params'>, 'series' | 'dataset' | 'colors' | 'theme' | 'experimentalFeatures'>, Omit<GaugeProviderProps, 'children'>, Omit<React.SVGProps<SVGSVGElement>, 'width' | 'height'> {
7
7
  children?: React.ReactNode;
8
8
  }
9
9
  declare const GaugeContainer: React.ForwardRefExoticComponent<Omit<GaugeContainerProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
@@ -18,12 +18,13 @@ import { LineChartPluginsSignatures } from "./LineChart.plugins.js";
18
18
  import { ChartsToolbarSlots, ChartsToolbarSlotProps } from "../Toolbar/index.js";
19
19
  export interface LineChartSlots extends ChartsAxisSlots, AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
20
20
  export interface LineChartSlotProps extends ChartsAxisSlotProps, AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
21
+ export type LineSeries = MakeOptional<LineSeriesType, 'type'>;
21
22
  export interface LineChartProps extends Omit<ChartContainerProps<'line', LineChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
22
23
  /**
23
24
  * The series to display in the line chart.
24
- * An array of [[LineSeriesType]] objects.
25
+ * An array of [[LineSeries]] objects.
25
26
  */
26
- series: Readonly<MakeOptional<LineSeriesType, 'type'>[]>;
27
+ series: Readonly<LineSeries[]>;
27
28
  /**
28
29
  * Option to display a cartesian grid in the background.
29
30
  */
@@ -118,6 +118,12 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
118
118
  * If `true`, render the line highlight item.
119
119
  */
120
120
  disableLineItemHighlight: _propTypes.default.bool,
121
+ /**
122
+ * Options to enable features planned for the next major.
123
+ */
124
+ experimentalFeatures: _propTypes.default.shape({
125
+ preferStrictDomainInLineCharts: _propTypes.default.bool
126
+ }),
121
127
  /**
122
128
  * Option to display a cartesian grid in the background.
123
129
  */
@@ -133,6 +139,14 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
133
139
  * If `true`, the legend is not rendered.
134
140
  */
135
141
  hideLegend: _propTypes.default.bool,
142
+ /**
143
+ * The controlled axis highlight.
144
+ * Identified by the axis id, and data index.
145
+ */
146
+ highlightedAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
147
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
148
+ dataIndex: _propTypes.default.number.isRequired
149
+ })),
136
150
  /**
137
151
  * The highlighted item.
138
152
  * Used when the highlight is controlled.
@@ -184,6 +198,14 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
184
198
  * @param {HighlightItemData | null} highlightedItem The newly highlighted item.
185
199
  */
186
200
  onHighlightChange: _propTypes.default.func,
201
+ /**
202
+ * The function called when the pointer position corresponds to a new axis data item.
203
+ * This update can either be caused by a pointer movement, or an axis update.
204
+ * In case of multiple axes, the function is called if at least one axis is updated.
205
+ * The argument contains the identifier for all axes with a `data` property.
206
+ * @param {AxisItemIdentifier[]} axisItems The array of axes item identifiers.
207
+ */
208
+ onHighlightedAxisChange: _propTypes.default.func,
187
209
  /**
188
210
  * Callback fired when a line element is clicked.
189
211
  */
@@ -194,7 +216,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
194
216
  onMarkClick: _propTypes.default.func,
195
217
  /**
196
218
  * The series to display in the line chart.
197
- * An array of [[LineSeriesType]] objects.
219
+ * An array of [[LineSeries]] objects.
198
220
  */
199
221
  series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
200
222
  /**
@@ -52,8 +52,8 @@ function LineHighlightPlot(props) {
52
52
  instance
53
53
  } = (0, _ChartProvider.useChartContext)();
54
54
  const store = (0, _useStore.useStore)();
55
- const highlightedIndex = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsInteractionXAxisIndex);
56
- if (highlightedIndex === null) {
55
+ const highlightedIndexes = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsHighlightXAxisIndex);
56
+ if (highlightedIndexes.length === 0) {
57
57
  return null;
58
58
  }
59
59
  if (seriesData === undefined) {
@@ -67,7 +67,10 @@ function LineHighlightPlot(props) {
67
67
  const defaultYAxisId = yAxisIds[0];
68
68
  const Element = slots?.lineHighlight ?? _LineHighlightElement.LineHighlightElement;
69
69
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", (0, _extends2.default)({}, other, {
70
- children: stackingGroups.flatMap(({
70
+ children: highlightedIndexes.flatMap(({
71
+ dataIndex: highlightedIndex,
72
+ axisId: highlightedAxisId
73
+ }) => stackingGroups.flatMap(({
71
74
  ids: groupIds
72
75
  }) => {
73
76
  return groupIds.flatMap(seriesId => {
@@ -82,6 +85,9 @@ function LineHighlightPlot(props) {
82
85
  if (disableHighlight || data[highlightedIndex] == null) {
83
86
  return null;
84
87
  }
88
+ if (highlightedAxisId !== xAxisId) {
89
+ return null;
90
+ }
85
91
  const xScale = (0, _useScale.getValueToPositionMapper)(xAxis[xAxisId].scale);
86
92
  const yScale = yAxis[yAxisId].scale;
87
93
  const xData = xAxis[xAxisId].data;
@@ -103,7 +109,7 @@ function LineHighlightPlot(props) {
103
109
  shape: shape
104
110
  }, slotProps?.lineHighlight), `${seriesId}`);
105
111
  });
106
- })
112
+ }))
107
113
  }));
108
114
  }
109
115
  process.env.NODE_ENV !== "production" ? LineHighlightPlot.propTypes = {
@@ -11,7 +11,6 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
11
11
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
13
  var React = _interopRequireWildcard(require("react"));
14
- var _useChartCartesianInteraction = require("../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors");
15
14
  var _constants = require("../constants");
16
15
  var _useSkipAnimation = require("../hooks/useSkipAnimation");
17
16
  var _useChartId = require("../hooks/useChartId");
@@ -24,6 +23,7 @@ var _MarkElement = require("./MarkElement");
24
23
  var _ChartProvider = require("../context/ChartProvider");
25
24
  var _hooks = require("../hooks");
26
25
  var _useInternalIsZoomInteracting = require("../internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting");
26
+ var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
27
27
  var _useSelector = require("../internals/store/useSelector");
28
28
  var _jsxRuntime = require("react/jsx-runtime");
29
29
  const _excluded = ["slots", "slotProps", "skipAnimation", "onItemClick"];
@@ -65,7 +65,21 @@ function MarkPlot(props) {
65
65
  isFaded,
66
66
  isHighlighted
67
67
  } = (0, _hooks.useItemHighlightedGetter)();
68
- const xAxisInteractionIndex = (0, _useSelector.useSelector)(store, _useChartCartesianInteraction.selectorChartsInteractionXAxisIndex);
68
+ const xAxisHighlightIndexes = (0, _useSelector.useSelector)(store, _useChartCartesianAxis.selectorChartsHighlightXAxisIndex);
69
+ const highlightedItems = React.useMemo(() => {
70
+ const rep = {};
71
+ for (const {
72
+ dataIndex,
73
+ axisId
74
+ } of xAxisHighlightIndexes) {
75
+ if (rep[axisId] === undefined) {
76
+ rep[axisId] = new Set([dataIndex]);
77
+ } else {
78
+ rep[axisId].add(dataIndex);
79
+ }
80
+ }
81
+ return rep;
82
+ }, [xAxisHighlightIndexes]);
69
83
  if (seriesData === undefined) {
70
84
  return null;
71
85
  }
@@ -163,7 +177,7 @@ function MarkPlot(props) {
163
177
  seriesId,
164
178
  dataIndex: index
165
179
  })),
166
- isHighlighted: xAxisInteractionIndex === index || isSeriesHighlighted,
180
+ isHighlighted: highlightedItems[xAxisId]?.has(index) || isSeriesHighlighted,
167
181
  isFaded: isSeriesFaded
168
182
  }, slotProps?.mark), `${seriesId}-${index}`);
169
183
  })
@@ -40,9 +40,10 @@ function useAreaPlotData(xAxes, yAxes) {
40
40
  connectNulls,
41
41
  baseline,
42
42
  curve,
43
- strictStepCurve
43
+ strictStepCurve,
44
+ area
44
45
  } = series[seriesId];
45
- if (!(xAxisId in xAxes) || !(yAxisId in yAxes)) {
46
+ if (!area || !(xAxisId in xAxes) || !(yAxisId in yAxes)) {
46
47
  continue;
47
48
  }
48
49
  const xScale = xAxes[xAxisId].scale;
@@ -152,6 +152,9 @@ process.env.NODE_ENV !== "production" ? PieArcLabelPlot.propTypes = {
152
152
  outerRadius: _propTypes.default.number,
153
153
  paddingAngle: _propTypes.default.number
154
154
  }),
155
+ /**
156
+ * The id of this series.
157
+ */
155
158
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
156
159
  /**
157
160
  * The radius between circle center and the beginning of the arc.
@@ -123,6 +123,9 @@ process.env.NODE_ENV !== "production" ? PieArcPlot.propTypes = {
123
123
  outerRadius: _propTypes.default.number,
124
124
  paddingAngle: _propTypes.default.number
125
125
  }),
126
+ /**
127
+ * The id of this series.
128
+ */
126
129
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
127
130
  /**
128
131
  * The radius between circle center and the beginning of the arc.
@@ -12,12 +12,13 @@ import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "
12
12
  import { PieChartPluginSignatures } from "./PieChart.plugins.js";
13
13
  export interface PieChartSlots extends PiePlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
14
14
  export interface PieChartSlotProps extends PiePlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
15
- export interface PieChartProps extends Omit<ChartContainerProps<'pie', PieChartPluginSignatures>, 'series' | 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, Pick<PiePlotProps, 'skipAnimation'> {
15
+ export type PieSeries = MakeOptional<PieSeriesType<MakeOptional<PieValueType, 'id'>>, 'type'>;
16
+ export interface PieChartProps extends Omit<ChartContainerProps<'pie', PieChartPluginSignatures>, 'series' | 'slots' | 'slotProps' | 'experimentalFeatures'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, Pick<PiePlotProps, 'skipAnimation'> {
16
17
  /**
17
18
  * The series to display in the pie chart.
18
- * An array of [[PieSeriesType]] objects.
19
+ * An array of [[PieSeries]] objects.
19
20
  */
20
- series: Readonly<MakeOptional<PieSeriesType<MakeOptional<PieValueType, 'id'>>, 'type'>[]>;
21
+ series: Readonly<PieSeries[]>;
21
22
  /**
22
23
  * If `true`, the legend is not rendered.
23
24
  */
@@ -180,7 +180,7 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
180
180
  onItemClick: _propTypes.default.func,
181
181
  /**
182
182
  * The series to display in the pie chart.
183
- * An array of [[PieSeriesType]] objects.
183
+ * An array of [[PieSeries]] objects.
184
184
  */
185
185
  series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
186
186
  /**
@@ -9,4 +9,4 @@ export interface PieClasses {
9
9
  export type PieClassKey = keyof PieClasses;
10
10
  export declare function getPieUtilityClass(slot: string): string;
11
11
  export declare const pieClasses: PieClasses;
12
- export declare const useUtilityClasses: (classes?: Partial<PieClasses>) => Record<"root" | "series" | "seriesLabels", string>;
12
+ export declare const useUtilityClasses: (classes?: Partial<PieClasses>) => Record<"series" | "root" | "seriesLabels", string>;
@@ -62,13 +62,11 @@ function RadarAxisHighlight(props) {
62
62
  className: classes.line,
63
63
  pointerEvents: "none",
64
64
  strokeDasharray: "4 4"
65
- }), points.map(({
66
- highlighted
67
- }, seriesIndex) => {
65
+ }), points.map((point, seriesIndex) => {
68
66
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("circle", (0, _extends2.default)({
69
67
  fill: series[seriesIndex].color,
70
- cx: highlighted.x,
71
- cy: highlighted.y,
68
+ cx: point.x,
69
+ cy: point.y,
72
70
  className: classes.dot,
73
71
  pointerEvents: "none"
74
72
  }, series[seriesIndex].hideMark ? highlightMark : highlightMarkShadow), series[seriesIndex].id);
@@ -2,12 +2,6 @@ import { UseChartPolarAxisSignature } from "../../internals/plugins/featurePlugi
2
2
  import { AxisId } from "../../models/axis.js";
3
3
  import { DefaultizedRadarSeriesType } from "../../models/seriesType/radar.js";
4
4
  import { ChartInstance } from "../../internals/plugins/models/index.js";
5
- interface UseRadarAxisHighlightParams {
6
- /**
7
- * If true, coordinates of the previous/next point will be added.
8
- */
9
- includesNeighbors?: boolean;
10
- }
11
5
  interface UseRadarAxisHighlightReturnValue {
12
6
  /**
13
7
  * The radar center.
@@ -40,7 +34,7 @@ interface UseRadarAxisHighlightReturnValue {
40
34
  * The { x, y, value } values for the highlighted points in the same order as the `series` array.
41
35
  * If `includesNeighbors` is set to `true` it also contains the information for `previous` and `next` data point.
42
36
  */
43
- points: Points[];
37
+ points: Point[];
44
38
  /**
45
39
  * Charts instances giving access to `polar2svg` and `svg2polar` helpers.
46
40
  */
@@ -53,10 +47,5 @@ interface Point {
53
47
  angle: number;
54
48
  value: number;
55
49
  }
56
- interface Points {
57
- highlighted: Point;
58
- previous?: Point;
59
- next?: Point;
60
- }
61
- export declare function useRadarAxisHighlight(params?: UseRadarAxisHighlightParams): UseRadarAxisHighlightReturnValue | null;
50
+ export declare function useRadarAxisHighlight(): UseRadarAxisHighlightReturnValue | null;
62
51
  export {};
@@ -12,10 +12,7 @@ var _useStore = require("../../internals/store/useStore");
12
12
  var _useChartContext = require("../../context/ChartProvider/useChartContext");
13
13
  var _useChartPolarAxis = require("../../internals/plugins/featurePlugins/useChartPolarAxis");
14
14
  var _useChartPolarInteraction = require("../../internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors");
15
- function useRadarAxisHighlight(params) {
16
- const {
17
- includesNeighbors = false
18
- } = params ?? {};
15
+ function useRadarAxisHighlight() {
19
16
  const radarSeries = (0, _useRadarSeries.useRadarSeries)();
20
17
  const rotationScale = (0, _useScale.useRotationScale)();
21
18
  const {
@@ -55,48 +52,14 @@ function useRadarAxisHighlight(params) {
55
52
  const value = series.data[highlightedIndex];
56
53
  const r = radiusScale(value);
57
54
  const [x, y] = instance.polar2svg(r, angle);
58
- const retrunedValue = {
59
- highlighted: {
60
- x,
61
- y,
62
- r,
63
- angle,
64
- value
65
- }
55
+ const returnedValue = {
56
+ x,
57
+ y,
58
+ r,
59
+ angle,
60
+ value
66
61
  };
67
- if (!includesNeighbors) {
68
- return retrunedValue;
69
- }
70
- const dataLength = series.data.length;
71
- const prevIndex = (dataLength + highlightedIndex - 1) % dataLength;
72
- const nextIndex = (highlightedIndex + 1) % dataLength;
73
- const prevValue = series.data[prevIndex];
74
- const nextValue = series.data[nextIndex];
75
- if (prevValue != null) {
76
- const prevR = radiusAxis[radiusAxisIds[prevIndex]].scale(prevValue);
77
- const prevAngle = rotationScale(rotationScale.domain()[prevIndex]);
78
- const [px, py] = instance.polar2svg(prevR, prevAngle);
79
- retrunedValue.previous = {
80
- x: px,
81
- y: py,
82
- r: prevR,
83
- angle: prevAngle,
84
- value: prevValue
85
- };
86
- }
87
- if (nextValue != null) {
88
- const nextR = radiusAxis[radiusAxisIds[nextIndex]].scale(nextValue);
89
- const nextAngle = rotationScale(rotationScale.domain()[nextIndex]);
90
- const [nx, ny] = instance.polar2svg(nextR, nextAngle);
91
- retrunedValue.next = {
92
- x: nx,
93
- y: ny,
94
- r: nextR,
95
- angle: nextAngle,
96
- value: nextValue
97
- };
98
- }
99
- return retrunedValue;
62
+ return returnedValue;
100
63
  })
101
64
  };
102
65
  }
@@ -5,13 +5,14 @@ import { ChartsSurfaceProps } from "../ChartsSurface/index.js";
5
5
  import { ChartsWrapperProps } from "../internals/components/ChartsWrapper/index.js";
6
6
  import { RadarGridProps } from "./RadarGrid/index.js";
7
7
  import { RadarDataProviderProps } from "./RadarDataProvider/RadarDataProvider.js";
8
+ import { RadarSeriesPlotProps } from "./RadarSeriesPlot/index.js";
8
9
  import { RadarAxisHighlightProps } from "./RadarAxisHighlight/index.js";
9
10
  import { ChartsTooltipSlotProps, ChartsTooltipSlots } from "../ChartsTooltip/index.js";
10
11
  import { ChartsSlotProps, ChartsSlots } from "../internals/material/index.js";
11
12
  import { ChartsToolbarSlotProps, ChartsToolbarSlots } from "../Toolbar/index.js";
12
13
  export interface RadarChartSlots extends ChartsTooltipSlots, ChartsOverlaySlots, ChartsLegendSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
13
14
  export interface RadarChartSlotProps extends ChartsTooltipSlotProps, ChartsOverlaySlotProps, ChartsLegendSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
14
- export interface RadarChartProps extends RadarDataProviderProps, Omit<RadarGridProps, 'classes'>, Omit<Partial<RadarAxisHighlightProps>, 'classes'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, Pick<ChartsWrapperProps, 'sx'>, Omit<ChartsSurfaceProps, 'sx'> {
15
+ export interface RadarChartProps extends RadarDataProviderProps, Omit<RadarGridProps, 'classes'>, Omit<Partial<RadarAxisHighlightProps>, 'classes'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, Pick<ChartsWrapperProps, 'sx'>, Omit<ChartsSurfaceProps, 'sx'>, Pick<RadarSeriesPlotProps, 'onAreaClick' | 'onMarkClick'> {
15
16
  /**
16
17
  * If `true`, the legend is not rendered.
17
18
  */