@mui/x-charts 8.16.0 → 8.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (485) hide show
  1. package/BarChart/AnimatedBarElement.d.ts +1 -1
  2. package/BarChart/BarChart.js +1 -0
  3. package/BarChart/BarClipPath.d.ts +1 -1
  4. package/BarChart/BarElement.d.ts +1 -1
  5. package/BarChart/BarElement.js +6 -8
  6. package/BarChart/BarLabel/BarLabel.d.ts +6 -0
  7. package/BarChart/BarLabel/BarLabel.js +41 -4
  8. package/BarChart/BarLabel/BarLabelItem.d.ts +7 -1
  9. package/BarChart/BarLabel/BarLabelItem.js +4 -2
  10. package/BarChart/BarLabel/BarLabelPlot.d.ts +2 -3
  11. package/BarChart/BarLabel/BarLabelPlot.js +42 -38
  12. package/BarChart/BarPlot.d.ts +13 -3
  13. package/BarChart/BarPlot.js +8 -3
  14. package/BarChart/seriesConfig/{extremums.d.ts → bar/extremums.d.ts} +1 -1
  15. package/BarChart/seriesConfig/{extremums.js → bar/extremums.js} +1 -1
  16. package/BarChart/seriesConfig/bar/getColor.d.ts +3 -0
  17. package/BarChart/seriesConfig/{getColor.js → bar/getColor.js} +28 -5
  18. package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +3 -0
  19. package/BarChart/seriesConfig/bar/legend.d.ts +3 -0
  20. package/BarChart/seriesConfig/{legend.js → bar/legend.js} +1 -1
  21. package/BarChart/seriesConfig/bar/seriesProcessor.d.ts +3 -0
  22. package/BarChart/seriesConfig/{seriesProcessor.js → bar/seriesProcessor.js} +1 -1
  23. package/BarChart/seriesConfig/bar/tooltip.d.ts +4 -0
  24. package/BarChart/seriesConfig/{tooltip.js → bar/tooltip.js} +1 -1
  25. package/BarChart/seriesConfig/bar/tooltipPosition.d.ts +3 -0
  26. package/BarChart/seriesConfig/{tooltipPosition.js → bar/tooltipPosition.js} +1 -1
  27. package/BarChart/seriesConfig/index.d.ts +1 -1
  28. package/BarChart/seriesConfig/index.js +9 -9
  29. package/BarChart/types.d.ts +2 -0
  30. package/BarChart/useBarPlotData.js +5 -3
  31. package/CHANGELOG.md +208 -1
  32. package/ChartDataProvider/ChartDataProvider.d.ts +1 -1
  33. package/ChartsAxis/ChartsAxis.d.ts +1 -2
  34. package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -2
  35. package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -2
  36. package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -2
  37. package/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +1 -2
  38. package/ChartsClipPath/ChartsClipPath.d.ts +1 -2
  39. package/ChartsClipPath/ChartsClipPath.js +0 -2
  40. package/ChartsGrid/ChartsGrid.d.ts +1 -2
  41. package/ChartsGrid/ChartsGrid.js +0 -2
  42. package/ChartsGrid/ChartsHorizontalGrid.d.ts +1 -2
  43. package/ChartsGrid/ChartsVerticalGrid.d.ts +1 -2
  44. package/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
  45. package/ChartsLocalizationProvider/ChartsLocalizationProvider.d.ts +1 -1
  46. package/ChartsOverlay/ChartsLoadingOverlay.d.ts +1 -2
  47. package/ChartsOverlay/ChartsLoadingOverlay.js +0 -2
  48. package/ChartsOverlay/ChartsNoDataOverlay.d.ts +1 -2
  49. package/ChartsOverlay/ChartsNoDataOverlay.js +0 -2
  50. package/ChartsOverlay/ChartsOverlay.d.ts +1 -1
  51. package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -2
  52. package/ChartsReferenceLine/ChartsReferenceLine.js +0 -2
  53. package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -2
  54. package/ChartsReferenceLine/ChartsXReferenceLine.js +0 -2
  55. package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -2
  56. package/ChartsReferenceLine/ChartsYReferenceLine.js +0 -2
  57. package/ChartsSurface/ChartsSurface.js +8 -9
  58. package/ChartsSurface/chartsSurfaceClasses.d.ts +6 -0
  59. package/ChartsSurface/chartsSurfaceClasses.js +21 -0
  60. package/ChartsSurface/index.d.ts +2 -1
  61. package/ChartsSurface/index.js +12 -1
  62. package/ChartsText/ChartsText.d.ts +1 -1
  63. package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -2
  64. package/ChartsTooltip/ChartsAxisTooltipContent.js +0 -2
  65. package/ChartsTooltip/ChartsItemTooltipContent.d.ts +1 -2
  66. package/ChartsTooltip/ChartsItemTooltipContent.js +0 -2
  67. package/ChartsTooltip/ChartsTooltip.d.ts +1 -2
  68. package/ChartsTooltip/ChartsTooltip.js +0 -2
  69. package/ChartsTooltip/ChartsTooltipContainer.d.ts +1 -1
  70. package/ChartsTooltip/ChartsTooltipContainer.js +13 -14
  71. package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
  72. package/ChartsWrapper/ChartsWrapper.d.ts +1 -1
  73. package/ChartsWrapper/ChartsWrapper.js +3 -5
  74. package/ChartsXAxis/ChartsGroupedXAxisTicks.d.ts +1 -2
  75. package/ChartsXAxis/ChartsSingleXAxisTicks.d.ts +1 -2
  76. package/ChartsXAxis/ChartsXAxis.d.ts +1 -2
  77. package/ChartsXAxis/ChartsXAxis.js +0 -2
  78. package/ChartsXAxis/ChartsXAxisImpl.d.ts +1 -2
  79. package/ChartsXAxis/useAxisTicksProps.d.ts +32 -32
  80. package/ChartsYAxis/ChartsGroupedYAxisTicks.d.ts +1 -2
  81. package/ChartsYAxis/ChartsSingleYAxisTicks.d.ts +1 -2
  82. package/ChartsYAxis/ChartsYAxis.d.ts +1 -2
  83. package/ChartsYAxis/ChartsYAxis.js +0 -2
  84. package/ChartsYAxis/ChartsYAxisImpl.d.ts +1 -2
  85. package/ChartsYAxis/useAxisTicksProps.d.ts +32 -32
  86. package/Gauge/GaugeProvider.d.ts +1 -1
  87. package/Gauge/GaugeReferenceArc.d.ts +1 -1
  88. package/Gauge/GaugeValueArc.d.ts +1 -1
  89. package/Gauge/GaugeValueText.d.ts +1 -2
  90. package/Gauge/GaugeValueText.js +0 -2
  91. package/LineChart/AnimatedArea.d.ts +1 -1
  92. package/LineChart/AppearingMask.d.ts +1 -1
  93. package/LineChart/AreaElement.d.ts +1 -1
  94. package/LineChart/AreaPlot.d.ts +1 -1
  95. package/LineChart/CircleMarkElement.d.ts +1 -1
  96. package/LineChart/FocusedMark.d.ts +1 -2
  97. package/LineChart/FocusedMark.js +0 -2
  98. package/LineChart/LineElement.d.ts +1 -1
  99. package/LineChart/LineHighlightElement.d.ts +1 -1
  100. package/LineChart/LineHighlightPlot.d.ts +1 -1
  101. package/LineChart/LinePlot.d.ts +1 -1
  102. package/LineChart/MarkElement.d.ts +1 -1
  103. package/LineChart/MarkPlot.d.ts +1 -1
  104. package/LineChart/seriesConfig/getColor.js +28 -5
  105. package/LineChart/seriesConfig/index.d.ts +1 -1
  106. package/LineChart/seriesConfig/index.js +2 -2
  107. package/PieChart/PieArcLabelPlot.d.ts +1 -1
  108. package/PieChart/PieArcPlot.d.ts +1 -1
  109. package/PieChart/PiePlot.d.ts +1 -2
  110. package/PieChart/PiePlot.js +0 -2
  111. package/PieChart/seriesConfig/index.d.ts +1 -1
  112. package/PieChart/seriesConfig/index.js +2 -2
  113. package/RadarChart/RadarAxis/RadarAxis.d.ts +1 -1
  114. package/RadarChart/RadarAxis/RadarAxis.utils.d.ts +2 -2
  115. package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.ts +1 -2
  116. package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +7 -3
  117. package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +1 -2
  118. package/RadarChart/RadarGrid/CircularRadarGrid.d.ts +1 -2
  119. package/RadarChart/RadarGrid/CircularRadarStripes.d.ts +1 -2
  120. package/RadarChart/RadarGrid/RadarGrid.d.ts +1 -2
  121. package/RadarChart/RadarGrid/SharpRadarGrid.d.ts +1 -2
  122. package/RadarChart/RadarGrid/SharpRadarStripes.d.ts +1 -2
  123. package/RadarChart/RadarMetricLabels/RadarMetricLabels.d.ts +1 -2
  124. package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +1 -1
  125. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +1 -1
  126. package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +1 -2
  127. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +1 -2
  128. package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +1 -3
  129. package/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +3 -0
  130. package/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +8 -1
  131. package/RadarChart/seriesConfig/getColor.js +12 -1
  132. package/ScatterChart/BatchScatter.d.ts +1 -2
  133. package/ScatterChart/BatchScatter.js +4 -4
  134. package/ScatterChart/Scatter.d.ts +7 -2
  135. package/ScatterChart/Scatter.js +7 -3
  136. package/ScatterChart/ScatterMarker.d.ts +1 -1
  137. package/ScatterChart/ScatterPlot.d.ts +1 -1
  138. package/ScatterChart/ScatterPlot.js +1 -1
  139. package/ScatterChart/seriesConfig/getColor.js +36 -7
  140. package/ScatterChart/seriesConfig/index.d.ts +1 -1
  141. package/ScatterChart/seriesConfig/index.js +2 -2
  142. package/context/ChartProvider/ChartProvider.d.ts +1 -1
  143. package/context/ChartProvider/ChartProvider.js +4 -4
  144. package/context/ChartProvider/ChartProvider.types.d.ts +3 -3
  145. package/context/ChartsSlotsContext.d.ts +1 -1
  146. package/esm/BarChart/AnimatedBarElement.d.ts +1 -1
  147. package/esm/BarChart/BarChart.js +1 -0
  148. package/esm/BarChart/BarClipPath.d.ts +1 -1
  149. package/esm/BarChart/BarElement.d.ts +1 -1
  150. package/esm/BarChart/BarElement.js +6 -8
  151. package/esm/BarChart/BarLabel/BarLabel.d.ts +6 -0
  152. package/esm/BarChart/BarLabel/BarLabel.js +41 -4
  153. package/esm/BarChart/BarLabel/BarLabelItem.d.ts +7 -1
  154. package/esm/BarChart/BarLabel/BarLabelItem.js +4 -2
  155. package/esm/BarChart/BarLabel/BarLabelPlot.d.ts +2 -3
  156. package/esm/BarChart/BarLabel/BarLabelPlot.js +42 -37
  157. package/esm/BarChart/BarPlot.d.ts +13 -3
  158. package/esm/BarChart/BarPlot.js +8 -3
  159. package/esm/BarChart/seriesConfig/{extremums.d.ts → bar/extremums.d.ts} +1 -1
  160. package/esm/BarChart/seriesConfig/{extremums.js → bar/extremums.js} +1 -1
  161. package/esm/BarChart/seriesConfig/bar/getColor.d.ts +3 -0
  162. package/esm/BarChart/seriesConfig/{getColor.js → bar/getColor.js} +28 -5
  163. package/esm/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +3 -0
  164. package/esm/BarChart/seriesConfig/bar/legend.d.ts +3 -0
  165. package/esm/BarChart/seriesConfig/{legend.js → bar/legend.js} +1 -1
  166. package/esm/BarChart/seriesConfig/bar/seriesProcessor.d.ts +3 -0
  167. package/esm/BarChart/seriesConfig/{seriesProcessor.js → bar/seriesProcessor.js} +1 -1
  168. package/esm/BarChart/seriesConfig/bar/tooltip.d.ts +4 -0
  169. package/esm/BarChart/seriesConfig/{tooltip.js → bar/tooltip.js} +1 -1
  170. package/esm/BarChart/seriesConfig/bar/tooltipPosition.d.ts +3 -0
  171. package/esm/BarChart/seriesConfig/{tooltipPosition.js → bar/tooltipPosition.js} +1 -1
  172. package/esm/BarChart/seriesConfig/index.d.ts +1 -1
  173. package/esm/BarChart/seriesConfig/index.js +8 -8
  174. package/esm/BarChart/types.d.ts +2 -0
  175. package/esm/BarChart/useBarPlotData.js +5 -3
  176. package/esm/ChartDataProvider/ChartDataProvider.d.ts +1 -1
  177. package/esm/ChartsAxis/ChartsAxis.d.ts +1 -2
  178. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +1 -2
  179. package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -2
  180. package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -2
  181. package/esm/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +1 -2
  182. package/esm/ChartsClipPath/ChartsClipPath.d.ts +1 -2
  183. package/esm/ChartsClipPath/ChartsClipPath.js +0 -1
  184. package/esm/ChartsGrid/ChartsGrid.d.ts +1 -2
  185. package/esm/ChartsGrid/ChartsGrid.js +0 -1
  186. package/esm/ChartsGrid/ChartsHorizontalGrid.d.ts +1 -2
  187. package/esm/ChartsGrid/ChartsVerticalGrid.d.ts +1 -2
  188. package/esm/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
  189. package/esm/ChartsLocalizationProvider/ChartsLocalizationProvider.d.ts +1 -1
  190. package/esm/ChartsOverlay/ChartsLoadingOverlay.d.ts +1 -2
  191. package/esm/ChartsOverlay/ChartsLoadingOverlay.js +0 -1
  192. package/esm/ChartsOverlay/ChartsNoDataOverlay.d.ts +1 -2
  193. package/esm/ChartsOverlay/ChartsNoDataOverlay.js +0 -1
  194. package/esm/ChartsOverlay/ChartsOverlay.d.ts +1 -1
  195. package/esm/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -2
  196. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +0 -1
  197. package/esm/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -2
  198. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +0 -1
  199. package/esm/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -2
  200. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +0 -1
  201. package/esm/ChartsSurface/ChartsSurface.js +9 -10
  202. package/esm/ChartsSurface/chartsSurfaceClasses.d.ts +6 -0
  203. package/esm/ChartsSurface/chartsSurfaceClasses.js +13 -0
  204. package/esm/ChartsSurface/index.d.ts +2 -1
  205. package/esm/ChartsSurface/index.js +2 -1
  206. package/esm/ChartsText/ChartsText.d.ts +1 -1
  207. package/esm/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -2
  208. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +0 -1
  209. package/esm/ChartsTooltip/ChartsItemTooltipContent.d.ts +1 -2
  210. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +0 -1
  211. package/esm/ChartsTooltip/ChartsTooltip.d.ts +1 -2
  212. package/esm/ChartsTooltip/ChartsTooltip.js +0 -1
  213. package/esm/ChartsTooltip/ChartsTooltipContainer.d.ts +1 -1
  214. package/esm/ChartsTooltip/ChartsTooltipContainer.js +13 -14
  215. package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
  216. package/esm/ChartsWrapper/ChartsWrapper.d.ts +1 -1
  217. package/esm/ChartsWrapper/ChartsWrapper.js +4 -6
  218. package/esm/ChartsXAxis/ChartsGroupedXAxisTicks.d.ts +1 -2
  219. package/esm/ChartsXAxis/ChartsSingleXAxisTicks.d.ts +1 -2
  220. package/esm/ChartsXAxis/ChartsXAxis.d.ts +1 -2
  221. package/esm/ChartsXAxis/ChartsXAxis.js +0 -1
  222. package/esm/ChartsXAxis/ChartsXAxisImpl.d.ts +1 -2
  223. package/esm/ChartsXAxis/useAxisTicksProps.d.ts +32 -32
  224. package/esm/ChartsYAxis/ChartsGroupedYAxisTicks.d.ts +1 -2
  225. package/esm/ChartsYAxis/ChartsSingleYAxisTicks.d.ts +1 -2
  226. package/esm/ChartsYAxis/ChartsYAxis.d.ts +1 -2
  227. package/esm/ChartsYAxis/ChartsYAxis.js +0 -1
  228. package/esm/ChartsYAxis/ChartsYAxisImpl.d.ts +1 -2
  229. package/esm/ChartsYAxis/useAxisTicksProps.d.ts +32 -32
  230. package/esm/Gauge/GaugeProvider.d.ts +1 -1
  231. package/esm/Gauge/GaugeReferenceArc.d.ts +1 -1
  232. package/esm/Gauge/GaugeValueArc.d.ts +1 -1
  233. package/esm/Gauge/GaugeValueText.d.ts +1 -2
  234. package/esm/Gauge/GaugeValueText.js +0 -1
  235. package/esm/LineChart/AnimatedArea.d.ts +1 -1
  236. package/esm/LineChart/AppearingMask.d.ts +1 -1
  237. package/esm/LineChart/AreaElement.d.ts +1 -1
  238. package/esm/LineChart/AreaPlot.d.ts +1 -1
  239. package/esm/LineChart/CircleMarkElement.d.ts +1 -1
  240. package/esm/LineChart/FocusedMark.d.ts +1 -2
  241. package/esm/LineChart/FocusedMark.js +0 -1
  242. package/esm/LineChart/LineElement.d.ts +1 -1
  243. package/esm/LineChart/LineHighlightElement.d.ts +1 -1
  244. package/esm/LineChart/LineHighlightPlot.d.ts +1 -1
  245. package/esm/LineChart/LinePlot.d.ts +1 -1
  246. package/esm/LineChart/MarkElement.d.ts +1 -1
  247. package/esm/LineChart/MarkPlot.d.ts +1 -1
  248. package/esm/LineChart/seriesConfig/getColor.js +28 -5
  249. package/esm/LineChart/seriesConfig/index.d.ts +1 -1
  250. package/esm/LineChart/seriesConfig/index.js +1 -1
  251. package/esm/PieChart/PieArcLabelPlot.d.ts +1 -1
  252. package/esm/PieChart/PieArcPlot.d.ts +1 -1
  253. package/esm/PieChart/PiePlot.d.ts +1 -2
  254. package/esm/PieChart/PiePlot.js +0 -1
  255. package/esm/PieChart/seriesConfig/index.d.ts +1 -1
  256. package/esm/PieChart/seriesConfig/index.js +1 -1
  257. package/esm/RadarChart/RadarAxis/RadarAxis.d.ts +1 -1
  258. package/esm/RadarChart/RadarAxis/RadarAxis.utils.d.ts +2 -2
  259. package/esm/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.ts +1 -2
  260. package/esm/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +7 -2
  261. package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +1 -2
  262. package/esm/RadarChart/RadarGrid/CircularRadarGrid.d.ts +1 -2
  263. package/esm/RadarChart/RadarGrid/CircularRadarStripes.d.ts +1 -2
  264. package/esm/RadarChart/RadarGrid/RadarGrid.d.ts +1 -2
  265. package/esm/RadarChart/RadarGrid/SharpRadarGrid.d.ts +1 -2
  266. package/esm/RadarChart/RadarGrid/SharpRadarStripes.d.ts +1 -2
  267. package/esm/RadarChart/RadarMetricLabels/RadarMetricLabels.d.ts +1 -2
  268. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +1 -1
  269. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +1 -1
  270. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +1 -2
  271. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.d.ts +1 -2
  272. package/esm/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +1 -2
  273. package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.d.ts +3 -0
  274. package/esm/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +8 -1
  275. package/esm/RadarChart/seriesConfig/getColor.js +12 -1
  276. package/esm/ScatterChart/BatchScatter.d.ts +1 -2
  277. package/esm/ScatterChart/BatchScatter.js +4 -4
  278. package/esm/ScatterChart/Scatter.d.ts +7 -2
  279. package/esm/ScatterChart/Scatter.js +7 -3
  280. package/esm/ScatterChart/ScatterMarker.d.ts +1 -1
  281. package/esm/ScatterChart/ScatterPlot.d.ts +1 -1
  282. package/esm/ScatterChart/ScatterPlot.js +1 -1
  283. package/esm/ScatterChart/seriesConfig/getColor.js +36 -7
  284. package/esm/ScatterChart/seriesConfig/index.d.ts +1 -1
  285. package/esm/ScatterChart/seriesConfig/index.js +1 -1
  286. package/esm/context/ChartProvider/ChartProvider.d.ts +1 -1
  287. package/esm/context/ChartProvider/ChartProvider.js +4 -4
  288. package/esm/context/ChartProvider/ChartProvider.types.d.ts +3 -3
  289. package/esm/context/ChartsSlotsContext.d.ts +1 -1
  290. package/esm/hooks/animation/useAnimateBarLabel.d.ts +1 -1
  291. package/esm/hooks/animation/useAnimateBarLabel.js +61 -12
  292. package/esm/hooks/index.d.ts +1 -0
  293. package/esm/hooks/index.js +1 -0
  294. package/esm/hooks/useAxis.d.ts +116 -16
  295. package/esm/hooks/useAxis.js +122 -18
  296. package/esm/hooks/useDataset.d.ts +6 -0
  297. package/esm/hooks/useDataset.js +13 -0
  298. package/esm/hooks/useInteractionItemProps.js +2 -5
  299. package/esm/hooks/useIsItemFocused.js +5 -3
  300. package/esm/hooks/useItemHighlighted.js +2 -2
  301. package/esm/hooks/useItemHighlightedGetter.js +0 -1
  302. package/esm/hooks/useScale.d.ts +25 -6
  303. package/esm/hooks/useScale.js +29 -8
  304. package/esm/index.js +1 -1
  305. package/esm/internals/colorScale.d.ts +1 -1
  306. package/esm/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -2
  307. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -2
  308. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +0 -1
  309. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +1 -2
  310. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +0 -1
  311. package/esm/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -2
  312. package/esm/internals/createSeriesSelectorOfType.js +5 -3
  313. package/esm/internals/getSeriesColorFn.d.ts +5 -0
  314. package/esm/internals/getSeriesColorFn.js +3 -0
  315. package/esm/internals/index.d.ts +1 -1
  316. package/esm/internals/index.js +1 -1
  317. package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.js +7 -15
  318. package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +2 -4
  319. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +28 -36
  320. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +11 -17
  321. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +27 -21
  322. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +1 -6
  323. package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +2 -4
  324. package/esm/internals/plugins/corePlugins/useChartId/useChartId.js +6 -10
  325. package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +2 -4
  326. package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +1 -3
  327. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +10 -10
  328. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +11 -7
  329. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +8 -1
  330. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +1 -0
  331. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +19 -35
  332. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +29 -57
  333. package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +2 -2
  334. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +15 -15
  335. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +21 -5
  336. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +11 -17
  337. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +12 -4
  338. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +15 -9
  339. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +62 -86
  340. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +69 -45
  341. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +14 -26
  342. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +3 -2
  343. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +17 -33
  344. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +23 -22
  345. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +9 -15
  346. package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +2 -4
  347. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +12 -16
  348. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +23 -21
  349. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +8 -7
  350. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +29 -43
  351. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +14 -28
  352. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.d.ts +7 -9
  353. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +47 -53
  354. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +22 -36
  355. package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +3 -0
  356. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +3 -5
  357. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +11 -21
  358. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +14 -26
  359. package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +11 -10
  360. package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +1 -3
  361. package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +3 -5
  362. package/esm/internals/plugins/models/plugin.d.ts +3 -2
  363. package/esm/internals/plugins/utils/selectors.d.ts +13 -17
  364. package/esm/internals/plugins/utils/selectors.js +3 -35
  365. package/esm/internals/plugins/utils/useLazySelectorEffect.d.ts +2 -2
  366. package/esm/internals/plugins/utils/useLazySelectorEffect.js +2 -2
  367. package/esm/internals/store/useCharts.d.ts +3 -4
  368. package/esm/internals/store/useCharts.js +2 -2
  369. package/esm/internals/store/useSelector.d.ts +2 -4
  370. package/esm/internals/store/useSelector.js +2 -8
  371. package/esm/internals/store/useStore.d.ts +3 -5
  372. package/esm/locales/index.d.ts +2 -1
  373. package/esm/locales/index.js +1 -0
  374. package/esm/locales/nbNO.d.ts +115 -0
  375. package/esm/locales/nbNO.js +113 -0
  376. package/esm/models/seriesType/bar.d.ts +16 -0
  377. package/esm/models/seriesType/common.d.ts +22 -6
  378. package/esm/models/seriesType/config.d.ts +7 -16
  379. package/hooks/animation/useAnimateBarLabel.d.ts +1 -1
  380. package/hooks/animation/useAnimateBarLabel.js +61 -12
  381. package/hooks/index.d.ts +1 -0
  382. package/hooks/index.js +12 -0
  383. package/hooks/useAxis.d.ts +116 -16
  384. package/hooks/useAxis.js +122 -18
  385. package/hooks/useDataset.d.ts +6 -0
  386. package/hooks/useDataset.js +18 -0
  387. package/hooks/useInteractionItemProps.js +2 -5
  388. package/hooks/useIsItemFocused.js +5 -3
  389. package/hooks/useItemHighlighted.js +2 -2
  390. package/hooks/useScale.d.ts +25 -6
  391. package/hooks/useScale.js +29 -8
  392. package/index.js +1 -1
  393. package/internals/colorScale.d.ts +1 -1
  394. package/internals/components/ChartsAxesGradients/ChartsAxesGradients.d.ts +1 -2
  395. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.d.ts +1 -2
  396. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +0 -2
  397. package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.d.ts +1 -2
  398. package/internals/components/ChartsAxesGradients/ChartsContinuousGradientObjectBound.js +0 -2
  399. package/internals/components/ChartsAxesGradients/ChartsPiecewiseGradient.d.ts +1 -2
  400. package/internals/createSeriesSelectorOfType.js +6 -3
  401. package/internals/getSeriesColorFn.d.ts +5 -0
  402. package/internals/getSeriesColorFn.js +9 -0
  403. package/internals/index.d.ts +1 -1
  404. package/internals/index.js +1 -1
  405. package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.js +7 -15
  406. package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +2 -4
  407. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +28 -36
  408. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +11 -17
  409. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +27 -21
  410. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +1 -6
  411. package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +2 -4
  412. package/internals/plugins/corePlugins/useChartId/useChartId.js +6 -10
  413. package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +2 -4
  414. package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +1 -3
  415. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +10 -10
  416. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +11 -7
  417. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +9 -2
  418. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +1 -0
  419. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +19 -35
  420. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +29 -57
  421. package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +2 -2
  422. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +15 -15
  423. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +22 -6
  424. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +11 -17
  425. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +12 -4
  426. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +14 -8
  427. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +62 -86
  428. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +70 -46
  429. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +14 -26
  430. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +3 -2
  431. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +17 -33
  432. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +23 -23
  433. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +9 -15
  434. package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +2 -4
  435. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +12 -16
  436. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +23 -21
  437. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +8 -7
  438. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +29 -43
  439. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +14 -28
  440. package/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.d.ts +7 -9
  441. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +47 -53
  442. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +22 -36
  443. package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +4 -1
  444. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +3 -5
  445. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +11 -21
  446. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +14 -26
  447. package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +12 -10
  448. package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.js +1 -3
  449. package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +3 -5
  450. package/internals/plugins/models/plugin.d.ts +3 -2
  451. package/internals/plugins/utils/selectors.d.ts +13 -17
  452. package/internals/plugins/utils/selectors.js +3 -35
  453. package/internals/plugins/utils/useLazySelectorEffect.d.ts +2 -2
  454. package/internals/plugins/utils/useLazySelectorEffect.js +2 -2
  455. package/internals/store/useCharts.d.ts +3 -4
  456. package/internals/store/useCharts.js +2 -2
  457. package/internals/store/useSelector.d.ts +2 -4
  458. package/internals/store/useSelector.js +2 -10
  459. package/internals/store/useStore.d.ts +3 -5
  460. package/locales/index.d.ts +2 -1
  461. package/locales/index.js +11 -0
  462. package/locales/nbNO.d.ts +115 -0
  463. package/locales/nbNO.js +119 -0
  464. package/models/seriesType/bar.d.ts +16 -0
  465. package/models/seriesType/common.d.ts +22 -6
  466. package/models/seriesType/config.d.ts +7 -16
  467. package/package.json +5 -5
  468. package/BarChart/seriesConfig/getColor.d.ts +0 -3
  469. package/BarChart/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
  470. package/BarChart/seriesConfig/legend.d.ts +0 -3
  471. package/BarChart/seriesConfig/seriesProcessor.d.ts +0 -3
  472. package/BarChart/seriesConfig/tooltip.d.ts +0 -4
  473. package/BarChart/seriesConfig/tooltipPosition.d.ts +0 -3
  474. package/esm/BarChart/seriesConfig/getColor.d.ts +0 -3
  475. package/esm/BarChart/seriesConfig/getSeriesWithDefaultValues.d.ts +0 -3
  476. package/esm/BarChart/seriesConfig/legend.d.ts +0 -3
  477. package/esm/BarChart/seriesConfig/seriesProcessor.d.ts +0 -3
  478. package/esm/BarChart/seriesConfig/tooltip.d.ts +0 -4
  479. package/esm/BarChart/seriesConfig/tooltipPosition.d.ts +0 -3
  480. package/esm/internals/plugins/utils/ChartStore.d.ts +0 -13
  481. package/esm/internals/plugins/utils/ChartStore.js +0 -22
  482. package/internals/plugins/utils/ChartStore.d.ts +0 -13
  483. package/internals/plugins/utils/ChartStore.js +0 -29
  484. /package/BarChart/seriesConfig/{getSeriesWithDefaultValues.js → bar/getSeriesWithDefaultValues.js} +0 -0
  485. /package/esm/BarChart/seriesConfig/{getSeriesWithDefaultValues.js → bar/getSeriesWithDefaultValues.js} +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
