@mui/x-charts 8.6.0 → 8.8.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 (254) hide show
  1. package/BarChart/BarChart.d.ts +1 -1
  2. package/BarChart/BarChart.js +16 -0
  3. package/BarChart/BarPlot.js +11 -150
  4. package/BarChart/useBarPlotData.d.ts +8 -0
  5. package/BarChart/useBarPlotData.js +146 -0
  6. package/CHANGELOG.md +202 -1
  7. package/ChartContainer/ChartContainer.d.ts +1 -21
  8. package/ChartContainer/ChartContainer.js +22 -8
  9. package/ChartContainer/index.d.ts +8 -1
  10. package/ChartContainer/useChartContainerProps.js +8 -2
  11. package/ChartDataProvider/ChartDataProvider.js +6 -0
  12. package/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
  13. package/ChartDataProvider/useChartDataProviderProps.js +6 -1
  14. package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -1
  15. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +34 -24
  16. package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -1
  17. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +34 -24
  18. package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
  19. package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +3 -0
  20. package/ChartsReferenceLine/ChartsXReferenceLine.js +48 -1
  21. package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +3 -0
  22. package/ChartsReferenceLine/ChartsYReferenceLine.js +48 -1
  23. package/ChartsReferenceLine/index.d.ts +3 -1
  24. package/ChartsSurface/ChartsSurface.js +2 -1
  25. package/ChartsTooltip/ChartsTooltipContainer.js +6 -3
  26. package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
  27. package/ChartsTooltip/utils.js +18 -29
  28. package/Gauge/GaugeContainer.d.ts +1 -1
  29. package/LineChart/AreaPlot.js +5 -115
  30. package/LineChart/LineChart.js +22 -0
  31. package/LineChart/LineHighlightPlot.js +10 -4
  32. package/LineChart/LinePlot.js +5 -99
  33. package/LineChart/MarkPlot.js +17 -3
  34. package/LineChart/useAreaPlotData.d.ts +12 -0
  35. package/LineChart/useAreaPlotData.js +126 -0
  36. package/LineChart/useLinePlotData.d.ts +11 -0
  37. package/LineChart/useLinePlotData.js +108 -0
  38. package/PieChart/PieChart.d.ts +1 -1
  39. package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +1 -1
  40. package/ScatterChart/Scatter.js +22 -48
  41. package/ScatterChart/ScatterChart.d.ts +1 -1
  42. package/ScatterChart/ScatterPlot.js +2 -2
  43. package/ScatterChart/seriesConfig/seriesProcessor.js +3 -0
  44. package/ScatterChart/useScatterPlotData.d.ts +8 -0
  45. package/ScatterChart/useScatterPlotData.js +33 -0
  46. package/SparkLineChart/SparkLineChart.d.ts +1 -1
  47. package/SparkLineChart/SparkLineChart.js +16 -0
  48. package/context/ChartApi.d.ts +22 -0
  49. package/context/ChartApi.js +5 -0
  50. package/context/ChartProvider/ChartContext.js +1 -0
  51. package/context/index.d.ts +2 -1
  52. package/context/useChartApiContext.d.ts +1 -1
  53. package/esm/BarChart/BarChart.d.ts +1 -1
  54. package/esm/BarChart/BarChart.js +16 -0
  55. package/esm/BarChart/BarPlot.js +12 -152
  56. package/esm/BarChart/useBarPlotData.d.ts +8 -0
  57. package/esm/BarChart/useBarPlotData.js +139 -0
  58. package/esm/ChartContainer/ChartContainer.d.ts +1 -21
  59. package/esm/ChartContainer/ChartContainer.js +22 -8
  60. package/esm/ChartContainer/index.d.ts +8 -1
  61. package/esm/ChartContainer/index.js +6 -1
  62. package/esm/ChartContainer/useChartContainerProps.js +8 -2
  63. package/esm/ChartDataProvider/ChartDataProvider.js +6 -0
  64. package/esm/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
  65. package/esm/ChartDataProvider/useChartDataProviderProps.js +7 -2
  66. package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -1
  67. package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +36 -26
  68. package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -1
  69. package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +36 -26
  70. package/esm/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
  71. package/esm/ChartsReferenceLine/ChartsXReferenceLine.d.ts +3 -0
  72. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +47 -0
  73. package/esm/ChartsReferenceLine/ChartsYReferenceLine.d.ts +3 -0
  74. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +47 -0
  75. package/esm/ChartsReferenceLine/index.d.ts +3 -1
  76. package/esm/ChartsReferenceLine/index.js +2 -1
  77. package/esm/ChartsSurface/ChartsSurface.js +2 -1
  78. package/esm/ChartsTooltip/ChartsTooltipContainer.js +6 -3
  79. package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
  80. package/esm/ChartsTooltip/utils.js +18 -29
  81. package/esm/Gauge/GaugeContainer.d.ts +1 -1
  82. package/esm/LineChart/AreaPlot.js +5 -115
  83. package/esm/LineChart/LineChart.js +22 -0
  84. package/esm/LineChart/LineHighlightPlot.js +11 -5
  85. package/esm/LineChart/LinePlot.js +5 -99
  86. package/esm/LineChart/MarkPlot.js +17 -3
  87. package/esm/LineChart/useAreaPlotData.d.ts +12 -0
  88. package/esm/LineChart/useAreaPlotData.js +119 -0
  89. package/esm/LineChart/useLinePlotData.d.ts +11 -0
  90. package/esm/LineChart/useLinePlotData.js +101 -0
  91. package/esm/PieChart/PieChart.d.ts +1 -1
  92. package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +1 -1
  93. package/esm/ScatterChart/Scatter.js +23 -49
  94. package/esm/ScatterChart/ScatterChart.d.ts +1 -1
  95. package/esm/ScatterChart/ScatterPlot.js +2 -2
  96. package/esm/ScatterChart/seriesConfig/seriesProcessor.js +3 -0
  97. package/esm/ScatterChart/useScatterPlotData.d.ts +8 -0
  98. package/esm/ScatterChart/useScatterPlotData.js +26 -0
  99. package/esm/SparkLineChart/SparkLineChart.d.ts +1 -1
  100. package/esm/SparkLineChart/SparkLineChart.js +16 -0
  101. package/esm/context/ChartApi.d.ts +22 -0
  102. package/esm/context/ChartApi.js +1 -0
  103. package/esm/context/ChartProvider/ChartContext.js +2 -0
  104. package/esm/context/index.d.ts +2 -1
  105. package/esm/context/useChartApiContext.d.ts +1 -1
  106. package/esm/hooks/useAxis.d.ts +2 -2
  107. package/esm/hooks/useInteractionItemProps.d.ts +14 -9
  108. package/esm/hooks/useInteractionItemProps.js +28 -28
  109. package/esm/index.d.ts +2 -1
  110. package/esm/index.js +2 -2
  111. package/esm/internals/constants.d.ts +3 -0
  112. package/esm/internals/constants.js +4 -0
  113. package/esm/internals/getLabel.d.ts +1 -1
  114. package/esm/internals/index.d.ts +6 -0
  115. package/esm/internals/index.js +6 -0
  116. package/esm/internals/plugins/corePlugins/corePlugins.d.ts +4 -2
  117. package/esm/internals/plugins/corePlugins/corePlugins.js +3 -1
  118. package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
  119. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -29
  120. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
  121. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +0 -6
  122. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/index.d.ts +3 -0
  123. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/index.js +2 -0
  124. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.ts +3 -0
  125. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +27 -0
  126. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +8 -0
  127. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +3 -0
  128. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +21 -0
  129. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js +1 -0
  130. package/esm/internals/plugins/corePlugins/useChartId/useChartId.js +2 -0
  131. package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
  132. package/esm/internals/plugins/corePlugins/useChartInteractionListener/index.d.ts +2 -0
  133. package/esm/internals/plugins/corePlugins/useChartInteractionListener/index.js +1 -0
  134. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.d.ts +3 -0
  135. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +77 -0
  136. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +31 -0
  137. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.js +1 -0
  138. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
  139. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -1
  140. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -2
  141. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +1 -0
  142. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +5 -2
  143. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +7 -0
  144. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.js +14 -0
  145. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
  146. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +2 -0
  147. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
  148. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +90 -36
  149. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +18 -1
  150. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -0
  151. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +76 -0
  152. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -5
  153. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +8 -5
  154. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +47 -0
  155. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +48 -0
  156. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +18 -12
  157. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +16 -2
  158. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +6 -1
  159. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +5 -5
  160. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
  161. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +34 -34
  162. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
  163. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +7 -8
  164. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +47 -30
  165. package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
  166. package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
  167. package/esm/internals/plugins/utils/useLazySelectorEffect.d.ts +7 -0
  168. package/esm/internals/plugins/utils/useLazySelectorEffect.js +70 -0
  169. package/esm/internals/store/useCharts.d.ts +1 -1
  170. package/esm/locales/elGR.d.ts +19 -0
  171. package/esm/locales/elGR.js +15 -0
  172. package/esm/locales/index.d.ts +1 -0
  173. package/esm/locales/index.js +1 -0
  174. package/esm/models/axis.d.ts +15 -0
  175. package/esm/models/axis.js +4 -0
  176. package/esm/models/index.d.ts +1 -1
  177. package/esm/models/seriesType/scatter.d.ts +11 -2
  178. package/esm/themeAugmentation/components.d.ts +3 -0
  179. package/esm/themeAugmentation/props.d.ts +2 -0
  180. package/hooks/useAxis.d.ts +2 -2
  181. package/hooks/useInteractionItemProps.d.ts +14 -9
  182. package/hooks/useInteractionItemProps.js +29 -28
  183. package/index.d.ts +2 -1
  184. package/index.js +37 -11
  185. package/internals/constants.d.ts +3 -0
  186. package/internals/constants.js +5 -1
  187. package/internals/getLabel.d.ts +1 -1
  188. package/internals/index.d.ts +6 -0
  189. package/internals/index.js +52 -0
  190. package/internals/plugins/corePlugins/corePlugins.d.ts +4 -2
  191. package/internals/plugins/corePlugins/corePlugins.js +3 -1
  192. package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
  193. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -29
  194. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
  195. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +0 -6
  196. package/internals/plugins/corePlugins/useChartExperimentalFeature/index.d.ts +3 -0
  197. package/internals/plugins/corePlugins/useChartExperimentalFeature/index.js +27 -0
  198. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.ts +3 -0
  199. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +34 -0
  200. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +8 -0
  201. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +10 -0
  202. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +21 -0
  203. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js +5 -0
  204. package/internals/plugins/corePlugins/useChartId/useChartId.js +1 -0
  205. package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
  206. package/internals/plugins/corePlugins/useChartInteractionListener/index.d.ts +2 -0
  207. package/internals/plugins/corePlugins/useChartInteractionListener/index.js +12 -0
  208. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.d.ts +3 -0
  209. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +84 -0
  210. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +31 -0
  211. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.js +5 -0
  212. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
  213. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -1
  214. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -2
  215. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +1 -0
  216. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +4 -1
  217. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +7 -0
  218. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.js +21 -0
  219. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
  220. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +24 -0
  221. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
  222. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +90 -36
  223. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +18 -1
  224. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -0
  225. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +82 -0
  226. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -5
  227. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +9 -6
  228. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +47 -0
  229. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +55 -0
  230. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +18 -12
  231. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +18 -3
  232. package/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +6 -1
  233. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +5 -5
  234. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
  235. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +34 -34
  236. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
  237. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +7 -8
  238. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +46 -30
  239. package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
  240. package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
  241. package/internals/plugins/utils/useLazySelectorEffect.d.ts +7 -0
  242. package/internals/plugins/utils/useLazySelectorEffect.js +77 -0
  243. package/internals/store/useCharts.d.ts +1 -1
  244. package/locales/elGR.d.ts +19 -0
  245. package/locales/elGR.js +21 -0
  246. package/locales/index.d.ts +1 -0
  247. package/locales/index.js +11 -0
  248. package/models/axis.d.ts +15 -0
  249. package/models/axis.js +4 -0
  250. package/models/index.d.ts +1 -1
  251. package/models/seriesType/scatter.d.ts +11 -2
  252. package/package.json +4 -3
  253. package/themeAugmentation/components.d.ts +3 -0
  254. package/themeAugmentation/props.d.ts +2 -0
