@mui/x-charts 8.0.0-alpha.12 → 8.0.0-alpha.13

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 (314) hide show
  1. package/BarChart/BarChart.d.ts +1 -1
  2. package/BarChart/BarChart.js +14 -30
  3. package/BarChart/useBarChartProps.js +3 -18
  4. package/CHANGELOG.md +299 -0
  5. package/ChartContainer/ChartContainer.d.ts +1 -1
  6. package/ChartContainer/ChartContainer.js +15 -7
  7. package/ChartDataProvider/ChartDataProvider.d.ts +2 -2
  8. package/ChartDataProvider/ChartDataProvider.js +4 -3
  9. package/ChartsAxis/ChartsAxis.d.ts +1 -25
  10. package/ChartsAxis/ChartsAxis.js +25 -87
  11. package/ChartsAxis/axisClasses.d.ts +5 -1
  12. package/ChartsLabel/ChartsLabelMark.d.ts +6 -1
  13. package/ChartsLabel/ChartsLabelMark.js +15 -2
  14. package/ChartsLabel/index.d.ts +1 -1
  15. package/ChartsLabel/labelGradientClasses.d.ts +1 -1
  16. package/ChartsLabel/labelMarkClasses.d.ts +1 -1
  17. package/ChartsLabel/labelMarkClasses.js +1 -1
  18. package/ChartsLegend/chartsLegendClasses.d.ts +1 -1
  19. package/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
  20. package/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
  21. package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
  22. package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
  23. package/ChartsTooltip/ChartsTooltipTable.js +1 -1
  24. package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
  25. package/ChartsXAxis/ChartsXAxis.js +70 -57
  26. package/ChartsYAxis/ChartsYAxis.js +11 -15
  27. package/Gauge/Gauge.js +4 -3
  28. package/Gauge/GaugeContainer.js +7 -5
  29. package/LineChart/LineChart.d.ts +1 -1
  30. package/LineChart/LineChart.js +14 -30
  31. package/LineChart/useLineChartProps.js +2 -17
  32. package/PieChart/PieArcLabelPlot.js +1 -1
  33. package/PieChart/PieArcPlot.js +1 -1
  34. package/PieChart/PieChart.d.ts +1 -1
  35. package/PieChart/PieChart.js +6 -4
  36. package/ScatterChart/ScatterChart.d.ts +1 -1
  37. package/ScatterChart/ScatterChart.js +14 -30
  38. package/ScatterChart/useScatterChartProps.js +2 -17
  39. package/SparkLineChart/SparkLineChart.d.ts +4 -8
  40. package/SparkLineChart/SparkLineChart.js +23 -21
  41. package/constants/index.d.ts +8 -1
  42. package/constants/index.js +13 -6
  43. package/context/AnimationProvider/useSkipAnimation.js +1 -1
  44. package/context/ChartProvider/ChartProvider.types.d.ts +6 -6
  45. package/context/PolarProvider/Polar.types.d.ts +3 -2
  46. package/esm/BarChart/BarChart.d.ts +1 -1
  47. package/esm/BarChart/BarChart.js +14 -30
  48. package/esm/BarChart/useBarChartProps.js +3 -18
  49. package/esm/ChartContainer/ChartContainer.d.ts +1 -1
  50. package/esm/ChartContainer/ChartContainer.js +15 -7
  51. package/esm/ChartDataProvider/ChartDataProvider.d.ts +2 -2
  52. package/esm/ChartDataProvider/ChartDataProvider.js +4 -3
  53. package/esm/ChartsAxis/ChartsAxis.d.ts +1 -25
  54. package/esm/ChartsAxis/ChartsAxis.js +24 -86
  55. package/esm/ChartsAxis/axisClasses.d.ts +5 -1
  56. package/esm/ChartsLabel/ChartsLabelMark.d.ts +6 -1
  57. package/esm/ChartsLabel/ChartsLabelMark.js +15 -2
  58. package/esm/ChartsLabel/index.d.ts +1 -1
  59. package/esm/ChartsLabel/index.js +0 -3
  60. package/esm/ChartsLabel/labelGradientClasses.d.ts +1 -1
  61. package/esm/ChartsLabel/labelMarkClasses.d.ts +1 -1
  62. package/esm/ChartsLabel/labelMarkClasses.js +1 -1
  63. package/esm/ChartsLegend/chartsLegendClasses.d.ts +1 -1
  64. package/esm/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
  65. package/esm/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
  66. package/esm/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
  67. package/esm/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
  68. package/esm/ChartsTooltip/ChartsTooltipTable.js +1 -1
  69. package/esm/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
  70. package/esm/ChartsXAxis/ChartsXAxis.js +70 -57
  71. package/esm/ChartsYAxis/ChartsYAxis.js +12 -16
  72. package/esm/Gauge/Gauge.js +4 -3
  73. package/esm/Gauge/GaugeContainer.js +7 -5
  74. package/esm/LineChart/LineChart.d.ts +1 -1
  75. package/esm/LineChart/LineChart.js +14 -30
  76. package/esm/LineChart/useLineChartProps.js +2 -17
  77. package/esm/PieChart/PieArcLabelPlot.js +1 -1
  78. package/esm/PieChart/PieArcPlot.js +1 -1
  79. package/esm/PieChart/PieChart.d.ts +1 -1
  80. package/esm/PieChart/PieChart.js +6 -4
  81. package/esm/ScatterChart/ScatterChart.d.ts +1 -1
  82. package/esm/ScatterChart/ScatterChart.js +14 -30
  83. package/esm/ScatterChart/useScatterChartProps.js +2 -17
  84. package/esm/SparkLineChart/SparkLineChart.d.ts +4 -8
  85. package/esm/SparkLineChart/SparkLineChart.js +23 -21
  86. package/esm/constants/index.d.ts +8 -1
  87. package/esm/constants/index.js +12 -5
  88. package/esm/context/AnimationProvider/useSkipAnimation.js +1 -1
  89. package/esm/context/ChartProvider/ChartProvider.types.d.ts +6 -6
  90. package/esm/context/PolarProvider/Polar.types.d.ts +3 -2
  91. package/esm/hooks/useAxis.d.ts +2 -2
  92. package/esm/hooks/useAxis.js +1 -1
  93. package/esm/hooks/useSvgRef.js +1 -1
  94. package/esm/index.js +1 -1
  95. package/esm/internals/defaultizeColor.d.ts +23 -23
  96. package/esm/internals/defaultizeMargin.d.ts +3 -0
  97. package/esm/internals/defaultizeMargin.js +15 -0
  98. package/esm/internals/domUtils.js +1 -0
  99. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.d.ts +1 -1
  100. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +52 -31
  101. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +549 -105
  102. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +19 -18
  103. package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +7 -16
  104. package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +2 -2
  105. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +2 -3
  106. package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +3 -3
  107. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
  108. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +7 -2
  109. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +13 -15
  110. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +37 -35
  111. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +3 -36
  112. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +37 -9
  113. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -1
  114. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -1
  115. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +216 -0
  116. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +6 -0
  117. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +15 -14
  118. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +15 -13
  119. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.d.ts +70 -0
  120. package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.js +4 -0
  121. package/{internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.d.ts → esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts} +1815 -911
  122. package/{modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js → esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js} +4 -6
  123. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +86 -130
  124. package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +2 -2
  125. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +188 -71
  126. package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +9 -4
  127. package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.d.ts +2 -2
  128. package/esm/internals/plugins/models/plugin.d.ts +1 -1
  129. package/esm/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
  130. package/esm/internals/plugins/utils/ChartStore.d.ts +7 -7
  131. package/esm/internals/plugins/utils/selectors.d.ts +1 -0
  132. package/esm/internals/store/useCharts.js +0 -8
  133. package/esm/internals/store/useSelector.d.ts +1 -1
  134. package/esm/internals/store/useSelector.js +4 -1
  135. package/esm/internals/store/useStore.js +1 -1
  136. package/esm/models/axis.d.ts +56 -10
  137. package/esm/models/colorMapping.d.ts +1 -1
  138. package/esm/models/index.d.ts +0 -1
  139. package/esm/models/index.js +0 -1
  140. package/esm/models/seriesType/bar.d.ts +1 -1
  141. package/esm/models/seriesType/config.d.ts +1 -1
  142. package/esm/models/seriesType/line.d.ts +1 -1
  143. package/esm/models/seriesType/pie.d.ts +1 -1
  144. package/esm/models/seriesType/scatter.d.ts +1 -1
  145. package/esm/models/z-axis.d.ts +1 -1
  146. package/hooks/useAxis.d.ts +2 -2
  147. package/hooks/useAxis.js +5 -5
  148. package/hooks/useSvgRef.js +1 -1
  149. package/index.js +1 -1
  150. package/internals/defaultizeColor.d.ts +23 -23
  151. package/internals/defaultizeMargin.d.ts +3 -0
  152. package/internals/defaultizeMargin.js +22 -0
  153. package/internals/domUtils.js +1 -0
  154. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.d.ts +1 -1
  155. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +51 -30
  156. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +549 -105
  157. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +20 -19
  158. package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +7 -16
  159. package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +2 -2
  160. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +2 -3
  161. package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +3 -3
  162. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
  163. package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +7 -2
  164. package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +13 -15
  165. package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +39 -37
  166. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +3 -36
  167. package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +36 -8
  168. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -1
  169. package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +4 -4
  170. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +216 -0
  171. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +12 -0
  172. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +16 -15
  173. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +15 -13
  174. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.d.ts +70 -0
  175. package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.js +11 -0
  176. package/{modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.d.ts → internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts} +1815 -911
  177. package/internals/plugins/featurePlugins/useChartCartesianAxis/{useChartCartesianAxis.selectors.js → useChartCartesianAxisRendering.selectors.js} +10 -13
  178. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +86 -130
  179. package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +2 -2
  180. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +188 -71
  181. package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +10 -5
  182. package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.d.ts +2 -2
  183. package/internals/plugins/models/plugin.d.ts +1 -1
  184. package/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
  185. package/internals/plugins/utils/ChartStore.d.ts +7 -7
  186. package/internals/plugins/utils/selectors.d.ts +1 -0
  187. package/internals/store/useCharts.js +0 -8
  188. package/internals/store/useSelector.d.ts +1 -1
  189. package/internals/store/useSelector.js +5 -1
  190. package/internals/store/useStore.js +1 -1
  191. package/models/axis.d.ts +56 -10
  192. package/models/colorMapping.d.ts +1 -1
  193. package/models/index.d.ts +0 -1
  194. package/models/index.js +0 -11
  195. package/models/seriesType/bar.d.ts +1 -1
  196. package/models/seriesType/config.d.ts +1 -1
  197. package/models/seriesType/line.d.ts +1 -1
  198. package/models/seriesType/pie.d.ts +1 -1
  199. package/models/seriesType/scatter.d.ts +1 -1
  200. package/models/z-axis.d.ts +1 -1
  201. package/modern/BarChart/BarChart.d.ts +1 -1
  202. package/modern/BarChart/BarChart.js +14 -30
  203. package/modern/BarChart/useBarChartProps.js +3 -18
  204. package/modern/ChartContainer/ChartContainer.d.ts +1 -1
  205. package/modern/ChartContainer/ChartContainer.js +15 -7
  206. package/modern/ChartDataProvider/ChartDataProvider.d.ts +2 -2
  207. package/modern/ChartDataProvider/ChartDataProvider.js +4 -3
  208. package/modern/ChartsAxis/ChartsAxis.d.ts +1 -25
  209. package/modern/ChartsAxis/ChartsAxis.js +24 -86
  210. package/modern/ChartsAxis/axisClasses.d.ts +5 -1
  211. package/modern/ChartsLabel/ChartsLabelMark.d.ts +6 -1
  212. package/modern/ChartsLabel/ChartsLabelMark.js +15 -2
  213. package/modern/ChartsLabel/index.d.ts +1 -1
  214. package/modern/ChartsLabel/index.js +0 -3
  215. package/modern/ChartsLabel/labelGradientClasses.d.ts +1 -1
  216. package/modern/ChartsLabel/labelMarkClasses.d.ts +1 -1
  217. package/modern/ChartsLabel/labelMarkClasses.js +1 -1
  218. package/modern/ChartsLegend/chartsLegendClasses.d.ts +1 -1
  219. package/modern/ChartsLegend/continuousColorLegendClasses.d.ts +1 -1
  220. package/modern/ChartsLegend/piecewiseColorLegendClasses.d.ts +1 -1
  221. package/modern/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
  222. package/modern/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
  223. package/modern/ChartsTooltip/ChartsTooltipTable.js +1 -1
  224. package/modern/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
  225. package/modern/ChartsXAxis/ChartsXAxis.js +70 -57
  226. package/modern/ChartsYAxis/ChartsYAxis.js +12 -16
  227. package/modern/Gauge/Gauge.js +4 -3
  228. package/modern/Gauge/GaugeContainer.js +7 -5
  229. package/modern/LineChart/LineChart.d.ts +1 -1
  230. package/modern/LineChart/LineChart.js +14 -30
  231. package/modern/LineChart/useLineChartProps.js +2 -17
  232. package/modern/PieChart/PieArcLabelPlot.js +1 -1
  233. package/modern/PieChart/PieArcPlot.js +1 -1
  234. package/modern/PieChart/PieChart.d.ts +1 -1
  235. package/modern/PieChart/PieChart.js +6 -4
  236. package/modern/ScatterChart/ScatterChart.d.ts +1 -1
  237. package/modern/ScatterChart/ScatterChart.js +14 -30
  238. package/modern/ScatterChart/useScatterChartProps.js +2 -17
  239. package/modern/SparkLineChart/SparkLineChart.d.ts +4 -8
  240. package/modern/SparkLineChart/SparkLineChart.js +23 -21
  241. package/modern/constants/index.d.ts +8 -1
  242. package/modern/constants/index.js +12 -5
  243. package/modern/context/AnimationProvider/useSkipAnimation.js +1 -1
  244. package/modern/context/ChartProvider/ChartProvider.types.d.ts +6 -6
  245. package/modern/context/PolarProvider/Polar.types.d.ts +3 -2
  246. package/modern/hooks/useAxis.d.ts +2 -2
  247. package/modern/hooks/useAxis.js +1 -1
  248. package/modern/hooks/useSvgRef.js +1 -1
  249. package/modern/index.js +1 -1
  250. package/modern/internals/defaultizeColor.d.ts +23 -23
  251. package/modern/internals/defaultizeMargin.d.ts +3 -0
  252. package/modern/internals/defaultizeMargin.js +15 -0
  253. package/modern/internals/domUtils.js +1 -0
  254. package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.d.ts +1 -1
  255. package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +52 -31
  256. package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +549 -105
  257. package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +19 -18
  258. package/modern/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +7 -16
  259. package/modern/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +2 -2
  260. package/modern/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +2 -3
  261. package/modern/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +3 -3
  262. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +1 -1
  263. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +7 -2
  264. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +13 -15
  265. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +37 -35
  266. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.d.ts +3 -36
  267. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +37 -9
  268. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +1 -1
  269. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +1 -1
  270. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +216 -0
  271. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +6 -0
  272. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +15 -14
  273. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +15 -13
  274. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.d.ts +70 -0
  275. package/modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.js +4 -0
  276. package/{esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.d.ts → modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts} +1815 -911
  277. package/{esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.selectors.js → modern/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js} +4 -6
  278. package/modern/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +86 -130
  279. package/modern/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +2 -2
  280. package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +188 -71
  281. package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +9 -4
  282. package/modern/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.types.d.ts +2 -2
  283. package/modern/internals/plugins/models/plugin.d.ts +1 -1
  284. package/modern/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
  285. package/modern/internals/plugins/utils/ChartStore.d.ts +7 -7
  286. package/modern/internals/plugins/utils/selectors.d.ts +1 -0
  287. package/modern/internals/store/useCharts.js +0 -8
  288. package/modern/internals/store/useSelector.d.ts +1 -1
  289. package/modern/internals/store/useSelector.js +4 -1
  290. package/modern/internals/store/useStore.js +1 -1
  291. package/modern/models/axis.d.ts +56 -10
  292. package/modern/models/colorMapping.d.ts +1 -1
  293. package/modern/models/index.d.ts +0 -1
  294. package/modern/models/index.js +0 -1
  295. package/modern/models/seriesType/bar.d.ts +1 -1
  296. package/modern/models/seriesType/config.d.ts +1 -1
  297. package/modern/models/seriesType/line.d.ts +1 -1
  298. package/modern/models/seriesType/pie.d.ts +1 -1
  299. package/modern/models/seriesType/scatter.d.ts +1 -1
  300. package/modern/models/z-axis.d.ts +1 -1
  301. package/package.json +3 -3
  302. package/tsconfig.build.tsbuildinfo +1 -1
  303. package/esm/internals/calculateMargins.d.ts +0 -7
  304. package/esm/internals/calculateMargins.js +0 -25
  305. package/esm/models/layout.d.ts +0 -18
  306. package/esm/models/layout.js +0 -1
  307. package/internals/calculateMargins.d.ts +0 -7
  308. package/internals/calculateMargins.js +0 -33
  309. package/models/layout.d.ts +0 -18
  310. package/models/layout.js +0 -5
  311. package/modern/internals/calculateMargins.d.ts +0 -7
  312. package/modern/internals/calculateMargins.js +0 -25
  313. package/modern/models/layout.d.ts +0 -18
  314. package/modern/models/layout.js +0 -1