4
4
  import _extends from "@babel/runtime/helpers/esm/extends";
5
- const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes", "skipAnimation", "layout", "xOrigin", "yOrigin"];
5
+ const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes", "skipAnimation", "layout", "xOrigin", "yOrigin", "placement"];
6
6
  import * as React from 'react';
7
7
  import { styled, useThemeProps } from '@mui/material/styles';
8
8
  import PropTypes from 'prop-types';
@@ -23,8 +23,6 @@ export const BarLabelComponent = styled('text', {
23
23
  stroke: 'none',
24
24
  fill: (theme.vars || theme)?.palette?.text?.primary,
25
25
  transition: 'opacity 0.2s ease-in, fill 0.2s ease-in',
26
- textAnchor: 'middle',
27
- dominantBaseline: 'central',
28
26
  pointerEvents: 'none',
29
27
  opacity: 1,
30
28
  [`&.${barLabelClasses.faded}`]: {
@@ -38,7 +36,40 @@ function BarLabel(inProps) {
38
36
  });
39
37
  const otherProps = _objectWithoutPropertiesLoose(props, _excluded);
40
38
  const animatedProps = useAnimateBarLabel(props);
41
- return /*#__PURE__*/_jsx(BarLabelComponent, _extends({}, otherProps, animatedProps));
39
+ const textAnchor = getTextAnchor(props);
40
+ const dominantBaseline = getDominantBaseline(props);
41
+ return /*#__PURE__*/_jsx(BarLabelComponent, _extends({
42
+ textAnchor: textAnchor,
43
+ dominantBaseline: dominantBaseline
44
+ }, otherProps, animatedProps));
45
+ }
46
+ function getTextAnchor({
47
+ placement,
48
+ layout,
49
+ xOrigin,
50
+ x
51
+ }) {
52
+ if (placement === 'outside') {
53
+ if (layout === 'horizontal') {
54
+ return x < xOrigin ? 'end' : 'start';
55
+ }
56
+ return 'middle';
57
+ }
58
+ return 'middle';
59
+ }
60
+ function getDominantBaseline({
61
+ placement,
62
+ layout,
63
+ yOrigin,
64
+ y
65
+ }) {
66
+ if (placement === 'outside') {
67
+ if (layout === 'horizontal') {
68
+ return 'central';
69
+ }
70
+ return y < yOrigin ? 'auto' : 'hanging';
71
+ }
72
+ return 'central';
42
73
  }
43
74
  process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
44
75
  // ----------------------------- Warning --------------------------------
@@ -54,6 +85,12 @@ process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
54
85
  isFaded: PropTypes.bool.isRequired,
55
86
  isHighlighted: PropTypes.bool.isRequired,
56
87
  layout: PropTypes.oneOf(['horizontal', 'vertical']).isRequired,
88
+ /**
89
+ * The placement of the bar label.
90
+ * It controls whether the label is rendered in the center or outside the bar.
91
+ * @default 'center'
92
+ */
93
+ placement: PropTypes.oneOf(['center', 'outside']),
57
94
  seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
58
95
  skipAnimation: PropTypes.bool.isRequired,
59
96
  /**
@@ -67,11 +67,17 @@ export type BarLabelItemProps = Omit<BarLabelOwnerState, 'isFaded' | 'isHighligh
67
67
  * @returns {string} The formatted label.
68
68
  */
69
69
  barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
70
+ /**
71
+ * The placement of the bar label.
72
+ * It controls whether the label is rendered in the center or outside the bar.
73
+ * @default 'center'
74
+ */
75
+ barLabelPlacement?: BarLabelProps['placement'];
70
76
  };
