@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
@@ -12,12 +12,12 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
  var React = _interopRequireWildcard(require("react"));
14
14
  var _styles = require("@mui/material/styles");
15
- var _web = require("@react-spring/web");
16
15
  var _propTypes = _interopRequireDefault(require("prop-types"));
16
+ var _useAnimateBarLabel = require("../../hooks/animation/useAnimateBarLabel");
17
17
  var _barLabelClasses = require("./barLabelClasses");
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
- const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes"];
20
- const BarLabelComponent = exports.BarLabelComponent = (0, _styles.styled)(_web.animated.text, {
19
+ const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes", "skipAnimation", "layout", "xOrigin", "yOrigin"];
20
+ const BarLabelComponent = exports.BarLabelComponent = (0, _styles.styled)('text', {
21
21
  name: 'MuiBarLabel',
22
22
  slot: 'Root',
23
23
  overridesResolver: (_, styles) => [{
@@ -45,7 +45,8 @@ function BarLabel(inProps) {
45
45
  name: 'MuiBarLabel'
46
46
  });
47
47
  const otherProps = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
48
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(BarLabelComponent, (0, _extends2.default)({}, otherProps));
48
+ const animatedProps = (0, _useAnimateBarLabel.useAnimateBarLabel)(props);
49
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(BarLabelComponent, (0, _extends2.default)({}, otherProps, animatedProps));
49
50
  }
50
51
  process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
51
52
  // ----------------------------- Warning --------------------------------
@@ -54,7 +55,33 @@ process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
54
55
  // ----------------------------------------------------------------------
55
56
  classes: _propTypes.default.object,
56
57
  dataIndex: _propTypes.default.number.isRequired,
58
+ /**
59
+ * Height of the bar this label belongs to.
60
+ */
61
+ height: _propTypes.default.number.isRequired,
57
62
  isFaded: _propTypes.default.bool.isRequired,
58
63
  isHighlighted: _propTypes.default.bool.isRequired,
59
- seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired
64
+ layout: _propTypes.default.oneOf(['horizontal', 'vertical']).isRequired,
65
+ seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
66
+ skipAnimation: _propTypes.default.bool.isRequired,
67
+ /**
68
+ * Width of the bar this label belongs to.
69
+ */
70
+ width: _propTypes.default.number.isRequired,
71
+ /**
72
+ * Position in the x-axis of the bar this label belongs to.
73
+ */
74
+ x: _propTypes.default.number.isRequired,
75
+ /**
76
+ * The x-coordinate of the stack this bar label belongs to.
77
+ */
78
+ xOrigin: _propTypes.default.number.isRequired,
79
+ /**
80
+ * Position in the y-axis of the bar this label belongs to.
81
+ */
82
+ y: _propTypes.default.number.isRequired,
83
+ /**
84
+ * The y-coordinate of the stack this bar label belongs to.
85
+ */
86
+ yOrigin: _propTypes.default.number.isRequired
60
87
  } : void 0;
@@ -6,6 +6,8 @@ export interface BarLabelOwnerState {
6
6
  color: string;
7
7
  isFaded: boolean;
8
8
  isHighlighted: boolean;
9
+ skipAnimation: boolean;
10
+ layout: 'vertical' | 'horizontal';
9
11
  classes?: Partial<BarLabelClasses>;
10
12
  }
11
13
  export type BarItem = {
@@ -23,6 +23,22 @@ export type BarLabelItemProps = Omit<BarLabelOwnerState, 'isFaded' | 'isHighligh
23
23
  * @default {}
24
24
  */
25
25
  slots?: BarLabelSlots;
26
+ /**
27
+ * The position in the x-axis of the stack this bar label belongs to.
28
+ */
29
+ xOrigin: number;
30
+ /**
31
+ * The position in the y-axis of the stack this bar label belongs to.
32
+ */
33
+ yOrigin: number;
34
+ /**
35
+ * The position of the bar in the x-axis.
36
+ */
37
+ x: number;
38
+ /**
39
+ * The position of the bar in the y-axis.
40
+ */
41
+ y: number;
26
42
  /**
27
43
  * The height of the bar.
28
44
  */
@@ -31,10 +47,18 @@ export type BarLabelItemProps = Omit<BarLabelOwnerState, 'isFaded' | 'isHighligh
31
47
  * The width of the bar.
32
48
  */
33
49
  width: number;
50
+ /**
51
+ * The orientation of the bar.
52
+ */
53
+ layout: 'vertical' | 'horizontal';
34
54
  /**
35
55
  * The value of the data point.
36
56
  */
37
57
  value: number | null;
58
+ /**
59
+ * If true, no animations should be applied.
60
+ */
61
+ skipAnimation: boolean;
38
62
  /**
39
63
  * If provided, the function will be used to format the label of the bar.
40
64
  * It can be set to 'value' to display the current value.
@@ -16,7 +16,7 @@ var _getBarLabel = require("./getBarLabel");
16
16
  var _BarLabel = require("./BarLabel");
17
17
  var _useItemHighlighted = require("../../hooks/useItemHighlighted");
18
18
  var _jsxRuntime = require("react/jsx-runtime");
19
- const _excluded = ["seriesId", "classes", "color", "style", "dataIndex", "barLabel", "slots", "slotProps", "height", "width", "value"],
19
+ const _excluded = ["seriesId", "classes", "color", "dataIndex", "barLabel", "slots", "slotProps", "xOrigin", "yOrigin", "x", "y", "width", "height", "value", "skipAnimation", "layout"],
20
20
  _excluded2 = ["ownerState"];
21
21
  /**
22
22
  * @ignore - internal component.
@@ -26,14 +26,19 @@ function BarLabelItem(props) {
26
26
  seriesId,
27
27
  classes: innerClasses,
28
28
  color,
29
- style,
30
29
  dataIndex,
31
30
  barLabel,
32
31
  slots,
33
32
  slotProps,
34
- height,
33
+ xOrigin,
34
+ yOrigin,
35
+ x,
36
+ y,
35
37
  width,
36
- value
38
+ height,
39
+ value,
40
+ skipAnimation,
41
+ layout
37
42
  } = props,
38
43
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
39
44
  const {
@@ -49,7 +54,9 @@ function BarLabelItem(props) {
49
54
  color,
50
55
  isFaded,
51
56
  isHighlighted,
52
- dataIndex
57
+ dataIndex,
58
+ skipAnimation,
59
+ layout
53
60
  };
54
61
  const classes = (0, _barLabelClasses.useUtilityClasses)(ownerState);
55
62
  const Component = slots?.barLabel ?? _BarLabel.BarLabel;
@@ -57,7 +64,12 @@ function BarLabelItem(props) {
57
64
  elementType: Component,
58
65
  externalSlotProps: slotProps?.barLabel,
59
66
  additionalProps: (0, _extends2.default)({}, other, {
60
- style,
67
+ xOrigin,
68
+ yOrigin,
69
+ x,
70
+ y,
71
+ width,
72
+ height,
61
73
  className: classes.root
62
74
  }),
63
75
  ownerState
@@ -6,43 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.BarLabelPlot = BarLabelPlot;
9
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
11
  var React = _interopRequireWildcard(require("react"));
12
- var _web = require("@react-spring/web");
13
12
  var _BarLabelItem = require("./BarLabelItem");
14
13
  var _jsxRuntime = require("react/jsx-runtime");
15
14
  const _excluded = ["bars", "skipAnimation"];
16
- const leaveStyle = ({
17
- layout,
18
- yOrigin,
19
- x,
20
- width,
21
- y,
22
- xOrigin,
23
- height
24
- }) => (0, _extends2.default)({}, layout === 'vertical' ? {
25
- y: yOrigin,
26
- x: x + width / 2,
27
- height: 0,
28
- width
29
- } : {
30
- y: y + height / 2,
31
- x: xOrigin,
32
- height,
33
- width: 0
34
- });
35
- const enterStyle = ({
36
- x,
37
- width,
38
- y,
39
- height
40
- }) => ({
41
- x: x + width / 2,
42
- y: y + height / 2,
43
- height,
44
- width
45
- });
46
15
  /**
47
16
  * @ignore - internal component.
48
17
  */
@@ -52,31 +21,32 @@ function BarLabelPlot(props) {
52
21
  skipAnimation
53
22
  } = props,
54
23
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
55
- const barLabelTransition = (0, _web.useTransition)(bars, {
56
- keys: bar => `${bar.seriesId}-${bar.dataIndex}`,
57
- from: skipAnimation ? undefined : leaveStyle,
58
- leave: null,
59
- enter: enterStyle,
60
- update: enterStyle,
61
- immediate: skipAnimation
62
- });
63
24
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
64
- children: barLabelTransition((style, {
25
+ children: bars.map(({
26
+ xOrigin,
27
+ yOrigin,
28
+ x,
29
+ y,
65
30
  seriesId,
66
31
  dataIndex,
67
32
  color,
68
33
  value,
69
34
  width,
70
- height
35
+ height,
36
+ layout
71
37
  }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarLabelItem.BarLabelItem, (0, _extends2.default)({
72
38
  seriesId: seriesId,
73
39
  dataIndex: dataIndex,
74
40
  value: value,
75
41
  color: color,
42
+ xOrigin: xOrigin,
43
+ yOrigin: yOrigin,
44
+ x: x,
45
+ y: y,
76
46
  width: width,
77
- height: height
78
- }, other, {
79
- style: style
80
- })))
47
+ height: height,
48
+ skipAnimation: skipAnimation ?? false,
49
+ layout: layout ?? 'vertical'
50
+ }, other), `${seriesId}-${dataIndex}`))
81
51
  });
82
52
  }
