@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
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
5
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
@@ -138,12 +139,28 @@ const useChartVoronoi = ({
138
139
  dataIndex
139
140
  };
140
141
  }
141
- const handleMouseLeave = () => {
142
- instance.cleanInteraction?.();
143
- instance.clearHighlight?.();
144
- };
145
- const handleMouseMove = event => {
146
- const closestPoint = getClosestPoint(event);
142
+
143
+ // Clean the interaction when the mouse leaves the chart.
144
+ const moveEndHandler = instance.addInteractionListener('moveEnd', event => {
145
+ if (!event.detail.activeGestures.pan) {
146
+ instance.cleanInteraction?.();
147
+ instance.clearHighlight?.();
148
+ }
149
+ });
150
+ const panEndHandler = instance.addInteractionListener('panEnd', event => {
151
+ if (!event.detail.activeGestures.move) {
152
+ instance.cleanInteraction?.();
153
+ instance.clearHighlight?.();
154
+ }
155
+ });
156
+ const pressEndHandler = instance.addInteractionListener('quickPressEnd', event => {
157
+ if (!event.detail.activeGestures.move && !event.detail.activeGestures.pan) {
158
+ instance.cleanInteraction?.();
159
+ instance.clearHighlight?.();
160
+ }
161
+ });
162
+ const gestureHandler = event => {
163
+ const closestPoint = getClosestPoint(event.detail.srcEvent);
147
164
  if (closestPoint === 'outside-chart') {
148
165
  instance.cleanInteraction?.();
149
166
  instance.clearHighlight?.();
@@ -168,32 +185,31 @@ const useChartVoronoi = ({
168
185
  dataIndex
169
186
  });
170
187
  };
171
- const handleMouseClick = event => {
172
- if (!onItemClick) {
173
- return;
174
- }
175
- const closestPoint = getClosestPoint(event);
176
- if (typeof closestPoint === 'string') {
177
- // No point fond for any reason
178
- return;
188
+ const tapHandler = instance.addInteractionListener('tap', event => {
189
+ const closestPoint = getClosestPoint(event.detail.srcEvent);
190
+ if (typeof closestPoint !== 'string' && onItemClick) {
191
+ const {
192
+ seriesId,
193
+ dataIndex
194
+ } = closestPoint;
195
+ onItemClick(event.detail.srcEvent, {
196
+ type: 'scatter',
197
+ seriesId,
198
+ dataIndex
199
+ });
179
200
  }
180
- const {
181
- seriesId,
182
- dataIndex
183
- } = closestPoint;
184
- onItemClick(event, {
185
- type: 'scatter',
186
- seriesId,
187
- dataIndex
188
- });
189
- };
190
- element.addEventListener('pointerleave', handleMouseLeave);
191
- element.addEventListener('pointermove', handleMouseMove);
192
- element.addEventListener('click', handleMouseClick);
201
+ });
202
+ const moveHandler = instance.addInteractionListener('move', gestureHandler);
203
+ const panHandler = instance.addInteractionListener('pan', gestureHandler);
204
+ const pressHandler = instance.addInteractionListener('quickPress', gestureHandler);
193
205
  return () => {
194
- element.removeEventListener('pointerleave', handleMouseLeave);
195
- element.removeEventListener('pointermove', handleMouseMove);
196
- element.removeEventListener('click', handleMouseClick);
206
+ tapHandler.cleanup();
207
+ moveHandler.cleanup();
208
+ moveEndHandler.cleanup();
209
+ panHandler.cleanup();
210
+ panEndHandler.cleanup();
211
+ pressHandler.cleanup();
212
+ pressEndHandler.cleanup();
197
213
  };
198
214
  }, [svgRef, yAxis, xAxis, voronoiMaxRadius, onItemClick, disableVoronoi, drawingArea, instance]);
199
215
 
@@ -1,4 +1,4 @@
1
- export declare const selectorChartsVoronoiIsVoronoiEnabled: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("./useChartVoronoi.types.js").UseChartVoronoiState & Partial<{}> & {
1
+ export declare const selectorChartsVoronoiIsVoronoiEnabled: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & import("./useChartVoronoi.types.js").UseChartVoronoiState & Partial<{}> & {
2
2
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
3
3
  } & {
4
4
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
@@ -1,4 +1,4 @@
1
- export declare const selectorChartZAxis: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("./useChartZAxis.types.js").UseChartZAxisState & Partial<{}> & {
1
+ export declare const selectorChartZAxis: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & import("./useChartZAxis.types.js").UseChartZAxisState & Partial<{}> & {
2
2
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
3
3
  } & {
4
4
  cacheKey: import("../../models/index.js").ChartStateCacheKey;
@@ -0,0 +1,7 @@
1
+ import type { ChartStore } from "./ChartStore.js";
2
+ import { ChartAnyPluginSignature, ChartState } from "../models/index.js";
3
+ export declare function useLazySelectorEffect<TSignatures extends readonly ChartAnyPluginSignature[], Value>(store: ChartStore<TSignatures>, selector: (state: ChartState<TSignatures>) => Value, effect: (previous: Value, next: Value) => void,
4
+ /**
5
+ * If true, the selector will be ignored.
6
+ */
7
+ skip?: boolean): void;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ /* eslint-disable react-compiler/react-compiler */
5
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
6
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.useLazySelectorEffect = useLazySelectorEffect;
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _useLazyRef = _interopRequireDefault(require("@mui/utils/useLazyRef"));
13
+ const noop = () => {};
14
+ function useLazySelectorEffect(store, selector, effect,
15
+ /**
16
+ * If true, the selector will be ignored.
17
+ */
18
+ skip) {
19
+ const instance = (0, _useLazyRef.default)(initialize, {
20
+ store,
21
+ selector,
22
+ skip
23
+ }).current;
24
+ instance.effect = effect;
25
+ // eslint-disable-next-line react-hooks/exhaustive-deps
26
+ React.useEffect(instance.onMount(skip), [skip]);
27
+ }
28
+
29
+ // `useLazyRef` typings are incorrect, `params` should not be optional
30
+ function initialize(params) {
31
+ const {
32
+ store,
33
+ selector,
34
+ skip: initialSkip
35
+ } = params;
36
+ let isRunning = false;
37
+ let previousState;
38
+
39
+ // We want a single subscription done right away and cleared on unmount only,
40
+ // but React triggers `useOnMount` multiple times in dev, so we need to manage
41
+ // the subscription anyway.
42
+ const subscribe = () => {
43
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
44
+ instance.dispose ?? (instance.dispose = store.subscribe(state => {
45
+ const nextState = selector(state);
46
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
47
+ instance.effect(previousState, nextState);
48
+ previousState = nextState;
49
+ }));
50
+ };
51
+ const instance = {
52
+ effect: noop,
53
+ dispose: null,
54
+ onMount: skip => () => {
55
+ if (skip) {
56
+ return undefined;
57
+ }
58
+ if (!isRunning) {
59
+ // Initialize values
60
+ isRunning = true;
61
+ previousState = selector(store.value);
62
+ }
63
+ subscribe();
64
+ return () => {
65
+ instance.dispose?.();
66
+ instance.dispose = null;
67
+ };
68
+ }
69
+ };
70
+ if (!initialSkip) {
71
+ // Initialize values
72
+ isRunning = true;
73
+ previousState = selector(store.value);
74
+ subscribe();
75
+ }
76
+ return instance;
77
+ }
@@ -16,7 +16,7 @@ import { ChartSeriesConfig } from "../plugins/models/seriesConfig/index.js";
16
16
  */
17
17
  export declare function useCharts<TSeriesType extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]>(inPlugins: ConvertSignaturesIntoPlugins<TSignatures>, props: Partial<UseChartBaseProps<TSignatures>>, seriesConfig: ChartSeriesConfig<TSeriesType>): {
18
18
  contextValue: {
19
- store: ChartStore<readonly [import("../index.js").UseChartIdSignature, import("../index.js").UseChartDimensionsSignature, import("../index.js").UseChartSeriesSignature, import("../plugins/corePlugins/useChartAnimation/index.js").UseChartAnimationSignature, ...TSignatures]> & UseChartInteractionState;
19
+ store: ChartStore<readonly [import("../index.js").UseChartIdSignature, import("../plugins/corePlugins/useChartExperimentalFeature/index.js").UseChartExperimentalFeaturesSignature, import("../index.js").UseChartDimensionsSignature, import("../index.js").UseChartSeriesSignature, import("../plugins/corePlugins/useChartAnimation/index.js").UseChartAnimationSignature, import("../index.js").UseChartInteractionListenerSignature, ...TSignatures]> & UseChartInteractionState;
20
20
  publicAPI: ChartPublicAPI<TSignatures>;
21
21
  instance: ChartInstance<TSignatures>;
22
22
  svgRef: React.RefObject<SVGSVGElement | null>;
@@ -0,0 +1,19 @@
1
+ import { ChartsLocaleText } from "./utils/chartsLocaleTextApi.js";
2
+ export declare const elGRLocaleText: Partial<ChartsLocaleText>;
3
+ export declare const elGR: {
4
+ components: {
5
+ MuiChartsLocalizationProvider: {
6
+ defaultProps: {
7
+ localeText: {
8
+ loading?: string | undefined;
9
+ noData?: string | undefined;
10
+ zoomIn?: string | undefined;
11
+ zoomOut?: string | undefined;
12
+ toolbarExport?: string | undefined;
13
+ toolbarExportPrint?: string | undefined;
14
+ toolbarExportImage?: ((mimeType: import("./utils/imageMimeTypes.js").ChartImageExportMimeType | (string & {})) => string) | undefined;
15
+ };
16
+ };
17
+ };
18
+ };
19
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.elGRLocaleText = exports.elGR = void 0;
7
+ var _imageMimeTypes = require("./utils/imageMimeTypes");
8
+ var _getChartsLocalization = require("./utils/getChartsLocalization");
9
+ const elGRLocaleText = exports.elGRLocaleText = {
10
+ // Overlay
11
+ loading: 'Φόρτωση δεδομένων…',
12
+ noData: 'Δεν υπάρχουν δεδομένα για εμφάνιση',
13
+ // Toolbar
14
+ zoomIn: 'Μεγέθυνση',
15
+ zoomOut: 'Σμίκρυνση',
16
+ toolbarExport: 'Εξαγωγή',
17
+ // Toolbar Export Menu
18
+ toolbarExportPrint: 'Εκτύπωση',
19
+ toolbarExportImage: mimeType => `Εξαγωγή ως ${_imageMimeTypes.imageMimeTypes[mimeType] ?? mimeType}`
20
+ };
21
+ const elGR = exports.elGR = (0, _getChartsLocalization.getChartsLocalization)(elGRLocaleText);
@@ -1,4 +1,5 @@
1
1
  export type { ChartsLocaleText } from "./utils/chartsLocaleTextApi.js";
2
+ export * from "./elGR.js";
2
3
  export * from "./enUS.js";
3
4
  export * from "./frFR.js";
4
5
  export * from "./ptBR.js";
package/locales/index.js CHANGED
@@ -3,6 +3,17 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ var _elGR = require("./elGR");
7
+ Object.keys(_elGR).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _elGR[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _elGR[key];
14
+ }
15
+ });
16
+ });
6
17
  var _enUS = require("./enUS");
7
18
  Object.keys(_enUS).forEach(function (key) {
8
19
  if (key === "default" || key === "__esModule") return;
package/models/axis.d.ts CHANGED
@@ -408,6 +408,21 @@ export interface ChartsAxisData {
408
408
  */
409
409
  seriesValues: Record<string, number | null | undefined>;
410
410
  }
411
+ export type CartesianDirection = 'x' | 'y';
412
+ export type PolarDirection = 'rotation' | 'radius';
413
+ /**
414
+ * Identifies a data point within an axis.
415
+ */
416
+ export interface AxisItemIdentifier {
417
+ /**
418
+ * The axis id.
419
+ */
420
+ axisId: AxisId;
421
+ /**
422
+ * The data index.
423
+ */
424
+ dataIndex: number;
425
+ }
411
426
  export type XAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<AxisConfig<S, V, ChartsXAxisProps>, 'id'> : never;
412
427
  export type YAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? MakeOptional<AxisConfig<S, V, ChartsYAxisProps>, 'id'> : never;
413
428
  export type RotationAxis<S extends ScaleName = ScaleName, V = any> = S extends ScaleName ? AxisConfig<S, V, ChartsRotationAxisProps> : never;
package/models/axis.js CHANGED
@@ -29,6 +29,10 @@ function isPointScaleConfig(scaleConfig) {
29
29
  * The data format returned by onAxisClick.
30
30
  */
31
31
 
32
+ /**
33
+ * Identifies a data point within an axis.
34
+ */
35
+
32
36
  /**
33
37
  * The axis configuration with missing values filled with default values.
34
38
  */
package/models/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from "./seriesType/index.js";
2
2
  export * from "./stacking.js";
3
3
  export * from "./slots/index.js";
4
- export type { AxisConfig, ChartsYAxisProps, ChartsXAxisProps, ScaleName, ContinuousScaleName, ChartsAxisData, XAxis, YAxis, RadiusAxis, RotationAxis, AxisValueFormatterContext } from "./axis.js";
4
+ export type { AxisConfig, ChartsYAxisProps, ChartsXAxisProps, ScaleName, ContinuousScaleName, ChartsAxisData, XAxis, YAxis, RadiusAxis, RotationAxis, AxisItemIdentifier, AxisValueFormatterContext } from "./axis.js";
5
5
  export type { PropsFromSlot } from '@mui/x-internals/slots';
6
6
  export type { Position } from "./position.js";
7
7
  export type { CurveType } from "./curve.js";
@@ -1,4 +1,4 @@
1
- import { DefaultizedProps } from '@mui/x-internals/types';
1
+ import { DefaultizedProps, MakeRequired } from '@mui/x-internals/types';
2
2
  import { CartesianSeriesType, CommonDefaultizedProps, CommonSeriesType, SeriesId } from "./common.js";
3
3
  export type ScatterValueType = {
4
4
  x: number;
@@ -50,6 +50,13 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | n
50
50
  */
51
51
  id?: string;
52
52
  };
53
+ preview?: {
54
+ /**
55
+ * The size of the preview marker.
56
+ * @default 1
57
+ */
58
+ markerSize?: number;
59
+ };
53
60
  }
54
61
  /**
55
62
  * An object that allows to identify a single scatter item.
@@ -60,4 +67,6 @@ export type ScatterItemIdentifier = {
60
67
  seriesId: SeriesId;
61
68
  dataIndex: number;
62
69
  };
63
- export interface DefaultizedScatterSeriesType extends DefaultizedProps<ScatterSeriesType, CommonDefaultizedProps | 'color' | 'markerSize'> {}
70
+ export interface DefaultizedScatterSeriesType extends DefaultizedProps<ScatterSeriesType, CommonDefaultizedProps | 'color' | 'markerSize'> {
71
+ preview: MakeRequired<NonNullable<ScatterSeriesType['preview']>, 'markerSize'>;
72
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "8.6.0",
3
+ "version": "8.8.0",
4
4
  "author": "MUI Team",
5
5
  "description": "The community edition of MUI X Charts components.",
6
6
  "main": "./index.js",
@@ -30,14 +30,15 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.27.6",
33
- "@mui/utils": "^7.1.1",
33
+ "@mui/utils": "^7.2.0",
34
34
  "bezier-easing": "^2.1.0",
35
35
  "clsx": "^2.1.1",
36
36
  "prop-types": "^15.8.1",
37
37
  "reselect": "^5.1.1",
38
38
  "use-sync-external-store": "^1.5.0",
39
39
  "@mui/x-charts-vendor": "8.5.3",
40
- "@mui/x-internals": "8.6.0"
40
+ "@mui/x-internals": "8.8.0",
41
+ "@mui/x-internal-gestures": "0.2.1"
41
42
  },
42
43
  "peerDependencies": {
43
44
  "@emotion/react": "^11.9.0",
@@ -33,6 +33,9 @@ export interface ChartsComponents<Theme = unknown> {
33
33
  defaultProps?: ComponentsProps['MuiChartsSurface'];
34
34
  styleOverrides?: ComponentsOverrides<Theme>['MuiChartsSurface'];
35
35
  };
36
+ MuiChartDataProvider?: {
37
+ defaultProps?: ComponentsProps['MuiChartDataProvider'];
38
+ };
36
39
  MuiBarChart?: {
37
40
  defaultProps?: ComponentsProps['MuiBarChart'];
38
41
  };
@@ -9,6 +9,7 @@ import { ScatterChartProps } from "../ScatterChart/ScatterChart.js";
9
9
  import { PieChartProps } from "../PieChart/PieChart.js";
10
10
  import { ChartsXAxisProps, ChartsYAxisProps } from "../models/axis.js";
11
11
  import { ChartsLocalizationProviderProps } from "../ChartsLocalizationProvider/index.js";
12
+ import { ChartDataProviderProps } from "../ChartDataProvider/index.js";
12
13
  export interface ChartsComponentsPropsList {
13
14
  MuiChartsXAxis: ChartsXAxisProps;
14
15
  MuiChartsYAxis: ChartsYAxisProps;
@@ -17,6 +18,7 @@ export interface ChartsComponentsPropsList {
17
18
  MuiChartsLocalizationProvider: ChartsLocalizationProviderProps;
18
19
  MuiChartsTooltip: ChartsTooltipProps;
19
20
  MuiChartsSurface: ChartsSurfaceProps;
21
+ MuiChartDataProvider: ChartDataProviderProps;
20
22
  MuiBarChart: BarChartProps;
21
23
  MuiBarLabel: BarLabelProps;
22
24
  MuiLineChart: LineChartProps;