@mui/x-charts 9.8.0 → 9.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/BarChart/AnimatedBarElement.d.mts +1 -1
  2. package/BarChart/AnimatedBarElement.d.ts +1 -1
  3. package/BarChart/BarClipPath.d.mts +1 -1
  4. package/BarChart/BarClipPath.d.ts +1 -1
  5. package/BarChart/BarElement.d.mts +1 -1
  6. package/BarChart/BarElement.d.ts +1 -1
  7. package/BarChart/BarLabel/BarLabelItem.d.mts +1 -1
  8. package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
  9. package/BarChart/BarLabel/BarLabelPlot.d.mts +2 -1
  10. package/BarChart/BarLabel/BarLabelPlot.d.ts +2 -1
  11. package/BarChart/BatchBarPlot/BarGroup.d.mts +1 -1
  12. package/BarChart/BatchBarPlot/BarGroup.d.ts +1 -1
  13. package/BarChart/BatchBarPlot/BatchBarPlot.d.mts +2 -1
  14. package/BarChart/BatchBarPlot/BatchBarPlot.d.ts +2 -1
  15. package/BarChart/FocusedBar.d.mts +1 -1
  16. package/BarChart/FocusedBar.d.ts +1 -1
  17. package/BarChart/IndividualBarPlot.d.mts +2 -1
  18. package/BarChart/IndividualBarPlot.d.ts +2 -1
  19. package/BarChart/seriesConfig/bar/tooltipPosition.d.mts +2 -3
  20. package/BarChart/seriesConfig/bar/tooltipPosition.d.ts +2 -3
  21. package/BarChart/seriesConfig/bar/tooltipPosition.js +19 -15
  22. package/BarChart/seriesConfig/bar/tooltipPosition.mjs +18 -14
  23. package/BarChart/seriesConfig/index.js +2 -2
  24. package/BarChart/seriesConfig/index.mjs +2 -2
  25. package/BarChart/useBarPlotData.d.mts +5 -1
  26. package/BarChart/useBarPlotData.d.ts +5 -1
  27. package/BarChart/useBarPlotData.js +102 -25
  28. package/BarChart/useBarPlotData.mjs +102 -26
  29. package/CHANGELOG.md +119 -0
  30. package/ChartsAxis/ChartsAxis.d.mts +2 -1
  31. package/ChartsAxis/ChartsAxis.d.ts +2 -1
  32. package/ChartsAxisHighlight/ChartsAxisHighlight.d.mts +2 -1
  33. package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +2 -1
  34. package/ChartsAxisHighlight/ChartsXAxisHighlight.d.mts +2 -1
  35. package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +2 -1
  36. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +22 -5
  37. package/ChartsAxisHighlight/ChartsXAxisHighlight.mjs +23 -6
  38. package/ChartsAxisHighlight/ChartsYAxisHighlight.d.mts +2 -1
  39. package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +2 -1
  40. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +22 -5
  41. package/ChartsAxisHighlight/ChartsYAxisHighlight.mjs +23 -6
  42. package/ChartsAxisHighlight/getSampledBandHighlight.d.mts +27 -0
  43. package/ChartsAxisHighlight/getSampledBandHighlight.d.ts +27 -0
  44. package/ChartsAxisHighlight/getSampledBandHighlight.js +35 -0
  45. package/ChartsAxisHighlight/getSampledBandHighlight.mjs +29 -0
  46. package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.mts +1 -1
  47. package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.d.ts +1 -1
  48. package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.mts +2 -1
  49. package/ChartsAxisHighlightValue/ChartsAxisHighlightValueItem.d.ts +2 -1
  50. package/ChartsBrushOverlay/ChartsBrushOverlay.d.mts +2 -1
  51. package/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +2 -1
  52. package/ChartsClipPath/ChartsClipPath.d.mts +1 -1
  53. package/ChartsClipPath/ChartsClipPath.d.ts +1 -1
  54. package/ChartsDataProvider/ChartsDataProvider.d.mts +1 -1
  55. package/ChartsDataProvider/ChartsDataProvider.d.ts +1 -1
  56. package/ChartsGrid/ChartsGrid.d.mts +1 -1
  57. package/ChartsGrid/ChartsGrid.d.ts +1 -1
  58. package/ChartsGrid/ChartsHorizontalGrid.d.mts +2 -1
  59. package/ChartsGrid/ChartsHorizontalGrid.d.ts +2 -1
  60. package/ChartsGrid/ChartsVerticalGrid.d.mts +2 -1
  61. package/ChartsGrid/ChartsVerticalGrid.d.ts +2 -1
  62. package/ChartsLocalizationProvider/ChartsLocalizationProvider.d.mts +1 -1
  63. package/ChartsLocalizationProvider/ChartsLocalizationProvider.d.ts +1 -1
  64. package/ChartsOverlay/ChartsLoadingOverlay.d.mts +1 -1
  65. package/ChartsOverlay/ChartsLoadingOverlay.d.ts +1 -1
  66. package/ChartsOverlay/ChartsNoDataOverlay.d.mts +1 -1
  67. package/ChartsOverlay/ChartsNoDataOverlay.d.ts +1 -1
  68. package/ChartsOverlay/ChartsOverlay.d.mts +1 -1
  69. package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
  70. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.mts +2 -1
  71. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.d.ts +2 -1
  72. package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.mts +2 -1
  73. package/ChartsRadialAxisHighlight/ChartsRadiusAxisHighlight.d.ts +2 -1
  74. package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.mts +2 -1
  75. package/ChartsRadialAxisHighlight/ChartsRotationAxisHighlight.d.ts +2 -1
  76. package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.mts +1 -1
  77. package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.ts +1 -1
  78. package/ChartsRadialGrid/ChartsRadialGrid.d.mts +1 -1
  79. package/ChartsRadialGrid/ChartsRadialGrid.d.ts +1 -1
  80. package/ChartsRadialGrid/ChartsRadiusGrid.d.mts +2 -1
  81. package/ChartsRadialGrid/ChartsRadiusGrid.d.ts +2 -1
  82. package/ChartsRadialGrid/ChartsRotationGrid.d.mts +2 -1
  83. package/ChartsRadialGrid/ChartsRotationGrid.d.ts +2 -1
  84. package/ChartsRadiusAxis/ChartsRadiusAxis.d.mts +1 -1
  85. package/ChartsRadiusAxis/ChartsRadiusAxis.d.ts +1 -1
  86. package/ChartsReferenceLine/ChartsReferenceLine.d.mts +1 -1
  87. package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
  88. package/ChartsReferenceLine/ChartsXReferenceLine.d.mts +1 -1
  89. package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
  90. package/ChartsReferenceLine/ChartsYReferenceLine.d.mts +1 -1
  91. package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
  92. package/ChartsRotationAxis/ChartsRotationAxis.d.mts +1 -1
  93. package/ChartsRotationAxis/ChartsRotationAxis.d.ts +1 -1
  94. package/ChartsText/ChartsText.d.mts +1 -1
  95. package/ChartsText/ChartsText.d.ts +1 -1
  96. package/ChartsTooltip/ChartsAxisTooltipContent.d.mts +1 -1
  97. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -1
  98. package/ChartsTooltip/ChartsItemTooltipContent.d.mts +2 -1
  99. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +2 -1
  100. package/ChartsTooltip/ChartsTooltip.d.mts +1 -1
  101. package/ChartsTooltip/ChartsTooltip.d.ts +1 -1
  102. package/ChartsTooltip/ChartsTooltipContainer.d.mts +1 -1
  103. package/ChartsTooltip/ChartsTooltipContainer.d.ts +1 -1
  104. package/ChartsTooltip/ChartsTooltipContainer.js +1 -5
  105. package/ChartsTooltip/ChartsTooltipContainer.mjs +2 -6
  106. package/ChartsXAxis/ChartsGroupedXAxisTicks.d.mts +2 -1
  107. package/ChartsXAxis/ChartsGroupedXAxisTicks.d.ts +2 -1
  108. package/ChartsXAxis/ChartsSingleXAxisTicks.d.mts +2 -1
  109. package/ChartsXAxis/ChartsSingleXAxisTicks.d.ts +2 -1
  110. package/ChartsXAxis/ChartsXAxis.d.mts +1 -1
  111. package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
  112. package/ChartsXAxis/ChartsXAxisImpl.d.mts +2 -1
  113. package/ChartsXAxis/ChartsXAxisImpl.d.ts +2 -1
  114. package/ChartsYAxis/ChartsGroupedYAxisTicks.d.mts +2 -1
  115. package/ChartsYAxis/ChartsGroupedYAxisTicks.d.ts +2 -1
  116. package/ChartsYAxis/ChartsSingleYAxisTicks.d.mts +2 -1
  117. package/ChartsYAxis/ChartsSingleYAxisTicks.d.ts +2 -1
  118. package/ChartsYAxis/ChartsYAxis.d.mts +1 -1
  119. package/ChartsYAxis/ChartsYAxis.d.ts +1 -1
  120. package/ChartsYAxis/ChartsYAxisImpl.d.mts +2 -1
  121. package/ChartsYAxis/ChartsYAxisImpl.d.ts +2 -1
  122. package/Gauge/GaugeProvider.d.mts +1 -1
  123. package/Gauge/GaugeProvider.d.ts +1 -1
  124. package/Gauge/GaugeReferenceArc.d.mts +1 -1
  125. package/Gauge/GaugeReferenceArc.d.ts +1 -1
  126. package/Gauge/GaugeValueArc.d.mts +1 -1
  127. package/Gauge/GaugeValueArc.d.ts +1 -1
  128. package/Gauge/GaugeValueText.d.mts +1 -1
  129. package/Gauge/GaugeValueText.d.ts +1 -1
  130. package/LineChart/AnimatedArea.d.mts +1 -1
  131. package/LineChart/AnimatedArea.d.ts +1 -1
  132. package/LineChart/AppearingMask.d.mts +1 -1
  133. package/LineChart/AppearingMask.d.ts +1 -1
  134. package/LineChart/AreaElement.d.mts +1 -1
  135. package/LineChart/AreaElement.d.ts +1 -1
  136. package/LineChart/AreaPlot.d.mts +1 -1
  137. package/LineChart/AreaPlot.d.ts +1 -1
  138. package/LineChart/CircleMarkElement.d.mts +1 -1
  139. package/LineChart/CircleMarkElement.d.ts +1 -1
  140. package/LineChart/FocusedLineMark.d.mts +1 -1
  141. package/LineChart/FocusedLineMark.d.ts +1 -1
  142. package/LineChart/LineElement.d.mts +1 -1
  143. package/LineChart/LineElement.d.ts +1 -1
  144. package/LineChart/LineHighlightElement.d.mts +1 -1
  145. package/LineChart/LineHighlightElement.d.ts +1 -1
  146. package/LineChart/LineHighlightPlot.d.mts +1 -1
  147. package/LineChart/LineHighlightPlot.d.ts +1 -1
  148. package/LineChart/LinePlot.d.mts +1 -1
  149. package/LineChart/LinePlot.d.ts +1 -1
  150. package/LineChart/LinePlot.js +3 -2
  151. package/LineChart/LinePlot.mjs +3 -2
  152. package/LineChart/MarkElement.d.mts +1 -1
  153. package/LineChart/MarkElement.d.ts +1 -1
  154. package/LineChart/MarkPlot.d.mts +1 -1
  155. package/LineChart/MarkPlot.d.ts +1 -1
  156. package/LineChart/seriesConfig/index.js +2 -2
  157. package/LineChart/seriesConfig/index.mjs +2 -2
  158. package/LineChart/seriesConfig/tooltipPosition.d.mts +2 -3
  159. package/LineChart/seriesConfig/tooltipPosition.d.ts +2 -3
  160. package/LineChart/seriesConfig/tooltipPosition.js +14 -14
  161. package/LineChart/seriesConfig/tooltipPosition.mjs +13 -13
  162. package/LineChart/useLinePlotData.d.mts +13 -1
  163. package/LineChart/useLinePlotData.d.ts +13 -1
  164. package/LineChart/useLinePlotData.js +90 -33
  165. package/LineChart/useLinePlotData.mjs +92 -34
  166. package/PieChart/FocusedPieArc.d.mts +1 -1
  167. package/PieChart/FocusedPieArc.d.ts +1 -1
  168. package/PieChart/PieArcLabelPlot.d.mts +1 -1
  169. package/PieChart/PieArcLabelPlot.d.ts +1 -1
  170. package/PieChart/PieArcPlot.d.mts +1 -1
  171. package/PieChart/PieArcPlot.d.ts +1 -1
  172. package/PieChart/PiePlot.d.mts +1 -1
  173. package/PieChart/PiePlot.d.ts +1 -1
  174. package/PieChart/seriesConfig/index.js +2 -2
  175. package/PieChart/seriesConfig/index.mjs +2 -2
  176. package/PieChart/seriesConfig/tooltipPosition.d.mts +2 -3
  177. package/PieChart/seriesConfig/tooltipPosition.d.ts +2 -3
  178. package/PieChart/seriesConfig/tooltipPosition.js +7 -11
  179. package/PieChart/seriesConfig/tooltipPosition.mjs +6 -10
  180. package/RadarChart/FocusedRadarMark.d.mts +1 -1
  181. package/RadarChart/FocusedRadarMark.d.ts +1 -1
  182. package/RadarChart/RadarAxis/RadarAxis.d.mts +1 -1
  183. package/RadarChart/RadarAxis/RadarAxis.d.ts +1 -1
  184. package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.mts +1 -1
  185. package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.ts +1 -1
  186. package/RadarChart/RadarDataProvider/RadarDataProvider.d.mts +2 -1
  187. package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +2 -1
  188. package/RadarChart/RadarGrid/CircularRadarGrid.d.mts +2 -1
  189. package/RadarChart/RadarGrid/CircularRadarGrid.d.ts +2 -1
  190. package/RadarChart/RadarGrid/CircularRadarStripes.d.mts +2 -1
  191. package/RadarChart/RadarGrid/CircularRadarStripes.d.ts +2 -1
  192. package/RadarChart/RadarGrid/RadarGrid.d.mts +2 -1
  193. package/RadarChart/RadarGrid/RadarGrid.d.ts +2 -1
  194. package/RadarChart/RadarGrid/SharpRadarGrid.d.mts +2 -1
  195. package/RadarChart/RadarGrid/SharpRadarGrid.d.ts +2 -1
  196. package/RadarChart/RadarGrid/SharpRadarStripes.d.mts +2 -1
  197. package/RadarChart/RadarGrid/SharpRadarStripes.d.ts +2 -1
  198. package/RadarChart/RadarMetricLabels/RadarMetricLabels.d.mts +2 -1
  199. package/RadarChart/RadarMetricLabels/RadarMetricLabels.d.ts +2 -1
  200. package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.mts +2 -1
  201. package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +2 -1
  202. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.mts +2 -1
  203. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +2 -1
  204. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.mts +1 -1
  205. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +1 -1
  206. package/RadarChart/seriesConfig/index.js +2 -2
  207. package/RadarChart/seriesConfig/index.mjs +2 -2
  208. package/RadarChart/seriesConfig/tooltipPosition.d.mts +2 -3
  209. package/RadarChart/seriesConfig/tooltipPosition.d.ts +2 -3
  210. package/RadarChart/seriesConfig/tooltipPosition.js +9 -16
  211. package/RadarChart/seriesConfig/tooltipPosition.mjs +8 -15
  212. package/ScatterChart/BatchScatter.d.mts +2 -1
  213. package/ScatterChart/BatchScatter.d.ts +2 -1
  214. package/ScatterChart/FocusedScatterMark.d.mts +1 -1
  215. package/ScatterChart/FocusedScatterMark.d.ts +1 -1
  216. package/ScatterChart/HighlightedScatterMark.d.mts +1 -1
  217. package/ScatterChart/HighlightedScatterMark.d.ts +1 -1
  218. package/ScatterChart/Scatter.d.mts +1 -1
  219. package/ScatterChart/Scatter.d.ts +1 -1
  220. package/ScatterChart/ScatterMarker.d.mts +1 -1
  221. package/ScatterChart/ScatterMarker.d.ts +1 -1
  222. package/ScatterChart/ScatterPlot.d.mts +1 -1
  223. package/ScatterChart/ScatterPlot.d.ts +1 -1
  224. package/ScatterChart/async/ScatterAsync.d.mts +2 -1
  225. package/ScatterChart/async/ScatterAsync.d.ts +2 -1
  226. package/ScatterChart/async/ScatterAsyncBatch.d.mts +1 -1
  227. package/ScatterChart/async/ScatterAsyncBatch.d.ts +1 -1
  228. package/ScatterChart/seriesConfig/index.js +2 -2
  229. package/ScatterChart/seriesConfig/index.mjs +2 -2
  230. package/ScatterChart/seriesConfig/tooltipPosition.d.mts +2 -3
  231. package/ScatterChart/seriesConfig/tooltipPosition.d.ts +2 -3
  232. package/ScatterChart/seriesConfig/tooltipPosition.js +13 -13
  233. package/ScatterChart/seriesConfig/tooltipPosition.mjs +12 -12
  234. package/context/ChartsProvider/ChartsProvider.d.mts +1 -1
  235. package/context/ChartsProvider/ChartsProvider.d.ts +1 -1
  236. package/context/ChartsSlotsContext.d.mts +1 -1
  237. package/context/ChartsSlotsContext.d.ts +1 -1
  238. package/index.js +1 -1
  239. package/index.mjs +1 -1
  240. package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.d.mts +2 -1
  241. package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.d.ts +2 -1
  242. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.mts +2 -1
  243. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +2 -1
  244. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.mts +1 -1
  245. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -1
  246. package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.mts +1 -1
  247. package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +1 -1
  248. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.mts +2 -1
  249. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +2 -1
  250. package/internals/createGetBarDimensions.d.mts +14 -1
  251. package/internals/createGetBarDimensions.d.ts +14 -1
  252. package/internals/createGetBarDimensions.js +45 -0
  253. package/internals/createGetBarDimensions.mjs +45 -0
  254. package/internals/geometry.js +1 -1
  255. package/internals/geometry.mjs +1 -1
  256. package/internals/index.d.mts +1 -2
  257. package/internals/index.d.ts +1 -2
  258. package/internals/index.js +12 -8
  259. package/internals/index.mjs +1 -2
  260. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.mts +2 -2
  261. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
  262. package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.mts +1 -1
  263. package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.ts +1 -1
  264. package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.js +4 -4
  265. package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.mjs +1 -1
  266. package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.mts +11 -6
  267. package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.ts +11 -6
  268. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionSelector.types.d.mts +18 -0
  269. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionSelector.types.d.ts +18 -0
  270. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.mts +2 -0
  271. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
  272. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +12 -0
  273. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs +1 -0
  274. package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.d.mts +26 -0
  275. package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.d.ts +26 -0
  276. package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.js +89 -0
  277. package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.mjs +81 -0
  278. package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.types.d.mts +93 -0
  279. package/internals/plugins/featurePlugins/useChartCartesianAxis/sampling.types.d.ts +93 -0
  280. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.mts +5 -0
  281. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +5 -0
  282. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.mts +3 -8
  283. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +3 -8
  284. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +2 -53
  285. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.mjs +2 -53
  286. package/models/seriesType/config.d.mts +6 -2
  287. package/models/seriesType/config.d.ts +6 -2
  288. package/package.json +5 -5
  289. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.mts +0 -45
  290. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.ts +0 -45
  291. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.mts +0 -48
  292. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.ts +0 -48
  293. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.js +0 -124
  294. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.mjs +0 -117
  295. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.mts +0 -73
  296. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.ts +0 -73
  297. /package/internals/plugins/corePlugins/useChartSeriesConfig/types/{tooltipItemPositionGetter.types.js → tooltipItemPositionSelector.types.js} +0 -0
  298. /package/internals/plugins/corePlugins/useChartSeriesConfig/types/{tooltipItemPositionGetter.types.mjs → tooltipItemPositionSelector.types.mjs} +0 -0
  299. /package/internals/plugins/featurePlugins/{useGeoProjection/useGeoProjection.types.js → useChartCartesianAxis/sampling.types.js} +0 -0
  300. /package/internals/plugins/featurePlugins/{useGeoProjection/useGeoProjection.types.mjs → useChartCartesianAxis/sampling.types.mjs} +0 -0