@@ -6,8 +6,10 @@ export interface BarLabelClasses {
6
6
  highlighted: string;
7
7
  /** Styles applied to the root element if it is faded. */
8
8
  faded: string;
9
+ /** Styles applied to the root element if it is animated. */
10
+ animate: string;
9
11
  }
10
12
  export type BarLabelClassKey = keyof BarLabelClasses;
11
13
  export declare function getBarLabelUtilityClass(slot: string): string;
12
- export declare const barLabelClasses: Record<"root" | "highlighted" | "faded", string>;
14
+ export declare const barLabelClasses: Record<"root" | "animate" | "highlighted" | "faded", string>;
13
15
  export declare const useUtilityClasses: (ownerState: BarLabelOwnerState) => Record<"root", string>;
@@ -13,16 +13,17 @@ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"
13
13
  function getBarLabelUtilityClass(slot) {
14
14
  return (0, _generateUtilityClass.default)('MuiBarLabel', slot);
15
15
  }
16
- const barLabelClasses = exports.barLabelClasses = (0, _generateUtilityClasses.default)('MuiBarLabel', ['root', 'highlighted', 'faded']);
16
+ const barLabelClasses = exports.barLabelClasses = (0, _generateUtilityClasses.default)('MuiBarLabel', ['root', 'highlighted', 'faded', 'animate']);
17
17
  const useUtilityClasses = ownerState => {
18
18
  const {
19
19
  classes,
20
20
  seriesId,
21
21
  isFaded,
22
- isHighlighted
22
+ isHighlighted,
23
+ skipAnimation
23
24
  } = ownerState;
24
25
  const slots = {
25
- root: ['root', `series-${seriesId}`, isHighlighted && 'highlighted', isFaded && 'faded']
26
+ root: ['root', `series-${seriesId}`, isHighlighted && 'highlighted', isFaded && 'faded', !skipAnimation && 'animate']
26
27
  };
27
28
  return (0, _composeClasses.default)(slots, getBarLabelUtilityClass, classes);
28
29
  };
