@mui/x-charts 8.0.0-beta.2 → 8.0.0-beta.3

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 (345) hide show
  1. package/BarChart/AnimatedBarElement.d.ts +38 -8
  2. package/BarChart/AnimatedBarElement.js +5 -5
  3. package/BarChart/BarChart.js +2 -0
  4. package/BarChart/BarClipPath.d.ts +19 -1
  5. package/BarChart/BarClipPath.js +84 -17
  6. package/BarChart/BarElement.d.ts +9 -20
  7. package/BarChart/BarElement.js +29 -26
  8. package/BarChart/BarLabel/BarLabel.d.ts +27 -854
  9. package/BarChart/BarLabel/BarLabel.js +32 -5
  10. package/BarChart/BarLabel/BarLabel.types.d.ts +2 -0
  11. package/BarChart/BarLabel/BarLabelItem.d.ts +24 -0
  12. package/BarChart/BarLabel/BarLabelItem.js +18 -6
  13. package/BarChart/BarLabel/BarLabelPlot.js +16 -46
  14. package/BarChart/BarLabel/barLabelClasses.d.ts +3 -1
  15. package/BarChart/BarLabel/barLabelClasses.js +4 -3
  16. package/BarChart/BarPlot.js +37 -61
  17. package/BarChart/barElementClasses.d.ts +21 -0
  18. package/BarChart/barElementClasses.js +29 -0
  19. package/BarChart/getRadius.d.ts +1 -1
  20. package/BarChart/index.d.ts +2 -1
  21. package/BarChart/index.js +11 -0
  22. package/BarChart/seriesConfig/index.js +3 -1
  23. package/BarChart/seriesConfig/tooltip.d.ts +2 -1
  24. package/BarChart/seriesConfig/tooltip.js +14 -1
  25. package/BarChart/types.d.ts +2 -2
  26. package/CHANGELOG.md +141 -0
  27. package/ChartContainer/ChartContainer.js +4 -0
  28. package/ChartsLabel/ChartsLabelMark.js +0 -4
  29. package/ChartsLabel/index.d.ts +1 -0
  30. package/ChartsLabel/index.js +7 -0
  31. package/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
  32. package/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
  33. package/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
  34. package/ChartsTooltip/ChartsTooltip.js +2 -2
  35. package/ChartsTooltip/ChartsTooltipContainer.js +3 -8
  36. package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -1
  37. package/ChartsTooltip/ChartsTooltipTable.js +24 -9
  38. package/ChartsTooltip/chartsTooltipClasses.d.ts +4 -4
  39. package/ChartsTooltip/chartsTooltipClasses.js +2 -2
  40. package/ChartsTooltip/index.d.ts +1 -0
  41. package/ChartsTooltip/index.js +12 -0
  42. package/ChartsTooltip/useAxesTooltip.d.ts +7 -0
  43. package/ChartsTooltip/useAxesTooltip.js +18 -0
  44. package/ChartsTooltip/useAxisTooltip.d.ts +24 -3
  45. package/ChartsTooltip/useAxisTooltip.js +71 -37
  46. package/ChartsTooltip/useItemTooltip.js +4 -1
  47. package/ChartsXAxis/ChartsXAxis.js +5 -2
  48. package/ChartsYAxis/ChartsYAxis.js +69 -17
  49. package/LineChart/AnimatedArea.js +5 -22
  50. package/LineChart/AnimatedLine.d.ts +1 -4
  51. package/LineChart/AnimatedLine.js +10 -25
  52. package/LineChart/AppearingMask.d.ts +5 -0
  53. package/LineChart/AppearingMask.js +25 -18
  54. package/LineChart/CircleMarkElement.js +16 -22
  55. package/LineChart/LineChart.js +2 -0
  56. package/LineChart/LineHighlightPlot.js +2 -3
  57. package/LineChart/MarkElement.js +16 -27
  58. package/LineChart/MarkPlot.js +0 -1
  59. package/LineChart/markElementClasses.d.ts +3 -0
  60. package/LineChart/markElementClasses.js +4 -3
  61. package/LineChart/seriesConfig/index.js +3 -1
  62. package/LineChart/seriesConfig/tooltip.d.ts +2 -1
  63. package/LineChart/seriesConfig/tooltip.js +8 -1
  64. package/PieChart/PieArc.d.ts +19 -11
  65. package/PieChart/PieArc.js +37 -24
  66. package/PieChart/PieArcLabel.d.ts +22 -13
  67. package/PieChart/PieArcLabel.js +52 -48
  68. package/PieChart/PieArcLabelPlot.js +16 -34
  69. package/PieChart/PieArcPlot.js +21 -34
  70. package/PieChart/seriesConfig/tooltip.js +3 -0
  71. package/ScatterChart/ScatterChart.js +2 -0
  72. package/SparkLineChart/SparkLineChart.js +2 -0
  73. package/colorPalettes/colorPalettes.js +2 -2
  74. package/constants/index.d.ts +1 -1
  75. package/constants/index.js +1 -1
  76. package/context/AnimationProvider/AnimationProvider.js +4 -6
  77. package/esm/BarChart/AnimatedBarElement.d.ts +38 -8
  78. package/esm/BarChart/AnimatedBarElement.js +5 -5
  79. package/esm/BarChart/BarChart.js +2 -0
  80. package/esm/BarChart/BarClipPath.d.ts +19 -1
  81. package/esm/BarChart/BarClipPath.js +84 -17
  82. package/esm/BarChart/BarElement.d.ts +9 -20
  83. package/esm/BarChart/BarElement.js +28 -23
  84. package/esm/BarChart/BarLabel/BarLabel.d.ts +27 -854
  85. package/esm/BarChart/BarLabel/BarLabel.js +32 -5
  86. package/esm/BarChart/BarLabel/BarLabel.types.d.ts +2 -0
  87. package/esm/BarChart/BarLabel/BarLabelItem.d.ts +24 -0
  88. package/esm/BarChart/BarLabel/BarLabelItem.js +18 -6
  89. package/esm/BarChart/BarLabel/BarLabelPlot.js +16 -46
  90. package/esm/BarChart/BarLabel/barLabelClasses.d.ts +3 -1
  91. package/esm/BarChart/BarLabel/barLabelClasses.js +4 -3
  92. package/esm/BarChart/BarPlot.js +37 -61
  93. package/esm/BarChart/barElementClasses.d.ts +21 -0
  94. package/esm/BarChart/barElementClasses.js +19 -0
  95. package/esm/BarChart/getRadius.d.ts +1 -1
  96. package/esm/BarChart/index.d.ts +2 -1
  97. package/esm/BarChart/index.js +2 -1
  98. package/esm/BarChart/seriesConfig/index.js +2 -1
  99. package/esm/BarChart/seriesConfig/tooltip.d.ts +2 -1
  100. package/esm/BarChart/seriesConfig/tooltip.js +12 -0
  101. package/esm/BarChart/types.d.ts +2 -2
  102. package/esm/ChartContainer/ChartContainer.js +4 -0
  103. package/esm/ChartsLabel/ChartsLabelMark.js +0 -4
  104. package/esm/ChartsLabel/index.d.ts +1 -0
  105. package/esm/ChartsLabel/index.js +1 -0
  106. package/esm/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
  107. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
  108. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
  109. package/esm/ChartsTooltip/ChartsTooltip.js +2 -2
  110. package/esm/ChartsTooltip/ChartsTooltipContainer.js +4 -9
  111. package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +3 -1
  112. package/esm/ChartsTooltip/ChartsTooltipTable.js +23 -9
  113. package/esm/ChartsTooltip/chartsTooltipClasses.d.ts +4 -4
  114. package/esm/ChartsTooltip/chartsTooltipClasses.js +2 -2
  115. package/esm/ChartsTooltip/index.d.ts +1 -0
  116. package/esm/ChartsTooltip/index.js +1 -0
  117. package/esm/ChartsTooltip/useAxesTooltip.d.ts +7 -0
  118. package/esm/ChartsTooltip/useAxesTooltip.js +12 -0
  119. package/esm/ChartsTooltip/useAxisTooltip.d.ts +24 -3
  120. package/esm/ChartsTooltip/useAxisTooltip.js +72 -38
  121. package/esm/ChartsTooltip/useItemTooltip.js +4 -1
  122. package/esm/ChartsXAxis/ChartsXAxis.js +5 -2
  123. package/esm/ChartsYAxis/ChartsYAxis.js +69 -17
  124. package/esm/LineChart/AnimatedArea.js +5 -22
  125. package/esm/LineChart/AnimatedLine.d.ts +1 -4
  126. package/esm/LineChart/AnimatedLine.js +9 -24
  127. package/esm/LineChart/AppearingMask.d.ts +5 -0
  128. package/esm/LineChart/AppearingMask.js +23 -18
  129. package/esm/LineChart/CircleMarkElement.js +19 -25
  130. package/esm/LineChart/LineChart.js +2 -0
  131. package/esm/LineChart/LineHighlightPlot.js +3 -4
  132. package/esm/LineChart/MarkElement.js +17 -28
  133. package/esm/LineChart/MarkPlot.js +0 -1
  134. package/esm/LineChart/markElementClasses.d.ts +3 -0
  135. package/esm/LineChart/markElementClasses.js +4 -3
  136. package/esm/LineChart/seriesConfig/index.js +2 -1
  137. package/esm/LineChart/seriesConfig/tooltip.d.ts +2 -1
  138. package/esm/LineChart/seriesConfig/tooltip.js +6 -0
  139. package/esm/PieChart/PieArc.d.ts +19 -11
  140. package/esm/PieChart/PieArc.js +36 -23
  141. package/esm/PieChart/PieArcLabel.d.ts +22 -13
  142. package/esm/PieChart/PieArcLabel.js +51 -47
  143. package/esm/PieChart/PieArcLabelPlot.js +16 -34
  144. package/esm/PieChart/PieArcPlot.js +21 -34
  145. package/esm/PieChart/seriesConfig/tooltip.js +3 -0
  146. package/esm/ScatterChart/ScatterChart.js +2 -0
  147. package/esm/SparkLineChart/SparkLineChart.js +2 -0
  148. package/esm/colorPalettes/colorPalettes.js +2 -2
  149. package/esm/constants/index.d.ts +1 -1
  150. package/esm/constants/index.js +1 -1
  151. package/esm/context/AnimationProvider/AnimationProvider.js +3 -6
  152. package/esm/hooks/animation/index.d.ts +6 -0
  153. package/esm/hooks/animation/index.js +6 -0
  154. package/esm/hooks/animation/useAnimateArea.d.ts +15 -0
  155. package/esm/hooks/animation/useAnimateArea.js +27 -0
  156. package/esm/hooks/animation/useAnimateBar.d.ts +17 -0
  157. package/esm/hooks/animation/useAnimateBar.js +56 -0
  158. package/esm/hooks/animation/useAnimateBarLabel.d.ts +19 -0
  159. package/esm/hooks/animation/useAnimateBarLabel.js +59 -0
  160. package/esm/hooks/animation/useAnimateLine.d.ts +14 -0
  161. package/esm/hooks/animation/useAnimateLine.js +26 -0
  162. package/esm/hooks/animation/useAnimatePieArc.d.ts +15 -0
  163. package/esm/hooks/animation/useAnimatePieArc.js +70 -0
  164. package/esm/hooks/animation/useAnimatePieArcLabel.d.ts +15 -0
  165. package/esm/hooks/animation/useAnimatePieArcLabel.js +72 -0
  166. package/esm/hooks/index.d.ts +2 -1
  167. package/esm/hooks/index.js +2 -1
  168. package/esm/hooks/useInteractionItemProps.js +11 -0
  169. package/esm/index.js +1 -1
  170. package/esm/internals/animation/Transition.d.ts +37 -0
  171. package/esm/internals/animation/Transition.js +83 -0
  172. package/esm/internals/animation/animation.d.ts +4 -0
  173. package/esm/internals/animation/animation.js +4 -0
  174. package/esm/internals/animation/useAnimate.d.ts +19 -0
  175. package/esm/internals/animation/useAnimate.js +74 -0
  176. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
  177. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +9 -3
  178. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.ts +5 -0
  179. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js +21 -0
  180. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
  181. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -1
  182. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +60 -26
  183. package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +3 -1
  184. package/esm/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +10 -4
  185. package/esm/internals/shallowEqual.d.ts +8 -0
  186. package/esm/internals/shallowEqual.js +31 -0
  187. package/esm/models/axis.d.ts +8 -0
  188. package/esm/themeAugmentation/overrides.d.ts +1 -1
  189. package/hooks/animation/index.d.ts +6 -0
  190. package/hooks/animation/index.js +71 -0
  191. package/hooks/animation/useAnimateArea.d.ts +15 -0
  192. package/hooks/animation/useAnimateArea.js +34 -0
  193. package/hooks/animation/useAnimateBar.d.ts +17 -0
  194. package/hooks/animation/useAnimateBar.js +62 -0
  195. package/hooks/animation/useAnimateBarLabel.d.ts +19 -0
  196. package/hooks/animation/useAnimateBarLabel.js +65 -0
  197. package/hooks/animation/useAnimateLine.d.ts +14 -0
  198. package/hooks/animation/useAnimateLine.js +33 -0
  199. package/hooks/animation/useAnimatePieArc.d.ts +15 -0
  200. package/hooks/animation/useAnimatePieArc.js +77 -0
  201. package/hooks/animation/useAnimatePieArcLabel.d.ts +15 -0
  202. package/hooks/animation/useAnimatePieArcLabel.js +79 -0
  203. package/hooks/index.d.ts +2 -1
  204. package/hooks/index.js +13 -1
  205. package/hooks/useInteractionItemProps.js +11 -0
  206. package/index.js +1 -1
  207. package/internals/animation/Transition.d.ts +37 -0
  208. package/internals/animation/Transition.js +89 -0
  209. package/internals/animation/animation.d.ts +4 -0
  210. package/internals/animation/animation.js +11 -0
  211. package/internals/animation/useAnimate.d.ts +19 -0
  212. package/internals/animation/useAnimate.js +80 -0
  213. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
  214. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +9 -3
  215. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.ts +5 -0
  216. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js +28 -0
  217. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
  218. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -1
  219. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +61 -27
  220. package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +3 -1
  221. package/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +10 -4
  222. package/internals/shallowEqual.d.ts +8 -0
  223. package/internals/shallowEqual.js +37 -0
  224. package/models/axis.d.ts +8 -0
  225. package/modern/BarChart/AnimatedBarElement.d.ts +38 -8
  226. package/modern/BarChart/AnimatedBarElement.js +5 -5
  227. package/modern/BarChart/BarChart.js +2 -0
  228. package/modern/BarChart/BarClipPath.d.ts +19 -1
  229. package/modern/BarChart/BarClipPath.js +84 -17
  230. package/modern/BarChart/BarElement.d.ts +9 -20
  231. package/modern/BarChart/BarElement.js +28 -23
  232. package/modern/BarChart/BarLabel/BarLabel.d.ts +27 -854
  233. package/modern/BarChart/BarLabel/BarLabel.js +32 -5
  234. package/modern/BarChart/BarLabel/BarLabel.types.d.ts +2 -0
  235. package/modern/BarChart/BarLabel/BarLabelItem.d.ts +24 -0
  236. package/modern/BarChart/BarLabel/BarLabelItem.js +18 -6
  237. package/modern/BarChart/BarLabel/BarLabelPlot.js +16 -46
  238. package/modern/BarChart/BarLabel/barLabelClasses.d.ts +3 -1
  239. package/modern/BarChart/BarLabel/barLabelClasses.js +4 -3
  240. package/modern/BarChart/BarPlot.js +37 -61
  241. package/modern/BarChart/barElementClasses.d.ts +21 -0
  242. package/modern/BarChart/barElementClasses.js +19 -0
  243. package/modern/BarChart/getRadius.d.ts +1 -1
  244. package/modern/BarChart/index.d.ts +2 -1
  245. package/modern/BarChart/index.js +2 -1
  246. package/modern/BarChart/seriesConfig/index.js +2 -1
  247. package/modern/BarChart/seriesConfig/tooltip.d.ts +2 -1
  248. package/modern/BarChart/seriesConfig/tooltip.js +12 -0
  249. package/modern/BarChart/types.d.ts +2 -2
  250. package/modern/ChartContainer/ChartContainer.js +4 -0
  251. package/modern/ChartsLabel/ChartsLabelMark.js +0 -4
  252. package/modern/ChartsLabel/index.d.ts +1 -0
  253. package/modern/ChartsLabel/index.js +1 -0
  254. package/modern/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
  255. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
  256. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
  257. package/modern/ChartsTooltip/ChartsTooltip.js +2 -2
  258. package/modern/ChartsTooltip/ChartsTooltipContainer.js +4 -9
  259. package/modern/ChartsTooltip/ChartsTooltipTable.d.ts +3 -1
  260. package/modern/ChartsTooltip/ChartsTooltipTable.js +23 -9
  261. package/modern/ChartsTooltip/chartsTooltipClasses.d.ts +4 -4
  262. package/modern/ChartsTooltip/chartsTooltipClasses.js +2 -2
  263. package/modern/ChartsTooltip/index.d.ts +1 -0
  264. package/modern/ChartsTooltip/index.js +1 -0
  265. package/modern/ChartsTooltip/useAxesTooltip.d.ts +7 -0
  266. package/modern/ChartsTooltip/useAxesTooltip.js +12 -0
  267. package/modern/ChartsTooltip/useAxisTooltip.d.ts +24 -3
  268. package/modern/ChartsTooltip/useAxisTooltip.js +72 -38
  269. package/modern/ChartsTooltip/useItemTooltip.js +4 -1
  270. package/modern/ChartsXAxis/ChartsXAxis.js +5 -2
  271. package/modern/ChartsYAxis/ChartsYAxis.js +69 -17
  272. package/modern/LineChart/AnimatedArea.js +5 -22
  273. package/modern/LineChart/AnimatedLine.d.ts +1 -4
  274. package/modern/LineChart/AnimatedLine.js +9 -24
  275. package/modern/LineChart/AppearingMask.d.ts +5 -0
  276. package/modern/LineChart/AppearingMask.js +23 -18
  277. package/modern/LineChart/CircleMarkElement.js +19 -25
  278. package/modern/LineChart/LineChart.js +2 -0
  279. package/modern/LineChart/LineHighlightPlot.js +3 -4
  280. package/modern/LineChart/MarkElement.js +17 -28
  281. package/modern/LineChart/MarkPlot.js +0 -1
  282. package/modern/LineChart/markElementClasses.d.ts +3 -0
  283. package/modern/LineChart/markElementClasses.js +4 -3
  284. package/modern/LineChart/seriesConfig/index.js +2 -1
  285. package/modern/LineChart/seriesConfig/tooltip.d.ts +2 -1
  286. package/modern/LineChart/seriesConfig/tooltip.js +6 -0
  287. package/modern/PieChart/PieArc.d.ts +19 -11
  288. package/modern/PieChart/PieArc.js +36 -23
  289. package/modern/PieChart/PieArcLabel.d.ts +22 -13
  290. package/modern/PieChart/PieArcLabel.js +51 -47
  291. package/modern/PieChart/PieArcLabelPlot.js +16 -34
  292. package/modern/PieChart/PieArcPlot.js +21 -34
  293. package/modern/PieChart/seriesConfig/tooltip.js +3 -0
  294. package/modern/ScatterChart/ScatterChart.js +2 -0
  295. package/modern/SparkLineChart/SparkLineChart.js +2 -0
  296. package/modern/colorPalettes/colorPalettes.js +2 -2
  297. package/modern/constants/index.d.ts +1 -1
  298. package/modern/constants/index.js +1 -1
  299. package/modern/context/AnimationProvider/AnimationProvider.js +3 -6
  300. package/modern/hooks/animation/index.d.ts +6 -0
  301. package/modern/hooks/animation/index.js +6 -0
  302. package/modern/hooks/animation/useAnimateArea.d.ts +15 -0
  303. package/modern/hooks/animation/useAnimateArea.js +27 -0
  304. package/modern/hooks/animation/useAnimateBar.d.ts +17 -0
  305. package/modern/hooks/animation/useAnimateBar.js +56 -0
  306. package/modern/hooks/animation/useAnimateBarLabel.d.ts +19 -0
  307. package/modern/hooks/animation/useAnimateBarLabel.js +59 -0
  308. package/modern/hooks/animation/useAnimateLine.d.ts +14 -0
  309. package/modern/hooks/animation/useAnimateLine.js +26 -0
  310. package/modern/hooks/animation/useAnimatePieArc.d.ts +15 -0
  311. package/modern/hooks/animation/useAnimatePieArc.js +70 -0
  312. package/modern/hooks/animation/useAnimatePieArcLabel.d.ts +15 -0
  313. package/modern/hooks/animation/useAnimatePieArcLabel.js +72 -0
  314. package/modern/hooks/index.d.ts +2 -1
  315. package/modern/hooks/index.js +2 -1
  316. package/modern/hooks/useInteractionItemProps.js +11 -0
  317. package/modern/index.js +1 -1
  318. package/modern/internals/animation/Transition.d.ts +37 -0
  319. package/modern/internals/animation/Transition.js +83 -0
  320. package/modern/internals/animation/animation.d.ts +4 -0
  321. package/modern/internals/animation/animation.js +4 -0
  322. package/modern/internals/animation/useAnimate.d.ts +19 -0
  323. package/modern/internals/animation/useAnimate.js +74 -0
  324. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
  325. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +9 -3
  326. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.ts +5 -0
  327. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js +21 -0
  328. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
  329. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -1
  330. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +60 -26
  331. package/modern/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +3 -1
  332. package/modern/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +10 -4
  333. package/modern/internals/shallowEqual.d.ts +8 -0
  334. package/modern/internals/shallowEqual.js +31 -0
  335. package/modern/models/axis.d.ts +8 -0
  336. package/modern/themeAugmentation/overrides.d.ts +1 -1
  337. package/package.json +8 -9
  338. package/themeAugmentation/overrides.d.ts +1 -1
  339. package/tsconfig.build.tsbuildinfo +1 -1
  340. package/PieChart/dataTransform/transition.d.ts +0 -4
  341. package/PieChart/dataTransform/transition.js +0 -145
  342. package/esm/PieChart/dataTransform/transition.d.ts +0 -4
  343. package/esm/PieChart/dataTransform/transition.js +0 -137
  344. package/modern/PieChart/dataTransform/transition.d.ts +0 -4
  345. package/modern/PieChart/dataTransform/transition.js +0 -137