@@ -14,14 +14,6 @@ var _ChartDataProvider = require("../ChartDataProvider");
14
14
  var _useChartContainerProps = require("./useChartContainerProps");
15
15
  var _ChartsSurface = require("../ChartsSurface");
16
16
  var _jsxRuntime = require("react/jsx-runtime");
17
- /**
18
- * The API of the chart `apiRef` object.
19
- * The chart type can be passed as the first generic parameter to narrow down the API to the specific chart type.
20
- * @example ChartApi<'bar'>
21
- * If the chart is being created using composition, the `composition` value can be used.
22
- * @example ChartApi<'composition'>
23
- */
24
-
25
17
  /**
26
18
  * It sets up the data providers as well as the `<svg>` for the chart.
27
19
  *
@@ -91,10 +83,24 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
91
83
  * If true, the voronoi interaction are ignored.
92
84
  */
93
85
  disableVoronoi: _propTypes.default.bool,
86
+ /**
87
+ * Options to enable features planned for the next major.
88
+ */
89
+ experimentalFeatures: _propTypes.default.shape({
90
+ preferStrictDomainInLineCharts: _propTypes.default.bool
91
+ }),
94
92
  /**
95
93
  * The height of the chart in px. If not defined, it takes the height of the parent element.
96
94
  */
