@mui/x-charts 9.4.0 → 9.6.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 (288) hide show
  1. package/BarChart/BarChart.js +1 -1
  2. package/BarChart/BarChart.mjs +1 -1
  3. package/BarChart/BarElement.js +2 -1
  4. package/BarChart/BarElement.mjs +2 -1
  5. package/BarChart/BarLabel/BarLabel.js +1 -1
  6. package/BarChart/BarLabel/BarLabel.mjs +1 -1
  7. package/BarChart/BarPlot.js +1 -1
  8. package/BarChart/BarPlot.mjs +1 -1
  9. package/CHANGELOG.md +251 -0
  10. package/ChartsAxis/ChartsAxis.js +1 -1
  11. package/ChartsAxis/ChartsAxis.mjs +1 -1
  12. package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  13. package/ChartsAxisHighlight/ChartsAxisHighlight.mjs +1 -1
  14. package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.js +2 -2
  15. package/ChartsAxisHighlightValue/ChartsAxisHighlightValue.mjs +2 -2
  16. package/ChartsBrushOverlay/ChartsBrushOverlay.d.mts +5 -1
  17. package/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +5 -1
  18. package/ChartsBrushOverlay/ChartsBrushOverlay.js +12 -1
  19. package/ChartsBrushOverlay/ChartsBrushOverlay.mjs +14 -2
  20. package/ChartsClipPath/ChartsClipPath.js +1 -1
  21. package/ChartsClipPath/ChartsClipPath.mjs +1 -1
  22. package/ChartsContainer/ChartsContainer.js +5 -3
  23. package/ChartsContainer/ChartsContainer.mjs +5 -3
  24. package/ChartsDataProvider/ChartsDataProvider.js +5 -1
  25. package/ChartsDataProvider/ChartsDataProvider.mjs +5 -1
  26. package/ChartsGrid/ChartsGrid.js +5 -1
  27. package/ChartsGrid/ChartsGrid.mjs +5 -1
  28. package/ChartsLayerContainer/ChartsLayerContainer.js +1 -1
  29. package/ChartsLayerContainer/ChartsLayerContainer.mjs +1 -1
  30. package/ChartsLocalizationProvider/ChartsLocalizationProvider.js +1 -1
  31. package/ChartsLocalizationProvider/ChartsLocalizationProvider.mjs +1 -1
  32. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.js +2 -2
  33. package/ChartsRadialAxisHighlight/ChartsRadialAxisHighlight.mjs +2 -2
  34. package/ChartsRadialAxisHighlight/index.d.mts +6 -1
  35. package/ChartsRadialAxisHighlight/index.d.ts +6 -1
  36. package/ChartsRadialAxisHighlight/index.js +9 -2
  37. package/ChartsRadialAxisHighlight/index.mjs +8 -1
  38. package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.mts +1 -1
  39. package/ChartsRadialDataProvider/ChartsRadialDataProvider.d.ts +1 -1
  40. package/ChartsRadialDataProvider/ChartsRadialDataProvider.js +10 -2
  41. package/ChartsRadialDataProvider/ChartsRadialDataProvider.mjs +10 -2
  42. package/ChartsRadialDataProvider/index.d.mts +5 -0
  43. package/ChartsRadialDataProvider/index.d.ts +5 -0
  44. package/ChartsRadialDataProvider/index.js +12 -1
  45. package/ChartsRadialDataProvider/index.mjs +7 -0
  46. package/ChartsRadialGrid/ChartsRadialGrid.js +5 -1
  47. package/ChartsRadialGrid/ChartsRadialGrid.mjs +5 -1
  48. package/ChartsRadialGrid/index.d.mts +6 -1
  49. package/ChartsRadialGrid/index.d.ts +6 -1
  50. package/ChartsRadialGrid/index.js +8 -2
  51. package/ChartsRadialGrid/index.mjs +8 -1
  52. package/ChartsRadiusAxis/ChartsRadiusAxis.d.mts +8 -2
  53. package/ChartsRadiusAxis/ChartsRadiusAxis.d.ts +8 -2
  54. package/ChartsRadiusAxis/ChartsRadiusAxis.js +143 -3
  55. package/ChartsRadiusAxis/ChartsRadiusAxis.mjs +144 -5
  56. package/ChartsRadiusAxis/index.d.mts +6 -1
  57. package/ChartsRadiusAxis/index.d.ts +6 -1
  58. package/ChartsRadiusAxis/index.js +10 -2
  59. package/ChartsRadiusAxis/index.mjs +7 -1
  60. package/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
  61. package/ChartsReferenceLine/ChartsReferenceLine.mjs +1 -1
  62. package/ChartsRotationAxis/ChartsRotationAxis.d.mts +8 -2
  63. package/ChartsRotationAxis/ChartsRotationAxis.d.ts +8 -2
  64. package/ChartsRotationAxis/ChartsRotationAxis.js +140 -3
  65. package/ChartsRotationAxis/ChartsRotationAxis.mjs +141 -5
  66. package/ChartsRotationAxis/index.d.mts +6 -1
  67. package/ChartsRotationAxis/index.d.ts +6 -1
  68. package/ChartsRotationAxis/index.js +10 -2
  69. package/ChartsRotationAxis/index.mjs +7 -1
  70. package/ChartsSurface/ChartsSurface.js +1 -1
  71. package/ChartsSurface/ChartsSurface.mjs +1 -1
  72. package/ChartsSvgLayer/ChartsSvgLayer.js +1 -1
  73. package/ChartsSvgLayer/ChartsSvgLayer.mjs +1 -1
  74. package/ChartsText/ChartsText.js +2 -2
  75. package/ChartsText/ChartsText.mjs +2 -2
  76. package/ChartsTooltip/ChartsAxisTooltipContent.js +22 -3
  77. package/ChartsTooltip/ChartsAxisTooltipContent.mjs +22 -3
  78. package/ChartsTooltip/ChartsItemTooltipContent.js +52 -1
  79. package/ChartsTooltip/ChartsItemTooltipContent.mjs +52 -1
  80. package/ChartsTooltip/ChartsTooltip.js +13 -33
  81. package/ChartsTooltip/ChartsTooltip.mjs +13 -33
  82. package/ChartsTooltip/ChartsTooltipContainer.js +17 -30
  83. package/ChartsTooltip/ChartsTooltipContainer.mjs +17 -30
  84. package/ChartsWrapper/ChartsWrapper.js +1 -1
  85. package/ChartsWrapper/ChartsWrapper.mjs +1 -1
  86. package/ChartsXAxis/ChartsSingleXAxisTicks.js +1 -1
  87. package/ChartsXAxis/ChartsSingleXAxisTicks.mjs +1 -1
  88. package/ChartsXAxis/ChartsXAxis.js +11 -2
  89. package/ChartsXAxis/ChartsXAxis.mjs +11 -2
  90. package/ChartsYAxis/ChartsSingleYAxisTicks.js +1 -1
  91. package/ChartsYAxis/ChartsSingleYAxisTicks.mjs +1 -1
  92. package/ChartsYAxis/ChartsYAxis.js +11 -2
  93. package/ChartsYAxis/ChartsYAxis.mjs +11 -2
  94. package/ChartsYAxis/ChartsYAxisImpl.js +1 -1
  95. package/ChartsYAxis/ChartsYAxisImpl.mjs +1 -1
  96. package/Gauge/Gauge.js +1 -1
  97. package/Gauge/Gauge.mjs +1 -1
  98. package/Gauge/GaugeContainer.js +1 -1
  99. package/Gauge/GaugeContainer.mjs +1 -1
  100. package/Gauge/GaugeValueArc.js +2 -2
  101. package/Gauge/GaugeValueArc.mjs +2 -2
  102. package/Gauge/GaugeValueText.js +1 -1
  103. package/Gauge/GaugeValueText.mjs +1 -1
  104. package/LineChart/AnimatedArea.js +3 -3
  105. package/LineChart/AnimatedArea.mjs +3 -3
  106. package/LineChart/AnimatedLine.js +1 -1
  107. package/LineChart/AnimatedLine.mjs +1 -1
  108. package/LineChart/AreaElement.js +2 -2
  109. package/LineChart/AreaElement.mjs +2 -2
  110. package/LineChart/AreaPlot.js +1 -1
  111. package/LineChart/AreaPlot.mjs +1 -1
  112. package/LineChart/CircleMarkElement.js +1 -1
  113. package/LineChart/CircleMarkElement.mjs +1 -1
  114. package/LineChart/LineChart.js +1 -1
  115. package/LineChart/LineChart.mjs +1 -1
  116. package/LineChart/LineElement.js +5 -3
  117. package/LineChart/LineElement.mjs +5 -3
  118. package/LineChart/LineHighlightElement.js +1 -2
  119. package/LineChart/LineHighlightElement.mjs +1 -2
  120. package/LineChart/LineHighlightPlot.js +1 -1
  121. package/LineChart/LineHighlightPlot.mjs +1 -1
  122. package/LineChart/LinePlot.js +1 -1
  123. package/LineChart/LinePlot.mjs +1 -1
  124. package/LineChart/MarkElement.js +4 -3
  125. package/LineChart/MarkElement.mjs +4 -3
  126. package/LineChart/MarkPlot.js +2 -1
  127. package/LineChart/MarkPlot.mjs +2 -1
  128. package/PieChart/FocusedPieArc.d.mts +5 -1
  129. package/PieChart/FocusedPieArc.d.ts +5 -1
  130. package/PieChart/FocusedPieArc.js +22 -1
  131. package/PieChart/FocusedPieArc.mjs +24 -2
  132. package/PieChart/PieArc.js +1 -1
  133. package/PieChart/PieArc.mjs +1 -1
  134. package/PieChart/PieArcLabel.js +1 -1
  135. package/PieChart/PieArcLabel.mjs +1 -1
  136. package/PieChart/PieArcLabelPlot.js +7 -6
  137. package/PieChart/PieArcLabelPlot.mjs +7 -6
  138. package/PieChart/PieArcPlot.js +7 -6
  139. package/PieChart/PieArcPlot.mjs +7 -6
  140. package/PieChart/PieChart.js +1 -1
  141. package/PieChart/PieChart.mjs +1 -1
  142. package/PieChart/PiePlot.js +2 -1
  143. package/PieChart/PiePlot.mjs +2 -1
  144. package/RadarChart/RadarAxis/RadarAxis.js +5 -1
  145. package/RadarChart/RadarAxis/RadarAxis.mjs +5 -1
  146. package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +6 -2
  147. package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.mjs +6 -2
  148. package/RadarChart/RadarChart.js +1 -1
  149. package/RadarChart/RadarChart.mjs +1 -1
  150. package/RadarChart/RadarGrid/RadarGrid.js +1 -5
  151. package/RadarChart/RadarGrid/RadarGrid.mjs +1 -5
  152. package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +5 -1
  153. package/RadarChart/RadarSeriesPlot/RadarSeriesArea.mjs +5 -1
  154. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +5 -1
  155. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.mjs +5 -1
  156. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +5 -1
  157. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.mjs +5 -1
  158. package/ScatterChart/Scatter.js +1 -1
  159. package/ScatterChart/Scatter.mjs +1 -1
  160. package/ScatterChart/ScatterChart.js +12 -6
  161. package/ScatterChart/ScatterChart.mjs +12 -6
  162. package/ScatterChart/ScatterChart.plugins.d.mts +2 -1
  163. package/ScatterChart/ScatterChart.plugins.d.ts +2 -1
  164. package/ScatterChart/ScatterChart.plugins.js +2 -1
  165. package/ScatterChart/ScatterChart.plugins.mjs +2 -1
  166. package/ScatterChart/ScatterMarker.js +2 -2
  167. package/ScatterChart/ScatterMarker.mjs +2 -2
  168. package/ScatterChart/ScatterPlot.d.mts +12 -3
  169. package/ScatterChart/ScatterPlot.d.ts +12 -3
  170. package/ScatterChart/ScatterPlot.js +30 -5
  171. package/ScatterChart/ScatterPlot.mjs +30 -5
  172. package/ScatterChart/async/ScatterAsync.d.mts +9 -0
  173. package/ScatterChart/async/ScatterAsync.d.ts +9 -0
  174. package/ScatterChart/async/ScatterAsync.js +71 -0
  175. package/ScatterChart/async/ScatterAsync.mjs +67 -0
  176. package/ScatterChart/async/ScatterAsyncBatch.d.mts +24 -0
  177. package/ScatterChart/async/ScatterAsyncBatch.d.ts +24 -0
  178. package/ScatterChart/async/ScatterAsyncBatch.js +112 -0
  179. package/ScatterChart/async/ScatterAsyncBatch.mjs +106 -0
  180. package/ScatterChart/async/scatterRenderData.selectors.d.mts +38 -0
  181. package/ScatterChart/async/scatterRenderData.selectors.d.ts +38 -0
  182. package/ScatterChart/async/scatterRenderData.selectors.js +93 -0
  183. package/ScatterChart/async/scatterRenderData.selectors.mjs +87 -0
  184. package/ScatterChart/seriesConfig/getColor.js +6 -15
  185. package/ScatterChart/seriesConfig/getColor.mjs +6 -15
  186. package/SparkLineChart/SparkLineChart.js +3 -2
  187. package/SparkLineChart/SparkLineChart.mjs +3 -2
  188. package/Toolbar/Toolbar.js +1 -1
  189. package/Toolbar/Toolbar.mjs +1 -1
  190. package/Toolbar/ToolbarButton.js +1 -1
  191. package/Toolbar/ToolbarButton.mjs +1 -1
  192. package/index.d.mts +1 -1
  193. package/index.d.ts +1 -1
  194. package/index.js +1 -1
  195. package/index.mjs +1 -1
  196. package/internals/colorScale.d.mts +2 -2
  197. package/internals/colorScale.d.ts +2 -2
  198. package/internals/colorScale.js +2 -2
  199. package/internals/colorScale.mjs +2 -2
  200. package/internals/getSeriesColorFn.d.mts +5 -5
  201. package/internals/getSeriesColorFn.d.ts +5 -5
  202. package/internals/index.d.mts +3 -0
  203. package/internals/index.d.ts +3 -0
  204. package/internals/index.js +20 -0
  205. package/internals/index.mjs +3 -0
  206. package/internals/plugins/allPlugins.d.mts +4 -3
  207. package/internals/plugins/allPlugins.d.ts +4 -3
  208. package/internals/plugins/allPlugins.js +2 -1
  209. package/internals/plugins/allPlugins.mjs +2 -1
  210. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.mts +12 -3
  211. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +12 -3
  212. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +10 -1
  213. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.mjs +10 -1
  214. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.mts +15 -1
  215. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +15 -1
  216. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +16 -30
  217. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.mjs +17 -31
  218. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.mts +8 -1
  219. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +8 -1
  220. package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.mts +1 -1
  221. package/internals/plugins/corePlugins/useChartSeriesConfig/types/colorProcessor.types.d.ts +1 -1
  222. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.mts +7 -0
  223. package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipItemPositionGetter.types.d.ts +7 -0
  224. package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.d.mts +0 -8
  225. package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.d.ts +0 -8
  226. package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.js +1 -2
  227. package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.mjs +2 -2
  228. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +27 -2
  229. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.mjs +27 -2
  230. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +1 -3
  231. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.mjs +1 -3
  232. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +1 -1
  233. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs +1 -1
  234. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +6 -1
  235. package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.mjs +6 -1
  236. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +6 -2
  237. package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.mjs +6 -2
  238. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.mts +49 -0
  239. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.d.ts +49 -0
  240. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.js +124 -0
  241. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.selectors.mjs +117 -0
  242. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.mts +64 -0
  243. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.d.ts +64 -0
  244. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.js +5 -0
  245. package/internals/plugins/featurePlugins/useGeoProjection/useGeoProjection.types.mjs +1 -0
  246. package/internals/plugins/featurePlugins/useProgressiveRendering/index.d.mts +3 -0
  247. package/internals/plugins/featurePlugins/useProgressiveRendering/index.d.ts +3 -0
  248. package/internals/plugins/featurePlugins/useProgressiveRendering/index.js +27 -0
  249. package/internals/plugins/featurePlugins/useProgressiveRendering/index.mjs +2 -0
  250. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.d.mts +13 -0
  251. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.d.ts +13 -0
  252. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.js +136 -0
  253. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.mjs +128 -0
  254. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.mts +42 -0
  255. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.d.ts +42 -0
  256. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.js +166 -0
  257. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.selectors.mjs +159 -0
  258. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.d.mts +34 -0
  259. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.d.ts +34 -0
  260. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.js +5 -0
  261. package/internals/plugins/featurePlugins/useProgressiveRendering/useProgressiveRendering.types.mjs +1 -0
  262. package/internals/resolveColorProcessor.js +4 -7
  263. package/internals/resolveColorProcessor.mjs +4 -7
  264. package/internals/scales/scaleBand.js +70 -43
  265. package/internals/scales/scaleBand.mjs +71 -44
  266. package/models/axis.d.mts +20 -4
  267. package/models/axis.d.ts +20 -4
  268. package/models/colorMapping.d.mts +8 -0
  269. package/models/colorMapping.d.ts +8 -0
  270. package/models/seriesType/bar.d.mts +1 -1
  271. package/models/seriesType/bar.d.ts +1 -1
  272. package/models/seriesType/common.d.mts +4 -4
  273. package/models/seriesType/common.d.ts +4 -4
  274. package/models/seriesType/config.d.mts +3 -3
  275. package/models/seriesType/config.d.ts +3 -3
  276. package/models/seriesType/line.d.mts +1 -1
  277. package/models/seriesType/line.d.ts +1 -1
  278. package/models/seriesType/pie.d.mts +1 -1
  279. package/models/seriesType/pie.d.ts +1 -1
  280. package/models/seriesType/radar.d.mts +1 -1
  281. package/models/seriesType/radar.d.ts +1 -1
  282. package/models/seriesType/scatter.d.mts +1 -1
  283. package/models/seriesType/scatter.d.ts +1 -1
  284. package/package.json +8 -5
  285. package/hooks/useIsHydrated.d.mts +0 -4
  286. package/hooks/useIsHydrated.d.ts +0 -4
  287. package/hooks/useIsHydrated.js +0 -19
  288. package/hooks/useIsHydrated.mjs +0 -14
