@mui/x-charts 8.0.0-beta.1 → 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 (450) 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/BarChart/useBarChartProps.d.ts +2 -1
  27. package/BarChart/useBarChartProps.js +20 -13
  28. package/CHANGELOG.md +235 -0
  29. package/ChartContainer/ChartContainer.js +4 -0
  30. package/ChartsAxisHighlight/ChartsXAxisHighlight.js +8 -8
  31. package/ChartsAxisHighlight/ChartsYAxisHighlight.js +8 -8
  32. package/ChartsLabel/ChartsLabelMark.js +0 -4
  33. package/ChartsLabel/index.d.ts +1 -0
  34. package/ChartsLabel/index.js +7 -0
  35. package/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
  36. package/ChartsOverlay/ChartsLoadingOverlay.js +1 -1
  37. package/ChartsOverlay/ChartsNoDataOverlay.js +1 -1
  38. package/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
  39. package/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
  40. package/ChartsTooltip/ChartsTooltip.js +2 -2
  41. package/ChartsTooltip/ChartsTooltipContainer.js +4 -8
  42. package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -1
  43. package/ChartsTooltip/ChartsTooltipTable.js +24 -9
  44. package/ChartsTooltip/chartsTooltipClasses.d.ts +4 -4
  45. package/ChartsTooltip/chartsTooltipClasses.js +2 -2
  46. package/ChartsTooltip/index.d.ts +1 -0
  47. package/ChartsTooltip/index.js +12 -0
  48. package/ChartsTooltip/useAxesTooltip.d.ts +7 -0
  49. package/ChartsTooltip/useAxesTooltip.js +18 -0
  50. package/ChartsTooltip/useAxisTooltip.d.ts +24 -3
  51. package/ChartsTooltip/useAxisTooltip.js +72 -38
  52. package/ChartsTooltip/useItemTooltip.js +4 -1
  53. package/ChartsXAxis/ChartsXAxis.js +5 -2
  54. package/ChartsYAxis/ChartsYAxis.js +69 -17
  55. package/LineChart/AnimatedArea.js +5 -22
  56. package/LineChart/AnimatedLine.d.ts +1 -4
  57. package/LineChart/AnimatedLine.js +10 -25
  58. package/LineChart/AppearingMask.d.ts +5 -0
  59. package/LineChart/AppearingMask.js +25 -18
  60. package/LineChart/CircleMarkElement.js +17 -23
  61. package/LineChart/LineChart.js +2 -0
  62. package/LineChart/LineHighlightPlot.js +3 -4
  63. package/LineChart/MarkElement.js +16 -27
  64. package/LineChart/MarkPlot.js +0 -1
  65. package/LineChart/markElementClasses.d.ts +3 -0
  66. package/LineChart/markElementClasses.js +4 -3
  67. package/LineChart/seriesConfig/index.js +3 -1
  68. package/LineChart/seriesConfig/tooltip.d.ts +2 -1
  69. package/LineChart/seriesConfig/tooltip.js +8 -1
  70. package/LineChart/useLineChartProps.d.ts +2 -1
  71. package/LineChart/useLineChartProps.js +7 -4
  72. package/PieChart/PieArc.d.ts +19 -11
  73. package/PieChart/PieArc.js +37 -24
  74. package/PieChart/PieArcLabel.d.ts +22 -13
  75. package/PieChart/PieArcLabel.js +52 -48
  76. package/PieChart/PieArcLabelPlot.js +16 -34
  77. package/PieChart/PieArcPlot.js +21 -34
  78. package/PieChart/seriesConfig/tooltip.js +3 -0
  79. package/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +9 -5
  80. package/RadarChart/RadarGrid/RadarGrid.d.ts +1 -1
  81. package/RadarChart/RadarGrid/RadarGrid.js +5 -1
  82. package/RadarChart/RadarGrid/useRadarGridData.d.ts +1 -1
  83. package/RadarChart/RadarGrid/useRadarGridData.js +3 -0
  84. package/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +2 -2
  85. package/ScatterChart/ScatterChart.js +2 -0
  86. package/ScatterChart/useScatterChartProps.d.ts +2 -1
  87. package/ScatterChart/useScatterChartProps.js +6 -3
  88. package/SparkLineChart/SparkLineChart.js +2 -0
  89. package/colorPalettes/colorPalettes.js +2 -2
  90. package/constants/index.d.ts +1 -1
  91. package/constants/index.js +1 -1
  92. package/context/AnimationProvider/AnimationProvider.js +4 -6
  93. package/esm/BarChart/AnimatedBarElement.d.ts +38 -8
  94. package/esm/BarChart/AnimatedBarElement.js +5 -5
  95. package/esm/BarChart/BarChart.js +2 -0
  96. package/esm/BarChart/BarClipPath.d.ts +19 -1
  97. package/esm/BarChart/BarClipPath.js +84 -17
  98. package/esm/BarChart/BarElement.d.ts +9 -20
  99. package/esm/BarChart/BarElement.js +28 -23
  100. package/esm/BarChart/BarLabel/BarLabel.d.ts +27 -854
  101. package/esm/BarChart/BarLabel/BarLabel.js +32 -5
  102. package/esm/BarChart/BarLabel/BarLabel.types.d.ts +2 -0
  103. package/esm/BarChart/BarLabel/BarLabelItem.d.ts +24 -0
  104. package/esm/BarChart/BarLabel/BarLabelItem.js +18 -6
  105. package/esm/BarChart/BarLabel/BarLabelPlot.js +16 -46
  106. package/esm/BarChart/BarLabel/barLabelClasses.d.ts +3 -1
  107. package/esm/BarChart/BarLabel/barLabelClasses.js +4 -3
  108. package/esm/BarChart/BarPlot.js +37 -61
  109. package/esm/BarChart/barElementClasses.d.ts +21 -0
  110. package/esm/BarChart/barElementClasses.js +19 -0
  111. package/esm/BarChart/getRadius.d.ts +1 -1
  112. package/esm/BarChart/index.d.ts +2 -1
  113. package/esm/BarChart/index.js +2 -1
  114. package/esm/BarChart/seriesConfig/index.js +2 -1
  115. package/esm/BarChart/seriesConfig/tooltip.d.ts +2 -1
  116. package/esm/BarChart/seriesConfig/tooltip.js +12 -0
  117. package/esm/BarChart/types.d.ts +2 -2
  118. package/esm/BarChart/useBarChartProps.d.ts +2 -1
  119. package/esm/BarChart/useBarChartProps.js +19 -13
  120. package/esm/ChartContainer/ChartContainer.js +4 -0
  121. package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +8 -8
  122. package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +8 -8
  123. package/esm/ChartsLabel/ChartsLabelMark.js +0 -4
  124. package/esm/ChartsLabel/index.d.ts +1 -0
  125. package/esm/ChartsLabel/index.js +1 -0
  126. package/esm/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
  127. package/esm/ChartsOverlay/ChartsLoadingOverlay.js +1 -1
  128. package/esm/ChartsOverlay/ChartsNoDataOverlay.js +1 -1
  129. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
  130. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
  131. package/esm/ChartsTooltip/ChartsTooltip.js +2 -2
  132. package/esm/ChartsTooltip/ChartsTooltipContainer.js +5 -9
  133. package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +3 -1
  134. package/esm/ChartsTooltip/ChartsTooltipTable.js +23 -9
  135. package/esm/ChartsTooltip/chartsTooltipClasses.d.ts +4 -4
  136. package/esm/ChartsTooltip/chartsTooltipClasses.js +2 -2
  137. package/esm/ChartsTooltip/index.d.ts +1 -0
  138. package/esm/ChartsTooltip/index.js +1 -0
  139. package/esm/ChartsTooltip/useAxesTooltip.d.ts +7 -0
  140. package/esm/ChartsTooltip/useAxesTooltip.js +12 -0
  141. package/esm/ChartsTooltip/useAxisTooltip.d.ts +24 -3
  142. package/esm/ChartsTooltip/useAxisTooltip.js +72 -38
  143. package/esm/ChartsTooltip/useItemTooltip.js +4 -1
  144. package/esm/ChartsXAxis/ChartsXAxis.js +5 -2
  145. package/esm/ChartsYAxis/ChartsYAxis.js +69 -17
  146. package/esm/LineChart/AnimatedArea.js +5 -22
  147. package/esm/LineChart/AnimatedLine.d.ts +1 -4
  148. package/esm/LineChart/AnimatedLine.js +9 -24
  149. package/esm/LineChart/AppearingMask.d.ts +5 -0
  150. package/esm/LineChart/AppearingMask.js +23 -18
  151. package/esm/LineChart/CircleMarkElement.js +19 -25
  152. package/esm/LineChart/LineChart.js +2 -0
  153. package/esm/LineChart/LineHighlightPlot.js +3 -4
  154. package/esm/LineChart/MarkElement.js +17 -28
  155. package/esm/LineChart/MarkPlot.js +0 -1
  156. package/esm/LineChart/markElementClasses.d.ts +3 -0
  157. package/esm/LineChart/markElementClasses.js +4 -3
  158. package/esm/LineChart/seriesConfig/index.js +2 -1
  159. package/esm/LineChart/seriesConfig/tooltip.d.ts +2 -1
  160. package/esm/LineChart/seriesConfig/tooltip.js +6 -0
  161. package/esm/LineChart/useLineChartProps.d.ts +2 -1
  162. package/esm/LineChart/useLineChartProps.js +6 -4
  163. package/esm/PieChart/PieArc.d.ts +19 -11
  164. package/esm/PieChart/PieArc.js +36 -23
  165. package/esm/PieChart/PieArcLabel.d.ts +22 -13
  166. package/esm/PieChart/PieArcLabel.js +51 -47
  167. package/esm/PieChart/PieArcLabelPlot.js +16 -34
  168. package/esm/PieChart/PieArcPlot.js +21 -34
  169. package/esm/PieChart/seriesConfig/tooltip.js +3 -0
  170. package/esm/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +9 -5
  171. package/esm/RadarChart/RadarGrid/RadarGrid.d.ts +1 -1
  172. package/esm/RadarChart/RadarGrid/RadarGrid.js +5 -1
  173. package/esm/RadarChart/RadarGrid/useRadarGridData.d.ts +1 -1
  174. package/esm/RadarChart/RadarGrid/useRadarGridData.js +3 -0
  175. package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +2 -2
  176. package/esm/ScatterChart/ScatterChart.js +2 -0
  177. package/esm/ScatterChart/useScatterChartProps.d.ts +2 -1
  178. package/esm/ScatterChart/useScatterChartProps.js +5 -3
  179. package/esm/SparkLineChart/SparkLineChart.js +2 -0
  180. package/esm/colorPalettes/colorPalettes.js +2 -2
  181. package/esm/constants/index.d.ts +1 -1
  182. package/esm/constants/index.js +1 -1
  183. package/esm/context/AnimationProvider/AnimationProvider.js +3 -6
  184. package/esm/hooks/animation/index.d.ts +6 -0
  185. package/esm/hooks/animation/index.js +6 -0
  186. package/esm/hooks/animation/useAnimateArea.d.ts +15 -0
  187. package/esm/hooks/animation/useAnimateArea.js +27 -0
  188. package/esm/hooks/animation/useAnimateBar.d.ts +17 -0
  189. package/esm/hooks/animation/useAnimateBar.js +56 -0
  190. package/esm/hooks/animation/useAnimateBarLabel.d.ts +19 -0
  191. package/esm/hooks/animation/useAnimateBarLabel.js +59 -0
  192. package/esm/hooks/animation/useAnimateLine.d.ts +14 -0
  193. package/esm/hooks/animation/useAnimateLine.js +26 -0
  194. package/esm/hooks/animation/useAnimatePieArc.d.ts +15 -0
  195. package/esm/hooks/animation/useAnimatePieArc.js +70 -0
  196. package/esm/hooks/animation/useAnimatePieArcLabel.d.ts +15 -0
  197. package/esm/hooks/animation/useAnimatePieArcLabel.js +72 -0
  198. package/esm/hooks/index.d.ts +2 -1
  199. package/esm/hooks/index.js +2 -1
  200. package/esm/hooks/useAxis.d.ts +5 -5
  201. package/esm/hooks/useInteractionItemProps.js +11 -0
  202. package/esm/hooks/useScale.d.ts +2 -2
  203. package/esm/hooks/useScale.js +2 -2
  204. package/esm/index.js +1 -1
  205. package/esm/internals/animation/Transition.d.ts +37 -0
  206. package/esm/internals/animation/Transition.js +83 -0
  207. package/esm/internals/animation/animation.d.ts +4 -0
  208. package/esm/internals/animation/animation.js +4 -0
  209. package/esm/internals/animation/useAnimate.d.ts +19 -0
  210. package/esm/internals/animation/useAnimate.js +74 -0
  211. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
  212. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +9 -3
  213. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.ts +5 -0
  214. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js +21 -0
  215. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.d.ts +8 -6
  216. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +28 -22
  217. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
  218. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -0
  219. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +9 -42
  220. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
  221. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -0
  222. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +75 -0
  223. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +7 -20
  224. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +36 -242
  225. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +4 -10
  226. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +9 -15
  227. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.ts +12 -0
  228. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js +8 -0
  229. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.d.ts +6 -4
  230. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.js +18 -13
  231. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +16 -32
  232. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +3669 -0
  233. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +22 -0
  234. package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +3 -1
  235. package/esm/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +10 -4
  236. package/esm/internals/shallowEqual.d.ts +8 -0
  237. package/esm/internals/shallowEqual.js +31 -0
  238. package/esm/models/axis.d.ts +8 -0
  239. package/esm/themeAugmentation/overrides.d.ts +1 -1
  240. package/hooks/animation/index.d.ts +6 -0
  241. package/hooks/animation/index.js +71 -0
  242. package/hooks/animation/useAnimateArea.d.ts +15 -0
  243. package/hooks/animation/useAnimateArea.js +34 -0
  244. package/hooks/animation/useAnimateBar.d.ts +17 -0
  245. package/hooks/animation/useAnimateBar.js +62 -0
  246. package/hooks/animation/useAnimateBarLabel.d.ts +19 -0
  247. package/hooks/animation/useAnimateBarLabel.js +65 -0
  248. package/hooks/animation/useAnimateLine.d.ts +14 -0
  249. package/hooks/animation/useAnimateLine.js +33 -0
  250. package/hooks/animation/useAnimatePieArc.d.ts +15 -0
  251. package/hooks/animation/useAnimatePieArc.js +77 -0
  252. package/hooks/animation/useAnimatePieArcLabel.d.ts +15 -0
  253. package/hooks/animation/useAnimatePieArcLabel.js +79 -0
  254. package/hooks/index.d.ts +2 -1
  255. package/hooks/index.js +13 -1
  256. package/hooks/useAxis.d.ts +5 -5
  257. package/hooks/useInteractionItemProps.js +11 -0
  258. package/hooks/useScale.d.ts +2 -2
  259. package/hooks/useScale.js +2 -2
  260. package/index.js +1 -1
  261. package/internals/animation/Transition.d.ts +37 -0
  262. package/internals/animation/Transition.js +89 -0
  263. package/internals/animation/animation.d.ts +4 -0
  264. package/internals/animation/animation.js +11 -0
  265. package/internals/animation/useAnimate.d.ts +19 -0
  266. package/internals/animation/useAnimate.js +80 -0
  267. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
  268. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +9 -3
  269. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.ts +5 -0
  270. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js +28 -0
  271. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.d.ts +8 -6
  272. package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +29 -22
  273. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
  274. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +12 -0
  275. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +7 -40
  276. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
  277. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -0
  278. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +81 -0
  279. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +7 -20
  280. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +36 -242
  281. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +5 -11
  282. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +9 -15
  283. package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.ts +12 -0
  284. package/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js +17 -0
  285. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.d.ts +6 -4
  286. package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.js +19 -13
  287. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +16 -32
  288. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +3669 -0
  289. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +28 -0
  290. package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +3 -1
  291. package/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +10 -4
  292. package/internals/shallowEqual.d.ts +8 -0
  293. package/internals/shallowEqual.js +37 -0
  294. package/models/axis.d.ts +8 -0
  295. package/modern/BarChart/AnimatedBarElement.d.ts +38 -8
  296. package/modern/BarChart/AnimatedBarElement.js +5 -5
  297. package/modern/BarChart/BarChart.js +2 -0
  298. package/modern/BarChart/BarClipPath.d.ts +19 -1
  299. package/modern/BarChart/BarClipPath.js +84 -17
  300. package/modern/BarChart/BarElement.d.ts +9 -20
  301. package/modern/BarChart/BarElement.js +28 -23
  302. package/modern/BarChart/BarLabel/BarLabel.d.ts +27 -854
  303. package/modern/BarChart/BarLabel/BarLabel.js +32 -5
  304. package/modern/BarChart/BarLabel/BarLabel.types.d.ts +2 -0
  305. package/modern/BarChart/BarLabel/BarLabelItem.d.ts +24 -0
  306. package/modern/BarChart/BarLabel/BarLabelItem.js +18 -6
  307. package/modern/BarChart/BarLabel/BarLabelPlot.js +16 -46
  308. package/modern/BarChart/BarLabel/barLabelClasses.d.ts +3 -1
  309. package/modern/BarChart/BarLabel/barLabelClasses.js +4 -3
  310. package/modern/BarChart/BarPlot.js +37 -61
  311. package/modern/BarChart/barElementClasses.d.ts +21 -0
  312. package/modern/BarChart/barElementClasses.js +19 -0
  313. package/modern/BarChart/getRadius.d.ts +1 -1
  314. package/modern/BarChart/index.d.ts +2 -1
  315. package/modern/BarChart/index.js +2 -1
  316. package/modern/BarChart/seriesConfig/index.js +2 -1
  317. package/modern/BarChart/seriesConfig/tooltip.d.ts +2 -1
  318. package/modern/BarChart/seriesConfig/tooltip.js +12 -0
  319. package/modern/BarChart/types.d.ts +2 -2
  320. package/modern/BarChart/useBarChartProps.d.ts +2 -1
  321. package/modern/BarChart/useBarChartProps.js +19 -13
  322. package/modern/ChartContainer/ChartContainer.js +4 -0
  323. package/modern/ChartsAxisHighlight/ChartsXAxisHighlight.js +8 -8
  324. package/modern/ChartsAxisHighlight/ChartsYAxisHighlight.js +8 -8
  325. package/modern/ChartsLabel/ChartsLabelMark.js +0 -4
  326. package/modern/ChartsLabel/index.d.ts +1 -0
  327. package/modern/ChartsLabel/index.js +1 -0
  328. package/modern/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
  329. package/modern/ChartsOverlay/ChartsLoadingOverlay.js +1 -1
  330. package/modern/ChartsOverlay/ChartsNoDataOverlay.js +1 -1
  331. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +47 -55
  332. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +11 -9
  333. package/modern/ChartsTooltip/ChartsTooltip.js +2 -2
  334. package/modern/ChartsTooltip/ChartsTooltipContainer.js +5 -9
  335. package/modern/ChartsTooltip/ChartsTooltipTable.d.ts +3 -1
  336. package/modern/ChartsTooltip/ChartsTooltipTable.js +23 -9
  337. package/modern/ChartsTooltip/chartsTooltipClasses.d.ts +4 -4
  338. package/modern/ChartsTooltip/chartsTooltipClasses.js +2 -2
  339. package/modern/ChartsTooltip/index.d.ts +1 -0
  340. package/modern/ChartsTooltip/index.js +1 -0
  341. package/modern/ChartsTooltip/useAxesTooltip.d.ts +7 -0
  342. package/modern/ChartsTooltip/useAxesTooltip.js +12 -0
  343. package/modern/ChartsTooltip/useAxisTooltip.d.ts +24 -3
  344. package/modern/ChartsTooltip/useAxisTooltip.js +72 -38
  345. package/modern/ChartsTooltip/useItemTooltip.js +4 -1
  346. package/modern/ChartsXAxis/ChartsXAxis.js +5 -2
  347. package/modern/ChartsYAxis/ChartsYAxis.js +69 -17
  348. package/modern/LineChart/AnimatedArea.js +5 -22
  349. package/modern/LineChart/AnimatedLine.d.ts +1 -4
  350. package/modern/LineChart/AnimatedLine.js +9 -24
  351. package/modern/LineChart/AppearingMask.d.ts +5 -0
  352. package/modern/LineChart/AppearingMask.js +23 -18
  353. package/modern/LineChart/CircleMarkElement.js +19 -25
  354. package/modern/LineChart/LineChart.js +2 -0
  355. package/modern/LineChart/LineHighlightPlot.js +3 -4
  356. package/modern/LineChart/MarkElement.js +17 -28
  357. package/modern/LineChart/MarkPlot.js +0 -1
  358. package/modern/LineChart/markElementClasses.d.ts +3 -0
  359. package/modern/LineChart/markElementClasses.js +4 -3
  360. package/modern/LineChart/seriesConfig/index.js +2 -1
  361. package/modern/LineChart/seriesConfig/tooltip.d.ts +2 -1
  362. package/modern/LineChart/seriesConfig/tooltip.js +6 -0
  363. package/modern/LineChart/useLineChartProps.d.ts +2 -1
  364. package/modern/LineChart/useLineChartProps.js +6 -4
  365. package/modern/PieChart/PieArc.d.ts +19 -11
  366. package/modern/PieChart/PieArc.js +36 -23
  367. package/modern/PieChart/PieArcLabel.d.ts +22 -13
  368. package/modern/PieChart/PieArcLabel.js +51 -47
  369. package/modern/PieChart/PieArcLabelPlot.js +16 -34
  370. package/modern/PieChart/PieArcPlot.js +21 -34
  371. package/modern/PieChart/seriesConfig/tooltip.js +3 -0
  372. package/modern/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +9 -5
  373. package/modern/RadarChart/RadarGrid/RadarGrid.d.ts +1 -1
  374. package/modern/RadarChart/RadarGrid/RadarGrid.js +5 -1
  375. package/modern/RadarChart/RadarGrid/useRadarGridData.d.ts +1 -1
  376. package/modern/RadarChart/RadarGrid/useRadarGridData.js +3 -0
  377. package/modern/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +2 -2
  378. package/modern/ScatterChart/ScatterChart.js +2 -0
  379. package/modern/ScatterChart/useScatterChartProps.d.ts +2 -1
  380. package/modern/ScatterChart/useScatterChartProps.js +5 -3
  381. package/modern/SparkLineChart/SparkLineChart.js +2 -0
  382. package/modern/colorPalettes/colorPalettes.js +2 -2
  383. package/modern/constants/index.d.ts +1 -1
  384. package/modern/constants/index.js +1 -1
  385. package/modern/context/AnimationProvider/AnimationProvider.js +3 -6
  386. package/modern/hooks/animation/index.d.ts +6 -0
  387. package/modern/hooks/animation/index.js +6 -0
  388. package/modern/hooks/animation/useAnimateArea.d.ts +15 -0
  389. package/modern/hooks/animation/useAnimateArea.js +27 -0
  390. package/modern/hooks/animation/useAnimateBar.d.ts +17 -0
  391. package/modern/hooks/animation/useAnimateBar.js +56 -0
  392. package/modern/hooks/animation/useAnimateBarLabel.d.ts +19 -0
  393. package/modern/hooks/animation/useAnimateBarLabel.js +59 -0
  394. package/modern/hooks/animation/useAnimateLine.d.ts +14 -0
  395. package/modern/hooks/animation/useAnimateLine.js +26 -0
  396. package/modern/hooks/animation/useAnimatePieArc.d.ts +15 -0
  397. package/modern/hooks/animation/useAnimatePieArc.js +70 -0
  398. package/modern/hooks/animation/useAnimatePieArcLabel.d.ts +15 -0
  399. package/modern/hooks/animation/useAnimatePieArcLabel.js +72 -0
  400. package/modern/hooks/index.d.ts +2 -1
  401. package/modern/hooks/index.js +2 -1
  402. package/modern/hooks/useAxis.d.ts +5 -5
  403. package/modern/hooks/useInteractionItemProps.js +11 -0
  404. package/modern/hooks/useScale.d.ts +2 -2
  405. package/modern/hooks/useScale.js +2 -2
  406. package/modern/index.js +1 -1
  407. package/modern/internals/animation/Transition.d.ts +37 -0
  408. package/modern/internals/animation/Transition.js +83 -0
  409. package/modern/internals/animation/animation.d.ts +4 -0
  410. package/modern/internals/animation/animation.js +4 -0
  411. package/modern/internals/animation/useAnimate.d.ts +19 -0
  412. package/modern/internals/animation/useAnimate.js +74 -0
  413. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
  414. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +9 -3
  415. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.d.ts +5 -0
  416. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisTriggerTooltip.js +21 -0
  417. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.d.ts +8 -6
  418. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +28 -22
  419. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -0
  420. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -0
  421. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +9 -42
  422. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +8 -32
  423. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +9 -0
  424. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +75 -0
  425. package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +7 -20
  426. package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +36 -242
  427. package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +4 -10
  428. package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +9 -15
  429. package/modern/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.d.ts +12 -0
  430. package/modern/internals/plugins/featurePlugins/useChartPolarAxis/coordinateTransformation.js +8 -0
  431. package/modern/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.d.ts +6 -4
  432. package/modern/internals/plugins/featurePlugins/useChartPolarAxis/getAxisValue.js +18 -13
  433. package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +16 -32
  434. package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +3669 -0
  435. package/modern/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +22 -0
  436. package/modern/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +3 -1
  437. package/modern/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +10 -4
  438. package/modern/internals/shallowEqual.d.ts +8 -0
  439. package/modern/internals/shallowEqual.js +31 -0
  440. package/modern/models/axis.d.ts +8 -0
  441. package/modern/themeAugmentation/overrides.d.ts +1 -1
  442. package/package.json +8 -9
  443. package/themeAugmentation/overrides.d.ts +1 -1
  444. package/tsconfig.build.tsbuildinfo +1 -1
  445. package/PieChart/dataTransform/transition.d.ts +0 -4
  446. package/PieChart/dataTransform/transition.js +0 -145
  447. package/esm/PieChart/dataTransform/transition.d.ts +0 -4
  448. package/esm/PieChart/dataTransform/transition.js +0 -137
  449. package/modern/PieChart/dataTransform/transition.d.ts +0 -4
  450. package/modern/PieChart/dataTransform/transition.js +0 -137