97
95
  height: _propTypes.default.number,
96
+ /**
97
+ * The controlled axis highlight.
98
+ * Identified by the axis id, and data index.
99
+ */
100
+ highlightedAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
101
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
102
+ dataIndex: _propTypes.default.number.isRequired
103
+ })),
98
104
  /**
99
105
  * The highlighted item.
100
106
  * Used when the highlight is controlled.
@@ -137,6 +143,14 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
137
143
  * @param {HighlightItemData | null} highlightedItem The newly highlighted item.
138
144
  */
139
145
  onHighlightChange: _propTypes.default.func,
146
+ /**
147
+ * The function called when the pointer position corresponds to a new axis data item.
148
+ * This update can either be caused by a pointer movement, or an axis update.
149
+ * In case of multiple axes, the function is called if at least one axis is updated.
150
+ * The argument contains the identifier for all axes with a `data` property.
151
+ * @param {AxisItemIdentifier[]} axisItems The array of axes item identifiers.
152
+ */
153
+ onHighlightedAxisChange: _propTypes.default.func,
140
154
  /**
141
155
  * Callback fired when clicking close to an item.
142
156
  * This is only available for scatter plot for now.
@@ -1 +1,8 @@
1
- export * from "./ChartContainer.js";
1
+ import type { ChartApi as ChartApiOriginal, PluginsPerSeriesType } from "../context/ChartApi.js";
2
+ import type { ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
3
+ import type { AllPluginSignatures } from "../internals/plugins/allPlugins.js";
4
+ export * from "./ChartContainer.js";
5
+ /**
6
+ * @deprecated Use `ChartApi` from `@mui/x-charts/context` instead.
7
+ */
8
+ export type ChartApi<TSeries extends keyof PluginsPerSeriesType | undefined = undefined, TSignatures extends readonly ChartAnyPluginSignature[] = (TSeries extends keyof PluginsPerSeriesType ? PluginsPerSeriesType[TSeries] : AllPluginSignatures)> = ChartApiOriginal<TSeries, TSignatures>;
@@ -9,7 +9,7 @@ exports.useChartContainerProps = void 0;
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
11
  var _allPlugins = require("../internals/plugins/allPlugins");