71
77
  /**
72
78
  * @ignore - internal component.
73
79
  */
74
- declare function BarLabelItem(props: BarLabelItemProps): React.JSX.Element | null;
80
+ declare function BarLabelItem(props: BarLabelItemProps): import("react/jsx-runtime").JSX.Element | null;
75
81
  declare namespace BarLabelItem {
76
82
  var propTypes: any;
77
83
  }
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["seriesId", "classes", "color", "dataIndex", "barLabel", "slots", "slotProps", "xOrigin", "yOrigin", "x", "y", "width", "height", "value", "skipAnimation", "layout"],
3
+ const _excluded = ["seriesId", "classes", "color", "dataIndex", "barLabel", "slots", "slotProps", "xOrigin", "yOrigin", "x", "y", "width", "height", "value", "skipAnimation", "layout", "barLabelPlacement"],
4
4
  _excluded2 = ["ownerState"];
5
5
  import * as React from 'react';
6
6
  import useSlotProps from '@mui/utils/useSlotProps';
@@ -30,7 +30,8 @@ function BarLabelItem(props) {
30
30
  height,
31
31
  value,
32
32
  skipAnimation,
33
- layout
33
+ layout,
34
+ barLabelPlacement
34
35
  } = props,
35
36
  other = _objectWithoutPropertiesLoose(props, _excluded);