@@ -7,12 +7,12 @@ Object.defineProperty(exports, "__esModule", {
7
7
  value: true
8
8
  });
9
9
  exports.BarPlot = BarPlot;
10
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
11
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
12
12
  var React = _interopRequireWildcard(require("react"));
13
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
14
- var _web = require("@react-spring/web");
15
14
  var _styles = require("@mui/material/styles");
15
+ var _barElementClasses = require("./barElementClasses");
16
16
  var _BarElement = require("./BarElement");
17
17
  var _getColor = _interopRequireDefault(require("./seriesConfig/getColor"));
18
18
  var _hooks = require("../hooks");
@@ -119,8 +119,8 @@ const useAggregatedData = () => {
119
119
  layout,
120
120
  x: verticalLayout ? xScale(baseValue) + barOffset : minValueCoord,
121
121
  y: verticalLayout ? minValueCoord : yScale(baseValue) + barOffset,
122
- xOrigin: xScale(0),
123
- yOrigin: yScale(0),
122
+ xOrigin: xScale(0) ?? 0,
123
+ yOrigin: yScale(0) ?? 0,
124
124
  height: verticalLayout ? maxValueCoord - minValueCoord : barWidth,
125
125
  width: verticalLayout ? barWidth : maxValueCoord - minValueCoord,
126
126
  color: colorGetter(dataIndex),
@@ -160,42 +160,12 @@ const useAggregatedData = () => {
160
160
  masksData: Object.values(masks)
161
161
  };
162
162
  };