12
- const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText", "slots", "slotProps"];
12
+ const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "highlightedAxis", "onHighlightedAxisChange", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText", "slots", "slotProps", "experimentalFeatures"];
13
13
  const useChartContainerProps = (props, ref) => {
14
14
  const _ref = props,
15
15
  {
@@ -22,6 +22,8 @@ const useChartContainerProps = (props, ref) => {
22
22
  dataset,
23
23
  desc,
24
24
  onAxisClick,
25
+ highlightedAxis,
26
+ onHighlightedAxisChange,
25
27
  disableVoronoi,
26
28
  voronoiMaxRadius,
27
29
  onItemClick,
@@ -40,7 +42,8 @@ const useChartContainerProps = (props, ref) => {
40
42
  plugins,
41
43
  localeText,
42
44
  slots,
43
- slotProps
45
+ slotProps,
46
+ experimentalFeatures
44
47
  } = _ref,
45
48
  other = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
46
49
  const chartsSurfaceProps = (0, _extends2.default)({
@@ -58,6 +61,8 @@ const useChartContainerProps = (props, ref) => {
58
61
  highlightedItem,
59
62
  onHighlightChange,
60
63
  onAxisClick,
64
+ highlightedAxis,
65
+ onHighlightedAxisChange,
61
66
  disableVoronoi,
62
67
  voronoiMaxRadius,
63
68
  onItemClick,
@@ -71,6 +76,7 @@ const useChartContainerProps = (props, ref) => {
71
76
  height,
72
77
  localeText,
73
78
  seriesConfig,
79
+ experimentalFeatures,
74
80
  plugins: plugins ?? _allPlugins.DEFAULT_PLUGINS,
75
81
  slots,
76
82
  slotProps
@@ -80,6 +80,12 @@ process.env.NODE_ENV !== "production" ? ChartDataProvider.propTypes = {
80
80
  * An array of objects that can be used to populate series and axes data using their `dataKey` property.
81
81
  */
82
82
  dataset: _propTypes.default.arrayOf(_propTypes.default.object),
83
+ /**
84
+ * Options to enable features planned for the next major.
85
+ */
86
+ experimentalFeatures: _propTypes.default.shape({
87
+ preferStrictDomainInLineCharts: _propTypes.default.bool
88
+ }),
83
89
  /**
84
90
  * The height of the chart in px. If not defined, it takes the height of the parent element.
85
91
  */
@@ -4,7 +4,7 @@ import { ChartAnyPluginSignature } from "../internals/plugins/models/index.js";
4
4
  import { ChartSeriesType } from "../models/seriesType/config.js";
5
5
  import { AllPluginSignatures } from "../internals/plugins/allPlugins.js";
6
6
  import { ChartsLocalizationProviderProps } from "../ChartsLocalizationProvider/index.js";
7
- export declare const useChartDataProviderProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartDataProviderProps<TSeries, TSignatures> & ChartsLocalizationProviderProps) => {
7
+ export declare const useChartDataProviderProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(inProps: ChartDataProviderProps<TSeries, TSignatures> & ChartsLocalizationProviderProps) => {
8
8
  children: import("react").ReactNode;
9
9
  localeText: Partial<import("../locales/index.js").ChartsLocaleText> | undefined;
10
10
  chartProviderProps: ChartProviderProps<TSeries, TSignatures>;
@@ -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
  }
@@ -7,4 +7,4 @@ declare function ChartsReferenceLine(props: ChartsReferenceLineProps): React.JSX
7
7
  declare namespace ChartsReferenceLine {
8
8
  var propTypes: any;
9
9
  }
10
- export { ChartsReferenceLine };
10
+ export { ChartsReferenceLine, type ChartsReferenceLineProps };
@@ -10,4 +10,7 @@ export type ChartsXReferenceLineProps<TValue extends string | number | Date = st
10
10
  };
11
11
  export declare function getXReferenceLineClasses(classes?: Partial<ChartsReferenceLineClasses>): Record<"root" | "line" | "label", string>;
12
12
  declare function ChartsXReferenceLine(props: ChartsXReferenceLineProps): React.JSX.Element | null;
13
+ declare namespace ChartsXReferenceLine {
14
+ var propTypes: any;
15
+ }
13
16
  export { ChartsXReferenceLine };
@@ -10,6 +10,7 @@ exports.ChartsXReferenceLine = ChartsXReferenceLine;
10
10
  exports.getXReferenceLineClasses = getXReferenceLineClasses;
11
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
12
  var React = _interopRequireWildcard(require("react"));
13
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
14
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
14
15
  var _warning = require("@mui/x-internals/warning");
15
16
  var _hooks = require("../hooks");
@@ -106,4 +107,50 @@ function ChartsXReferenceLine(props) {
106
107
  style: (0, _extends2.default)({}, textParams.style, labelStyle)
107
108
  }))]
108
109
  });
109
- }
110
+ }
111
+ process.env.NODE_ENV !== "production" ? ChartsXReferenceLine.propTypes = {
112
+ // ----------------------------- Warning --------------------------------
113
+ // | These PropTypes are generated from the TypeScript type definitions |
114
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
115
+ // ----------------------------------------------------------------------
116
+ /**
117
+ * The id of the axis used for the reference value.
118
+ * @default The `id` of the first defined axis.
119
+ */
120
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
121
+ /**
122
+ * Override or extend the styles applied to the component.
123
+ */
124
+ classes: _propTypes.default.object,
125
+ /**
126
+ * The label to display along the reference line.
127
+ */
128
+ label: _propTypes.default.string,
129
+ /**
130
+ * The alignment if the label is in the chart drawing area.
131
+ * @default 'middle'
132
+ */
133
+ labelAlign: _propTypes.default.oneOf(['end', 'middle', 'start']),
134
+ /**
135
+ * The style applied to the label.
136
+ */
137
+ labelStyle: _propTypes.default.object,
138
+ /**
139
+ * The style applied to the line.
140
+ */
141
+ lineStyle: _propTypes.default.object,
142
+ /**
143
+ * Additional space around the label in px.
144
+ * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes.
145
+ * @default 5
146
+ */
147
+ spacing: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
148
+ x: _propTypes.default.number,
149
+ y: _propTypes.default.number
150
+ })]),
151
+ /**
152
+ * The x value associated with the reference line.
153
+ * If defined the reference line will be vertical.
154
+ */
155
+ x: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]).isRequired
156
+ } : void 0;
@@ -10,4 +10,7 @@ export type ChartsYReferenceLineProps<TValue extends string | number | Date = st
10
10
  };