@@ -9,6 +9,7 @@ import { type UseChartZAxisSignature } from "./featurePlugins/useChartZAxis/inde
9
9
  import { type UseChartBrushSignature } from "./featurePlugins/useChartBrush/index.mjs";
10
10
  import { type UseChartVisibilityManagerSignature } from "./featurePlugins/useChartVisibilityManager/index.mjs";
11
11
  import { type UseChartTooltipSignature } from "./featurePlugins/useChartTooltip/index.mjs";
12
- export type AllPluginSignatures<SeriesType extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<SeriesType>, UseChartPolarAxisSignature, UseChartTooltipSignature<SeriesType>, UseChartInteractionSignature, UseChartHighlightSignature<SeriesType>, UseChartVisibilityManagerSignature<SeriesType>, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
13
- export type DefaultPluginSignatures<SeriesType extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature<SeriesType>, UseChartInteractionSignature, UseChartCartesianAxisSignature<SeriesType>, UseChartHighlightSignature<SeriesType>, UseChartVisibilityManagerSignature<SeriesType>, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
14
- export declare const DEFAULT_PLUGINS: readonly [import("./models/index.mjs").ChartPlugin<UseChartZAxisSignature>, import("./models/index.mjs").ChartPlugin<UseChartBrushSignature>, import("./models/index.mjs").ChartPlugin<UseChartTooltipSignature<any>>, import("./models/index.mjs").ChartPlugin<UseChartInteractionSignature>, import("./models/index.mjs").ChartPlugin<UseChartCartesianAxisSignature<any>>, import("./models/index.mjs").ChartPlugin<UseChartHighlightSignature<any>>, import("./models/index.mjs").ChartPlugin<UseChartVisibilityManagerSignature<any>>, import("./models/index.mjs").ChartPlugin<UseChartClosestPointSignature>, import("./models/index.mjs").ChartPlugin<UseChartKeyboardNavigationSignature>];
12
+ import { type UseProgressiveRenderingSignature } from "./featurePlugins/useProgressiveRendering/index.mjs";
13
+ export type AllPluginSignatures<SeriesType extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<SeriesType>, UseChartPolarAxisSignature, UseChartTooltipSignature<SeriesType>, UseChartInteractionSignature, UseChartHighlightSignature<SeriesType>, UseChartVisibilityManagerSignature<SeriesType>, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature, UseProgressiveRenderingSignature];
14
+ export type DefaultPluginSignatures<SeriesType extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature<SeriesType>, UseChartInteractionSignature, UseChartCartesianAxisSignature<SeriesType>, UseChartHighlightSignature<SeriesType>, UseChartVisibilityManagerSignature<SeriesType>, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature, UseProgressiveRenderingSignature];
15
+ export declare const DEFAULT_PLUGINS: readonly [import("./models/index.mjs").ChartPlugin<UseChartZAxisSignature>, import("./models/index.mjs").ChartPlugin<UseChartBrushSignature>, import("./models/index.mjs").ChartPlugin<UseChartTooltipSignature<any>>, import("./models/index.mjs").ChartPlugin<UseChartInteractionSignature>, import("./models/index.mjs").ChartPlugin<UseChartCartesianAxisSignature<any>>, import("./models/index.mjs").ChartPlugin<UseChartHighlightSignature<any>>, import("./models/index.mjs").ChartPlugin<UseChartVisibilityManagerSignature<any>>, import("./models/index.mjs").ChartPlugin<UseChartClosestPointSignature>, import("./models/index.mjs").ChartPlugin<UseChartKeyboardNavigationSignature>, import("./models/index.mjs").ChartPlugin<UseProgressiveRenderingSignature>];
@@ -9,6 +9,7 @@ import { type UseChartZAxisSignature } from "./featurePlugins/useChartZAxis/inde
9
9
  import { type UseChartBrushSignature } from "./featurePlugins/useChartBrush/index.js";