36
37
  const {
@@ -62,6 +63,7 @@ function BarLabelItem(props) {
62
63
  y,
63
64
  width,
64
65
  height,
66
+ placement: barLabelPlacement,
65
67
  className: classes.root
66
68
  }),
67
69
  ownerState
@@ -1,13 +1,12 @@
1
- import * as React from 'react';
2
1
  import type { ProcessedBarSeriesData } from "../types.js";
3
2
  import { BarLabelItemProps } from "./BarLabelItem.js";
4
3
  type BarLabelPlotProps = {
5
- bars: ProcessedBarSeriesData[];
4
+ processedSeries: ProcessedBarSeriesData;
6
5
  skipAnimation?: boolean;
7
6
  barLabel?: BarLabelItemProps['barLabel'];
8
7
  };
9
8
  /**
10
9
  * @ignore - internal component.
11
10
  */
12
- declare function BarLabelPlot(props: BarLabelPlotProps): React.JSX.Element;
11
+ declare function BarLabelPlot(props: BarLabelPlotProps): import("react/jsx-runtime").JSX.Element | null;
13
12
  export { BarLabelPlot };
@@ -1,7 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["bars", "skipAnimation"];
4
- import * as React from 'react';
3
+ const _excluded = ["processedSeries", "skipAnimation"];
5
4
  import { BarLabelItem } from "./BarLabelItem.js";