@@ -11,7 +11,7 @@ var _useSelector = require("../../internals/store/useSelector");
11
11
  var _useStore = require("../../internals/store/useStore");
12
12
  var _useChartContext = require("../../context/ChartProvider/useChartContext");
13
13
  var _useChartPolarAxis = require("../../internals/plugins/featurePlugins/useChartPolarAxis");
14
- var _useChartInteraction = require("../../internals/plugins/featurePlugins/useChartInteraction");
14
+ var _useChartPolarInteraction = require("../../internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors");
15
15
  function useRadarAxisHighlight(params) {
16
16
  const {
17
17
  includesNeighbors = false
@@ -26,10 +26,14 @@ function useRadarAxisHighlight(params) {
26
26
  instance
27
27
  } = (0, _useChartContext.useChartContext)();
28
28
  const store = (0, _useStore.useStore)();
29
- const xAxisIdentifier = (0, _useSelector.useSelector)(store, _useChartInteraction.selectorChartsInteractionXAxis);
29
+ const rotationAxisIndex = (0, _useSelector.useSelector)(store, _useChartPolarInteraction.selectorChartsInteractionRotationAxisIndex);
30
+ const rotationAxisValue = (0, _useSelector.useSelector)(store, _useChartPolarInteraction.selectorChartsInteractionRotationAxisValue);
30
31
  const center = (0, _useSelector.useSelector)(store, _useChartPolarAxis.selectorChartPolarCenter);
31
- const highlightedIndex = xAxisIdentifier?.index;
32
- if (highlightedIndex === undefined) {
32
+ const highlightedIndex = rotationAxisIndex;
33
+ if (!rotationScale) {
34
+ return null;
35
+ }
36
+ if (highlightedIndex === null || highlightedIndex === -1) {
33
37
  return null;
34
38
  }
35
39
  if (radarSeries === undefined || radarSeries.length === 0) {
@@ -37,7 +41,7 @@ function useRadarAxisHighlight(params) {
37
41
  }
38
42
  const metric = radiusAxisIds[highlightedIndex];
39
43
  const radiusScale = radiusAxis[metric].scale;
40
- const angle = rotationScale(xAxisIdentifier?.value);
44
+ const angle = rotationScale(rotationAxisValue);
41
45
  const radius = radiusScale.range()[1];
42
46
  return {
43
47
  center,
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { RadarGridProps } from "./RadarGrid.types.js";
3
- declare function RadarGrid(props: RadarGridProps): React.JSX.Element;
3
+ declare function RadarGrid(props: RadarGridProps): React.JSX.Element | null;
4
4
  declare namespace RadarGrid {
5
5
  var propTypes: any;
6
6
  }
@@ -17,11 +17,15 @@ function RadarGrid(props) {
17
17
  divisions = 5,
18
18
  shape = 'sharp'
19
19
  } = props;
20
+ const gridData = (0, _useRadarGridData.useRadarGridData)();
21
+ if (gridData === null) {
22
+ return null;
23
+ }
20
24
  const {
21
25
  center,
22
26
  corners,
23
27
  radius
24
- } = (0, _useRadarGridData.useRadarGridData)();
28
+ } = gridData;
25
29
  return shape === 'sharp' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_SharpRadarGrid.SharpRadarGrid, {
26
30
  divisions: divisions,
27
31
  corners: corners,
@@ -8,4 +8,4 @@ export declare function useRadarGridData(): {
8
8
  y: number;
9
9
  }[];
10
10
  radius: number;
11
- };
11
+ } | null;
@@ -19,6 +19,9 @@ function useRadarGridData() {
19
19
  const drawingArea = (0, _useDrawingArea.useDrawingArea)();
20
20
  const cx = drawingArea.left + drawingArea.width / 2;
21
21
  const cy = drawingArea.top + drawingArea.height / 2;
22
+ if (!rotationScale || rotationScale.domain().length === 0) {
23
+ return null;
24
+ }
22
25
  const metrics = rotationScale.domain();
23
26
  const angles = metrics.map(key => rotationScale(key));
24
27
  return {
@@ -29,8 +29,8 @@ function useRadarSeriesData(querySeriesId) {
29
29
  isFaded: isItemFaded,
30
30
  isHighlighted: isItemHighlighted
31
31
  } = (0, _useItemHighlightedGetter.useItemHighlightedGetter)();
32
- const metrics = rotationScale.domain();
33
- const angles = metrics.map(key => rotationScale(key));
32
+ const metrics = rotationScale?.domain() ?? [];
33
+ const angles = metrics.map(key => rotationScale?.(key));
34
34
  return radarSeries.map(series => {
35
35
  const seriesId = series.id;
36
36
  const isSeriesHighlighted = isItemHighlighted({
@@ -236,6 +236,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
236
236
  height: _propTypes.default.number,
237
237
  hideTooltip: _propTypes.default.bool,
238
238
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
239
+ ignoreTooltip: _propTypes.default.bool,
239
240
  label: _propTypes.default.string,
240
241
  labelStyle: _propTypes.default.object,
241
242
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
@@ -291,6 +292,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
291
292
  fill: _propTypes.default.string,
292
293
  hideTooltip: _propTypes.default.bool,
293
294
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
295
+ ignoreTooltip: _propTypes.default.bool,
294
296
  label: _propTypes.default.string,
295
297
  labelStyle: _propTypes.default.object,
296
298
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import { ChartsAxisProps } from "../ChartsAxis/index.js";
2
3
  import { ChartsAxisHighlightProps } from "../ChartsAxisHighlight/index.js";
3
4
  import { ChartsGridProps } from "../ChartsGrid/index.js";
@@ -24,5 +25,5 @@ export declare const useScatterChartProps: (props: ScatterChartProps) => {
24
25
  overlayProps: ChartsOverlayProps;
25
26
  legendProps: ChartsLegendSlotExtension;
26
27
  axisHighlightProps: ChartsAxisHighlightProps;
27
- children: import("react").ReactNode;
28
+ children: React.ReactNode;
28
29
  };
@@ -2,12 +2,14 @@
2
2
  'use client';
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
6
  Object.defineProperty(exports, "__esModule", {
6
7
  value: true
7
8
  });
8
9
  exports.useScatterChartProps = void 0;
9
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
11
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
+ var React = _interopRequireWildcard(require("react"));
11
13
  var _ScatterChart = require("./ScatterChart.plugins");
12
14
  const _excluded = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className"];
13
15
  /**
@@ -42,10 +44,11 @@ const useScatterChartProps = props => {
42
44
  className
43
45
  } = props,
44
46
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
47
+ const seriesWithDefault = React.useMemo(() => series.map(s => (0, _extends2.default)({
48
+ type: 'scatter'
49
+ }, s)), [series]);
45
50
  const chartContainerProps = (0, _extends2.default)({}, other, {
46
- series: series.map(s => (0, _extends2.default)({
47
- type: 'scatter'
48
- }, s)),
51
+ series: seriesWithDefault,
49
52
  width,
50
53
  height,
51
54
  margin,
@@ -299,6 +299,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
299
299
  height: _propTypes.default.number,
300
300
  hideTooltip: _propTypes.default.bool,
301
301
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
302
+ ignoreTooltip: _propTypes.default.bool,
302
303
  label: _propTypes.default.string,
303
304
  labelStyle: _propTypes.default.object,
304
305
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
@@ -353,6 +354,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
353
354
  fill: _propTypes.default.string,
354
355
  hideTooltip: _propTypes.default.bool,
355
356
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
357
+ ignoreTooltip: _propTypes.default.bool,
356
358
  label: _propTypes.default.string,
357
359
  labelStyle: _propTypes.default.object,
358
360
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.rainbowSurgePaletteLight = exports.rainbowSurgePaletteDark = exports.rainbowSurgePalette = exports.mangoFusionPaletteLight = exports.mangoFusionPaletteDark = exports.mangoFusionPalette = exports.cheerfulFiestaPaletteLight = exports.cheerfulFiestaPaletteDark = exports.cheerfulFiestaPalette = exports.blueberryTwilightPaletteLight = exports.blueberryTwilightPaletteDark = exports.blueberryTwilightPalette = void 0;
7
- const rainbowSurgePaletteLight = exports.rainbowSurgePaletteLight = ['#4254FB', '#FFB219', '#54C690', '#FF5463', '#F287B3', '#2EAFFF', '#FD8731'];
8
- const rainbowSurgePaletteDark = exports.rainbowSurgePaletteDark = ['#273DFF', '#FAC04E', '#32ae6a', '#F3616E', '#F286B3', '#2EAFFF', '#FD8731'];
7
+ const rainbowSurgePaletteLight = exports.rainbowSurgePaletteLight = ['#4254FB', '#FFB422', '#FA4F58', '#0DBEFF', '#22BF75', '#FA83B4', '#FF7511'];
8
+ const rainbowSurgePaletteDark = exports.rainbowSurgePaletteDark = ['#495AFB', '#FFC758', '#F35865', '#30C8FF', '#44CE8D', '#F286B3', '#FF8C39'];
9
9
  const rainbowSurgePalette = mode => mode === 'dark' ? rainbowSurgePaletteDark : rainbowSurgePaletteLight;
10
10
  exports.rainbowSurgePalette = rainbowSurgePalette;
11
11
  const blueberryTwilightPaletteLight = exports.blueberryTwilightPaletteLight = ['#02B2AF', '#2E96FF', '#B800D8', '#60009B', '#2731C8', '#03008D'];
@@ -8,6 +8,6 @@ export declare const DEFAULT_MARGINS: {
8
8
  left: number;
9
9
  right: number;
10
10
  };
11
- export declare const DEFAULT_AXIS_SIZE_WIDTH = 30;
11
+ export declare const DEFAULT_AXIS_SIZE_WIDTH = 45;
12
12
  export declare const DEFAULT_AXIS_SIZE_HEIGHT = 25;
13
13
  export declare const AXIS_LABEL_DEFAULT_HEIGHT = 20;
@@ -14,7 +14,7 @@ const DEFAULT_MARGINS = exports.DEFAULT_MARGINS = {
14
14
  left: 20,
15
15
  right: 20
16
16
  };
17
- const DEFAULT_AXIS_SIZE_WIDTH = exports.DEFAULT_AXIS_SIZE_WIDTH = 30;
17
+ const DEFAULT_AXIS_SIZE_WIDTH = exports.DEFAULT_AXIS_SIZE_WIDTH = 45;
18
18
  const DEFAULT_AXIS_SIZE_HEIGHT = exports.DEFAULT_AXIS_SIZE_HEIGHT = 25;
19
19
 
20
20
  // How many pixels to add to the default axis size if that axis has a label
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
  'use client';
3
3
 
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
5
  var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
6
  Object.defineProperty(exports, "__esModule", {
6
7
  value: true
7
8
  });
8
9
  exports.AnimationProvider = AnimationProvider;
9
- var _web = require("@react-spring/web");
10
10
  var React = _interopRequireWildcard(require("react"));
11
+ var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
11
12
  var _AnimationContext = require("./AnimationContext");
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  function AnimationProvider(props) {
@@ -24,7 +25,7 @@ function AnimationProvider(props) {
24
25
  // We use the value of `isAnimationDisabledEnvironment` as the initial value of `skipAnimation` to avoid
25
26
  // re-rendering the component on environments where matchMedia is not supported, hence skipAnimation will always be true.
26
27
  const [skipAnimation, setSkipAnimation] = React.useState(process.env.NODE_ENV === 'test' ? isAnimationDisabledEnvironment || undefined : undefined);
27
- (0, _web.useIsomorphicLayoutEffect)(() => {
28
+ (0, _useEnhancedEffect.default)(() => {
28
29
  if (isAnimationDisabledEnvironment) {
29
30
  return undefined;
30
31
  }
@@ -32,9 +33,6 @@ function AnimationProvider(props) {
32
33
  // This hook can remove animation but never activate it.
33
34
  const inputValue = event.matches || undefined;
34
35
  setSkipAnimation(inputValue);
35
- _web.Globals.assign({
36
- skipAnimation: inputValue
37
- });
38
36
  };
39
37
  const mql = window.matchMedia('(prefers-reduced-motion)');
40
38
  handleMediaChange(mql);
@@ -44,7 +42,7 @@ function AnimationProvider(props) {
44
42
  return () => {
45
43
  mql?.removeEventListener?.('change', handleMediaChange);
46
44
  };
47
- }, []);
45
+ }, [isAnimationDisabledEnvironment]);
48
46
  const value = React.useMemo(() => ({
49
47
  isInitialized: true,
50
48
  data: {
@@ -1,12 +1,42 @@
1
1
  import * as React from 'react';
2
- import { AnimatedProps } from '@react-spring/web';
3
- import type { BarElementOwnerState } from './BarElement';
4
- export interface BarProps extends Omit<React.SVGProps<SVGRectElement>, 'id' | 'color' | 'ref' | 'x' | 'y' | 'height' | 'width'>, AnimatedProps<{
5
- x?: string | number | undefined;
6
- y?: string | number | undefined;
7
- height?: string | number | undefined;
8
- width?: string | number | undefined;
9
- }> {
2
+ import { SeriesId } from "../models/seriesType/common.js";
3
+ import { BarElementOwnerState } from "./barElementClasses.js";
4
+ export interface BarProps extends Omit<React.SVGProps<SVGRectElement>, 'id' | 'color' | 'ref' | 'x' | 'y' | 'height' | 'width'> {
5
+ id: SeriesId;
6
+ dataIndex: number;
7
+ color: string;
10
8
  ownerState: BarElementOwnerState;
9
+ /**
10
+ * The position in the x-axis of the stack this bar belongs to.
11
+ */
12
+ xOrigin: number;
13
+ /**
14
+ * The position in the y-axis of the stack this bar belongs to.
15
+ */
16
+ yOrigin: number;
17
+ /**
18
+ * The position of the bar in the x-axis.
19
+ */
20
+ x: number;
21
+ /**
22
+ * The position of the bar in the y-axis.
23
+ */
24
+ y: number;
25
+ /**
26
+ * The height of the bar.
27
+ */
28
+ height: number;
29
+ /**
30
+ * The width of the bar.
31
+ */
32
+ width: number;
33
+ /**
34
+ * The orientation of the bar.
35
+ */
36
+ layout: 'vertical' | 'horizontal';
37
+ /**
38
+ * If true, no animations should be applied.
39
+ */
40
+ skipAnimation: boolean;
11
41
  }
12
42
  export declare function AnimatedBarElement(props: BarProps): React.JSX.Element;
@@ -2,18 +2,18 @@
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 = ["ownerState"];
5
+ const _excluded = ["ownerState", "skipAnimation", "id", "dataIndex", "xOrigin", "yOrigin"];
6
6
  import * as React from 'react';
7
- import { animated } from '@react-spring/web';
7
+ import { useAnimateBar } from "../hooks/animation/useAnimateBar.js";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  export function AnimatedBarElement(props) {
10
10
  const {
11
11
  ownerState
12
12
  } = props,
13
13
  other = _objectWithoutPropertiesLoose(props, _excluded);
14
- return /*#__PURE__*/_jsx(animated.rect, _extends({}, other, {
15
- // @ts-expect-error
14
+ const animatedProps = useAnimateBar(props);
15
+ return /*#__PURE__*/_jsx("rect", _extends({}, other, {
16
16
  filter: ownerState.isHighlighted ? 'brightness(120%)' : undefined,
17
17
  opacity: ownerState.isFaded ? 0.3 : 1
18
- }));
18
+ }, animatedProps));
19
19
  }
@@ -238,6 +238,7 @@ process.env.NODE_ENV !== "production" ? BarChart.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" ? BarChart.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]),
@@ -1,11 +1,29 @@
1
1
  import * as React from 'react';
2
+ import { GetRadiusData } from "./getRadius.js";
3
+ type UseAnimateBarClipRectParams = Pick<BarClipRectProps, 'x' | 'y' | 'width' | 'height' | 'skipAnimation'> & {
4
+ ref?: React.Ref<SVGRectElement>;
5
+ borderRadius: number;
6
+ ownerState: Omit<GetRadiusData, 'borderRadius'>;
7
+ };
8
+ type UseAnimateBarClipRectReturn = {
9
+ ref: React.Ref<SVGRectElement>;
10
+ style: React.CSSProperties;
11
+ } & Pick<BarClipRectProps, 'x' | 'y' | 'width' | 'height'>;
12
+ export declare function useAnimateBarClipRect(props: UseAnimateBarClipRectParams): UseAnimateBarClipRectReturn;
13
+ interface BarClipRectProps extends Pick<BarClipPathProps, 'x' | 'y' | 'width' | 'height' | 'skipAnimation'> {
14
+ ownerState: GetRadiusData;
15
+ }
2
16
  export interface BarClipPathProps {
3
17
  maskId: string;
4
18
  borderRadius?: number;
5
19
  hasNegative: boolean;
6
20
  hasPositive: boolean;
7
21
  layout?: 'vertical' | 'horizontal';
8
- style: {};
22
+ x: number;
23
+ y: number;
24
+ width: number;
25
+ height: number;
26
+ skipAnimation: boolean;
9
27
  }
10
28
  /**
11
29
  * @ignore - internal component.
@@ -1,31 +1,94 @@
1
+ 'use client';
2
+
1
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
4
  import _extends from "@babel/runtime/helpers/esm/extends";
3
- const _excluded = ["style", "maskId"];
5
+ const _excluded = ["maskId", "x", "y", "width", "height", "skipAnimation"];
4
6
  import * as React from 'react';
5
- import { animated } from '@react-spring/web';
7
+ import { interpolateNumber } from '@mui/x-charts-vendor/d3-interpolate';
8
+ import { useAnimate } from "../internals/animation/useAnimate.js";
6
9
  import { getRadius } from "./getRadius.js";
7
10
  import { jsx as _jsx } from "react/jsx-runtime";
8
- const buildInset = corners => `inset(0px round ${corners.topLeft}px ${corners.topRight}px ${corners.bottomRight}px ${corners.bottomLeft}px)`;
9
- function BarClipRect(props) {
10
- const radiusData = props.ownerState;
11
- return /*#__PURE__*/_jsx(animated.rect, {
12
- style: _extends({}, props.style, {
13
- clipPath: (props.ownerState.layout === 'vertical' ? props.style?.height : props.style?.width).to(value => buildInset({
14
- topLeft: Math.min(value, getRadius('top-left', radiusData)),
15
- topRight: Math.min(value, getRadius('top-right', radiusData)),
16
- bottomRight: Math.min(value, getRadius('bottom-right', radiusData)),
17
- bottomLeft: Math.min(value, getRadius('bottom-left', radiusData))
18
- }))
19
- })
11
+ function buildClipPath(size, borderRadius, ownerState) {
12
+ const radiusData = _extends({}, ownerState, {
13
+ borderRadius
20
14
  });
15
+ const topLeft = Math.min(size, getRadius('top-left', radiusData));
16
+ const topRight = Math.min(size, getRadius('top-right', radiusData));
17
+ const bottomRight = Math.min(size, getRadius('bottom-right', radiusData));
18
+ const bottomLeft = Math.min(size, getRadius('bottom-left', radiusData));
19
+ return `inset(0px round ${topLeft}px ${topRight}px ${bottomRight}px ${bottomLeft}px)`;
20
+ }
21
+ function barClipRectPropsInterpolator(from, to) {
22
+ const interpolateX = interpolateNumber(from.x, to.x);
23
+ const interpolateY = interpolateNumber(from.y, to.y);
24
+ const interpolateWidth = interpolateNumber(from.width, to.width);
25
+ const interpolateHeight = interpolateNumber(from.height, to.height);
26
+ const interpolateBorderRadius = interpolateNumber(from.borderRadius, to.borderRadius);
27
+ return t => {
28
+ return {
29
+ x: interpolateX(t),
30
+ y: interpolateY(t),
31
+ width: interpolateWidth(t),
32
+ height: interpolateHeight(t),
33
+ borderRadius: interpolateBorderRadius(t)
34
+ };
35
+ };
36
+ }
37
+ export function useAnimateBarClipRect(props) {
38
+ const initialProps = {
39
+ x: props.x,
40
+ y: props.y + (props.ownerState.layout === 'vertical' ? props.height : 0),
41
+ width: props.ownerState.layout === 'vertical' ? props.width : 0,
42
+ height: props.ownerState.layout === 'vertical' ? 0 : props.height,
43
+ borderRadius: props.borderRadius
44
+ };
45
+ const ref = useAnimate({
46
+ x: props.x,
47
+ y: props.y,
48
+ width: props.width,
49
+ height: props.height,
50
+ borderRadius: props.borderRadius
51
+ }, {
52
+ createInterpolator: barClipRectPropsInterpolator,
53
+ applyProps(element, animatedProps) {
54
+ element.setAttribute('x', animatedProps.x.toString());
55
+ element.setAttribute('y', animatedProps.y.toString());
56
+ element.setAttribute('width', animatedProps.width.toString());
57
+ element.setAttribute('height', animatedProps.height.toString());
58
+ element.style.clipPath = buildClipPath(props.ownerState.layout === 'vertical' ? animatedProps.height : animatedProps.width, animatedProps.borderRadius, props.ownerState);
59
+ },
60
+ initialProps,
61
+ skip: props.skipAnimation
62
+ });
63
+ const usedProps = props.skipAnimation ? props : initialProps;
64
+ return {
65
+ ref,
66
+ x: usedProps.x,
67
+ y: usedProps.y,
68
+ width: usedProps.width,
69
+ height: usedProps.height,
70
+ style: {
71
+ clipPath: buildClipPath(props.ownerState.layout === 'vertical' ? usedProps.height : usedProps.width, usedProps.borderRadius, props.ownerState)
72
+ }
73
+ };
74
+ }
75
+ function BarClipRect(props) {
76
+ const animatedProps = useAnimateBarClipRect(_extends({}, props, {
77
+ borderRadius: props.ownerState.borderRadius ?? 0
78
+ }));
79
+ return /*#__PURE__*/_jsx("rect", _extends({}, animatedProps));
21
80
  }
22
81
  /**
23
82
  * @ignore - internal component.
24
83
  */
25
84
  function BarClipPath(props) {
26
85
  const {
27
- style,
28
- maskId
86
+ maskId,
87
+ x,
88
+ y,
89
+ width,
90
+ height,
91
+ skipAnimation
29
92
  } = props,
30
93
  rest = _objectWithoutPropertiesLoose(props, _excluded);
31
94
  if (!props.borderRadius || props.borderRadius <= 0) {
@@ -35,7 +98,11 @@ function BarClipPath(props) {
35
98
  id: maskId,
36
99
  children: /*#__PURE__*/_jsx(BarClipRect, {
37
100
  ownerState: rest,
38
- style: style
101
+ x: x,
102
+ y: y,
103
+ width: width,
104
+ height: height,
105
+ skipAnimation: skipAnimation
39
106
  })
40
107
  });
41
108
  }
@@ -1,26 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { SlotComponentPropsFromProps } from '@mui/x-internals/types';
3
- import { SeriesId } from "../models/seriesType/common.js";
3
+ import { BarElementOwnerState } from "./barElementClasses.js";
4
4
  import { BarProps } from "./AnimatedBarElement.js";
5
- export interface BarElementClasses {
6
- /** Styles applied to the root element. */
7
- root: string;
8
- /** Styles applied to the root element if it is highlighted. */
9
- highlighted: string;
10
- /** Styles applied to the root element if it is faded. */
11
- faded: string;
12
- }
13
- export type BarElementClassKey = keyof BarElementClasses;
14
- export interface BarElementOwnerState {
15
- id: SeriesId;
16
- dataIndex: number;
17
- color: string;
18
- isFaded: boolean;
19
- isHighlighted: boolean;
20
- classes?: Partial<BarElementClasses>;
21
- }
22
- export declare function getBarElementUtilityClass(slot: string): string;
23
- export declare const barElementClasses: BarElementClasses;
24
5
  export interface BarElementSlots {
25
6
  /**
26
7
  * The component that renders the bar.
@@ -42,6 +23,14 @@ export type BarElementProps = Omit<BarElementOwnerState, 'isFaded' | 'isHighligh
42
23
  * @default {}
43
24
  */
44
25
  slots?: BarElementSlots;
26
+ x: number;
27
+ xOrigin: number;
28
+ y: number;
29
+ yOrigin: number;
30
+ width: number;
31
+ height: number;
32
+ layout: 'horizontal' | 'vertical';
33
+ skipAnimation: boolean;
45
34
  };
46
35
  declare function BarElement(props: BarElementProps): React.JSX.Element;
47
36
  declare namespace BarElement {
@@ -2,33 +2,15 @@
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 = ["id", "dataIndex", "classes", "color", "slots", "slotProps", "style", "onClick"];
5
+ const _excluded = ["id", "dataIndex", "classes", "color", "slots", "slotProps", "style", "onClick", "skipAnimation", "layout", "x", "xOrigin", "y", "yOrigin", "width", "height"];
6
6
  import * as React from 'react';
7
7
  import PropTypes from 'prop-types';
8
- import composeClasses from '@mui/utils/composeClasses';
9
8
  import useSlotProps from '@mui/utils/useSlotProps';
10
- import generateUtilityClass from '@mui/utils/generateUtilityClass';
11
- import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
9
+ import { useUtilityClasses } from "./barElementClasses.js";
12
10
  import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
13
11
  import { useItemHighlighted } from "../hooks/useItemHighlighted.js";
14
12
  import { AnimatedBarElement } from "./AnimatedBarElement.js";
15
13
  import { jsx as _jsx } from "react/jsx-runtime";
16
- export function getBarElementUtilityClass(slot) {
17
- return generateUtilityClass('MuiBarElement', slot);
18
- }
19
- export const barElementClasses = generateUtilityClasses('MuiBarElement', ['root', 'highlighted', 'faded']);
20
- const useUtilityClasses = ownerState => {
21
- const {
22
- classes,
23
- id,
24
- isHighlighted,
25
- isFaded
26
- } = ownerState;
27
- const slots = {
28
- root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
29
- };
30
- return composeClasses(slots, getBarElementUtilityClass, classes);
31
- };
32
14
  function BarElement(props) {
33
15
  const {
34
16
  id,
@@ -38,7 +20,15 @@ function BarElement(props) {
38
20
  slots,
39
21
  slotProps,
40
22
  style,
41
- onClick
23
+ onClick,
24
+ skipAnimation,
25
+ layout,
26
+ x,
27
+ xOrigin,
28
+ y,
29
+ yOrigin,
30
+ width,
31
+ height
42
32
  } = props,
43
33
  other = _objectWithoutPropertiesLoose(props, _excluded);
44
34
  const interactionProps = useInteractionItemProps({
@@ -68,11 +58,22 @@ function BarElement(props) {
68
58
  externalSlotProps: slotProps?.bar,
69
59
  externalForwardedProps: other,
70
60
  additionalProps: _extends({}, interactionProps, {
61
+ id,
62
+ dataIndex,
63
+ color,
64
+ x,
65
+ xOrigin,
66
+ y,
67
+ yOrigin,
68
+ width,
69
+ height,
71
70
  style,
72
71
  onClick,
73
72
  cursor: onClick ? 'pointer' : 'unset',
74
73
  stroke: 'none',
75
- fill: color
74
+ fill: color,
75
+ skipAnimation,
76
+ layout
76
77
  }),
77
78
  className: classes.root,
78
79
  ownerState
@@ -87,6 +88,8 @@ process.env.NODE_ENV !== "production" ? BarElement.propTypes = {
87
88
  classes: PropTypes.object,
88
89
  dataIndex: PropTypes.number.isRequired,
89
90
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
91
+ layout: PropTypes.oneOf(['horizontal', 'vertical']).isRequired,
92
+ skipAnimation: PropTypes.bool.isRequired,
90
93
  /**
91
94
  * The props used for each component slot.
92
95
  * @default {}
@@ -96,6 +99,8 @@ process.env.NODE_ENV !== "production" ? BarElement.propTypes = {
96
99
  * Overridable component slots.
97
100
  * @default {}
98
101
  */
99
- slots: PropTypes.object
102
+ slots: PropTypes.object,
103
+ xOrigin: PropTypes.number.isRequired,
104
+ yOrigin: PropTypes.number.isRequired
100
105
  } : void 0;
101
106
  export { BarElement };