@@ -19,12 +19,7 @@ var _ChartsTooltip = require("../ChartsTooltip");
19
19
  var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
20
20
  var _jsxRuntime = require("react/jsx-runtime");
21
21
  const _excluded = ["xAxis", "yAxis", "width", "height", "margin", "color", "sx", "showTooltip", "showHighlight", "axisHighlight", "children", "slots", "slotProps", "data", "plotType", "valueFormatter", "area", "curve", "className"];
22
- const SPARKLINE_DEFAULT_MARGIN = {
23
- top: 5,
24
- bottom: 5,
25
- left: 5,
26
- right: 5
27
- };
22
+ const SPARK_LINE_DEFAULT_MARGIN = 5;
28
23
 
29
24
  /**
30
25
  * Demos:
@@ -41,7 +36,7 @@ const SparkLineChart = exports.SparkLineChart = /*#__PURE__*/React.forwardRef(fu
41
36
  yAxis,
42
37
  width,
43
38
  height,
44
- margin = SPARKLINE_DEFAULT_MARGIN,
39
+ margin = SPARK_LINE_DEFAULT_MARGIN,
45
40
  color,
46
41
  sx,
47
42
  showTooltip,
@@ -93,10 +88,14 @@ const SparkLineChart = exports.SparkLineChart = /*#__PURE__*/React.forwardRef(fu
93
88
  length: data.length
94
89
  }, (_, index) => index),