6
5
  import { useUtilityClasses } from "../barClasses.js";
7
6
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -10,44 +9,50 @@ import { jsx as _jsx } from "react/jsx-runtime";
10
9
  */
11
10
  function BarLabelPlot(props) {
12
11
  const {
13
- bars,
12
+ processedSeries,
14
13
  skipAnimation
15
14
  } = props,
16
15
  other = _objectWithoutPropertiesLoose(props, _excluded);
16
+ const {
17
+ seriesId,
18
+ data
19
+ } = processedSeries;
17
20
  const classes = useUtilityClasses();
18
- return /*#__PURE__*/_jsx(React.Fragment, {
19
- children: bars.flatMap(({
20
- seriesId,
21
- data
22
- }) => /*#__PURE__*/_jsx("g", {
23
- className: classes.seriesLabels,
24
- "data-series": seriesId,
25
- children: data.map(({
26
- xOrigin,
27
- yOrigin,
28
- x,
29
- y,
30
- dataIndex,
31
- color,
32
- value,
33
- width,
34
- height,
35
- layout
36
- }) => /*#__PURE__*/_jsx(BarLabelItem, _extends({
37
- seriesId: seriesId,
38
- dataIndex: dataIndex,
39
- value: value,
40
- color: color,
41
- xOrigin: xOrigin,
42
- yOrigin: yOrigin,
43
- x: x,
44
- y: y,
45
- width: width,
46
- height: height,
47
- skipAnimation: skipAnimation ?? false,
48
- layout: layout ?? 'vertical'
49
- }, other), dataIndex))
50
- }, seriesId))
51
- });
21
+ const barLabel = processedSeries.barLabel ?? props.barLabel;
22
+ if (!barLabel) {
23
+ return null;
24
+ }
25
+ return /*#__PURE__*/_jsx("g", {
26
+ className: classes.seriesLabels,
27
+ "data-series": seriesId,
28
+ children: data.map(({
29
+ xOrigin,
30
+ yOrigin,
31
+ x,
32
+ y,
33
+ dataIndex,
34
+ color,
35
+ value,
36
+ width,
37
+ height,
38
+ layout
39
+ }) => /*#__PURE__*/_jsx(BarLabelItem, _extends({
40
+ seriesId: seriesId,
41
+ dataIndex: dataIndex,
42
+ value: value,
43
+ color: color,
44
+ xOrigin: xOrigin,
45
+ yOrigin: yOrigin,
46
+ x: x,
47
+ y: y,
48
+ width: width,
49
+ height: height,
50
+ skipAnimation: skipAnimation ?? false,
51
+ layout: layout ?? 'vertical'
52
+ }, other, {
53
+ barLabel: barLabel,
54
+ barLabelPlacement: processedSeries.barLabelPlacement || 'center'
55
+ }), dataIndex))
56
+ }, seriesId);
52
57
  }