11
11
  export declare function getYReferenceLineClasses(classes?: Partial<ChartsReferenceLineClasses>): Record<"root" | "line" | "label", string>;
12
12
  declare function ChartsYReferenceLine(props: ChartsYReferenceLineProps): React.JSX.Element | null;
13
+ declare namespace ChartsYReferenceLine {
14
+ var propTypes: any;
15
+ }
13
16
  export { ChartsYReferenceLine };
@@ -10,6 +10,7 @@ exports.ChartsYReferenceLine = ChartsYReferenceLine;
10
10
  exports.getYReferenceLineClasses = getYReferenceLineClasses;
11
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
12
  var React = _interopRequireWildcard(require("react"));
13
+ var _propTypes = _interopRequireDefault(require("prop-types"));
13
14
  var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
14
15
  var _warning = require("@mui/x-internals/warning");
15
16
  var _hooks = require("../hooks");
@@ -106,4 +107,50 @@ function ChartsYReferenceLine(props) {
106
107
  style: (0, _extends2.default)({}, textParams.style, labelStyle)
107
108
  }))]
108
109
  });
109
- }
110
+ }
111
+ process.env.NODE_ENV !== "production" ? ChartsYReferenceLine.propTypes = {
112
+ // ----------------------------- Warning --------------------------------
113
+ // | These PropTypes are generated from the TypeScript type definitions |
114
+ // | To update them edit the TypeScript types and run "pnpm proptypes" |
115
+ // ----------------------------------------------------------------------
116
+ /**
117
+ * The id of the axis used for the reference value.
118
+ * @default The `id` of the first defined axis.
119
+ */
120
+ axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
121
+ /**
122
+ * Override or extend the styles applied to the component.
123
+ */
124
+ classes: _propTypes.default.object,
125
+ /**
126
+ * The label to display along the reference line.
127
+ */
128
+ label: _propTypes.default.string,
129
+ /**
130
+ * The alignment if the label is in the chart drawing area.
131
+ * @default 'middle'
132
+ */
133
+ labelAlign: _propTypes.default.oneOf(['end', 'middle', 'start']),
134
+ /**
135
+ * The style applied to the label.
136
+ */
137
+ labelStyle: _propTypes.default.object,
138
+ /**
139
+ * The style applied to the line.
140
+ */
141
+ lineStyle: _propTypes.default.object,
142
+ /**
143
+ * Additional space around the label in px.
144
+ * Can be a number or an object `{ x, y }` to distinguish space with the reference line and space with axes.
145
+ * @default 5
146
+ */
147
+ spacing: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
148
+ x: _propTypes.default.number,
149
+ y: _propTypes.default.number
150
+ })]),
151
+ /**
152
+ * The y value associated with the reference line.
153
+ * If defined the reference line will be horizontal.
154
+ */
155
+ y: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]).isRequired
156
+ } : void 0;
@@ -1,2 +1,4 @@
1
1
  export * from "./ChartsReferenceLine.js";