95
90
  hideTooltip: xAxis === undefined
96
- }, xAxis)],
91
+ }, xAxis, {
92
+ position: 'none'
93
+ })],
97
94
  yAxis: [(0, _extends2.default)({
98
95
  id: _constants.DEFAULT_Y_AXIS_KEY
99
- }, yAxis)],
96
+ }, yAxis, {
97
+ position: 'none'
98
+ })],
100
99
  colors: colors,
101
100
  sx: sx,
102
101
  disableAxisListener: (!showTooltip || slotProps?.tooltip?.trigger !== 'axis') && axisHighlight?.x === 'none' && axisHighlight?.y === 'none',
@@ -188,20 +187,16 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
188
187
  /**
189
188
  * The margin between the SVG and the drawing area.
190
189
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
191
- * Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
192
- * @default {
193
- * top: 5,
194
- * bottom: 5,
195
- * left: 5,
196
- * right: 5,
197
- * }
190
+ *
191
+ * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
192
+ * @default 5
198
193
  */
199
- margin: _propTypes.default.shape({
194
+ margin: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.shape({
200
195
  bottom: _propTypes.default.number,
201
196
  left: _propTypes.default.number,
202
197
  right: _propTypes.default.number,
203
198
  top: _propTypes.default.number
204
- }),
199
+ })]),
205
200
  /**
206
201
  * The function called for onClick events.
207
202
  * The second argument contains information about all line/bar elements at the current mouse position.
@@ -278,6 +273,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
278
273
  * Notice it is a single [[AxisConfig]] object, not an array of configuration.
279
274
  */