@@ -111,7 +111,7 @@ function getVisibleLabels(xTicks, {
111
111
  return true;
112
112
  }));
113
113
  }
114
- function shortenLabels(visibleLabels, drawingArea, maxHeight, tickLabelStyle) {
114
+ function shortenLabels(visibleLabels, drawingArea, maxHeight, isRtl, tickLabelStyle) {
115
115
  const shortenedLabels = new Map();
116
116
  const angle = clampAngle(tickLabelStyle?.angle ?? 0);
117
117
 
@@ -132,6 +132,9 @@ function shortenLabels(visibleLabels, drawingArea, maxHeight, tickLabelStyle) {
132
132
  if (angle > 90 && angle < 270) {
133
133
  [leftBoundFactor, rightBoundFactor] = [rightBoundFactor, leftBoundFactor];
134
134
  }
135
+ if (isRtl) {
136
+ [leftBoundFactor, rightBoundFactor] = [rightBoundFactor, leftBoundFactor];
137
+ }
135
138
  for (const item of visibleLabels) {
136
139
  if (item.formattedValue) {
137
140
  // That maximum width of the tick depends on its proximity to the axis bounds.
@@ -293,7 +296,7 @@ function ChartsXAxis(inProps) {
293
296
 
294
297
  /* If there's an axis title, the tick labels have less space to render */
295
298
  const tickLabelsMaxHeight = Math.max(0, axisHeight - (label ? labelHeight + AXIS_LABEL_TICK_LABEL_GAP : 0) - tickSize - TICK_LABEL_GAP);
296
- const tickLabels = isHydrated ? shortenLabels(visibleLabels, drawingArea, tickLabelsMaxHeight, axisTickLabelProps.style) : new Map(Array.from(visibleLabels).map(item => [item, item.formattedValue]));
299
+ const tickLabels = isHydrated ? shortenLabels(visibleLabels, drawingArea, tickLabelsMaxHeight, isRtl, axisTickLabelProps.style) : new Map(Array.from(visibleLabels).map(item => [item, item.formattedValue]));
297
300
  return /*#__PURE__*/_jsxs(XAxisRoot, {
298
301
  transform: `translate(0, ${position === 'bottom' ? top + height + offset : top - offset})`,
299
302
  className: classes.root,
@@ -9,6 +9,9 @@ import useSlotProps from '@mui/utils/useSlotProps';
9
9
  import composeClasses from '@mui/utils/composeClasses';
10
10
  import { useThemeProps, styled, useTheme } from '@mui/material/styles';
11
11
  import { useRtl } from '@mui/system/RtlProvider';
12
+ import { useIsHydrated } from "../hooks/useIsHydrated.js";
13
+ import { getDefaultBaseline, getDefaultTextAnchor } from "../ChartsText/defaultTextPlacement.js";
14
+ import { doesTextFitInRect, ellipsize } from "../internals/ellipsize.js";
12
15
  import { getStringSize } from "../internals/domUtils.js";
13
16
  import { useTicks } from "../hooks/useTicks.js";
14
17
  import { useDrawingArea } from "../hooks/useDrawingArea.js";
@@ -19,6 +22,8 @@ import { isInfinity } from "../internals/isInfinity.js";
19
22
  import { isBandScale } from "../internals/isBandScale.js";
20
23
  import { useChartContext } from "../context/ChartProvider/index.js";
21
24
  import { useYAxes } from "../hooks/index.js";
25
+ import { clampAngle } from "../internals/clampAngle.js";
26
+ import { invertTextAnchor } from "../internals/invertTextAnchor.js";
22
27
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
28
  const useUtilityClasses = ownerState => {
24
29
  const {
@@ -35,6 +40,47 @@ const useUtilityClasses = ownerState => {
35
40
  };
36
41
  return composeClasses(slots, getAxisUtilityClass, classes);
37
42
  };
43
+
44
+ /* Gap between a tick and its label. */
45
+ const TICK_LABEL_GAP = 2;
46
+ /* Gap between the axis label and tick labels. */
47
+ const AXIS_LABEL_TICK_LABEL_GAP = 2;
48
+ function shortenLabels(visibleLabels, drawingArea, maxWidth, isRtl, tickLabelStyle) {
49
+ const shortenedLabels = new Map();
50
+ const angle = clampAngle(tickLabelStyle?.angle ?? 0);
51
+ let topBoundFactor = 1;
52
+ let bottomBoundFactor = 1;
53
+ if (tickLabelStyle?.textAnchor === 'start') {
54
+ topBoundFactor = Infinity;
55
+ bottomBoundFactor = 1;
56
+ } else if (tickLabelStyle?.textAnchor === 'end') {
57
+ topBoundFactor = 1;
58
+ bottomBoundFactor = Infinity;
59
+ } else {
60
+ topBoundFactor = 2;
61
+ bottomBoundFactor = 2;
62
+ }
63
+ if (angle > 180) {
64
+ [topBoundFactor, bottomBoundFactor] = [bottomBoundFactor, topBoundFactor];
65
+ }
66
+ if (isRtl) {
67
+ [topBoundFactor, bottomBoundFactor] = [bottomBoundFactor, topBoundFactor];
68
+ }
69
+ for (const item of visibleLabels) {
70
+ if (item.formattedValue) {
71
+ // That maximum height of the tick depends on its proximity to the axis bounds.
72
+ const height = Math.min((item.offset + item.labelOffset) * topBoundFactor, (drawingArea.top + drawingArea.height + drawingArea.bottom - item.offset - item.labelOffset) * bottomBoundFactor);
73
+ const doesTextFit = text => doesTextFitInRect(text, {
74
+ width: maxWidth,
75
+ height,
76
+ angle,
77
+ measureText: string => getStringSize(string, tickLabelStyle)
78
+ });
79
+ shortenedLabels.set(item, ellipsize(item.formattedValue.toString(), doesTextFit));
80
+ }
81
+ }
82
+ return shortenedLabels;
83
+ }
38
84
  const YAxisRoot = styled(AxisRoot, {
39
85
  name: 'MuiChartsYAxis',
40
86
  slot: 'Root',
@@ -92,16 +138,18 @@ function ChartsYAxis(inProps) {
92
138
  } = defaultizedProps;
93
139
  const theme = useTheme();
94
140
  const isRtl = useRtl();
141
+ const isHydrated = useIsHydrated();
95
142
  const classes = useUtilityClasses(defaultizedProps);
96
143
  const {
97
144
  instance
98
145
  } = useChartContext();
146
+ const drawingArea = useDrawingArea();
99
147
  const {
100
148
  left,
101
149
  top,
102
150
  width,
103
151
  height
104
- } = useDrawingArea();
152
+ } = drawingArea;
105
153
  const tickSize = disableTicks ? 4 : tickSizeProp;
106
154
  const yTicks = useTicks({
107
155
  scale: yScale,
@@ -117,15 +165,16 @@ function ChartsYAxis(inProps) {
117
165
  const Tick = slots?.axisTick ?? 'line';
118
166
  const TickLabel = slots?.axisTickLabel ?? ChartsText;
119
167
  const Label = slots?.axisLabel ?? ChartsText;
120
- const revertAnchor = !isRtl && position === 'right' || isRtl && position !== 'right';
168
+ const defaultTextAnchor = getDefaultTextAnchor((position === 'right' ? -90 : 90) - (tickLabelStyle?.angle ?? 0));
169
+ const defaultDominantBaseline = getDefaultBaseline((position === 'right' ? -90 : 90) - (tickLabelStyle?.angle ?? 0));
121
170
  const axisTickLabelProps = useSlotProps({
122
171
  elementType: TickLabel,
123
172
  externalSlotProps: slotProps?.axisTickLabel,
124
173
  additionalProps: {
125
174
  style: _extends({}, theme.typography.caption, {
126
175
  fontSize: tickFontSize,
127
- textAnchor: revertAnchor ? 'start' : 'end',
128
- dominantBaseline: 'central'
176
+ textAnchor: isRtl ? invertTextAnchor(defaultTextAnchor) : defaultTextAnchor,
177
+ dominantBaseline: defaultDominantBaseline
129
178
  }, tickLabelStyle)
130
179
  },
131
180
  className: classes.tickLabel,
@@ -140,7 +189,7 @@ function ChartsYAxis(inProps) {
140
189
  fontSize: 14,
141
190
  angle: positionSign * 90,
142
191
  textAnchor: 'middle',
143
- dominantBaseline: 'auto'
192
+ dominantBaseline: 'text-before-edge'
144
193
  }, labelStyle)
145
194
  },
146
195
  ownerState: {}
@@ -163,11 +212,13 @@ function ChartsYAxis(inProps) {
163
212
  if (ordinalAxis && domain.length === 0 || !ordinalAxis && domain.some(isInfinity) || position === 'none') {
164
213
  return null;
165
214
  }
166
- const labelHeight = label ? getStringSize(label, axisLabelProps.style).height : 0;
167
215
  const labelRefPoint = {
168
- x: positionSign * (axisWidth - labelHeight),
216
+ x: positionSign * axisWidth,
169
217
  y: top + height / 2
170
218
  };
219
+ /* If there's an axis title, the tick labels have less space to render */
220
+ const tickLabelsMaxWidth = Math.max(0, axisWidth - (label ? getStringSize(label, axisLabelProps.style).height + AXIS_LABEL_TICK_LABEL_GAP : 0) - tickSize - TICK_LABEL_GAP);
221
+ const tickLabels = isHydrated ? shortenLabels(yTicks, drawingArea, tickLabelsMaxWidth, isRtl, axisTickLabelProps.style) : new Map(Array.from(yTicks).map(item => [item, item.formattedValue]));
171
222
  return /*#__PURE__*/_jsxs(YAxisRoot, {
172
223
  transform: `translate(${position === 'right' ? left + width + offset : left - offset}, 0)`,
173
224
  className: classes.root,
@@ -176,13 +227,13 @@ function ChartsYAxis(inProps) {
176
227
  y1: top,
177
228
  y2: top + height,
178
229
  className: classes.line
179
- }, lineSlotProps)), yTicks.map(({
180
- formattedValue,
181
- offset: tickOffset,
182
- labelOffset,
183
- value
184
- }, index) => {
185
- const xTickLabel = positionSign * (tickSize + 2);
230
+ }, lineSlotProps)), yTicks.map((item, index) => {
231
+ const {
232
+ offset: tickOffset,
233
+ labelOffset,
234
+ value
235
+ } = item;
236
+ const xTickLabel = positionSign * (tickSize + TICK_LABEL_GAP);
186
237
  const yTickLabel = labelOffset;
187
238
  const skipLabel = typeof tickLabelInterval === 'function' && !tickLabelInterval?.(value, index);
188
239
  const showLabel = instance.isPointInside({
@@ -191,6 +242,7 @@ function ChartsYAxis(inProps) {
191
242
  }, {
192
243
  direction: 'y'
193
244
  });
245
+ const tickLabel = tickLabels.get(item);
194
246
  if (!showLabel) {
195
247
  return null;
196
248
  }
@@ -200,13 +252,13 @@ function ChartsYAxis(inProps) {
200
252
  children: [!disableTicks && /*#__PURE__*/_jsx(Tick, _extends({
201
253
  x2: positionSign * tickSize,
202
254
  className: classes.tick
203
- }, slotProps?.axisTick)), formattedValue !== undefined && !skipLabel && /*#__PURE__*/_jsx(TickLabel, _extends({
255
+ }, slotProps?.axisTick)), tickLabel !== undefined && !skipLabel && /*#__PURE__*/_jsx(TickLabel, _extends({
204
256
  x: xTickLabel,
205
257
  y: yTickLabel,
206
- text: formattedValue.toString()
258
+ text: tickLabel
207
259
  }, axisTickLabelProps))]
208
260
  }, index);
209
- }), label && /*#__PURE__*/_jsx("g", {
261
+ }), label && isHydrated && /*#__PURE__*/_jsx("g", {
210
262
  className: classes.label,
211
263
  children: /*#__PURE__*/_jsx(Label, _extends({}, labelRefPoint, axisLabelProps, {
212
264
  text: label
@@ -2,11 +2,10 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["d", "skipAnimation", "ownerState"];
5
+ const _excluded = ["skipAnimation", "ownerState"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
- import { animated, useTransition } from '@react-spring/web';
9
- import { useStringInterpolator } from "../internals/useStringInterpolator.js";
8
+ import { useAnimateArea } from "../hooks/animation/useAnimateArea.js";
10
9
  import { AppearingMask } from "./AppearingMask.js";
11
10
  import { jsx as _jsx } from "react/jsx-runtime";
12
11
  /**
@@ -21,38 +20,22 @@ import { jsx as _jsx } from "react/jsx-runtime";
21
20
  */
22
21
  function AnimatedArea(props) {
23
22
  const {
24
- d,
25
23
  skipAnimation,
26
24
  ownerState
27
25
  } = props,
28
26
  other = _objectWithoutPropertiesLoose(props, _excluded);
29
- const stringInterpolator = useStringInterpolator(d);
30
- const transitionChange = useTransition([stringInterpolator], {
31
- from: skipAnimation ? undefined : {
32
- value: 0
33
- },
34
- to: {
35
- value: 1
36
- },
37
- enter: {
38
- value: 1
39
- },
40
- reset: false,
41
- immediate: skipAnimation
42
- });
27
+ const animatedProps = useAnimateArea(props);
43
28
  return /*#__PURE__*/_jsx(AppearingMask, {
44
29
  skipAnimation: skipAnimation,
45
30
  id: `${ownerState.id}-area-clip`,
46
- children: transitionChange((style, interpolator) => /*#__PURE__*/_jsx(animated.path, _extends({
47
- // @ts-expect-error
48
- d: style.value.to(interpolator),
31
+ children: /*#__PURE__*/_jsx("path", _extends({
49
32
  fill: ownerState.gradientId ? `url(#${ownerState.gradientId})` : ownerState.color,
50
33
  filter:
51
34
  // eslint-disable-next-line no-nested-ternary
52
35
  ownerState.isHighlighted ? 'brightness(140%)' : ownerState.gradientId ? undefined : 'brightness(120%)',
53
36
  opacity: ownerState.isFaded ? 0.3 : 1,
54
37
  stroke: "none"
55
- }, other)))
38
+ }, other, animatedProps))
56
39
  });
57
40
  }
58
41
  process.env.NODE_ENV !== "production" ? AnimatedArea.propTypes = {
@@ -19,8 +19,5 @@ export interface AnimatedLineProps extends React.ComponentPropsWithoutRef<'path'
19
19
  *
20
20
  * - [AnimatedLine API](https://mui.com/x/api/charts/animated-line/)
21
21
  */
22
- declare function AnimatedLine(props: AnimatedLineProps): React.JSX.Element;
23
- declare namespace AnimatedLine {
24
- var propTypes: any;
25
- }
22
+ declare const AnimatedLine: React.ForwardRefExoticComponent<AnimatedLineProps & React.RefAttributes<SVGPathElement>>;
26
23
  export { AnimatedLine };
@@ -2,11 +2,10 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["d", "skipAnimation", "ownerState"];
5
+ const _excluded = ["skipAnimation", "ownerState"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
- import { animated, useTransition } from '@react-spring/web';
9
- import { useStringInterpolator } from "../internals/useStringInterpolator.js";
8
+ import { useAnimateLine } from "../hooks/index.js";
10
9
  import { AppearingMask } from "./AppearingMask.js";
11
10
  import { jsx as _jsx } from "react/jsx-runtime";
12
11
  /**
@@ -19,42 +18,28 @@ import { jsx as _jsx } from "react/jsx-runtime";
19
18
  *
20
19
  * - [AnimatedLine API](https://mui.com/x/api/charts/animated-line/)
21
20
  */
22
- function AnimatedLine(props) {
21
+ const AnimatedLine = /*#__PURE__*/React.forwardRef(function AnimatedLine(props, ref) {
23
22
  const {
24
- d,
25
23
  skipAnimation,
26
24
  ownerState
27
25
  } = props,
28
26
  other = _objectWithoutPropertiesLoose(props, _excluded);
29
- const stringInterpolator = useStringInterpolator(d);
30
- const transitionChange = useTransition([stringInterpolator], {
31
- from: skipAnimation ? undefined : {
32
- value: 0
33
- },
34
- to: {
35
- value: 1
36
- },
37
- enter: {
38
- value: 1
39
- },
40
- reset: false,
41
- immediate: skipAnimation
42
- });
27
+ const animateProps = useAnimateLine(_extends({}, props, {
28
+ ref
29
+ }));
43
30
  return /*#__PURE__*/_jsx(AppearingMask, {
44
31
  skipAnimation: skipAnimation,
45
32
  id: `${ownerState.id}-line-clip`,
46
- children: transitionChange((style, interpolator) => /*#__PURE__*/_jsx(animated.path, _extends({
47
- // @ts-expect-error
48
- d: style.value.to(interpolator),
33
+ children: /*#__PURE__*/_jsx("path", _extends({
49
34
  stroke: ownerState.gradientId ? `url(#${ownerState.gradientId})` : ownerState.color,
50
35
  strokeWidth: 2,
51
36
  strokeLinejoin: "round",
52
37
  fill: "none",
53
38
  filter: ownerState.isHighlighted ? 'brightness(120%)' : undefined,
54
39
  opacity: ownerState.isFaded ? 0.3 : 1
55
- }, other)))
40
+ }, other, animateProps))
56
41
  });
57
- }
42
+ });
58
43
  process.env.NODE_ENV !== "production" ? AnimatedLine.propTypes = {
59
44
  // ----------------------------- Warning --------------------------------
60
45
  // | These PropTypes are generated from the TypeScript type definitions |
@@ -5,6 +5,11 @@ interface AppearingMaskProps {
5
5
  skipAnimation?: boolean;
6
6
  children: React.ReactNode;
7
7
  }
8
+ export interface AppearingMaskClasses {
9
+ /** Styles applied if the element should be animated. */
10
+ animate: string;
11
+ }
12
+ export declare const appearingMaskClasses: AppearingMaskClasses;
8
13
  /**
9
14
  * @ignore - internal component.
10
15
  */
@@ -1,40 +1,45 @@
1
1
  'use client';
2
2
 
3
3
  import * as React from 'react';
4
- import { animated, useTransition } from '@react-spring/web';
4
+ import { styled } from '@mui/material/styles';
5
+ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
6
+ import clsx from 'clsx';
7
+ import { ANIMATION_DURATION_MS, ANIMATION_TIMING_FUNCTION } from "../internals/animation/animation.js";
5
8
  import { cleanId } from "../internals/cleanId.js";
6
9
  import { useChartId, useDrawingArea } from "../hooks/index.js";
7
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ export const appearingMaskClasses = generateUtilityClasses('MuiAppearingMask', ['animate']);
12
+ const AnimatedRect = styled('rect')({
13
+ animationName: 'animate-width',
14
+ animationTimingFunction: ANIMATION_TIMING_FUNCTION,
15
+ animationDuration: '0s',
16
+ [`&.${appearingMaskClasses.animate}`]: {
17
+ animationDuration: `${ANIMATION_DURATION_MS}ms`
18
+ },
19
+ '@keyframes animate-width': {
20
+ from: {
21
+ width: 0
22
+ }
23
+ }
24
+ });
25
+
8
26
  /**
9
27
  * @ignore - internal component.
10
28
  */
11
29
  export function AppearingMask(props) {
12
30
  const drawingArea = useDrawingArea();
13
31
  const chartId = useChartId();
14
- const transitionAppear = useTransition([drawingArea], {
15
- from: props.skipAnimation ? undefined : v => ({
16
- animatedWidth: v.left
17
- }),
18
- enter: v => ({
19
- animatedWidth: v.width + v.left + v.right
20
- }),
21
- leave: v => ({
22
- animatedWidth: v.width + v.left + v.right
23
- }),
24
- reset: false,
25
- immediate: props.skipAnimation
26
- });
27
32
  const clipId = cleanId(`${chartId}-${props.id}`);
28
33
  return /*#__PURE__*/_jsxs(React.Fragment, {
29
34
  children: [/*#__PURE__*/_jsx("clipPath", {
30
35
  id: clipId,
31
- children: transitionAppear(style => /*#__PURE__*/_jsx(animated.rect, {
32
- // @ts-expect-error
36
+ children: /*#__PURE__*/_jsx(AnimatedRect, {
37
+ className: clsx(!props.skipAnimation && appearingMaskClasses.animate),
33
38
  x: 0,
34
39
  y: 0,
35
- width: style.animatedWidth,
40
+ width: drawingArea.left + drawingArea.width + drawingArea.right,
36
41
  height: drawingArea.top + drawingArea.height + drawingArea.bottom
37
- }))
42
+ })
38
43
  }), /*#__PURE__*/_jsx("g", {
39
44
  clipPath: `url(#${clipId})`,
40
45
  children: props.children
@@ -5,15 +5,23 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
5
5
  const _excluded = ["x", "y", "id", "classes", "color", "dataIndex", "onClick", "skipAnimation"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
- import { useTheme } from '@mui/material/styles';
9
- import { animated, useSpringValue } from '@react-spring/web';
8
+ import { styled, useTheme } from '@mui/material/styles';
9
+ import { ANIMATION_DURATION_MS, ANIMATION_TIMING_FUNCTION } from "../internals/animation/animation.js";
10
10
  import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
11
11
  import { useItemHighlighted } from "../hooks/useItemHighlighted.js";
12
- import { useUtilityClasses } from "./markElementClasses.js";
12
+ import { markElementClasses, useUtilityClasses } from "./markElementClasses.js";
13
13
  import { useSelector } from "../internals/store/useSelector.js";
14
- import { selectorChartsInteractionXAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
14
+ import { selectorChartsInteractionXAxisIndex } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
15
15
  import { useStore } from "../internals/store/useStore.js";
16
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
+ const Circle = styled('circle')({
18
+ [`&.${markElementClasses.animate}`]: {
19
+ transitionDuration: `${ANIMATION_DURATION_MS}ms`,
20
+ transitionProperty: 'cx, cy',
21
+ transitionTimingFunction: ANIMATION_TIMING_FUNCTION
22
+ }
23
+ });
24
+
17
25
  /**
18
26
  * The line mark element that only render circle for performance improvement.
19
27
  *
@@ -51,33 +59,19 @@ function CircleMarkElement(props) {
51
59
  seriesId: id
52
60
  });
53
61
  const store = useStore();
54
- const xAxisIdentifier = useSelector(store, selectorChartsInteractionXAxis);
55
- const cx = useSpringValue(x, {
56
- immediate: skipAnimation
57
- });
58
- const cy = useSpringValue(y, {
59
- immediate: skipAnimation
60
- });
61
- React.useEffect(() => {
62
- cy.start(y, {
63
- immediate: skipAnimation
64
- });
65
- cx.start(x, {
66
- immediate: skipAnimation
67
- });
68
- }, [cy, y, cx, x, skipAnimation]);
62
+ const xAxisInteractionIndex = useSelector(store, selectorChartsInteractionXAxisIndex);
69
63
  const ownerState = {
70
64
  id,
71
65
  classes: innerClasses,
72
- isHighlighted: xAxisIdentifier?.index === dataIndex || isHighlighted,
66
+ isHighlighted: xAxisInteractionIndex === dataIndex || isHighlighted,
73
67
  isFaded,
74
- color
68
+ color,
69
+ skipAnimation
75
70
  };
76
71
  const classes = useUtilityClasses(ownerState);
77
- return /*#__PURE__*/_jsx(animated.circle, _extends({}, other, {
78
- // @ts-expect-error
79
- cx: cx,
80
- cy: cy,
72
+ return /*#__PURE__*/_jsx(Circle, _extends({}, other, {
73
+ cx: x,
74
+ cy: y,
81
75
  r: 5,
82
76
  fill: (theme.vars || theme).palette.background.paper,
83
77
  stroke: color,
@@ -238,6 +238,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
238
238
  height: PropTypes.number,
239
239
  hideTooltip: PropTypes.bool,
240
240
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
241
+ ignoreTooltip: PropTypes.bool,
241
242
  label: PropTypes.string,
242
243
  labelStyle: PropTypes.object,
243
244
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
@@ -293,6 +294,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
293
294
  fill: PropTypes.string,
294
295
  hideTooltip: PropTypes.bool,
295
296
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
297
+ ignoreTooltip: PropTypes.bool,
296
298
  label: PropTypes.string,
297
299
  labelStyle: PropTypes.object,
298
300
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
@@ -13,7 +13,7 @@ import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
13
13
  import { useLineSeriesContext } from "../hooks/useLineSeries.js";
14
14
  import getColor from "./seriesConfig/getColor.js";
15
15
  import { useChartContext } from "../context/ChartProvider/index.js";
16
- import { selectorChartsInteractionXAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
16
+ import { selectorChartsInteractionXAxisIndex } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
17
17
  import { useXAxes, useYAxes } from "../hooks/useAxis.js";
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
19
  /**
@@ -45,9 +45,8 @@ function LineHighlightPlot(props) {
45
45
  instance
46
46
  } = useChartContext();
47
47
  const store = useStore();
48
- const xAxisIdentifier = useSelector(store, selectorChartsInteractionXAxis);
49
- const highlightedIndex = xAxisIdentifier?.index;
50
- if (highlightedIndex === undefined) {
48
+ const highlightedIndex = useSelector(store, selectorChartsInteractionXAxisIndex);
49
+ if (highlightedIndex === null) {
51
50
  return null;
52
51
  }
53
52
  if (seriesData === undefined) {
@@ -7,16 +7,16 @@ import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
8
  import { styled } from '@mui/material/styles';
9
9
  import { symbol as d3Symbol, symbolsFill as d3SymbolsFill } from '@mui/x-charts-vendor/d3-shape';
10
- import { animated, to, useSpringValue } from '@react-spring/web';
10
+ import { ANIMATION_DURATION_MS, ANIMATION_TIMING_FUNCTION } from "../internals/animation/animation.js";
11
11
  import { getSymbol } from "../internals/getSymbol.js";
12
12
  import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
13
13
  import { useItemHighlighted } from "../hooks/useItemHighlighted.js";
14
- import { useUtilityClasses } from "./markElementClasses.js";
15
- import { selectorChartsInteractionXAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
14
+ import { selectorChartsInteractionXAxisIndex } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
15
+ import { markElementClasses, useUtilityClasses } from "./markElementClasses.js";
16
16
  import { useSelector } from "../internals/store/useSelector.js";
17
17
  import { useStore } from "../internals/store/useStore.js";
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
- const MarkElementPath = styled(animated.path, {
19
+ const MarkElementPath = styled('path', {
20
20
  name: 'MuiMarkElement',
21
21
  slot: 'Root',
22
22
  overridesResolver: (_, styles) => styles.root
@@ -26,7 +26,12 @@ const MarkElementPath = styled(animated.path, {
26
26
  }) => ({
27
27
  fill: (theme.vars || theme).palette.background.paper,
28
28
  stroke: ownerState.color,
29
- strokeWidth: 2
29
+ strokeWidth: 2,
30
+ [`&.${markElementClasses.animate}`]: {
31
+ transitionDuration: `${ANIMATION_DURATION_MS}ms`,
32
+ transitionProperty: 'transform, transform-origin',
33
+ transitionTimingFunction: ANIMATION_TIMING_FUNCTION
34
+ }
30
35
  }));
31
36
  /**
32
37
  * Demos:
@@ -63,37 +68,22 @@ function MarkElement(props) {
63
68
  seriesId: id
64
69
  });
65
70
  const store = useStore();
66
- const xAxisIdentifier = useSelector(store, selectorChartsInteractionXAxis);
67
- const cx = useSpringValue(x, {
68
- immediate: skipAnimation
69
- });
70
- const cy = useSpringValue(y, {
71
- immediate: skipAnimation
72
- });
73
- React.useEffect(() => {
74
- cy.start(y, {
75
- immediate: skipAnimation
76
- });
77
- cx.start(x, {
78
- immediate: skipAnimation
79
- });
80
- }, [cy, y, cx, x, skipAnimation]);
71
+ const xAxisInteractionIndex = useSelector(store, selectorChartsInteractionXAxisIndex);
81
72
  const ownerState = {
82
73
  id,
83
74
  classes: innerClasses,
84
- isHighlighted: xAxisIdentifier?.index === dataIndex || isHighlighted,
75
+ isHighlighted: xAxisInteractionIndex === dataIndex || isHighlighted,
85
76
  isFaded,
86
- color
77
+ color,
78
+ skipAnimation
87
79
  };
88
80
  const classes = useUtilityClasses(ownerState);
89
81
  return /*#__PURE__*/_jsx(MarkElementPath, _extends({}, other, {
90
82
  style: {
91
- transform: to([cx, cy], (pX, pY) => `translate(${pX}px, ${pY}px)`),
92
- transformOrigin: to([cx, cy], (pX, pY) => `${pX}px ${pY}px`)
83
+ transform: `translate(${x}px, ${y}px)`,
84
+ transformOrigin: `${x}px ${y}px`
93
85
  },
94
- ownerState: ownerState
95
- // @ts-expect-error
96
- ,
86
+ ownerState: ownerState,
97
87
  className: classes.root,
98
88
  d: d3Symbol(d3SymbolsFill[getSymbol(shape)])(),
99
89
  onClick: onClick,
@@ -117,7 +107,6 @@ process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
117
107
  shape: PropTypes.oneOf(['circle', 'cross', 'diamond', 'square', 'star', 'triangle', 'wye']).isRequired,
118
108
  /**
119
109
  * If `true`, animations are skipped.
120
- * @default false
121
110
  */
122
111
  skipAnimation: PropTypes.bool
123
112
  } : void 0;
@@ -164,7 +164,6 @@ process.env.NODE_ENV !== "production" ? MarkPlot.propTypes = {
164
164
  onItemClick: PropTypes.func,
165
165
  /**
166
166
  * If `true`, animations are skipped.
167
- * @default false
168
167
  */
169
168
  skipAnimation: PropTypes.bool,
170
169
  /**
@@ -6,6 +6,8 @@ export interface MarkElementClasses {
6
6
  highlighted: string;
7
7
  /** Styles applied to the root element when faded. */
8
8
  faded: string;
9
+ /** Styles applied to the root element when animation is not skipped. */
10
+ animate: string;
9
11
  }
10
12
  export type MarkElementClassKey = keyof MarkElementClasses;
11
13
  export interface MarkElementOwnerState {
@@ -14,6 +16,7 @@ export interface MarkElementOwnerState {
14
16
  isFaded: boolean;
15
17
  isHighlighted: boolean;
16
18
  classes?: Partial<MarkElementClasses>;
19
+ skipAnimation?: boolean;
17
20
  }
18
21
  export declare function getMarkElementUtilityClass(slot: string): string;
19
22
  export declare const markElementClasses: MarkElementClasses;
@@ -4,16 +4,17 @@ import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
4
4
  export function getMarkElementUtilityClass(slot) {
5
5
  return generateUtilityClass('MuiMarkElement', slot);
6
6
  }
7
- export const markElementClasses = generateUtilityClasses('MuiMarkElement', ['root', 'highlighted', 'faded']);
7
+ export const markElementClasses = generateUtilityClasses('MuiMarkElement', ['root', 'highlighted', 'faded', 'animate']);
8
8
  export const useUtilityClasses = ownerState => {
9
9
  const {
10
10
  classes,
11
11
  id,
12
12
  isFaded,
13
- isHighlighted
13
+ isHighlighted,
14
+ skipAnimation
14
15
  } = ownerState;
15
16
  const slots = {
16
- root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
17
+ root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded', skipAnimation ? undefined : 'animate']
17
18
  };
18
19
  return composeClasses(slots, getMarkElementUtilityClass, classes);
19
20
  };