53
58
  export { BarLabelPlot };
@@ -1,10 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { BarElementSlotProps, BarElementSlots } from "./BarElement.js";
3
3
  import { BarItemIdentifier } from "../models/index.js";
4
- import { BarLabelItemProps, BarLabelSlotProps, BarLabelSlots } from "./BarLabel/BarLabelItem.js";
4
+ import { BarLabelSlotProps, BarLabelSlots } from "./BarLabel/BarLabelItem.js";
5
+ import { BarItem, BarLabelContext } from "./BarLabel/index.js";
5
6
  export interface BarPlotSlots extends BarElementSlots, BarLabelSlots {}
6
7
  export interface BarPlotSlotProps extends BarElementSlotProps, BarLabelSlotProps {}
7
- export interface BarPlotProps extends Pick<BarLabelItemProps, 'barLabel'> {
8
+ export interface BarPlotProps {
8
9
  /**
9
10
  * If `true`, animations are skipped.
10
11
  * @default undefined
@@ -20,6 +21,15 @@ export interface BarPlotProps extends Pick<BarLabelItemProps, 'barLabel'> {
20
21
  * Defines the border radius of the bar element.
21
22
  */
22
23
  borderRadius?: number;
24
+ /**
25
+ * @deprecated Use `barLabel` in the chart series instead.
26
+ * If provided, the function will be used to format the label of the bar.
27
+ * It can be set to 'value' to display the current value.
28
+ * @param {BarItem} item The item to format.
29
+ * @param {BarLabelContext} context data about the bar.
30
+ * @returns {string} The formatted label.
31
+ */
32
+ barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
23
33
  /**
24
34
  * The props used for each component slot.
25
35
  * @default {}
@@ -42,7 +52,7 @@ export interface BarPlotProps extends Pick<BarLabelItemProps, 'barLabel'> {
42
52
  *
43
53
  * - [BarPlot API](https://mui.com/x/api/charts/bar-plot/)
44
54
  */
45
- declare function BarPlot(props: BarPlotProps): React.JSX.Element;
55
+ declare function BarPlot(props: BarPlotProps): import("react/jsx-runtime").JSX.Element;
46
56
  declare namespace BarPlot {
47
57
  var propTypes: any;
48
58
  }
@@ -135,11 +135,11 @@ function BarPlot(props) {
135
135
  }, dataIndex);
136
136
  })
137
137
  }, seriesId);
138
- }), barLabel && /*#__PURE__*/_jsx(BarLabelPlot, _extends({
139
- bars: completedData,
138
+ }), completedData.map(processedSeries => /*#__PURE__*/_jsx(BarLabelPlot, _extends({
139
+ processedSeries: processedSeries,
140
140
  skipAnimation: skipAnimation,
141
141
  barLabel: barLabel
142
- }, other))]
142
+ }, other), processedSeries.seriesId))]
143
143
  });
144
144
  }