280
275
  xAxis: _propTypes.default.shape({
276
+ axis: _propTypes.default.oneOf(['x']),
281
277
  classes: _propTypes.default.object,
282
278
  colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
283
279
  colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
@@ -300,13 +296,15 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
300
296
  disableTicks: _propTypes.default.bool,
301
297
  domainLimit: _propTypes.default.oneOfType([_propTypes.default.oneOf(['nice', 'strict']), _propTypes.default.func]),
302
298
  fill: _propTypes.default.string,
299
+ height: _propTypes.default.number,
303
300
  hideTooltip: _propTypes.default.bool,
304
301
  id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
305
302
  label: _propTypes.default.string,
306
303
  labelStyle: _propTypes.default.object,
307
304
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
308
305
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
309
- position: _propTypes.default.oneOf(['bottom', 'top']),
306
+ offset: _propTypes.default.number,
307
+ position: _propTypes.default.oneOf(['bottom', 'none', 'top']),
310
308
  reverse: _propTypes.default.bool,
311
309
  scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
312
310
  slotProps: _propTypes.default.object,
@@ -315,6 +313,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
315
313
  sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
316
314
  tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
317
315
  tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
316
+ tickLabelMinGap: _propTypes.default.number,
318
317
  tickLabelPlacement: _propTypes.default.oneOf(['middle', 'tick']),
319
318
  tickLabelStyle: _propTypes.default.object,
320
319
  tickMaxStep: _propTypes.default.number,
@@ -329,6 +328,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
329
328
  * Notice it is a single [[AxisConfig]] object, not an array of configuration.
330
329
  */
331
330
  yAxis: _propTypes.default.shape({
331
+ axis: _propTypes.default.oneOf(['y']),
332
332
  classes: _propTypes.default.object,
333
333
  colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
334
334
  colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
@@ -357,7 +357,8 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
357
357
  labelStyle: _propTypes.default.object,
358
358
  max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
359
359
  min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
360
- position: _propTypes.default.oneOf(['left', 'right']),
360
+ offset: _propTypes.default.number,
361
+ position: _propTypes.default.oneOf(['left', 'none', 'right']),
361
362
  reverse: _propTypes.default.bool,
362
363
  scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
363
364
  slotProps: _propTypes.default.object,
@@ -373,6 +374,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
373
374
  tickNumber: _propTypes.default.number,
374
375
  tickPlacement: _propTypes.default.oneOf(['end', 'extremities', 'middle', 'start']),
375
376
  tickSize: _propTypes.default.number,
376
- valueFormatter: _propTypes.default.func
377
+ valueFormatter: _propTypes.default.func,
378
+ width: _propTypes.default.number
377
379
  })
378
380
  } : void 0;
@@ -6,4 +6,11 @@ export declare const DEFAULT_MARGINS: {
6
6
  left: number;
7
7
  right: number;
8
8
  };
9
- export declare const DEFAULT_LEGEND_FACING_MARGIN = 20;
9
+ export declare const DEFAULT_AXIS_SIZE_WIDTH = 30;
10
+ export declare const DEFAULT_AXIS_SIZE_HEIGHT = 25;
11
+ export declare const EMPTY_SIDES: {
12
+ top: number;
13
+ bottom: number;
14
+ left: number;
15
+ right: number;
16
+ };
@@ -3,13 +3,20 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DEFAULT_Y_AXIS_KEY = exports.DEFAULT_X_AXIS_KEY = exports.DEFAULT_MARGINS = exports.DEFAULT_LEGEND_FACING_MARGIN = void 0;
6
+ exports.EMPTY_SIDES = exports.DEFAULT_Y_AXIS_KEY = exports.DEFAULT_X_AXIS_KEY = exports.DEFAULT_MARGINS = exports.DEFAULT_AXIS_SIZE_WIDTH = exports.DEFAULT_AXIS_SIZE_HEIGHT = void 0;
7
7
  const DEFAULT_X_AXIS_KEY = exports.DEFAULT_X_AXIS_KEY = 'DEFAULT_X_AXIS_KEY';
8
8
  const DEFAULT_Y_AXIS_KEY = exports.DEFAULT_Y_AXIS_KEY = 'DEFAULT_Y_AXIS_KEY';
9
9
  const DEFAULT_MARGINS = exports.DEFAULT_MARGINS = {
10
- top: 50,
11
- bottom: 50,
12
- left: 50,
13
- right: 50
10
+ top: 20,
11
+ bottom: 20,
12
+ left: 20,
13
+ right: 20
14
14
  };
15
- const DEFAULT_LEGEND_FACING_MARGIN = exports.DEFAULT_LEGEND_FACING_MARGIN = 20;
15
+ const DEFAULT_AXIS_SIZE_WIDTH = exports.DEFAULT_AXIS_SIZE_WIDTH = 30;
16
+ const DEFAULT_AXIS_SIZE_HEIGHT = exports.DEFAULT_AXIS_SIZE_HEIGHT = 25;
17
+ const EMPTY_SIDES = exports.EMPTY_SIDES = {
18
+ top: 0,
19
+ bottom: 0,
20
+ left: 0,
21
+ right: 0
22
+ };
@@ -19,7 +19,7 @@ function useSkipAnimation(skipAnimation) {
19
19
  data
20
20
  } = React.useContext(_AnimationContext.AnimationContext);
21
21
  if (!isInitialized) {
22
- throw new Error(['MUI X: Could not find the animation ref context.', 'It looks like you rendered your component outside of a ChartsContainer parent component.'].join('\n'));
22
+ throw new Error(['MUI X: Could not find the animation ref context.', 'It looks like you rendered your component outside of a ChartContainer parent component.'].join('\n'));
23
23
  }
24
24
  return skipAnimation || data.skipAnimation;
25
25
  }
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
- import { ChartAnyPluginSignature, ChartInstance, ChartPublicAPI, ConvertSignaturesIntoPlugins, MergeSignaturesProperty } from "../../internals/plugins/models/index.js";
3
- import { ChartStore } from "../../internals/plugins/utils/ChartStore.js";
4
- import { ChartCorePluginSignatures } from "../../internals/plugins/corePlugins/index.js";
5
- import { ChartSeriesConfig } from "../../internals/plugins/models/seriesConfig/index.js";
6
- import { UseChartBaseProps } from "../../internals/store/useCharts.types.js";
7
- import { ChartSeriesType } from "../../models/seriesType/config.js";
2
+ import type { ChartAnyPluginSignature, ChartInstance, ChartPublicAPI, ConvertSignaturesIntoPlugins, MergeSignaturesProperty } from '../../internals/plugins/models';
3
+ import type { ChartStore } from '../../internals/plugins/utils/ChartStore';
4
+ import type { ChartCorePluginSignatures } from '../../internals/plugins/corePlugins';
5
+ import type { ChartSeriesConfig } from '../../internals/plugins/models/seriesConfig';
6
+ import type { UseChartBaseProps } from '../../internals/store/useCharts.types';
7
+ import type { ChartSeriesType } from '../../models/seriesType/config';
8
8
  export type ChartContextValue<TSignatures extends readonly ChartAnyPluginSignature[], TOptionalSignatures extends readonly ChartAnyPluginSignature[] = []> = {
9
9
  /**
10
10
  * And object with all the methods needed to interact with the chart.
@@ -1,5 +1,6 @@
1
1
  import { DatasetType } from "../../models/seriesType/config.js";
2
2
  import { AxisDefaultized, ScaleName, AxisId, AxisConfig, ChartsRotationAxisProps, ChartsRadiusAxisProps } from "../../models/axis.js";
3
+ import { ChartsAxisProps } from "../../ChartsAxis/index.js";
3
4
  export type PolarProviderProps = {
4
5
  /**
5
6
  * The configuration of the rotation-axes.
@@ -16,10 +17,10 @@ export type PolarProviderProps = {
16
17
  /**
17
18
  * An array of objects that can be used to populate series and axes data using their `dataKey` property.
18
19
  */
19
- dataset?: DatasetType;
20
+ dataset?: Readonly<DatasetType>;
20
21
  children: React.ReactNode;
21
22
  };