2
- export * from "./chartsReferenceLineClasses.js";
2
+ export * from "./chartsReferenceLineClasses.js";
3
+ export type { ChartsXReferenceLineProps } from "./ChartsXReferenceLine.js";
4
+ export type { ChartsYReferenceLineProps } from "./ChartsYReferenceLine.js";
@@ -36,7 +36,8 @@ const ChartsSurfaceStyles = (0, _styles.styled)('svg', {
36
36
  overflow: 'hidden',
37
37
  // This prevents default touch actions when using the svg on mobile devices.
38
38
  // For example, prevent page scroll & zoom.
39
- touchAction: 'none'
39
+ touchAction: 'pan-y',
40
+ userSelect: 'none'
40
41
  }));
41
42
 
42
43
  /**
@@ -16,7 +16,7 @@ var _useLazyRef = _interopRequireDefault(require("@mui/utils/useLazyRef"));
16
16
  var _styles = require("@mui/material/styles");
17
17
  var _Popper = _interopRequireDefault(require("@mui/material/Popper"));
18
18
  var _NoSsr = _interopRequireDefault(require("@mui/material/NoSsr"));
19
- var _useSvgRef = require("../hooks/useSvgRef");
19
+ var _rafThrottle = require("@mui/x-internals/rafThrottle");
20
20
  var _utils = require("./utils");
21
21
  var _chartsTooltipClasses = require("./chartsTooltipClasses");
22
22
  var _useSelector = require("../internals/store/useSelector");
@@ -25,6 +25,7 @@ var _useChartInteraction = require("../internals/plugins/featurePlugins/useChart
25
25
  var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
26
26
  var _useChartPolarInteraction = require("../internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors");
27
27
  var _useAxisSystem = require("../hooks/useAxisSystem");
28
+ var _hooks = require("../hooks");
28
29
  var _jsxRuntime = require("react/jsx-runtime");
29
30
  const _excluded = ["trigger", "classes", "children"];
30
31
  const noAxis = () => false;
@@ -58,8 +59,8 @@ function ChartsTooltipContainer(inProps) {
58
59
  children
59
60
  } = props,
60
61
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
62
+ const svgRef = (0, _hooks.useSvgRef)();
61
63
  const classes = (0, _chartsTooltipClasses.useUtilityClasses)(propClasses);
62
- const svgRef = (0, _useSvgRef.useSvgRef)();
63
64
  const pointerType = (0, _utils.usePointerType)();
64
65
  const isFineMainPointer = (0, _utils.useIsFineMainPointer)();
65
66
  const popperRef = React.useRef(null);
@@ -75,19 +76,21 @@ function ChartsTooltipContainer(inProps) {
75
76
  if (element === null) {
76
77
  return () => {};
77
78
  }
79
+ const update = (0, _rafThrottle.rafThrottle)(() => popperRef.current?.update());
78
80
  const handlePointerEvent = event => {
79
81
  // eslint-disable-next-line react-compiler/react-compiler
80
82
  positionRef.current = {
81
83
  x: event.clientX,
82
84
  y: event.clientY
83
85
  };
84
- popperRef.current?.update();
86
+ update();
85
87
  };
86
88
  element.addEventListener('pointerdown', handlePointerEvent);
87
89
  element.addEventListener('pointermove', handlePointerEvent);
88
90
  return () => {
89
91
  element.removeEventListener('pointerdown', handlePointerEvent);
90
92
  element.removeEventListener('pointermove', handlePointerEvent);
93
+ update.clear();
91
94
  };
92
95
  }, [svgRef, positionRef]);
93
96
  const anchorEl = React.useMemo(() => ({
@@ -13,6 +13,6 @@ export declare const ChartsTooltipRow: import("@emotion/styled").StyledComponent
13
13
  /**
14
14
  * @ignore - internal component.
15
15
  */