163
- const leaveStyle = ({
164
- layout,
165
- yOrigin,
166
- x,
167
- width,
168
- y,
169
- xOrigin,
170
- height
171
- }) => (0, _extends2.default)({}, layout === 'vertical' ? {
172
- y: yOrigin,
173
- x,
174
- height: 0,
175
- width
176
- } : {
177
- y,
178
- x: xOrigin,
179
- height,
180
- width: 0
181
- });
182
- const enterStyle = ({
183
- x,
184
- width,
185
- y,
186
- height
187
- }) => ({
188
- y,
189
- x,
190
- height,
191
- width
192
- });
193
163
  const BarPlotRoot = (0, _styles.styled)('g', {
194
164
  name: 'MuiBarPlot',
195
165
  slot: 'Root',
196
166
  overridesResolver: (_, styles) => styles.root
197
167
  })({
198
- [`& .${_BarElement.barElementClasses.root}`]: {
168
+ [`& .${_barElementClasses.barElementClasses.root}`]: {
199
169
  transition: 'opacity 0.2s ease-in, fill 0.2s ease-in'
200
170
  }
201
171
  });
@@ -226,25 +196,13 @@ function BarPlot(props) {
226
196
  const isZoomInteracting = (0, _useInternalIsZoomInteracting.useInternalIsZoomInteracting)();
227
197
  const skipAnimation = (0, _AnimationProvider.useSkipAnimation)(isZoomInteracting || inSkipAnimation);
228
198
  const withoutBorderRadius = !borderRadius || borderRadius <= 0;
229
- const transition = (0, _web.useTransition)(completedData, {
230
- keys: bar => `${bar.seriesId}-${bar.dataIndex}`,
231
- from: skipAnimation ? undefined : leaveStyle,
232
- leave: leaveStyle,
233
- enter: enterStyle,
234
- update: enterStyle,
235
- immediate: skipAnimation
236
- });
237
- const maskTransition = (0, _web.useTransition)(withoutBorderRadius ? [] : masksData, {
238
- keys: v => v.id,
239
- from: skipAnimation ? undefined : leaveStyle,
240
- leave: leaveStyle,
241
- enter: enterStyle,
242
- update: enterStyle,
243
- immediate: skipAnimation
244
- });
245
199
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(BarPlotRoot, {
246
- children: [!withoutBorderRadius && maskTransition((style, {
200
+ children: [!withoutBorderRadius && masksData.map(({
247
201
  id,
202
+ x,
203
+ y,
204
+ width,
205
+ height,
248
206
  hasPositive,
249
207
  hasNegative,
250
208
  layout
@@ -255,18 +213,37 @@ function BarPlot(props) {
255
213
  hasNegative: hasNegative,
256
214
  hasPositive: hasPositive,
257
215
  layout: layout,
258
- style: style
259
- });
260
- }), transition((style, {
216
+ x: x,
217
+ y: y,
218
+ width: width,
219
+ height: height,
220
+ skipAnimation: skipAnimation ?? false
221
+ }, id);
222
+ }), completedData.map(({
261
223
  seriesId,
262
224
  dataIndex,
263
225
  color,
264
- maskId
226
+ maskId,
227
+ layout,
228
+ x,
229
+ xOrigin,
230
+ y,
231
+ yOrigin,
232
+ width,
233
+ height
265
234
  }) => {
266
235
  const barElement = /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarElement.BarElement, (0, _extends2.default)({
267
236
  id: seriesId,
268
237
  dataIndex: dataIndex,
269
- color: color
238
+ color: color,
239
+ skipAnimation: skipAnimation ?? false,
240
+ layout: layout ?? 'vertical',
241
+ x: x,
242
+ xOrigin: xOrigin,
243
+ y: y,
244
+ yOrigin: yOrigin,
245
+ width: width,
246
+ height: height
270
247
  }, other, {
271
248
  onClick: onItemClick && (event => {
272
249
  onItemClick(event, {
@@ -274,16 +251,15 @@ function BarPlot(props) {
274
251
  seriesId,
275
252
  dataIndex
276
253
  });
277
- }),
278
- style: style
279
- }));
254
+ })
255
+ }), `${seriesId}-${dataIndex}`);
280
256
  if (withoutBorderRadius) {
281
257
  return barElement;
282
258
  }
283
259
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
284
260
  clipPath: `url(#${maskId})`,
285
261
  children: barElement
286
- });
262
+ }, `${seriesId}-${dataIndex}`);
287
263
  }), barLabel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarLabelPlot.BarLabelPlot, (0, _extends2.default)({
288
264
  bars: completedData,
289
265
  skipAnimation: skipAnimation,
@@ -0,0 +1,21 @@
1
+ import { SeriesId } from "../models/seriesType/common.js";
2
+ export interface BarElementClasses {
3
+ /** Styles applied to the root element. */
4
+ root: string;
5
+ /** Styles applied to the root element if it is highlighted. */
6
+ highlighted: string;
7
+ /** Styles applied to the root element if it is faded. */
8
+ faded: string;
9
+ }
10
+ export type BarElementClassKey = keyof BarElementClasses;
11
+ export interface BarElementOwnerState {
12
+ id: SeriesId;
13
+ dataIndex: number;
14
+ color: string;
15
+ isFaded: boolean;
16
+ isHighlighted: boolean;
17
+ classes?: Partial<BarElementClasses>;
18
+ }
19
+ export declare function getBarElementUtilityClass(slot: string): string;
20
+ export declare const barElementClasses: BarElementClasses;
21
+ export declare const useUtilityClasses: (ownerState: BarElementOwnerState) => Record<"root", string>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.barElementClasses = void 0;
8
+ exports.getBarElementUtilityClass = getBarElementUtilityClass;
9
+ exports.useUtilityClasses = void 0;
10
+ var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
11
+ var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
12
+ var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
13
+ function getBarElementUtilityClass(slot) {
14
+ return (0, _generateUtilityClass.default)('MuiBarElement', slot);
15
+ }
16
+ const barElementClasses = exports.barElementClasses = (0, _generateUtilityClasses.default)('MuiBarElement', ['root', 'highlighted', 'faded']);
17
+ const useUtilityClasses = ownerState => {
18
+ const {
19
+ classes,
20
+ id,
21
+ isHighlighted,
22
+ isFaded
23
+ } = ownerState;
24
+ const slots = {
25
+ root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
26
+ };
27
+ return (0, _composeClasses.default)(slots, getBarElementUtilityClass, classes);
28
+ };
29
+ exports.useUtilityClasses = useUtilityClasses;
@@ -1,4 +1,4 @@
1
- type GetRadiusData = {
1
+ export type GetRadiusData = {
2
2
  hasNegative: boolean;
3
3
  hasPositive: boolean;
4
4
  borderRadius?: number;
@@ -1,4 +1,5 @@
1
1
  export * from "./BarChart.js";
2
2
  export * from "./BarPlot.js";
3
3
  export * from "./BarElement.js";
4
- export * from "./BarLabel/index.js";
4
+ export * from "./BarLabel/index.js";
5
+ export * from "./barElementClasses.js";
package/BarChart/index.js CHANGED
@@ -46,4 +46,15 @@ Object.keys(_BarLabel).forEach(function (key) {
46
46
  return _BarLabel[key];
47
47
  }
48
48
  });
49
+ });
50
+ var _barElementClasses = require("./barElementClasses");
51
+ Object.keys(_barElementClasses).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _barElementClasses[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _barElementClasses[key];
58
+ }
59
+ });
49
60
  });
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
@@ -9,13 +10,14 @@ var _extremums = require("./extremums");
9
10
  var _seriesProcessor = _interopRequireDefault(require("./seriesProcessor"));