22
- export type DefaultizedAxisConfig<Axis> = {
23
+ export type DefaultizedAxisConfig<Axis extends ChartsAxisProps> = {
23
24
  [axisId: AxisId]: AxisDefaultized<ScaleName, any, Axis>;
24
25
  };
25
26
  export type PolarContextState = {
@@ -18,7 +18,7 @@ export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartP
18
18
  * The series to display in the bar chart.
19
19
  * An array of [[BarSeriesType]] objects.
20
20
  */
21
- series: MakeOptional<BarSeriesType, 'type'>[];
21
+ series: Readonly<MakeOptional<BarSeriesType, 'type'>[]>;
22
22
  /**
23
23
  * Option to display a cartesian grid in the background.
24
24
  */
@@ -92,12 +92,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
92
92
  * Defines the border radius of the bar element.
93
93
  */
94
94
  borderRadius: PropTypes.number,
95
- /**
96
- * Indicate which axis to display the bottom of the charts.
97
- * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
98
- * @default xAxisIds[0] The id of the first provided axis
99
- */
100
- bottomAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
101
95
  children: PropTypes.node,
102
96
  className: PropTypes.string,
103
97
  /**
@@ -149,12 +143,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
149
143
  * @default 'vertical'
150
144
  */
151
145
  layout: PropTypes.oneOf(['horizontal', 'vertical']),
152
- /**
153
- * Indicate which axis to display the left of the charts.
154
- * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
155
- * @default yAxisIds[0] The id of the first provided axis
156
- */
157
- leftAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
158
146
  /**
159
147
  * If `true`, a loading overlay is displayed.
160
148
  * @default false
@@ -163,14 +151,15 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
163
151
  /**
164
152
  * The margin between the SVG and the drawing area.
165
153
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
166
- * Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
154
+ *
155
+ * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
167
156
  */
168
- margin: PropTypes.shape({
157
+ margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
169
158
  bottom: PropTypes.number,
170
159
  left: PropTypes.number,
171
160
  right: PropTypes.number,
172
161
  top: PropTypes.number
173
- }),
162
+ })]),
174
163
  /**
175
164
  * The function called for onClick events.
176
165
  * The second argument contains information about all line/bar elements at the current mouse position.
@@ -190,12 +179,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
190
179
  * @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
191
180
  */