145
145
  process.env.NODE_ENV !== "production" ? BarPlot.propTypes = {
@@ -155,6 +155,11 @@ process.env.NODE_ENV !== "production" ? BarPlot.propTypes = {
155
155
  * @returns {string} The formatted label.
156
156
  */
157
157
  barLabel: PropTypes.oneOfType([PropTypes.oneOf(['value']), PropTypes.func]),
158
+ /**
159
+ * The placement of the bar label.
160
+ * It controls whether the label is rendered inside or outside the bar.
161
+ */
162
+ barLabelPlacement: PropTypes.oneOf(['outside', 'inside']),
158
163
  /**
159
164
  * Defines the border radius of the bar element.
160
165
  */
@@ -1,3 +1,3 @@
1
- import { CartesianExtremumGetter } from "../../internals/plugins/models/seriesConfig/index.js";
1
+ import { CartesianExtremumGetter } from "../../../internals/plugins/models/seriesConfig/index.js";
2
2
  export declare const getExtremumX: CartesianExtremumGetter<'bar'>;
3
3
  export declare const getExtremumY: CartesianExtremumGetter<'bar'>;
@@ -1,4 +1,4 @@
1
- import { findMinMax } from "../../internals/findMinMax.js";
1
+ import { findMinMax } from "../../../internals/findMinMax.js";
2
2
  const createResult = (data, direction) => {
3
3
  if (direction === 'x') {
4
4
  return {
@@ -0,0 +1,3 @@
1
+ import { ColorProcessor } from "../../../internals/plugins/models/index.js";
2
+ declare const getColor: ColorProcessor<'bar'>;
3
+ export default getColor;
@@ -1,17 +1,25 @@
1
+ import { getSeriesColorFn } from "../../../internals/getSeriesColorFn.js";
1
2
  const getColor = (series, xAxis, yAxis) => {
2
3
  const verticalLayout = series.layout === 'vertical';
3
4
  const bandColorScale = verticalLayout ? xAxis?.colorScale : yAxis?.colorScale;
4
5
  const valueColorScale = verticalLayout ? yAxis?.colorScale : xAxis?.colorScale;
5
6
  const bandValues = verticalLayout ? xAxis?.data : yAxis?.data;
7
+ const getSeriesColor = getSeriesColorFn(series);
6
8
  if (valueColorScale) {
7
9
  return dataIndex => {
8
10
  if (dataIndex === undefined) {
9
11
  return series.color;
10
12
  }
11
13
  const value = series.data[dataIndex];
12
- const color = value === null ? series.color : valueColorScale(value);
14
+ const color = value === null ? getSeriesColor({
15
+ value,
16
+ dataIndex
17
+ }) : valueColorScale(value);
13
18
  if (color === null) {
14
- return series.color;
19
+ return getSeriesColor({
20
+ value,
21
+ dataIndex
22
+ });
15
23
  }
16
24
  return color;
17
25
  };
@@ -22,13 +30,28 @@ const getColor = (series, xAxis, yAxis) => {
22
30
  return series.color;
23
31
  }
24
32
  const value = bandValues[dataIndex];
25
- const color = value === null ? series.color : bandColorScale(value);
33
+ const color = value === null ? getSeriesColor({
34
+ value,
35
+ dataIndex
36
+ }) : bandColorScale(value);
26
37
  if (color === null) {
27
- return series.color;
38
+ return getSeriesColor({
39
+ value,
40
+ dataIndex
41
+ });
28
42
  }
29
43
  return color;
30
44
  };
31
45
  }
32
- return () => series.color;
46
+ return dataIndex => {
47
+ if (dataIndex === undefined) {
48
+ return series.color;
49
+ }
50
+ const value = series.data[dataIndex];
51
+ return getSeriesColor({
52
+ value,
53
+ dataIndex
54
+ });
55
+ };
33
56
  };
34
57
  export default getColor;
@@ -0,0 +1,3 @@
1
+ import type { GetSeriesWithDefaultValues } from "../../../internals/plugins/models/seriesConfig/index.js";
2
+ declare const getSeriesWithDefaultValues: GetSeriesWithDefaultValues<'bar'>;
3
+ export default getSeriesWithDefaultValues;
@@ -0,0 +1,3 @@
1
+ import { LegendGetter } from "../../../internals/plugins/models/index.js";
2
+ declare const legendGetter: LegendGetter<'bar'>;
3
+ export default legendGetter;
@@ -1,4 +1,4 @@
1
- import { getLabel } from "../../internals/getLabel.js";
1
+ import { getLabel } from "../../../internals/getLabel.js";
2
2
  const legendGetter = params => {
3
3
  const {
4
4
  seriesOrder,
@@ -0,0 +1,3 @@
1
+ import { SeriesProcessor } from "../../../internals/plugins/models/index.js";
2
+ declare const seriesProcessor: SeriesProcessor<'bar'>;
3
+ export default seriesProcessor;
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
3
3
  import { warnOnce } from '@mui/x-internals/warning';
4
- import { getStackingGroups } from "../../internals/stackSeries.js";
4
+ import { getStackingGroups } from "../../../internals/stackSeries.js";
5
5
  const barValueFormatter = v => v == null ? '' : v.toLocaleString();
6
6
  const seriesProcessor = (params, dataset) => {
7
7
  const {
@@ -0,0 +1,4 @@
1
+ import type { AxisTooltipGetter, TooltipGetter } from "../../../internals/plugins/models/index.js";
2
+ declare const tooltipGetter: TooltipGetter<'bar'>;
3
+ export declare const axisTooltipGetter: AxisTooltipGetter<'bar', 'x' | 'y'>;
4
+ export default tooltipGetter;
@@ -1,4 +1,4 @@
1
- import { getLabel } from "../../internals/getLabel.js";
1
+ import { getLabel } from "../../../internals/getLabel.js";
2
2
  const tooltipGetter = params => {
3
3
  const {
4
4
  series,
@@ -0,0 +1,3 @@
1
+ import type { TooltipItemPositionGetter } from "../../../internals/plugins/models/seriesConfig/tooltipItemPositionGetter.types.js";
2
+ declare const tooltipItemPositionGetter: TooltipItemPositionGetter<'bar'>;
3
+ export default tooltipItemPositionGetter;
@@ -1,4 +1,4 @@
1
- import { getBarDimensions } from "../useBarPlotData.js";
1
+ import { getBarDimensions } from "../../useBarPlotData.js";
2
2
  const tooltipItemPositionGetter = params => {
3
3
  const {
4
4
  series,
@@ -1,2 +1,2 @@
1
1
  import { ChartSeriesTypeConfig } from "../../internals/plugins/models/seriesConfig/index.js";
2
- export declare const seriesConfig: ChartSeriesTypeConfig<'bar'>;
2
+ export declare const barSeriesConfig: ChartSeriesTypeConfig<'bar'>;
@@ -1,11 +1,11 @@
1
- import { getExtremumX, getExtremumY } from "./extremums.js";
2
- import seriesProcessor from "./seriesProcessor.js";
3
- import legendGetter from "./legend.js";
4
- import getColor from "./getColor.js";
5
- import tooltipGetter, { axisTooltipGetter } from "./tooltip.js";
6
- import tooltipItemPositionGetter from "./tooltipPosition.js";
7
- import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
8
- export const seriesConfig = {
1
+ import { getExtremumX, getExtremumY } from "./bar/extremums.js";
2
+ import seriesProcessor from "./bar/seriesProcessor.js";
3
+ import legendGetter from "./bar/legend.js";
4
+ import getColor from "./bar/getColor.js";
5
+ import tooltipGetter, { axisTooltipGetter } from "./bar/tooltip.js";
6
+ import tooltipItemPositionGetter from "./bar/tooltipPosition.js";
7
+ import getSeriesWithDefaultValues from "./bar/getSeriesWithDefaultValues.js";
8
+ export const barSeriesConfig = {
9
9
  seriesProcessor,
10
10
  colorProcessor: getColor,
11
11
  legendGetter,
@@ -12,6 +12,8 @@ export type AnimationData = {
12
12
  export interface ProcessedBarSeriesData {
13
13
  seriesId: SeriesId;
14
14
  data: ProcessedBarData[];
15
+ barLabel?: BarSeriesType['barLabel'];
16
+ barLabelPlacement?: BarSeriesType['barLabelPlacement'];
15
17
  }
16
18
  export interface ProcessedBarData extends AnimationData {
17
19
  seriesId: SeriesId;
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import getColor from "./seriesConfig/getColor.js";
2
+ import getColor from "./seriesConfig/bar/getColor.js";
3
3
  import { useChartId, useXAxes, useYAxes } from "../hooks/index.js";
4
4
  import { checkScaleErrors } from "./checkScaleErrors.js";
5
5
  import { useBarSeriesContext } from "../hooks/useBarSeries.js";
@@ -55,8 +55,8 @@ export function useBarPlotData(drawingArea, xAxes, yAxes) {
55
55
  seriesId,
56
56
  dataIndex,
57
57
  layout: series[seriesId].layout,
58
- xOrigin: xScale(0) ?? 0,
59
- yOrigin: yScale(0) ?? 0
58
+ xOrigin: Math.round(xScale(0) ?? 0),
59
+ yOrigin: Math.round(yScale(0) ?? 0)
60
60
  }, barDimensions, {
61
61
  color: colorGetter(dataIndex),
62
62
  value: series[seriesId].data[dataIndex],
@@ -91,6 +91,8 @@ export function useBarPlotData(drawingArea, xAxes, yAxes) {
91
91
  }
92
92
  return {
93
93
  seriesId,
94
+ barLabel: series[seriesId].barLabel,
95
+ barLabelPlacement: series[seriesId].barLabelPlacement,
94
96
  data: seriesDataPoints
95
97
  };
96
98
  });
@@ -42,7 +42,7 @@ export type ChartDataProviderProps<TSeries extends ChartSeriesType = ChartSeries
42
42
  * </ChartDataProvider>
43
43
  * ```
44
44
  */
45
- declare function ChartDataProvider<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartDataProviderProps<TSeries, TSignatures>): React.JSX.Element;
45
+ declare function ChartDataProvider<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartDataProviderProps<TSeries, TSignatures>): import("react/jsx-runtime").JSX.Element;
46
46
  declare namespace ChartDataProvider {
47
47
  var propTypes: any;
48
48
  }
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { ChartsAxisSlotProps, ChartsAxisSlots } from "../models/axis.js";
3
2
  export interface ChartsAxisProps {
4
3
  /**
@@ -21,7 +20,7 @@ export interface ChartsAxisProps {
21
20
  *
22
21
  * - [ChartsAxis API](https://mui.com/x/api/charts/charts-axis/)
23
22
  */
24
- declare function ChartsAxis(props: ChartsAxisProps): React.JSX.Element;
23
+ declare function ChartsAxis(props: ChartsAxisProps): import("react/jsx-runtime").JSX.Element;
25
24
  declare namespace ChartsAxis {
26
25
  var propTypes: any;
27
26
  }
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { ChartsAxisHighlightProps } from "./ChartsAxisHighlight.types.js";
3
2
  /**
4
3
  * Demos:
@@ -9,7 +8,7 @@ import { ChartsAxisHighlightProps } from "./ChartsAxisHighlight.types.js";
9
8
  *
10
9
  * - [ChartsAxisHighlight API](https://mui.com/x/api/charts/charts-axis-highlight/)
11
10
  */
12
- declare function ChartsAxisHighlight(props: ChartsAxisHighlightProps): React.JSX.Element;
11
+ declare function ChartsAxisHighlight(props: ChartsAxisHighlightProps): import("react/jsx-runtime").JSX.Element;
13
12
  declare namespace ChartsAxisHighlight {
14
13
  var propTypes: any;
15
14
  }
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { ChartsAxisHighlightType } from "./ChartsAxisHighlight.types.js";
3
2
  import { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.js";
4
3
  /**
@@ -7,4 +6,4 @@ import { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.js";
7
6
  export default function ChartsXHighlight(props: {
8
7
  type: ChartsAxisHighlightType;
9
8
  classes: ChartsAxisHighlightClasses;
10
- }): React.JSX.Element[] | null;
9
+ }): import("react/jsx-runtime").JSX.Element[] | null;
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { ChartsAxisHighlightType } from "./ChartsAxisHighlight.types.js";
3
2
  import { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.js";
4
3
  /**
@@ -7,4 +6,4 @@ import { ChartsAxisHighlightClasses } from "./chartsAxisHighlightClasses.js";
7
6
  export default function ChartsYHighlight(props: {
8
7
  type: ChartsAxisHighlightType;
9
8
  classes: ChartsAxisHighlightClasses;
10
- }): React.JSX.Element[] | null;
9
+ }): import("react/jsx-runtime").JSX.Element[] | null;
@@ -1,6 +1,5 @@
1
- import * as React from 'react';
2
1
  export interface ChartsBrushOverlayProps {}
3
2
  /**
4
3
  * Component that renders visual feedback during brush interaction
5
4
  */
6
- export declare function ChartsBrushOverlay(props: ChartsBrushOverlayProps): React.JSX.Element | null;
5
+ export declare function ChartsBrushOverlay(props: ChartsBrushOverlayProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  export type ChartsClipPathProps = {
3
2
  /**
4
3
  * The id of the clip path.
@@ -21,7 +20,7 @@ export type ChartsClipPathProps = {
21
20
  *
22
21
  * - [ChartsClipPath API](https://mui.com/x/api/charts/charts-clip-path/)
23
22
  */
24
- declare function ChartsClipPath(props: ChartsClipPathProps): React.JSX.Element;
23
+ declare function ChartsClipPath(props: ChartsClipPathProps): import("react/jsx-runtime").JSX.Element;
25
24
  declare namespace ChartsClipPath {
26
25
  var propTypes: any;
27
26
  }
@@ -1,7 +1,6 @@
1
1
  'use client';
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
- import * as React from 'react';
5
4
  import PropTypes from 'prop-types';
6
5
  import { useDrawingArea } from "../hooks/useDrawingArea.js";
7
6
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { ChartsGridClasses } from "./chartsGridClasses.js";
3
2
  export interface ChartsGridProps {
4
3
  /**
@@ -23,7 +22,7 @@ export interface ChartsGridProps {
23
22
  *
24
23
  * - [ChartsGrid API](https://mui.com/x/api/charts/charts-axis/)
25
24
  */
26
- declare function ChartsGrid(inProps: ChartsGridProps): React.JSX.Element;
25
+ declare function ChartsGrid(inProps: ChartsGridProps): import("react/jsx-runtime").JSX.Element;
27
26
  declare namespace ChartsGrid {
28
27
  var propTypes: any;
29
28
  }
@@ -3,7 +3,6 @@
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
5
  const _excluded = ["vertical", "horizontal"];
6
- import * as React from 'react';
7
6
  import PropTypes from 'prop-types';
8
7
  import composeClasses from '@mui/utils/composeClasses';
9
8
  import { useThemeProps } from '@mui/material/styles';
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { ComputedYAxis } from "../models/axis.js";
3
2
  import { ChartsGridClasses } from "./chartsGridClasses.js";
4
3
  interface ChartsGridHorizontalProps {
@@ -10,5 +9,5 @@ interface ChartsGridHorizontalProps {
10
9
  /**
11
10
  * @ignore - internal component.
12
11
  */
13
- export declare function ChartsGridHorizontal(props: ChartsGridHorizontalProps): React.JSX.Element;
12
+ export declare function ChartsGridHorizontal(props: ChartsGridHorizontalProps): import("react/jsx-runtime").JSX.Element;
14
13
  export {};
@@ -1,4 +1,3 @@
1
- import * as React from 'react';
2
1
  import { ComputedXAxis } from "../models/axis.js";
3
2
  import { ChartsGridClasses } from "./chartsGridClasses.js";
4
3
  interface ChartsGridVerticalProps {
@@ -10,5 +9,5 @@ interface ChartsGridVerticalProps {
10
9
  /**
11
10
  * @ignore - internal component.
12
11
  */
13
- export declare function ChartsGridVertical(props: ChartsGridVerticalProps): React.JSX.Element;
12
+ export declare function ChartsGridVertical(props: ChartsGridVerticalProps): import("react/jsx-runtime").JSX.Element;
14
13
  export {};