10
11
  var _legend = _interopRequireDefault(require("./legend"));
11
12
  var _getColor = _interopRequireDefault(require("./getColor"));
12
- var _tooltip = _interopRequireDefault(require("./tooltip"));
13
+ var _tooltip = _interopRequireWildcard(require("./tooltip"));
13
14
  var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
14
15
  const seriesConfig = exports.seriesConfig = {
15
16
  seriesProcessor: _seriesProcessor.default,
16
17
  colorProcessor: _getColor.default,
17
18
  legendGetter: _legend.default,
18
19
  tooltipGetter: _tooltip.default,
20
+ axisTooltipGetter: _tooltip.axisTooltipGetter,
19
21
  xExtremumGetter: _extremums.getExtremumX,
20
22
  yExtremumGetter: _extremums.getExtremumY,
21
23
  getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default
@@ -1,3 +1,4 @@
1
- import type { TooltipGetter } from '../../internals/plugins/models';
1
+ import type { AxisTooltipGetter, TooltipGetter } from '../../internals/plugins/models';
2
2
  declare const tooltipGetter: TooltipGetter<'bar'>;
3
+ export declare const axisTooltipGetter: AxisTooltipGetter<'bar', 'x' | 'y'>;
3
4
  export default tooltipGetter;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
6
+ exports.default = exports.axisTooltipGetter = void 0;
7
7
  var _getLabel = require("../../internals/getLabel");
8
8
  const tooltipGetter = params => {
9
9
  const {
@@ -16,6 +16,9 @@ const tooltipGetter = params => {
16
16
  }
17
17
  const label = (0, _getLabel.getLabel)(series.label, 'tooltip');
18
18
  const value = series.data[identifier.dataIndex];
19
+ if (value == null) {
20
+ return null;
21
+ }
19
22
  const formattedValue = series.valueFormatter(value, {
20
23
  dataIndex: identifier.dataIndex
21
24
  });
@@ -28,4 +31,14 @@ const tooltipGetter = params => {
28
31
  markType: series.labelMarkType
29
32
  };
30
33
  };
34
+ const axisTooltipGetter = series => {
35
+ return Object.values(series).map(s => s.layout === 'horizontal' ? {
36
+ direction: 'y',
37
+ axisId: s.yAxisId
38
+ } : {
39
+ direction: 'x',
40
+ axisId: s.xAxisId
41
+ });
42
+ };
43
+ exports.axisTooltipGetter = axisTooltipGetter;
31
44
  var _default = exports.default = tooltipGetter;
@@ -5,8 +5,8 @@ export type AnimationData = {
5
5
  y: number;
6
6
  width: number;
7
7
  height: number;
8
- yOrigin?: number;
9
- xOrigin?: number;
8
+ yOrigin: number;
9
+ xOrigin: number;
10
10
  layout: BarSeriesType['layout'];
11
11
  };
12
12
  export interface CompletedBarData extends AnimationData {