10
10
  import { type UseChartVisibilityManagerSignature } from "./featurePlugins/useChartVisibilityManager/index.js";
11
11
  import { type UseChartTooltipSignature } from "./featurePlugins/useChartTooltip/index.js";
12
- export type AllPluginSignatures<SeriesType extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<SeriesType>, UseChartPolarAxisSignature, UseChartTooltipSignature<SeriesType>, UseChartInteractionSignature, UseChartHighlightSignature<SeriesType>, UseChartVisibilityManagerSignature<SeriesType>, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
13
- export type DefaultPluginSignatures<SeriesType extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature<SeriesType>, UseChartInteractionSignature, UseChartCartesianAxisSignature<SeriesType>, UseChartHighlightSignature<SeriesType>, UseChartVisibilityManagerSignature<SeriesType>, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
14
- export declare const DEFAULT_PLUGINS: readonly [import("./models/index.js").ChartPlugin<UseChartZAxisSignature>, import("./models/index.js").ChartPlugin<UseChartBrushSignature>, import("./models/index.js").ChartPlugin<UseChartTooltipSignature<any>>, import("./models/index.js").ChartPlugin<UseChartInteractionSignature>, import("./models/index.js").ChartPlugin<UseChartCartesianAxisSignature<any>>, import("./models/index.js").ChartPlugin<UseChartHighlightSignature<any>>, import("./models/index.js").ChartPlugin<UseChartVisibilityManagerSignature<any>>, import("./models/index.js").ChartPlugin<UseChartClosestPointSignature>, import("./models/index.js").ChartPlugin<UseChartKeyboardNavigationSignature>];
12
+ import { type UseProgressiveRenderingSignature } from "./featurePlugins/useProgressiveRendering/index.js";
13
+ export type AllPluginSignatures<SeriesType extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<SeriesType>, UseChartPolarAxisSignature, UseChartTooltipSignature<SeriesType>, UseChartInteractionSignature, UseChartHighlightSignature<SeriesType>, UseChartVisibilityManagerSignature<SeriesType>, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature, UseProgressiveRenderingSignature];
14
+ export type DefaultPluginSignatures<SeriesType extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature<SeriesType>, UseChartInteractionSignature, UseChartCartesianAxisSignature<SeriesType>, UseChartHighlightSignature<SeriesType>, UseChartVisibilityManagerSignature<SeriesType>, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature, UseProgressiveRenderingSignature];
15
+ export declare const DEFAULT_PLUGINS: readonly [import("./models/index.js").ChartPlugin<UseChartZAxisSignature>, import("./models/index.js").ChartPlugin<UseChartBrushSignature>, import("./models/index.js").ChartPlugin<UseChartTooltipSignature<any>>, import("./models/index.js").ChartPlugin<UseChartInteractionSignature>, import("./models/index.js").ChartPlugin<UseChartCartesianAxisSignature<any>>, import("./models/index.js").ChartPlugin<UseChartHighlightSignature<any>>, import("./models/index.js").ChartPlugin<UseChartVisibilityManagerSignature<any>>, import("./models/index.js").ChartPlugin<UseChartClosestPointSignature>, import("./models/index.js").ChartPlugin<UseChartKeyboardNavigationSignature>, import("./models/index.js").ChartPlugin<UseProgressiveRenderingSignature>];
@@ -13,6 +13,7 @@ var _useChartZAxis = require("./featurePlugins/useChartZAxis");
13
13
  var _useChartBrush = require("./featurePlugins/useChartBrush");