@@ -1,10 +1,15 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import * as React from 'react';
2
3
  import getColor from "./seriesConfig/bar/getColor.mjs";
3
4
  import { useXAxes, useYAxes } from "../hooks/useAxis.mjs";
4
5
  import { checkBarChartScaleErrors } from "./checkBarChartScaleErrors.mjs";
5
6
  import { useBarSeriesContext } from "../hooks/useBarSeries.mjs";
6
- import { createGetBarDimensions } from "../internals/createGetBarDimensions.mjs";
7
+ import { createGetBarDimensions, createGetBucketBarDimensions } from "../internals/createGetBarDimensions.mjs";
7
8
  import { useChartId } from "../hooks/useChartId.mjs";
9
+ import { useStore } from "../internals/store/useStore.mjs";
10
+ import { selectorChartSamplingPyramids, getFullRangeZoom } from "../internals/plugins/featurePlugins/useChartCartesianAxis/sampling.selectors.mjs";
11
+ import { selectorChartSeriesConfig } from "../internals/plugins/corePlugins/useChartSeriesConfig/index.mjs";
12
+ import { selectorChartZoomMap, selectorChartZoomOptionsLookup } from "../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs";
8
13
  export function useBarPlotData(drawingArea, xAxes, yAxes) {
9
14
  const seriesData = useBarSeriesContext() ?? {
10
15
  series: {},
@@ -14,9 +19,14 @@ export function useBarPlotData(drawingArea, xAxes, yAxes) {
14
19
  const defaultXAxisId = useXAxes().xAxisIds[0];
15
20
  const defaultYAxisId = useYAxes().yAxisIds[0];
16
21
  const chartId = useChartId();
17
- return processBarDataForPlot(drawingArea, chartId, seriesData.stackingGroups, seriesData.series, xAxes, yAxes, defaultXAxisId, defaultYAxisId);
22
+ const store = useStore();
23
+ const samplingPyramids = store.use(selectorChartSamplingPyramids);
24
+ const zoomMap = store.use(selectorChartZoomMap);
25
+ const zoomOptions = store.use(selectorChartZoomOptionsLookup);
26
+ const sampler = store.use(selectorChartSeriesConfig).bar?.sampler;
27
+ return React.useMemo(() => processBarDataForPlot(drawingArea, chartId, seriesData.stackingGroups, seriesData.series, xAxes, yAxes, defaultXAxisId, defaultYAxisId, samplingPyramids, zoomMap, sampler, zoomOptions), [drawingArea, chartId, seriesData.stackingGroups, seriesData.series, xAxes, yAxes, defaultXAxisId, defaultYAxisId, samplingPyramids, zoomMap, sampler, zoomOptions]);
18
28
  }
19
- export function processBarDataForPlot(drawingArea, chartId, stackingGroups, series, xAxes, yAxes, defaultXAxisId, defaultYAxisId) {
29
+ export function processBarDataForPlot(drawingArea, chartId, stackingGroups, series, xAxes, yAxes, defaultXAxisId, defaultYAxisId, samplingPyramids = {}, zoomMap, sampler, zoomOptions) {
20
30
  const masks = {};
21
31
  const data = stackingGroups.flatMap(({
22
32
  ids: seriesIds
@@ -42,31 +52,13 @@ export function processBarDataForPlot(drawingArea, chartId, stackingGroups, seri
42
52
  const xOrigin = Math.round(xScale(0) ?? 0);
43
53
  const yOrigin = Math.round(yScale(0) ?? 0);
44
54
  const colorGetter = getColor(series[seriesId], xAxes[xAxisId], yAxes[yAxisId]);
55
+ const stackId = series[seriesId].stack;
45
56
  const seriesDataPoints = [];
46
- const getBarDimensions = createGetBarDimensions({
47
- verticalLayout,
48
- xAxisConfig,
49
- yAxisConfig,
50
- series: series[seriesId],
51
- numberOfGroups: stackingGroups.length
52
- });
53
- for (let dataIndex = 0; dataIndex < baseScaleConfig.data.length; dataIndex += 1) {
54
- const barDimensions = getBarDimensions(dataIndex, groupIndex);
55
- if (barDimensions == null) {
56
- continue;
57
- }
58
- const stackId = series[seriesId].stack;
59
- const result = _extends({
60
- seriesId,
61
- dataIndex,
62
- hidden: series[seriesId].hidden
63
- }, barDimensions, {
64
- color: colorGetter(dataIndex),
65
- value: series[seriesId].data[dataIndex],
66
- maskId: `${chartId}_${stackId || seriesId}_${groupIndex}_${dataIndex}`
67
- });
57
+
58
+ // Culls off-screen bars then records the bar's border-radius side and mask contribution.
59
+ const registerResult = (result, dataIndex) => {
68
60
  if (result.x > xMax || result.x + result.width < xMin || result.y > yMax || result.y + result.height < yMin) {
69
- continue;
61
+ return;
70
62
  }
71
63
  const lastNegative = lastNegativePerIndex.get(dataIndex);
72
64
  const lastPositive = lastPositivePerIndex.get(dataIndex);
@@ -107,6 +99,90 @@ export function processBarDataForPlot(drawingArea, chartId, stackingGroups, seri
107
99
  mask.hasNegative = mask.hasNegative || (reverse ? value > 0 : value < 0);
108
100
  mask.hasPositive = mask.hasPositive || (reverse ? value < 0 : value > 0);
109
101
  seriesDataPoints.push(result);
102
+ };
103
+ const makeResult = (dataIndex, barDimensions) => _extends({
104
+ seriesId,
105
+ dataIndex,
106
+ hidden: series[seriesId].hidden
107
+ }, barDimensions, {
108
+ color: colorGetter(dataIndex),
109
+ value: series[seriesId].data[dataIndex],
110
+ maskId: `${chartId}_${stackId || seriesId}_${groupIndex}_${dataIndex}`
111
+ });
112
+ const pyramid = samplingPyramids[seriesId];
113
+ const baseAxisId = verticalLayout ? xAxisId : yAxisId;
114
+ const zoom = zoomMap?.get(baseAxisId) ?? (pyramid ? getFullRangeZoom(baseAxisId) : undefined);
115
+ const availableSize = verticalLayout ? drawingArea.width : drawingArea.height;
116
+ const minSpan = zoomOptions?.[baseAxisId]?.minSpan ?? 0;
117
+ // The sampler (pro) owns the level-of-detail math; community renders one merged rect per
118
+ // bucket, spanning its index range with the bucket's min-base/max-top envelope.
119
+ const sampledBuckets = pyramid && zoom && sampler?.sample ? sampler.sample({
120
+ built: pyramid,
121
+ zoom,
122
+ availableSize,
123
+ minSpan
124
+ }) : null;
125
+ if (sampledBuckets) {
126
+ const getBucketBarDimensions = createGetBucketBarDimensions({
127
+ verticalLayout,
128
+ xAxisConfig,
129
+ yAxisConfig,
130
+ series: series[seriesId],
131
+ numberOfGroups: stackingGroups.length
132
+ });
133
+ const stacked = series[seriesId].visibleStackedData;
134
+ for (const {
135
+ startIndex,
136
+ endIndex,
137
+ indices
138
+ } of sampledBuckets) {
139
+ let low = Infinity;
140
+ let high = -Infinity;
141
+ for (let k = 0; k < indices.length; k += 1) {
142
+ const point = stacked[indices[k]];
143
+ // Both coords, so diverging/negative bars (`[0, -5]`, base > top) keep their full extent.
144
+ low = Math.min(low, point[0], point[1]);
145
+ high = Math.max(high, point[0], point[1]);
146
+ }
147
+ const dimensions = getBucketBarDimensions(startIndex, endIndex, low, high, groupIndex);
148
+ registerResult(makeResult(startIndex, dimensions), startIndex);
149
+ }
150
+ } else {
151
+ const getBarDimensions = createGetBarDimensions({
152
+ verticalLayout,
153
+ xAxisConfig,
154
+ yAxisConfig,
155
+ series: series[seriesId],
156
+ numberOfGroups: stackingGroups.length
157
+ });
158
+
159
+ // Narrow to the visible index window so panning/zoom doesn't compute every off-screen bar.
160
+ // `firstIndex`/`lastIndex` bound the band axis range; the cull in `registerResult` stays
161
+ // exact. A 1-bucket margin covers grouped-bar offsets and partial edge bars.
162
+ const baseData = baseScaleConfig.data;
163
+ const dataLength = baseData.length;
164
+ let firstIndex = 0;
165
+ let lastIndex = dataLength - 1;
166
+ if (dataLength > 1) {
167
+ const baseScale = baseScaleConfig.scale;
168
+ const p0 = baseScale(baseData[0]);
169
+ const slope = baseScale(baseData[1]) - p0; // signed px per index (handles reversed axis)
170
+ if (slope !== 0) {
171
+ const winLo = verticalLayout ? xMin : yMin;
172
+ const winHi = verticalLayout ? xMax : yMax;
173
+ const ia = (winLo - p0) / slope;
174
+ const ib = (winHi - p0) / slope;
175
+ firstIndex = Math.max(0, Math.floor(Math.min(ia, ib)) - 1);
176
+ lastIndex = Math.min(dataLength - 1, Math.ceil(Math.max(ia, ib)) + 1);
177
+ }
178
+ }
179
+ for (let dataIndex = firstIndex; dataIndex <= lastIndex; dataIndex += 1) {
180
+ const barDimensions = getBarDimensions(dataIndex, groupIndex);
181
+ if (barDimensions == null) {
182
+ continue;
183
+ }
184
+ registerResult(makeResult(dataIndex, barDimensions), dataIndex);
185
+ }
110
186
  }
111
187
  return {
112
188
  seriesId,
package/CHANGELOG.md CHANGED
@@ -1,5 +1,124 @@
1
1
  # Changelog
2
2
 
3
+ ## 9.9.0
4
+
5
+ _Jul 9, 2026_
6
+
7
+ We'd like to extend a big thank you to the 11 contributors who made this release possible. Here are some highlights ✨:
8
+
9
+ - 📊 [Data sampling](https://mui.com/x/react-charts/performance/#sampling) for better performance with large bar and line charts
10
+ - 🗺️ [Maps zoom support](https://mui.com/x/react-charts/map/#zoom)
11
+ - ☑️ Support [applying filters on demand](https://mui.com/x/react-data-grid/filtering/customization/#apply-filters-on-demand) in the Data Grid
12
+ - 🐞 Bugfixes
13
+ - 📚 Documentation improvements
14
+
15
+ Special thanks go out to these community members for their valuable contributions:
16
+ @mustafajw07, @sebastianfrey
17
+
18
+ The following team members contributed to this release:
19
+ @aemartos, @alexfauquette, @brijeshb42, @hasdfa, @Janpot, @JCQuintas, @LukasTy, @rita-codes, @sai6855
20
+
21
+ ### Data Grid
22
+
23
+ #### `@mui/x-data-grid@9.9.0`
24
+
25
+ - [DataGrid] Add `dataSourceKeepPreviousData` prop (#22554) @LukasTy
26
+ - [DataGrid] Add controlled filter panel for applying filters on demand (#23023) @sebastianfrey
27
+
28
+ #### `@mui/x-data-grid-pro@9.9.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
29
+
30
+ Same changes as in `@mui/x-data-grid@9.9.0`.
31
+
32
+ #### `@mui/x-data-grid-premium@9.9.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
33
+
34
+ Same changes as in `@mui/x-data-grid-pro@9.9.0`.
35
+
36
+ ### Date and Time Pickers
37
+
38
+ #### `@mui/x-date-pickers@9.9.0`
39
+
40
+ Internal changes.
41
+
42
+ #### `@mui/x-date-pickers-pro@9.9.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
43
+
44
+ Same changes as in `@mui/x-date-pickers@9.9.0`, plus:
45
+
46
+ - [DateRangeCalendar] Avoid unnecessary month switch when the value is already visible (#22996) @LukasTy
47
+
48
+ ### Charts
49
+
50
+ #### `@mui/x-charts@9.9.0`
51
+
52
+ - [charts] Optimize and de-duplicate sampled axis-highlight band lookup (#23052) @JCQuintas
53
+ - [charts] Unify tooltip item position getter and selector into a single selector API (#23041) @alexfauquette
54
+ - [charts] Fix impossible condition in axis text angle warning (#23102) @sai6855
55
+
56
+ #### `@mui/x-charts-pro@9.9.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
57
+
58
+ Same changes as in `@mui/x-charts@9.9.0`, plus:
59
+
60
+ - [charts-pro] Add data sampling for large bar and line charts (#22830) @JCQuintas
61
+ - [charts-pro] Allow sampling on non-zoomable charts (#23051) @JCQuintas
62
+
63
+ #### `@mui/x-charts-premium@9.9.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
64
+
65
+ #### Breaking changes
66
+
67
+ The API of the `Unstable_ChartsGeoDataProviderPremium` got modified.
68
+ Props `scale`, `rotation`, and `translation` are replaced by props `view` and `initialView`.
69
+ Same behavior can be obtained with `view.zoomLevel`, `view.center`, and `view.translation`.
70
+ See the [zoom view section](https://mui.com/x/react-charts/map/#control) for detailed information
71
+
72
+ Same changes as in `@mui/x-charts-pro@9.9.0`, plus:
73
+
74
+ - [charts-premium] Maps zoom support (#22709) @alexfauquette
75
+
76
+ ### Tree View
77
+
78
+ #### `@mui/x-tree-view@9.9.0`
79
+
80
+ Internal changes.
81
+
82
+ #### `@mui/x-tree-view-pro@9.9.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
83
+
84
+ Same changes as in `@mui/x-tree-view@9.9.0`.
85
+
86
+ ### Scheduler
87
+
88
+ #### `@mui/x-scheduler@9.0.0-beta.5`
89
+
90
+ - [scheduler] Introduce event resource helper utilities (#23022) @mustafajw07
91
+ - [scheduler] Preserve multi-day event continuity across overflow (#22797) @mustafajw07
92
+
93
+ #### `@mui/x-scheduler-premium@9.0.0-beta.5` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
94
+
95
+ Same changes as in `@mui/x-scheduler@9.0.0-beta.5`.
96
+
97
+ ### Codemod
98
+
99
+ #### `@mui/x-codemod@9.9.0`
100
+
101
+ Internal changes.
102
+
103
+ ### Docs
104
+
105
+ - [docs] Fix broken social preview image on shared docs links (#23055) @sai6855
106
+ - [docs] Review and clean up react-chat docs demos & gallery; fix actions-bar layout (#22993) @hasdfa
107
+ - [docs] Update the Pickers recommended date library bundle sizes (#23087) @LukasTy
108
+
109
+ ### Core
110
+
111
+ - [mcp] Add `@mui/mcp` server and `@mui/x-agent-tools`. See the [README](https://github.com/mui/mui-x/blob/master/packages/mcp/README.md) for setup (#22947) @aemartos
112
+ - [code-infra] Avoid OOM in the Netlify docs build and CircleCI lint step (#23086) @LukasTy
113
+ - [code-infra] Group `@atlaskit/pragmatic-drag-and-drop` renovate updates (#23105) @LukasTy
114
+ - [code-infra] Validate npm publishing through dry run (#23038) @brijeshb42
115
+ - [docs-infra] Enable `webpackBuildWorker` to bound docs build memory (#23100) @Janpot
116
+
117
+ ### Miscellaneous
118
+
119
+ - [test] Fix flaky "should render only the pageSize" Data Grid virtualization test (#23090) @LukasTy
120
+ - [test] Track `@mui/x-chat` bundle size via native expand (#23049) @Janpot
121
+
3
122
  ## 9.8.0
4
123
 
5
124
  _Jul 2, 2026_
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { ChartsAxisSlotProps, ChartsAxisSlots } from "../models/axis.mjs";
2
3
  export type { ChartsAxisSlots, ChartsAxisSlotProps };
3
4
  export interface ChartsAxisProps {
@@ -21,7 +22,7 @@ export interface ChartsAxisProps {
21
22
  *
22
23
  * - [ChartsAxis API](https://mui.com/x/api/charts/charts-axis/)
23
24
  */
24
- declare function ChartsAxis(props: ChartsAxisProps): import("react/jsx-runtime").JSX.Element;
25
+ declare function ChartsAxis(props: ChartsAxisProps): React.JSX.Element;
25
26
  declare namespace ChartsAxis {
26
27
  var propTypes: any;
27
28
  }
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { ChartsAxisSlotProps, ChartsAxisSlots } from "../models/axis.js";
2
3
  export type { ChartsAxisSlots, ChartsAxisSlotProps };
3
4
  export interface ChartsAxisProps {
@@ -21,7 +22,7 @@ export interface ChartsAxisProps {
21
22
  *
22
23
  * - [ChartsAxis API](https://mui.com/x/api/charts/charts-axis/)
23
24
  */
24
- declare function ChartsAxis(props: ChartsAxisProps): import("react/jsx-runtime").JSX.Element;
25
+ declare function ChartsAxis(props: ChartsAxisProps): React.JSX.Element;
25
26
  declare namespace ChartsAxis {
26
27
  var propTypes: any;
27
28
  }
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { ChartsAxisHighlightProps } from "./ChartsAxisHighlight.types.mjs";
2
3
  /**
3
4
  * Demos:
@@ -8,7 +9,7 @@ import type { ChartsAxisHighlightProps } from "./ChartsAxisHighlight.types.mjs";
8
9
  *
9
10
  * - [ChartsAxisHighlight API](https://mui.com/x/api/charts/charts-axis-highlight/)
10
11
  */
11
- declare function ChartsAxisHighlight(props: ChartsAxisHighlightProps): import("react/jsx-runtime").JSX.Element;
12
+ declare function ChartsAxisHighlight(props: ChartsAxisHighlightProps): React.JSX.Element;
12
13
  declare namespace ChartsAxisHighlight {
13
14
  var propTypes: any;
14
15
  }
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { ChartsAxisHighlightProps } from "./ChartsAxisHighlight.types.js";
2
3
  /**
3
4
  * Demos:
@@ -8,7 +9,7 @@ import type { ChartsAxisHighlightProps } from "./ChartsAxisHighlight.types.js";
8
9
  *
9
10
  * - [ChartsAxisHighlight API](https://mui.com/x/api/charts/charts-axis-highlight/)
10
11
  */
11
- declare function ChartsAxisHighlight(props: ChartsAxisHighlightProps): import("react/jsx-runtime").JSX.Element;
12
+ declare function ChartsAxisHighlight(props: ChartsAxisHighlightProps): React.JSX.Element;
12
13
  declare namespace ChartsAxisHighlight {
13
14
  var propTypes: any;
14
15
  }
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { ChartsAxisHighlightType } from "./ChartsAxisHighlight.types.mjs";
2
3
  import type { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.mjs";
3
4
  /**
@@ -6,4 +7,4 @@ import type { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.mj
6
7
  export default function ChartsXHighlight(props: {
7
8
  type: ChartsAxisHighlightType;
8
9
  classes: ChartsAxisHighlightClasses;
9
- }): import("react/jsx-runtime").JSX.Element[] | null;
10
+ }): React.JSX.Element[] | null;
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { ChartsAxisHighlightType } from "./ChartsAxisHighlight.types.js";
2
3
  import type { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.js";
3
4
  /**
@@ -6,4 +7,4 @@ import type { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.js
6
7
  export default function ChartsXHighlight(props: {
7
8
  type: ChartsAxisHighlightType;
8
9
  classes: ChartsAxisHighlightClasses;
9
- }): import("react/jsx-runtime").JSX.Element[] | null;
10
+ }): React.JSX.Element[] | null;
@@ -13,6 +13,7 @@ var _useStore = require("../internals/store/useStore");
13
13
  var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
14
14
  var _hooks = require("../hooks");
15
15
  var _ChartsAxisHighlightPath = require("./ChartsAxisHighlightPath");
16
+ var _getSampledBandHighlight = require("./getSampledBandHighlight");
16
17
  var _jsxRuntime = require("react/jsx-runtime");
17
18
  /**
18
19
  * @ignore - internal component.
@@ -29,13 +30,15 @@ function ChartsXHighlight(props) {
29
30
  const store = (0, _useStore.useStore)();
30
31
  const axisXValues = store.use(_useChartCartesianAxis.selectorChartsHighlightXAxisValue);
31
32
  const xAxes = store.use(_useChartCartesianAxis.selectorChartXAxis);
33
+ const bucketSizeByAxis = store.use(_useChartCartesianAxis.selectorChartHighlightBucketSize);
32
34
  if (axisXValues.length === 0) {
33
35
  return null;
34
36
  }
35
- return axisXValues.map(({
36
- axisId,
37
- value
38
- }) => {
37
+ return axisXValues.map(axisValue => {
38
+ const {
39
+ axisId,
40
+ value
41
+ } = axisValue;
39
42
  const xAxis = xAxes.axis[axisId];
40
43
  const xScale = xAxis.scale;
41
44
  const getXPosition = (0, _getValueToPositionMapper.getValueToPositionMapper)(xScale);
@@ -46,9 +49,23 @@ function ChartsXHighlight(props) {
46
49
  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'));
47
50
  }
48
51
  }
52
+ let bandStart = 0;
53
+ let bandSize = 0;
54
+ if (isXScaleOrdinal) {
55
+ ({
56
+ bandStart,
57
+ bandSize
58
+ } = (0, _getSampledBandHighlight.getSampledBandHighlight)({
59
+ scale: xScale,
60
+ value,
61
+ dataIndex: axisValue.dataIndex,
62
+ data: xAxis.data,
63
+ bucketSize: bucketSizeByAxis.get(axisId) ?? 1
64
+ }));
65
+ }
49
66
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
50
67
  children: [isXScaleOrdinal && xScale(value) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath, {
51
- d: `M ${xScale(value) - (xScale.step() - xScale.bandwidth()) / 2} ${top} l ${xScale.step()} 0 l 0 ${height} l ${-xScale.step()} 0 Z`,
68
+ d: `M ${bandStart} ${top} l ${bandSize} 0 l 0 ${height} l ${-bandSize} 0 Z`,
52
69
  className: classes.root,
53
70
  ownerState: {
54
71
  axisHighlight: 'band'
@@ -4,9 +4,10 @@ import * as React from 'react';
4
4
  import { getValueToPositionMapper } from "../hooks/getValueToPositionMapper.mjs";
5
5
  import { isOrdinalScale } from "../internals/scaleGuards.mjs";
6
6
  import { useStore } from "../internals/store/useStore.mjs";
7
- import { selectorChartsHighlightXAxisValue, selectorChartXAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs";
7
+ import { selectorChartsHighlightXAxisValue, selectorChartHighlightBucketSize, selectorChartXAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs";
8
8
  import { useDrawingArea } from "../hooks/index.mjs";
9
9
  import { ChartsAxisHighlightPath } from "./ChartsAxisHighlightPath.mjs";
10
+ import { getSampledBandHighlight } from "./getSampledBandHighlight.mjs";
10
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
12
  /**
12
13
  * @ignore - internal component.
@@ -23,13 +24,15 @@ export default function ChartsXHighlight(props) {
23
24
  const store = useStore();
24
25
  const axisXValues = store.use(selectorChartsHighlightXAxisValue);
25
26
  const xAxes = store.use(selectorChartXAxis);
27
+ const bucketSizeByAxis = store.use(selectorChartHighlightBucketSize);
26
28
  if (axisXValues.length === 0) {
27
29
  return null;
28
30
  }
29
- return axisXValues.map(({
30
- axisId,
31
- value
32
- }) => {
31
+ return axisXValues.map(axisValue => {
32
+ const {
33
+ axisId,
34
+ value
35
+ } = axisValue;
33
36
  const xAxis = xAxes.axis[axisId];
34
37
  const xScale = xAxis.scale;
35
38
  const getXPosition = getValueToPositionMapper(xScale);
@@ -40,9 +43,23 @@ export default function ChartsXHighlight(props) {
40
43
  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'));
41
44
  }
42
45
  }
46
+ let bandStart = 0;
47
+ let bandSize = 0;
48
+ if (isXScaleOrdinal) {
49
+ ({
50
+ bandStart,
51
+ bandSize
52
+ } = getSampledBandHighlight({
53
+ scale: xScale,
54
+ value,
55
+ dataIndex: axisValue.dataIndex,
56
+ data: xAxis.data,
57
+ bucketSize: bucketSizeByAxis.get(axisId) ?? 1
58
+ }));
59
+ }
43
60
  return /*#__PURE__*/_jsxs(React.Fragment, {
44
61
  children: [isXScaleOrdinal && xScale(value) !== undefined && /*#__PURE__*/_jsx(ChartsAxisHighlightPath, {
45
- d: `M ${xScale(value) - (xScale.step() - xScale.bandwidth()) / 2} ${top} l ${xScale.step()} 0 l 0 ${height} l ${-xScale.step()} 0 Z`,
62
+ d: `M ${bandStart} ${top} l ${bandSize} 0 l 0 ${height} l ${-bandSize} 0 Z`,
46
63
  className: classes.root,
47
64
  ownerState: {
48
65
  axisHighlight: 'band'
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { ChartsAxisHighlightType } from "./ChartsAxisHighlight.types.mjs";
2
3
  import type { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.mjs";
3
4
  /**
@@ -6,4 +7,4 @@ import type { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.mj
6
7
  export default function ChartsYHighlight(props: {
7
8
  type: ChartsAxisHighlightType;
8
9
  classes: ChartsAxisHighlightClasses;
9
- }): import("react/jsx-runtime").JSX.Element[] | null;
10
+ }): React.JSX.Element[] | null;
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { ChartsAxisHighlightType } from "./ChartsAxisHighlight.types.js";
2
3
  import type { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.js";
3
4
  /**
@@ -6,4 +7,4 @@ import type { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.js
6
7
  export default function ChartsYHighlight(props: {
7
8
  type: ChartsAxisHighlightType;
8
9
  classes: ChartsAxisHighlightClasses;
9
- }): import("react/jsx-runtime").JSX.Element[] | null;
10
+ }): React.JSX.Element[] | null;
@@ -13,6 +13,7 @@ var _useStore = require("../internals/store/useStore");
13
13
  var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
14
14
  var _hooks = require("../hooks");
15
15
  var _ChartsAxisHighlightPath = require("./ChartsAxisHighlightPath");
16
+ var _getSampledBandHighlight = require("./getSampledBandHighlight");
16
17
  var _jsxRuntime = require("react/jsx-runtime");
17
18
  /**
18
19
  * @ignore - internal component.
@@ -29,13 +30,15 @@ function ChartsYHighlight(props) {
29
30
  const store = (0, _useStore.useStore)();
30
31
  const axisYValues = store.use(_useChartCartesianAxis.selectorChartsHighlightYAxisValue);
31
32
  const yAxes = store.use(_useChartCartesianAxis.selectorChartYAxis);
33
+ const bucketSizeByAxis = store.use(_useChartCartesianAxis.selectorChartHighlightBucketSize);
32
34
  if (axisYValues.length === 0) {
33
35
  return null;
34
36
  }
35
- return axisYValues.map(({
36
- axisId,
37
- value
38
- }) => {
37
+ return axisYValues.map(axisValue => {
38
+ const {
39
+ axisId,
40
+ value
41
+ } = axisValue;
39
42
  const yAxis = yAxes.axis[axisId];
40
43
  const yScale = yAxis.scale;
41
44
  const getYPosition = (0, _getValueToPositionMapper.getValueToPositionMapper)(yScale);
@@ -46,9 +49,23 @@ function ChartsYHighlight(props) {
46
49
  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'));
47
50
  }
48
51
  }
52
+ let bandStart = 0;
53
+ let bandSize = 0;
54
+ if (isYScaleOrdinal) {
55
+ ({
56
+ bandStart,
57
+ bandSize
58
+ } = (0, _getSampledBandHighlight.getSampledBandHighlight)({
59
+ scale: yScale,
60
+ value,
61
+ dataIndex: axisValue.dataIndex,
62
+ data: yAxis.data,
63
+ bucketSize: bucketSizeByAxis.get(axisId) ?? 1
64
+ }));
65
+ }
49
66
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
50
67
  children: [isYScaleOrdinal && yScale(value) !== undefined && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlightPath.ChartsAxisHighlightPath, {
51
- d: `M ${left} ${yScale(value) - (yScale.step() - yScale.bandwidth()) / 2} l 0 ${yScale.step()} l ${width} 0 l 0 ${-yScale.step()} Z`,
68
+ d: `M ${left} ${bandStart} l 0 ${bandSize} l ${width} 0 l 0 ${-bandSize} Z`,
52
69
  className: classes.root,
53
70
  ownerState: {
54
71
  axisHighlight: 'band'
@@ -4,9 +4,10 @@ import * as React from 'react';
4
4
  import { getValueToPositionMapper } from "../hooks/getValueToPositionMapper.mjs";
5
5
  import { isOrdinalScale } from "../internals/scaleGuards.mjs";
6
6
  import { useStore } from "../internals/store/useStore.mjs";
7
- import { selectorChartsHighlightYAxisValue, selectorChartYAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs";
7
+ import { selectorChartsHighlightYAxisValue, selectorChartHighlightBucketSize, selectorChartYAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs";
8
8
  import { useDrawingArea } from "../hooks/index.mjs";
9
9
  import { ChartsAxisHighlightPath } from "./ChartsAxisHighlightPath.mjs";
10
+ import { getSampledBandHighlight } from "./getSampledBandHighlight.mjs";
10
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
12
  /**
12
13
  * @ignore - internal component.
@@ -23,13 +24,15 @@ export default function ChartsYHighlight(props) {
23
24
  const store = useStore();
24
25
  const axisYValues = store.use(selectorChartsHighlightYAxisValue);
25
26
  const yAxes = store.use(selectorChartYAxis);
27
+ const bucketSizeByAxis = store.use(selectorChartHighlightBucketSize);
26
28
  if (axisYValues.length === 0) {
27
29
  return null;
28
30
  }
29
- return axisYValues.map(({
30
- axisId,
31
- value
32
- }) => {
31
+ return axisYValues.map(axisValue => {
32
+ const {
33
+ axisId,
34
+ value
35
+ } = axisValue;
33
36
  const yAxis = yAxes.axis[axisId];
34
37
  const yScale = yAxis.scale;
35
38
  const getYPosition = getValueToPositionMapper(yScale);
@@ -40,9 +43,23 @@ export default function ChartsYHighlight(props) {
40
43
  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'));
41
44
  }
42
45
  }
46
+ let bandStart = 0;
47
+ let bandSize = 0;
48
+ if (isYScaleOrdinal) {
49
+ ({
50
+ bandStart,
51
+ bandSize
52
+ } = getSampledBandHighlight({
53
+ scale: yScale,
54
+ value,
55
+ dataIndex: axisValue.dataIndex,
56
+ data: yAxis.data,
57
+ bucketSize: bucketSizeByAxis.get(axisId) ?? 1
58
+ }));
59
+ }
43
60
  return /*#__PURE__*/_jsxs(React.Fragment, {
44
61
  children: [isYScaleOrdinal && yScale(value) !== undefined && /*#__PURE__*/_jsx(ChartsAxisHighlightPath, {
45
- d: `M ${left} ${yScale(value) - (yScale.step() - yScale.bandwidth()) / 2} l 0 ${yScale.step()} l ${width} 0 l 0 ${-yScale.step()} Z`,
62
+ d: `M ${left} ${bandStart} l 0 ${bandSize} l ${width} 0 l 0 ${-bandSize} Z`,
46
63
  className: classes.root,
47
64
  ownerState: {
48
65
  axisHighlight: 'band'
@@ -0,0 +1,27 @@
1
+ import type { D3OrdinalScale } from "../models/axis.mjs";
2
+ interface SampledBandHighlightParams {
3
+ scale: D3OrdinalScale;
4
+ /** The highlighted value. */
5
+ value: number | Date;
6
+ /** The data index of the highlighted value, when known (O(1) lookup). */
7
+ dataIndex: number | undefined;
8
+ /** The axis data. */
9
+ data: readonly any[] | undefined;
10
+ /** The number of merged data points per band when the series is sampled. */
11
+ bucketSize: number;
12
+ }
13
+ /**
14
+ * Computes the band highlight rectangle along the ordinal axis.
15
+ * When the series is sampled (`bucketSize > 1`), the band is widened to cover the whole merged bucket.
16
+ */
17
+ export declare function getSampledBandHighlight({
18
+ scale,
19
+ value,
20
+ dataIndex,
21
+ data,
22
+ bucketSize
23
+ }: SampledBandHighlightParams): {
24
+ bandStart: number;
25
+ bandSize: number;
26
+ };
27
+ export {};