16
- export declare const ChartsTooltipCell: import("@emotion/styled").StyledComponent<Pick<import("@mui/material/Typography").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "p" | "style" | "typography" | "zIndex" | "classes" | "border" | "boxShadow" | "fontWeight" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "className" | "children" | "sx" | "align" | "variant" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping">, "p" | "slot" | "style" | "title" | "ref" | "typography" | "zIndex" | "classes" | "border" | "boxShadow" | "fontWeight" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "content" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "translate" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "sx" | "align" | "variant" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
16
+ export declare const ChartsTooltipCell: import("@emotion/styled").StyledComponent<Pick<import("@mui/material/Typography").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "p" | "style" | "typography" | "zIndex" | "classes" | "border" | "boxShadow" | "fontWeight" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "className" | "children" | "sx" | "align" | "variant" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping">, "p" | "slot" | "style" | "title" | "ref" | "typography" | "zIndex" | "classes" | "border" | "boxShadow" | "fontWeight" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "color" | "columnGap" | "content" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "translate" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "displayPrint" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "popover" | "popoverTargetAction" | "popoverTarget" | "inert" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onScrollEnd" | "onScrollEndCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onToggle" | "onBeforeToggle" | "onTransitionCancel" | "onTransitionCancelCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "onTransitionRun" | "onTransitionRunCapture" | "onTransitionStart" | "onTransitionStartCapture" | "sx" | "align" | "variant" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
17
17
  component?: React.ElementType;
18
18
  }, {}, {}>;