14
14
  var _useChartVisibilityManager = require("./featurePlugins/useChartVisibilityManager");
15
15
  var _useChartTooltip = require("./featurePlugins/useChartTooltip");
16
+ var _useProgressiveRendering = require("./featurePlugins/useProgressiveRendering");
16
17
  // This file should be removed after creating all plugins in favor of a file per chart type.
17
18
 
18
- const DEFAULT_PLUGINS = exports.DEFAULT_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartBrush.useChartBrush, _useChartTooltip.useChartTooltip, _useChartInteraction.useChartInteraction, _useChartCartesianAxis.useChartCartesianAxis, _useChartHighlight.useChartHighlight, _useChartVisibilityManager.useChartVisibilityManager, _useChartClosestPoint.useChartClosestPoint, _useChartKeyboardNavigation.useChartKeyboardNavigation];
19
+ const DEFAULT_PLUGINS = exports.DEFAULT_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartBrush.useChartBrush, _useChartTooltip.useChartTooltip, _useChartInteraction.useChartInteraction, _useChartCartesianAxis.useChartCartesianAxis, _useChartHighlight.useChartHighlight, _useChartVisibilityManager.useChartVisibilityManager, _useChartClosestPoint.useChartClosestPoint, _useChartKeyboardNavigation.useChartKeyboardNavigation, _useProgressiveRendering.useProgressiveRendering];
@@ -9,4 +9,5 @@ import { useChartZAxis } from "./featurePlugins/useChartZAxis/index.mjs";
9
9
  import { useChartBrush } from "./featurePlugins/useChartBrush/index.mjs";
10
10
  import { useChartVisibilityManager } from "./featurePlugins/useChartVisibilityManager/index.mjs";
11
11
  import { useChartTooltip } from "./featurePlugins/useChartTooltip/index.mjs";
12
- export const DEFAULT_PLUGINS = [useChartZAxis, useChartBrush, useChartTooltip, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartVisibilityManager, useChartClosestPoint, useChartKeyboardNavigation];
12
+ import { useProgressiveRendering } from "./featurePlugins/useProgressiveRendering/index.mjs";
13
+ export const DEFAULT_PLUGINS = [useChartZAxis, useChartBrush, useChartTooltip, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartVisibilityManager, useChartClosestPoint, useChartKeyboardNavigation, useProgressiveRendering];
@@ -1,4 +1,13 @@
1
1
  import type { ChartSeriesType } from "../../../../models/seriesType/config.mjs";
2
- import { type ChartRootSelector } from "../../utils/selectors.mjs";
3
- import type { UseChartExperimentalFeaturesSignature } from "./useChartExperimentalFeature.types.mjs";
4
- export declare const selectorChartExperimentalFeaturesState: ChartRootSelector<UseChartExperimentalFeaturesSignature<ChartSeriesType>>;
2
+ import { type ChartState } from "../../models/chart.mjs";
3
+ import type { ChartExperimentalFeatures, UseChartExperimentalFeaturesSignature } from "./useChartExperimentalFeature.types.mjs";
4
+ /**
5
+ * Reads the value of a single experimental feature flag from the store.
6
+ *
7
+ * @example
8
+ * const enabled = store.use(
9
+ * selectorChartExperimentalFeaturesState,
10
+ * 'progressiveRendering',
11
+ * );
12
+ */
13
+ export declare const selectorChartExperimentalFeaturesState: <K extends keyof ChartExperimentalFeatures>(state: ChartState<[UseChartExperimentalFeaturesSignature<ChartSeriesType>]>, featureName: K) => ChartExperimentalFeatures[K] | undefined;
@@ -1,4 +1,13 @@
1
1
  import type { ChartSeriesType } from "../../../../models/seriesType/config.js";
2
- import { type ChartRootSelector } from "../../utils/selectors.js";
3
- import type { UseChartExperimentalFeaturesSignature } from "./useChartExperimentalFeature.types.js";
4
- export declare const selectorChartExperimentalFeaturesState: ChartRootSelector<UseChartExperimentalFeaturesSignature<ChartSeriesType>>;
2
+ import { type ChartState } from "../../models/chart.js";
3
+ import type { ChartExperimentalFeatures, UseChartExperimentalFeaturesSignature } from "./useChartExperimentalFeature.types.js";
4
+ /**
5
+ * Reads the value of a single experimental feature flag from the store.
6
+ *
7
+ * @example
8
+ * const enabled = store.use(
9
+ * selectorChartExperimentalFeaturesState,
10
+ * 'progressiveRendering',
11
+ * );
12
+ */
13
+ export declare const selectorChartExperimentalFeaturesState: <K extends keyof ChartExperimentalFeatures>(state: ChartState<[UseChartExperimentalFeaturesSignature<ChartSeriesType>]>, featureName: K) => ChartExperimentalFeatures[K] | undefined;
@@ -4,5 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.selectorChartExperimentalFeaturesState = void 0;
7
- const selectorChartExperimentalFeaturesState = state => state.experimentalFeatures;
7
+ /**
8
+ * Reads the value of a single experimental feature flag from the store.
9
+ *
10
+ * @example
11
+ * const enabled = store.use(
12
+ * selectorChartExperimentalFeaturesState,
13
+ * 'progressiveRendering',
14
+ * );
15
+ */
16
+ const selectorChartExperimentalFeaturesState = (state, featureName) => state.experimentalFeatures?.[featureName];
8
17
  exports.selectorChartExperimentalFeaturesState = selectorChartExperimentalFeaturesState;
@@ -1 +1,10 @@
1
- export const selectorChartExperimentalFeaturesState = state => state.experimentalFeatures;
1
+ /**
2
+ * Reads the value of a single experimental feature flag from the store.
3
+ *
4
+ * @example
5
+ * const enabled = store.use(
6
+ * selectorChartExperimentalFeaturesState,
7
+ * 'progressiveRendering',
8
+ * );
9
+ */
10
+ export const selectorChartExperimentalFeaturesState = (state, featureName) => state.experimentalFeatures?.[featureName];
@@ -13,7 +13,21 @@ interface LineExperimentalFeatures {
13
13
  */
14
14
  enablePositionBasedPointerInteraction?: boolean;
15
15
  }