192
181
  onItemClick: PropTypes.func,
193
- /**
194
- * Indicate which axis to display the right of the charts.
195
- * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
196
- * @default null
197
- */
198
- rightAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
199
182
  /**
200
183
  * The series to display in the bar chart.
201
184
  * An array of [[BarSeriesType]] objects.
@@ -219,12 +202,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
219
202
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
220
203
  theme: PropTypes.oneOf(['dark', 'light']),
221
204
  title: PropTypes.string,
222
- /**
223
- * Indicate which axis to display the top of the charts.
224
- * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
225
- * @default null
226
- */
227
- topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
228
205
  /**
229
206
  * The width of the chart in px. If not defined, it takes the width of the parent element.
230
207
  */
@@ -235,6 +212,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
235
212
  * An array of [[AxisConfig]] objects.
236
213
  */
237
214
  xAxis: PropTypes.arrayOf(PropTypes.shape({
215
+ axis: PropTypes.oneOf(['x']),
238
216
  classes: PropTypes.object,
239
217
  colorMap: PropTypes.oneOfType([PropTypes.shape({
240
218
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -257,13 +235,15 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
257
235
  disableTicks: PropTypes.bool,
258
236
  domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
259
237
  fill: PropTypes.string,
238
+ height: PropTypes.number,
260
239
  hideTooltip: PropTypes.bool,
261
240
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
262
241
  label: PropTypes.string,
263
242
  labelStyle: PropTypes.object,
264
243
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
265
244
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
266
- position: PropTypes.oneOf(['bottom', 'top']),
245
+ offset: PropTypes.number,
246
+ position: PropTypes.oneOf(['bottom', 'none', 'top']),
267
247
  reverse: PropTypes.bool,
268
248
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
269
249
  slotProps: PropTypes.object,
@@ -272,6 +252,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
272
252
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
273
253
  tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
274
254
  tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
255
+ tickLabelMinGap: PropTypes.number,
275
256
  tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
276
257
  tickLabelStyle: PropTypes.object,
277
258
  tickMaxStep: PropTypes.number,
@@ -287,6 +268,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
287
268
  * An array of [[AxisConfig]] objects.
288
269
  */
289
270
  yAxis: PropTypes.arrayOf(PropTypes.shape({
271
+ axis: PropTypes.oneOf(['y']),
290
272
  classes: PropTypes.object,
291
273
  colorMap: PropTypes.oneOfType([PropTypes.shape({
292
274
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -315,7 +297,8 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
315
297
  labelStyle: PropTypes.object,
316
298
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
317
299
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
318
- position: PropTypes.oneOf(['left', 'right']),
300
+ offset: PropTypes.number,
301
+ position: PropTypes.oneOf(['left', 'none', 'right']),
319
302
  reverse: PropTypes.bool,
320
303
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
321
304
  slotProps: PropTypes.object,
@@ -331,7 +314,8 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
331
314
  tickNumber: PropTypes.number,
332
315
  tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
333
316
  tickSize: PropTypes.number,
334
- valueFormatter: PropTypes.func
317
+ valueFormatter: PropTypes.func,
318
+ width: PropTypes.number
335
319
  }))
336
320
  } : void 0;
337
321
  export { BarChart };
@@ -2,10 +2,9 @@
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
4
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
5
- const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "axisHighlight", "grid", "topAxis", "leftAxis", "rightAxis", "bottomAxis", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className", "hideLegend"];
5
+ const _excluded = ["xAxis", "yAxis", "series", "width", "height", "margin", "colors", "dataset", "sx", "axisHighlight", "grid", "children", "slots", "slotProps", "skipAnimation", "loading", "layout", "onItemClick", "highlightedItem", "onHighlightChange", "borderRadius", "barLabel", "className", "hideLegend"];
6
6
  import useId from '@mui/utils/useId';
7
7
  import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from "../constants/index.js";
8
- import { calculateMargins } from "../internals/calculateMargins.js";
9
8
  import { BAR_CHART_PLUGINS } from "./BarChart.plugins.js";
10
9
 
11
10
  /**
@@ -28,10 +27,6 @@ export const useBarChartProps = props => {
28
27
  sx,
29
28
  axisHighlight,
30
29
  grid,
31
- topAxis,
32
- leftAxis,
33
- rightAxis,
34
- bottomAxis,
35
30
  children,
36
31
  slots,
37
32
  slotProps,
@@ -43,8 +38,7 @@ export const useBarChartProps = props => {
43
38
  onHighlightChange,
44
39
  borderRadius,
45
40
  barLabel,
46
- className,
47
- hideLegend
41
+ className
48
42
  } = props,
49
43
  rest = _objectWithoutPropertiesLoose(props, _excluded);
50
44
  const id = useId();
@@ -64,12 +58,7 @@ export const useBarChartProps = props => {
64
58
  })),
65
59
  width,
66
60
  height,
67
- margin: calculateMargins({
68
- margin,
69
- hideLegend,
70
- slotProps,
71
- series
72
- }),
61
+ margin,
73
62
  colors,
74
63
  dataset,
75
64
  xAxis: xAxis ?? (hasHorizontalSeries ? undefined : [_extends({
@@ -108,10 +97,6 @@ export const useBarChartProps = props => {
108
97
  loading
109
98
  };
110
99
  const chartsAxisProps = {
111
- topAxis,
112
- leftAxis,
113
- rightAxis,
114
- bottomAxis,
115
100
  slots,
116
101
  slotProps
117
102
  };
@@ -25,7 +25,7 @@ export type ChartContainerProps<SeriesType extends ChartSeriesType = ChartSeries
25
25
  * xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
26
26
  * >
27
27
  * <BarPlot />
28
- * <ChartsXAxis position="bottom" axisId="x-axis" />
28
+ * <ChartsXAxis axisId="x-axis" />
29
29
  * </ChartContainer>
30
30
  * ```
31
31
  */
@@ -27,7 +27,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
27
27
  * xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
28
28
  * >
29
29
  * <BarPlot />
30
- * <ChartsXAxis position="bottom" axisId="x-axis" />
30
+ * <ChartsXAxis axisId="x-axis" />
31
31
  * </ChartContainer>
32
32
  * ```
33
33
  */
@@ -96,14 +96,15 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
96
96
  /**
97
97
  * The margin between the SVG and the drawing area.
98
98
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
99
- * Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
99
+ *
100
+ * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
100
101
  */
101
- margin: PropTypes.shape({
102
+ margin: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
102
103
  bottom: PropTypes.number,
103
104
  left: PropTypes.number,
104
105
  right: PropTypes.number,
105
106
  top: PropTypes.number
106
- }),
107
+ })]),
107
108
  /**
108
109
  * The function called for onClick events.
109
110
  * The second argument contains information about all line/bar elements at the current mouse position.
@@ -153,6 +154,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
153
154
  * An array of [[AxisConfig]] objects.
154
155
  */
155
156
  xAxis: PropTypes.arrayOf(PropTypes.shape({
157
+ axis: PropTypes.oneOf(['x']),
156
158
  classes: PropTypes.object,
157
159
  colorMap: PropTypes.oneOfType([PropTypes.shape({
158
160
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -175,13 +177,15 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
175
177
  disableTicks: PropTypes.bool,
176
178
  domainLimit: PropTypes.oneOfType([PropTypes.oneOf(['nice', 'strict']), PropTypes.func]),
177
179
  fill: PropTypes.string,
180
+ height: PropTypes.number,
178
181
  hideTooltip: PropTypes.bool,
179
182
  id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
180
183
  label: PropTypes.string,
181
184
  labelStyle: PropTypes.object,
182
185
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
183
186
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
184
- position: PropTypes.oneOf(['bottom', 'top']),
187
+ offset: PropTypes.number,
188
+ position: PropTypes.oneOf(['bottom', 'none', 'top']),
185
189
  reverse: PropTypes.bool,
186
190
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
187
191
  slotProps: PropTypes.object,
@@ -190,6 +194,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
190
194
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
191
195
  tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
192
196
  tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
197
+ tickLabelMinGap: PropTypes.number,
193
198
  tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
194
199
  tickLabelStyle: PropTypes.object,
195
200
  tickMaxStep: PropTypes.number,
@@ -205,6 +210,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
205
210
  * An array of [[AxisConfig]] objects.
206
211
  */
207
212
  yAxis: PropTypes.arrayOf(PropTypes.shape({
213
+ axis: PropTypes.oneOf(['y']),
208
214
  classes: PropTypes.object,
209
215
  colorMap: PropTypes.oneOfType([PropTypes.shape({
210
216
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -233,7 +239,8 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
233
239
  labelStyle: PropTypes.object,
234
240
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
235
241
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
236
- position: PropTypes.oneOf(['left', 'right']),
242
+ offset: PropTypes.number,
243
+ position: PropTypes.oneOf(['left', 'none', 'right']),
237
244
  reverse: PropTypes.bool,
238
245
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
239
246
  slotProps: PropTypes.object,
@@ -249,7 +256,8 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
249
256
  tickNumber: PropTypes.number,
250
257
  tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
251
258
  tickSize: PropTypes.number,
252
- valueFormatter: PropTypes.func
259
+ valueFormatter: PropTypes.func,
260
+ width: PropTypes.number
253
261
  })),
254
262
  /**
255
263
  * The configuration of the z-axes.
@@ -14,7 +14,7 @@ export type ChartDataProviderProps<TSeries extends ChartSeriesType = ChartSeries
14
14
  *
15
15
  * Demos:
16
16
  *
17
- * - [Composition](https://mui.com/x/api/charts/composition/)
17
+ * - [Composition](https://mui.com/x/react-charts/composition/)
18
18
  *
19
19
  * API:
20
20
  *
@@ -28,7 +28,7 @@ export type ChartDataProviderProps<TSeries extends ChartSeriesType = ChartSeries
28
28
  * >
29
29
  * <ChartsSurface>
30
30
  * <BarPlot />
31
- * <ChartsXAxis position="bottom" axisId="x-axis" />
31
+ * <ChartsXAxis axisId="x-axis" />
32
32
  * </ChartsSurface>
33
33
  * {'Custom Legend Component'}
34
34
  * </ChartDataProvider>
@@ -14,7 +14,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  *
15
15
  * Demos:
16
16
  *
17
- * - [Composition](https://mui.com/x/api/charts/composition/)
17
+ * - [Composition](https://mui.com/x/react-charts/composition/)
18
18
  *
19
19
  * API:
20
20
  *
@@ -28,7 +28,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
28
28
  * >
29
29
  * <ChartsSurface>
30
30
  * <BarPlot />
31
- * <ChartsXAxis position="bottom" axisId="x-axis" />
31
+ * <ChartsXAxis axisId="x-axis" />
32
32
  * </ChartsSurface>
33
33
  * {'Custom Legend Component'}
34
34
  * </ChartDataProvider>
@@ -74,7 +74,8 @@ process.env.NODE_ENV !== "production" ? ChartDataProvider.propTypes = {
74
74
  /**
75
75
  * The margin between the SVG and the drawing area.
76
76
  * It's used for leaving some space for extra information such as the x- and y-axis or legend.
77
- * Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
77
+ *
78
+ * Accepts a `number` to be used on all sides or an object with the optional properties: `top`, `bottom`, `left`, and `right`.
78
79
  */
79
80
  margin: PropTypes.any,
80
81
  /**
@@ -1,30 +1,6 @@
1
1
  import * as React from 'react';
2
- import { ChartsAxisSlotProps, ChartsAxisSlots, ChartsXAxisProps, ChartsYAxisProps } from "../models/axis.js";
2
+ import { ChartsAxisSlotProps, ChartsAxisSlots } from "../models/axis.js";
3
3
  export interface ChartsAxisProps {
4
- /**
5
- * Indicate which axis to display the top of the charts.
6
- * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
7
- * @default null
8
- */
9
- topAxis?: null | string | ChartsXAxisProps;
10
- /**
11
- * Indicate which axis to display the bottom of the charts.
12
- * Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
13
- * @default xAxisIds[0] The id of the first provided axis
14
- */
15
- bottomAxis?: null | string | ChartsXAxisProps;
16
- /**
17
- * Indicate which axis to display the left of the charts.
18
- * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
19
- * @default yAxisIds[0] The id of the first provided axis
20
- */
21
- leftAxis?: null | string | ChartsYAxisProps;
22
- /**
23
- * Indicate which axis to display the right of the charts.
24
- * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
25
- * @default null
26
- */
27
- rightAxis?: null | string | ChartsYAxisProps;
28
4
  /**
29
5
  * Overridable component slots.
30
6
  * @default {}