16
- export type ChartExperimentalFeatures<SeriesType extends ChartSeriesType = ChartSeriesType> = 'line' extends SeriesType ? LineExperimentalFeatures : {};
16
+ interface ScatterExperimentalFeatures {
17
+ /**
18
+ * Enables automatic progressive (batched) rendering for scatter series.
19
+ *
20
+ * When enabled and the `renderer` prop is left unset, the chart switches to
21
+ * the `svg-progressive` renderer above an internal point-count threshold,
22
+ * painting points over several animation frames to keep the main thread
23
+ * responsive. When disabled, the unset `renderer` keeps the synchronous
24
+ * `svg-single` renderer. Setting `renderer` explicitly is unaffected.
25
+ *
26
+ * This behavior will become the default in the next major version.
27
+ */
28
+ progressiveRendering?: boolean;
29
+ }
30
+ export type ChartExperimentalFeatures<SeriesType extends ChartSeriesType = ChartSeriesType> = ('line' extends SeriesType ? LineExperimentalFeatures : {}) & ('scatter' extends SeriesType ? ScatterExperimentalFeatures : {});
17
31
  export interface UseChartExperimentalFeaturesParameters<SeriesType extends ChartSeriesType = ChartSeriesType> {
18
32
  /**
19
33
  * Options to enable features planned for the next major.
@@ -13,7 +13,21 @@ interface LineExperimentalFeatures {
13
13
  */
14
14
  enablePositionBasedPointerInteraction?: boolean;
15
15
  }
16
- export type ChartExperimentalFeatures<SeriesType extends ChartSeriesType = ChartSeriesType> = 'line' extends SeriesType ? LineExperimentalFeatures : {};
16
+ interface ScatterExperimentalFeatures {
17
+ /**
18
+ * Enables automatic progressive (batched) rendering for scatter series.
19
+ *
20
+ * When enabled and the `renderer` prop is left unset, the chart switches to
21
+ * the `svg-progressive` renderer above an internal point-count threshold,
22
+ * painting points over several animation frames to keep the main thread
23
+ * responsive. When disabled, the unset `renderer` keeps the synchronous
24
+ * `svg-single` renderer. Setting `renderer` explicitly is unaffected.
25
+ *
26
+ * This behavior will become the default in the next major version.
27
+ */
28
+ progressiveRendering?: boolean;
29
+ }
30
+ export type ChartExperimentalFeatures<SeriesType extends ChartSeriesType = ChartSeriesType> = ('line' extends SeriesType ? LineExperimentalFeatures : {}) & ('scatter' extends SeriesType ? ScatterExperimentalFeatures : {});
17
31
  export interface UseChartExperimentalFeaturesParameters<SeriesType extends ChartSeriesType = ChartSeriesType> {
18
32
  /**
19
33
  * Options to enable features planned for the next major.
@@ -40,34 +40,6 @@ const useChartInteractionListener = ({
40
40
  name: 'brush',
41
41
  threshold: 0,
42
42
  maxPointers: 1
43
- }),
44
- // Zoom gestures
45
- new _core.PanGesture({
46
- name: 'zoomPan',
47
- threshold: 0,
48
- preventIf: ['zoomTapAndDrag', 'zoomPressAndDrag']
49
- }), new _core.PinchGesture({
50
- name: 'zoomPinch',
51
- threshold: 5
52
- }), new _core.TurnWheelGesture({
53
- name: 'zoomTurnWheel',
54
- sensitivity: 0.01,
55
- initialDelta: 1,
56
- passive: false
57
- }), new _core.TurnWheelGesture({
58
- name: 'panTurnWheel',
59
- sensitivity: 0.5,
60
- passive: false
61
- }), new _core.TapAndDragGesture({
62
- name: 'zoomTapAndDrag',
63
- dragThreshold: 10
64
- }), new _core.PressAndDragGesture({
65
- name: 'zoomPressAndDrag',
66
- dragThreshold: 10,
67
- preventIf: ['zoomPinch']
68
- }), new _core.TapGesture({
69
- name: 'zoomDoubleTapReset',
70
- taps: 2
71
43
  })]
72
44
  });
73
45
  }
@@ -77,7 +49,7 @@ const useChartInteractionListener = ({
77
49
  if (!svg || !gestureManager) {
78
50
  return undefined;
79
51
  }
80
- gestureManager.registerElement(['pan', 'move', 'zoomPinch', 'zoomPan', 'zoomTurnWheel', 'panTurnWheel', 'tap', 'quickPress', 'zoomTapAndDrag', 'zoomPressAndDrag', 'zoomDoubleTapReset', 'brush'], svg);
52
+ gestureManager.registerElement(['pan', 'move', 'tap', 'quickPress', 'brush'], svg);
81
53
  return () => {
82
54
  // Cleanup gesture manager
83
55
  gestureManager.unregisterAllGestures(svg);
@@ -113,10 +85,24 @@ const useChartInteractionListener = ({
113
85
  svg?.removeEventListener('gestureend', preventDefault);
114
86
  };
115
87
  }, [chartsLayerContainerRef]);
88
+ const registerGestures = React.useCallback(gestures => {
89
+ const svg = chartsLayerContainerRef.current;
90
+ const gestureManager = gestureManagerRef.current;
91
+ if (!gestureManager || !svg) {
92
+ return () => {};
93
+ }
94
+ const gestureNames = gestures.map(gesture => gesture.name);
95
+ gestureManager.addGestures(gestures);
96
+ gestureManager.registerElement(gestureNames, svg);
97
+ return () => {
98
+ gestureManager.removeGestures(gestureNames);
99
+ };
100
+ }, [chartsLayerContainerRef, gestureManagerRef]);
116
101
  return {
117
102
  instance: {
118
103
  addInteractionListener,
119
- updateZoomInteractionListeners
104
+ updateZoomInteractionListeners,
105
+ registerGestures
120
106
  }
121
107
  };
122
108
  };
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import * as React from 'react';
4
- import { GestureManager, MoveGesture, PanGesture, PinchGesture, PressAndDragGesture, PressGesture, TapAndDragGesture, TapGesture, TurnWheelGesture } from '@mui/x-internal-gestures/core';
4
+ import { GestureManager, MoveGesture, PanGesture, PressGesture, TapGesture } from '@mui/x-internal-gestures/core';
5
5
  const preventDefault = event => event.preventDefault();
6
6
  export const useChartInteractionListener = ({
7
7
  instance
@@ -34,34 +34,6 @@ export const useChartInteractionListener = ({
34
34
  name: 'brush',
35
35
  threshold: 0,
36
36
  maxPointers: 1
37
- }),
38
- // Zoom gestures
39
- new PanGesture({
40
- name: 'zoomPan',
41
- threshold: 0,
42
- preventIf: ['zoomTapAndDrag', 'zoomPressAndDrag']
43
- }), new PinchGesture({
44
- name: 'zoomPinch',
45
- threshold: 5
46
- }), new TurnWheelGesture({
47
- name: 'zoomTurnWheel',
48
- sensitivity: 0.01,
49
- initialDelta: 1,
50
- passive: false
51
- }), new TurnWheelGesture({
52
- name: 'panTurnWheel',
53
- sensitivity: 0.5,
54
- passive: false
55
- }), new TapAndDragGesture({
56
- name: 'zoomTapAndDrag',
57
- dragThreshold: 10
58
- }), new PressAndDragGesture({
59
- name: 'zoomPressAndDrag',
60
- dragThreshold: 10,
61
- preventIf: ['zoomPinch']
62
- }), new TapGesture({
63
- name: 'zoomDoubleTapReset',
64
- taps: 2
65
37
  })]
66
38
  });
67
39
  }
@@ -71,7 +43,7 @@ export const useChartInteractionListener = ({
71
43
  if (!svg || !gestureManager) {
72
44
  return undefined;
73
45
  }
74
- gestureManager.registerElement(['pan', 'move', 'zoomPinch', 'zoomPan', 'zoomTurnWheel', 'panTurnWheel', 'tap', 'quickPress', 'zoomTapAndDrag', 'zoomPressAndDrag', 'zoomDoubleTapReset', 'brush'], svg);
46
+ gestureManager.registerElement(['pan', 'move', 'tap', 'quickPress', 'brush'], svg);
75
47
  return () => {
76
48
  // Cleanup gesture manager
77
49
  gestureManager.unregisterAllGestures(svg);
@@ -107,10 +79,24 @@ export const useChartInteractionListener = ({
107
79
  svg?.removeEventListener('gestureend', preventDefault);
108
80
  };
109
81
  }, [chartsLayerContainerRef]);
82
+ const registerGestures = React.useCallback(gestures => {
83
+ const svg = chartsLayerContainerRef.current;
84
+ const gestureManager = gestureManagerRef.current;
85
+ if (!gestureManager || !svg) {
86
+ return () => {};
87
+ }
88
+ const gestureNames = gestures.map(gesture => gesture.name);
89
+ gestureManager.addGestures(gestures);
90
+ gestureManager.registerElement(gestureNames, svg);
91
+ return () => {
92
+ gestureManager.removeGestures(gestureNames);
93
+ };
94
+ }, [chartsLayerContainerRef, gestureManagerRef]);
110
95
  return {
111
96
  instance: {
112
97
  addInteractionListener,
113
- updateZoomInteractionListeners
98
+ updateZoomInteractionListeners,
99
+ registerGestures
114
100
  }
115
101
  };
116
102
  };
@@ -1,4 +1,4 @@
1
- import { type MoveEvent, type PanEvent, type PanGestureOptions, type PinchEvent, type PinchGestureOptions, type PressEvent, type TapEvent, type TurnWheelEvent, type PressAndDragEvent, type PressAndDragGestureOptions, type TapAndDragEvent, type TapAndDragGestureOptions, type TapGestureOptions, type TurnWheelGestureOptions } from '@mui/x-internal-gestures/core';
1
+ import { type Gesture, type MoveEvent, type PanEvent, type PanGestureOptions, type PinchEvent, type PinchGestureOptions, type PressEvent, type TapEvent, type TurnWheelEvent, type PressAndDragEvent, type PressAndDragGestureOptions, type TapAndDragEvent, type TapAndDragGestureOptions, type TapGestureOptions, type TurnWheelGestureOptions } from '@mui/x-internal-gestures/core';
2
2
  import { type ChartPluginSignature } from "../../models/index.mjs";
3
3
  export type ChartInteraction = 'pan' | 'panStart' | 'panEnd' | 'zoomPan' | 'zoomPanStart' | 'zoomPanEnd' | 'zoomPinch' | 'zoomPinchStart' | 'zoomPinchEnd' | 'zoomTurnWheel' | 'panTurnWheel' | 'zoomTapAndDrag' | 'zoomTapAndDragStart' | 'zoomTapAndDragEnd' | 'zoomPressAndDrag' | 'zoomPressAndDragStart' | 'zoomPressAndDragEnd' | 'move' | 'moveStart' | 'moveEnd' | 'tap' | 'quickPress' | 'quickPressEnd' | 'zoomDoubleTapReset' | 'brush' | 'brushStart' | 'brushCancel' | 'brushEnd';
4
4
  export type InteractionListenerResult = {
@@ -27,6 +27,7 @@ export type UpdateZoomInteractionListeners = {
27
27
  };
28
28
  export interface UseChartInteractionListenerParameters {}
29
29
  export interface UseChartInteractionListenerState {}
30
+ export type RegisterGestures = (gestures: Gesture<string>[]) => () => void;
30
31
  export interface UseChartInteractionListenerInstance {
31
32
  /**
32
33
  * Adds an interaction listener to the SVG element.
@@ -42,6 +43,12 @@ export interface UseChartInteractionListenerInstance {
42
43
  * @param options The options to apply to the interaction.
43
44
  */
44
45
  updateZoomInteractionListeners: UpdateZoomInteractionListeners;
46
+ /**
47
+ * Registers additional gestures on the chart interaction element.
48
+ *
49
+ * @param gestures The gestures to register.
50
+ */
51
+ registerGestures: RegisterGestures;
45
52
  }
46
53
  export type UseChartInteractionListenerSignature = ChartPluginSignature<{
47
54
  params: UseChartInteractionListenerParameters;
@@ -1,4 +1,4 @@
1
- import { type MoveEvent, type PanEvent, type PanGestureOptions, type PinchEvent, type PinchGestureOptions, type PressEvent, type TapEvent, type TurnWheelEvent, type PressAndDragEvent, type PressAndDragGestureOptions, type TapAndDragEvent, type TapAndDragGestureOptions, type TapGestureOptions, type TurnWheelGestureOptions } from '@mui/x-internal-gestures/core';
1
+ import { type Gesture, type MoveEvent, type PanEvent, type PanGestureOptions, type PinchEvent, type PinchGestureOptions, type PressEvent, type TapEvent, type TurnWheelEvent, type PressAndDragEvent, type PressAndDragGestureOptions, type TapAndDragEvent, type TapAndDragGestureOptions, type TapGestureOptions, type TurnWheelGestureOptions } from '@mui/x-internal-gestures/core';
2
2
  import { type ChartPluginSignature } from "../../models/index.js";
3
3
  export type ChartInteraction = 'pan' | 'panStart' | 'panEnd' | 'zoomPan' | 'zoomPanStart' | 'zoomPanEnd' | 'zoomPinch' | 'zoomPinchStart' | 'zoomPinchEnd' | 'zoomTurnWheel' | 'panTurnWheel' | 'zoomTapAndDrag' | 'zoomTapAndDragStart' | 'zoomTapAndDragEnd' | 'zoomPressAndDrag' | 'zoomPressAndDragStart' | 'zoomPressAndDragEnd' | 'move' | 'moveStart' | 'moveEnd' | 'tap' | 'quickPress' | 'quickPressEnd' | 'zoomDoubleTapReset' | 'brush' | 'brushStart' | 'brushCancel' | 'brushEnd';
4
4
  export type InteractionListenerResult = {
@@ -27,6 +27,7 @@ export type UpdateZoomInteractionListeners = {
27
27
  };
28
28
  export interface UseChartInteractionListenerParameters {}
29
29
  export interface UseChartInteractionListenerState {}
30
+ export type RegisterGestures = (gestures: Gesture<string>[]) => () => void;
30
31
  export interface UseChartInteractionListenerInstance {
31
32
  /**
32
33
  * Adds an interaction listener to the SVG element.
@@ -42,6 +43,12 @@ export interface UseChartInteractionListenerInstance {
42
43
  * @param options The options to apply to the interaction.
43
44
  */
44
45
  updateZoomInteractionListeners: UpdateZoomInteractionListeners;
46
+ /**
47
+ * Registers additional gestures on the chart interaction element.
48
+ *
49
+ * @param gestures The gestures to register.
50
+ */
51
+ registerGestures: RegisterGestures;
45
52
  }
46
53
  export type UseChartInteractionListenerSignature = ChartPluginSignature<{
47
54
  params: UseChartInteractionListenerParameters;
@@ -6,7 +6,7 @@ import type { ChartSeriesType } from "../../../../../models/seriesType/config.mj
6
6
  * Map data index to a color.
7
7
  * If dataIndex is not defined, it falls back to the series color when defined.
8
8
  */
9
- export type ColorGetter<SeriesType extends ChartSeriesType> = SeriesType extends 'pie' | 'funnel' ? (dataIndex: number) => string : SeriesType extends 'heatmap' ? (value: number | null) => string : (dataIndex?: number) => string;
9
+ export type ColorGetter<SeriesType extends ChartSeriesType> = SeriesType extends 'pie' | 'funnel' ? (dataIndex: number) => string : SeriesType extends 'heatmap' ? (value: number | null) => string : SeriesType extends 'mapShape' ? (dataIndex?: number) => string | null : (dataIndex?: number) => string;
10
10
  export type ColorProcessor<SeriesType extends ChartSeriesType> = (series: DefaultizedSeriesType<SeriesType>,
11
11
  /**
12
12
  * Either the x-axis or rotation-axis, depending on the coordinate system.
@@ -6,7 +6,7 @@ import type { ChartSeriesType } from "../../../../../models/seriesType/config.js
6
6
  * Map data index to a color.
7
7
  * If dataIndex is not defined, it falls back to the series color when defined.
8
8
  */
9
- export type ColorGetter<SeriesType extends ChartSeriesType> = SeriesType extends 'pie' | 'funnel' ? (dataIndex: number) => string : SeriesType extends 'heatmap' ? (value: number | null) => string : (dataIndex?: number) => string;
9
+ export type ColorGetter<SeriesType extends ChartSeriesType> = SeriesType extends 'pie' | 'funnel' ? (dataIndex: number) => string : SeriesType extends 'heatmap' ? (value: number | null) => string : SeriesType extends 'mapShape' ? (dataIndex?: number) => string | null : (dataIndex?: number) => string;
10
10
  export type ColorProcessor<SeriesType extends ChartSeriesType> = (series: DefaultizedSeriesType<SeriesType>,
11
11
  /**
12
12
  * Either the x-axis or rotation-axis, depending on the coordinate system.
@@ -1,14 +1,21 @@
1
+ import type { ExtendedFeatureCollection, GeoProjection } from '@mui/x-charts-vendor/d3-geo';
1
2
  import type { SeriesItemIdentifierWithType } from "../../../../../models/seriesType/index.mjs";
2
3
  import type { ChartSeriesType } from "../../../../../models/seriesType/config.mjs";
3
4
  import { type ChartsRotationAxisProps, type ChartsRadiusAxisProps, type ComputedXAxis, type ComputedYAxis } from "../../../../../models/axis.mjs";
4
5
  import { type ChartDrawingArea } from "../../../../../hooks/useDrawingArea.mjs";
5
6
  import { type ProcessedSeries, type SeriesLayout } from "../../useChartSeries/index.mjs";
6
7
  import { type ComputeResult } from "../../../featurePlugins/useChartPolarAxis/computeAxisValue.mjs";
8
+ export type GeoTooltipPosition = {
9
+ geoData: ExtendedFeatureCollection | null;
10
+ projection: GeoProjection | null;
11
+ featureIndexesByName: ReadonlyMap<string, number[]>;
12
+ };
7
13
  export interface TooltipPositionGetterAxesConfig {
8
14
  x?: ComputedXAxis;
9
15
  y?: ComputedYAxis;
10
16
  rotationAxes?: ComputeResult<ChartsRotationAxisProps>;
11
17
  radiusAxes?: ComputeResult<ChartsRadiusAxisProps>;
18
+ geo?: GeoTooltipPosition;
12
19
  }
13
20
  export type TooltipItemPositionGetter<SeriesType extends ChartSeriesType> = (params: {
14
21
  series: ProcessedSeries<SeriesType>;
@@ -1,14 +1,21 @@
1
+ import type { ExtendedFeatureCollection, GeoProjection } from '@mui/x-charts-vendor/d3-geo';
1
2
  import type { SeriesItemIdentifierWithType } from "../../../../../models/seriesType/index.js";
2
3
  import type { ChartSeriesType } from "../../../../../models/seriesType/config.js";
3
4
  import { type ChartsRotationAxisProps, type ChartsRadiusAxisProps, type ComputedXAxis, type ComputedYAxis } from "../../../../../models/axis.js";
4
5
  import { type ChartDrawingArea } from "../../../../../hooks/useDrawingArea.js";
5
6
  import { type ProcessedSeries, type SeriesLayout } from "../../useChartSeries/index.js";
6
7
  import { type ComputeResult } from "../../../featurePlugins/useChartPolarAxis/computeAxisValue.js";
8
+ export type GeoTooltipPosition = {
9
+ geoData: ExtendedFeatureCollection | null;
10
+ projection: GeoProjection | null;
11
+ featureIndexesByName: ReadonlyMap<string, number[]>;
12
+ };
7
13
  export interface TooltipPositionGetterAxesConfig {
8
14
  x?: ComputedXAxis;
9
15
  y?: ComputedYAxis;
10
16
  rotationAxes?: ComputeResult<ChartsRotationAxisProps>;
11
17
  radiusAxes?: ComputeResult<ChartsRadiusAxisProps>;
18
+ geo?: GeoTooltipPosition;
12
19
  }
13
20
  export type TooltipItemPositionGetter<SeriesType extends ChartSeriesType> = (params: {
14
21
  series: ProcessedSeries<SeriesType>;
@@ -2,14 +2,6 @@ import { type NumberValue } from '@mui/x-charts-vendor/d3-scale';
2
2
  import { type AxisId, type ContinuousScaleName, type DefaultedAxis, type DefaultedXAxis, type DefaultedYAxis } from "../../../../models/axis.mjs";
3
3
  import { type ProcessedSeries } from "../../corePlugins/useChartSeries/index.mjs";
4
4
  import { type TickParams } from "../../../../hooks/useTicks.mjs";
5
- /**
6
- * Calculates the initial domain and tick number for a given axis.
7
- * The domain should still run through the zoom filterMode after this step.
8
- */
9
- export declare function calculateInitialDomainAndTickNumber(axis: DefaultedAxis<ContinuousScaleName>, axisDirection: 'x' | 'y', axisIndex: number, formattedSeries: ProcessedSeries, [minData, maxData]: [number | Date, number | Date], defaultTickNumber: number): {
10
- domain: [NumberValue, NumberValue];
11
- tickNumber: number;
12
- };
13
5
  /**
14
6
  * Calculates the final domain for an axis.
15
7
  * After this step, the domain can be used to create the axis scale.
@@ -2,14 +2,6 @@ import { type NumberValue } from '@mui/x-charts-vendor/d3-scale';
2
2
  import { type AxisId, type ContinuousScaleName, type DefaultedAxis, type DefaultedXAxis, type DefaultedYAxis } from "../../../../models/axis.js";
3
3
  import { type ProcessedSeries } from "../../corePlugins/useChartSeries/index.js";
4
4
  import { type TickParams } from "../../../../hooks/useTicks.js";
5
- /**
6
- * Calculates the initial domain and tick number for a given axis.
7
- * The domain should still run through the zoom filterMode after this step.
8
- */
9
- export declare function calculateInitialDomainAndTickNumber(axis: DefaultedAxis<ContinuousScaleName>, axisDirection: 'x' | 'y', axisIndex: number, formattedSeries: ProcessedSeries, [minData, maxData]: [number | Date, number | Date], defaultTickNumber: number): {
10
- domain: [NumberValue, NumberValue];
11
- tickNumber: number;
12
- };
13
5
  /**
14
6
  * Calculates the final domain for an axis.
15
7
  * After this step, the domain can be used to create the axis scale.
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.calculateFinalDomain = calculateFinalDomain;
7
- exports.calculateInitialDomainAndTickNumber = calculateInitialDomainAndTickNumber;
8
7
  exports.computeAxisDomainsMap = computeAxisDomainsMap;
9
8
  var _axis = require("../../../../models/axis");
10
9
  var _getScale = require("../../../getScale");
@@ -73,7 +72,7 @@ function getActualAxisExtrema(axisExtrema, minData, maxData) {
73
72
  if ('max' in axisExtrema && axisExtrema.max != null && axisExtrema.max < minData) {
74
73
  min = axisExtrema.max;
75
74
  }
76
- if ('min' in axisExtrema && axisExtrema.min != null && axisExtrema.min > minData) {
75
+ if ('min' in axisExtrema && axisExtrema.min != null && axisExtrema.min > maxData) {
77
76
  max = axisExtrema.min;
78
77
  }
79
78
  if (!('min' in axisExtrema) && !('max' in axisExtrema)) {
@@ -10,7 +10,7 @@ function niceDomain(scaleType, domain, tickNumber) {
10
10
  * Calculates the initial domain and tick number for a given axis.
11
11
  * The domain should still run through the zoom filterMode after this step.
12
12
  */
13
- export function calculateInitialDomainAndTickNumber(axis, axisDirection, axisIndex, formattedSeries, [minData, maxData], defaultTickNumber) {
13
+ function calculateInitialDomainAndTickNumber(axis, axisDirection, axisIndex, formattedSeries, [minData, maxData], defaultTickNumber) {
14
14
  const domainLimit = getAxisDomainLimit(axis, axisDirection, axisIndex, formattedSeries);
15
15
  let axisExtrema = getActualAxisExtrema(axis, minData, maxData);
16
16
  if (typeof domainLimit === 'function') {
@@ -65,7 +65,7 @@ function getActualAxisExtrema(axisExtrema, minData, maxData) {
65
65
  if ('max' in axisExtrema && axisExtrema.max != null && axisExtrema.max < minData) {
66
66
  min = axisExtrema.max;
67
67
  }
68
- if ('min' in axisExtrema && axisExtrema.min != null && axisExtrema.min > minData) {
68
+ if ('min' in axisExtrema && axisExtrema.min != null && axisExtrema.min > maxData) {
69
69
  max = axisExtrema.min;
70
70
  }
71
71
  if (!('min' in axisExtrema) && !('max' in axisExtrema)) {
@@ -13,14 +13,39 @@ function getRange(drawingArea, axisDirection, axis) {
13
13
  const range = axisDirection === 'x' ? [drawingArea.left, drawingArea.left + drawingArea.width] : [drawingArea.top + drawingArea.height, drawingArea.top];
14
14
  return axis.reverse ? [range[1], range[0]] : range;
15
15
  }
16
+
17
+ /**
18
+ * Caches the normalized ordinal scale so it is not rebuilt on every pan/zoom frame. Building a
19
+ * band/point scale is `O(domain)` — it interns the whole domain — which is prohibitive for large
20
+ * category axes when zooming. The domain array (the axis `data`) is referentially stable across
21
+ * zoom, so it is the outer key; a `WeakMap` lets unused domains be collected. The inner key is the
22
+ * scale variant (type + padding), because the same domain array can back several axes (e.g. a `band`
23
+ * and a `point` axis sharing one `data` array), which must not share a scale. Continuous scales are
24
+ * not cached: they are cheap to build and their domain reference changes with zoom anyway, so a
25
+ * cache would only ever miss.
26
+ */
27
+ const normalizedScaleCache = new WeakMap();
28
+ function getCachedOrdinalScale(domain, variant, build) {
29
+ let variants = normalizedScaleCache.get(domain);
30
+ if (!variants) {
31
+ variants = new Map();
32
+ normalizedScaleCache.set(domain, variants);
33
+ }
34
+ let scale = variants.get(variant);
35
+ if (!scale) {
36
+ scale = build();
37
+ variants.set(variant, scale);
38
+ }
39
+ return scale;
40
+ }
16
41
  function getNormalizedAxisScale(axis, domain) {
17
42
  const range = [0, 1];
18
43
  if ((0, _axis.isBandScaleConfig)(axis)) {
19
44
  const categoryGapRatio = axis.categoryGapRatio ?? DEFAULT_CATEGORY_GAP_RATIO;
20
- return (0, _scales.scaleBand)(domain, range).paddingInner(categoryGapRatio).paddingOuter(categoryGapRatio / 2);
45
+ return getCachedOrdinalScale(domain, `band:${categoryGapRatio}`, () => (0, _scales.scaleBand)(domain, range).paddingInner(categoryGapRatio).paddingOuter(categoryGapRatio / 2));
21
46
  }
22
47
  if ((0, _axis.isPointScaleConfig)(axis)) {
23
- return (0, _scales.scalePoint)(domain, range);
48
+ return getCachedOrdinalScale(domain, 'point', () => (0, _scales.scalePoint)(domain, range));
24
49
  }
25
50
  const scaleType = axis.scaleType ?? 'linear';
26
51
  const scale = (0, _getScale.getScale)(scaleType, domain, range);
@@ -6,14 +6,39 @@ export function getRange(drawingArea, axisDirection, axis) {
6
6
  const range = axisDirection === 'x' ? [drawingArea.left, drawingArea.left + drawingArea.width] : [drawingArea.top + drawingArea.height, drawingArea.top];
7
7
  return axis.reverse ? [range[1], range[0]] : range;
8
8
  }
9
+
10
+ /**
11
+ * Caches the normalized ordinal scale so it is not rebuilt on every pan/zoom frame. Building a
12
+ * band/point scale is `O(domain)` — it interns the whole domain — which is prohibitive for large
13
+ * category axes when zooming. The domain array (the axis `data`) is referentially stable across
14
+ * zoom, so it is the outer key; a `WeakMap` lets unused domains be collected. The inner key is the
15
+ * scale variant (type + padding), because the same domain array can back several axes (e.g. a `band`
16
+ * and a `point` axis sharing one `data` array), which must not share a scale. Continuous scales are
17
+ * not cached: they are cheap to build and their domain reference changes with zoom anyway, so a
18
+ * cache would only ever miss.
19
+ */
20
+ const normalizedScaleCache = new WeakMap();
21
+ function getCachedOrdinalScale(domain, variant, build) {
22
+ let variants = normalizedScaleCache.get(domain);
23
+ if (!variants) {
24
+ variants = new Map();
25
+ normalizedScaleCache.set(domain, variants);
26
+ }
27
+ let scale = variants.get(variant);
28
+ if (!scale) {
29
+ scale = build();
30
+ variants.set(variant, scale);
31
+ }
32
+ return scale;
33
+ }
9
34
  export function getNormalizedAxisScale(axis, domain) {
10
35
  const range = [0, 1];
11
36
  if (isBandScaleConfig(axis)) {
12
37
  const categoryGapRatio = axis.categoryGapRatio ?? DEFAULT_CATEGORY_GAP_RATIO;
13
- return scaleBand(domain, range).paddingInner(categoryGapRatio).paddingOuter(categoryGapRatio / 2);
38
+ return getCachedOrdinalScale(domain, `band:${categoryGapRatio}`, () => scaleBand(domain, range).paddingInner(categoryGapRatio).paddingOuter(categoryGapRatio / 2));
14
39
  }
15
40
  if (isPointScaleConfig(axis)) {
16
- return scalePoint(domain, range);
41
+ return getCachedOrdinalScale(domain, 'point', () => scalePoint(domain, range));
17
42
  }
18
43
  const scaleType = axis.scaleType ?? 'linear';
19
44
  const scale = getScale(scaleType, domain, range);
@@ -14,7 +14,6 @@ var _store = require("@mui/x-internals/store");
14
14
  var _useAssertModelConsistency = require("@mui/x-internals/useAssertModelConsistency");
15
15
  var _warning = require("@mui/x-internals/warning");
16
16
  var _colorPalettes = require("../../../../colorPalettes");
17
- var _useChartDimensions = require("../../corePlugins/useChartDimensions/useChartDimensions.selectors");
18
17
  var _useChartSeries = require("../../corePlugins/useChartSeries/useChartSeries.selectors");
19
18
  var _defaultizeAxis = require("./defaultizeAxis");
20
19
  var _useChartCartesianAxisRendering = require("./useChartCartesianAxisRendering.selectors");
@@ -47,7 +46,6 @@ const useChartCartesianAxis = ({
47
46
  (0, _warning.warnOnce)([`MUI X Charts: The following axis ids are duplicated: ${Array.from(duplicates).join(', ')}.`, `Please make sure that each axis has a unique id.`].join('\n'), 'error');
48
47
  }
49
48
  }
50
- const drawingArea = store.use(_useChartDimensions.selectorChartDrawingArea);
51
49
  const processedSeries = store.use(_useChartSeries.selectorChartSeriesProcessed);
52
50
  const isInteractionEnabled = store.use(_useChartInteraction.selectorChartsInteractionIsInitialized);
53
51
  const {
@@ -96,7 +94,7 @@ const useChartCartesianAxis = ({
96
94
  x: (0, _defaultizeAxis.defaultizeXAxis)(xAxis, dataset, axesGap),
97
95
  y: (0, _defaultizeAxis.defaultizeYAxis)(yAxis, dataset, axesGap)
98
96
  });
99
- }, [drawingArea, xAxis, yAxis, dataset, axesGap, store]);
97
+ }, [xAxis, yAxis, dataset, axesGap, store]);
100
98
  const usedXAxis = xAxisIds[0];
101
99
  const usedYAxis = yAxisIds[0];
102
100
  (0, _store.useStoreEffect)(store, _useChartCartesianInteraction.selectorChartAxisInteraction, (prevAxisInteraction, nextAxisInteraction) => {