@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
package/models/axis.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { ScaleBand, ScaleLogarithmic, ScalePower, ScaleTime, ScaleLinear, ScalePoint, ScaleOrdinal, ScaleSequential, ScaleThreshold } from '@mui/x-charts-vendor/d3-scale';
2
2
  import { SxProps } from '@mui/system/styleFunctionSx';
3
+ import { MakeRequired } from '@mui/x-internals/types';
3
4
  import { ChartsAxisClasses } from "../ChartsAxis/axisClasses.js";
4
5
  import type { TickParams } from '../hooks/useTicks';
5
6
  import { ChartsTextProps } from "../ChartsText/index.js";
@@ -104,17 +105,54 @@ export interface ChartsAxisProps extends TickParams {
104
105
  sx?: SxProps;
105
106
  }
106
107
  export interface ChartsYAxisProps extends ChartsAxisProps {
108
+ axis?: 'y';
109
+ }
110
+ export interface ChartsXAxisProps extends ChartsAxisProps {
111
+ axis?: 'x';
107
112
  /**
108
- * Position of the axis.
113
+ * The minimum gap in pixels between two tick labels.
114
+ * If two tick labels are closer than this minimum gap, one of them will be hidden.
115
+ * @default 4
109
116
  */
110
- position?: 'left' | 'right';
117
+ tickLabelMinGap?: number;
111
118
  }
112
- export interface ChartsXAxisProps extends ChartsAxisProps {
119
+ type AxisSideConfig<AxisProps extends ChartsAxisProps> = AxisProps extends ChartsXAxisProps ? {
113
120
  /**
114
121
  * Position of the axis.
122
+ *
123
+ * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data.
124
+ *
125
+ * Set to 'none' to hide the axis.
126
+ *
127
+ * The first axis in the list will always have a default position.
115
128
  */
116
- position?: 'top' | 'bottom';
117
- }
129
+ position?: 'top' | 'bottom' | 'none';
130
+ /**
131
+ * The height of the axis.
132
+ * @default 30
133
+ */
134
+ height?: number;
135
+ } : AxisProps extends ChartsYAxisProps ? {
136
+ /**
137
+ * Position of the axis.
138
+ *
139
+ * When set, the space for the axis is reserved, even if the axis is not displayed due to missing data.
140
+ *
141
+ * Set to 'none' to hide the axis.
142
+ *
143
+ * The first axis in the list will always have a default position.
144
+ */
145
+ position?: 'left' | 'right' | 'none';
146
+ /**
147
+ * The width of the axis.
148
+ * @default 30
149
+ */
150
+ width?: number;
151
+ } : {
152
+ position?: 'top' | 'bottom' | 'left' | 'right' | 'none';
153
+ height?: number;
154
+ width?: number;
155
+ };
118
156
  export interface ChartsRotationAxisProps extends ChartsAxisProps {
119
157
  /**
120
158
  * The start angle (in deg).
@@ -242,7 +280,7 @@ export type AxisValueFormatterContext<S extends ScaleName = ScaleName> = {
242
280
  */
243
281
  scale: AxisScaleConfig[S]['scale'];
244
282
  };
245
- export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps = ChartsXAxisProps | ChartsYAxisProps> = {
283
+ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsXAxisProps | ChartsYAxisProps> = {
246
284
  /**
247
285
  * Id used to identify the axis.
248
286
  */
@@ -260,7 +298,7 @@ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps = Cha
260
298
  /**
261
299
  * The data used by `'band'` and `'point'` scales.
262
300
  */
263
- data?: V[];
301
+ data?: readonly V[];
264
302
  /**
265
303
  * The key used to retrieve `data` from the `dataset` prop.
266
304
  */
@@ -280,6 +318,13 @@ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps = Cha
280
318
  * If `true`, Reverse the axis scaleBand.
281
319
  */
282
320
  reverse?: boolean;
321
+ /**
322
+ * The offset of the axis in pixels. It can be used to move the axis from its default position.
323
+ * X-axis: A top axis will move up, and a bottom axis will move down.
324
+ * Y-axis: A left axis will move left, and a right axis will move right.
325
+ * @default 0
326
+ */
327
+ offset?: number;
283
328
  /**
284
329
  * Defines the axis scale domain based on the min/max values of series linked to it.
285
330
  * - 'nice': Rounds the domain at human friendly values.
@@ -290,9 +335,9 @@ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps = Cha
290
335
  min: number;
291
336
  max: number;
292
337
  });
293
- } & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & TickParams & AxisConfigExtension;
338
+ } & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & AxisSideConfig<AxisProps> & TickParams & AxisConfigExtension;
294
339
  export interface AxisConfigExtension {}
295
- export type AxisDefaultized<S extends ScaleName = ScaleName, V = any, AxisProps = ChartsXAxisProps | ChartsYAxisProps> = Omit<AxisConfig<S, V, AxisProps>, 'scaleType'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S] & {
340
+ export type AxisDefaultized<S extends ScaleName = ScaleName, V = any, AxisProps extends ChartsAxisProps = ChartsXAxisProps | ChartsYAxisProps> = MakeRequired<Omit<AxisConfig<S, V, AxisProps>, 'scaleType'>, 'offset'> & AxisScaleConfig[S] & AxisSideConfig<AxisProps> & AxisScaleComputedConfig[S] & {
296
341
  /**
297
342
  * An indication of the expected number of ticks.
298
343
  */
@@ -320,4 +365,5 @@ export interface ChartsAxisData {
320
365
  * The mapping of series ids to their value for this particular axis index.
321
366
  */
322
367
  seriesValues: Record<string, number | null | undefined>;
323
- }
368
+ }
369
+ export {};
@@ -33,7 +33,7 @@ export interface OrdinalColorConfig<Value = number | Date | string> {
33
33
  * The value to map.
34
34
  * If undefined, it will be integers from 0 to the number of colors.
35
35
  */
36
- values?: Value[];
36
+ values?: readonly Value[];
37
37
  /**
38
38
  * The color palette.
39
39
  * Items equal to `values[k]` will get the color of `colors[k]`.
package/models/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from "./seriesType/index.js";
2
- export * from "./layout.js";
3
2
  export * from "./stacking.js";
4
3
  export type { AxisConfig, ChartsYAxisProps, ChartsXAxisProps, ScaleName, ContinuousScaleName, ChartsAxisData } from './axis';
5
4
  export type { PropsFromSlot } from '@mui/x-internals/slots';
package/models/index.js CHANGED
@@ -14,17 +14,6 @@ Object.keys(_seriesType).forEach(function (key) {
14
14
  }
15
15
  });
16
16
  });
17
- var _layout = require("./layout");
18
- Object.keys(_layout).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _layout[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _layout[key];
25
- }
26
- });
27
- });
28
17
  var _stacking = require("./stacking");
29
18
  Object.keys(_stacking).forEach(function (key) {
30
19
  if (key === "default" || key === "__esModule") return;
@@ -6,7 +6,7 @@ export interface BarSeriesType extends CommonSeriesType<number | null>, Cartesia
6
6
  /**
7
7
  * Data associated to each bar.
8
8
  */
9
- data?: (number | null)[];
9
+ data?: readonly (number | null)[];
10
10
  /**
11
11
  * The key used to retrieve data from the dataset.
12
12
  */
@@ -76,6 +76,6 @@ export type ChartSeriesDefaultized<T extends ChartSeriesType> = ChartsSeriesConf
76
76
  } : ChartsSeriesConfig[T]['series'];
77
77
  export type ChartItemIdentifier<T extends ChartSeriesType> = ChartsSeriesConfig[T]['itemIdentifier'];
78
78
  export type DatasetElementType<T> = {
79
- [key: string]: T;
79
+ [key: string]: Readonly<T>;
80
80
  };
81
81
  export type DatasetType<T = number | string | Date | null | undefined> = DatasetElementType<T>[];
@@ -29,7 +29,7 @@ export interface LineSeriesType extends CommonSeriesType<number | null>, Cartesi
29
29
  /**
30
30
  * Data associated to the line.
31
31
  */
32
- data?: (number | null)[];
32
+ data?: readonly (number | null)[];
33
33
  /**
34
34
  * The key used to retrieve data from the dataset.
35
35
  */
@@ -27,7 +27,7 @@ export type DefaultizedPieValueType = PieValueType & Omit<D3PieArcDatum<any>, 'd
27
27
  export type ChartsPieSorting = 'none' | 'asc' | 'desc' | ((a: number, b: number) => number);
28
28
  export interface PieSeriesType<TData = PieValueType> extends CommonSeriesType<TData> {
29
29
  type: 'pie';
30
- data: TData[];
30
+ data: Readonly<TData[]>;
31
31
  /**
32
32
  * The radius between circle center and the beginning of the arc.
33
33
  * Can be a number (in px) or a string with a percentage such as '50%'.
@@ -11,7 +11,7 @@ export type ScatterValueType = {
11
11
  };
12
12
  export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType | null>, CartesianSeriesType {
13
13
  type: 'scatter';
14
- data?: ScatterValueType[];
14
+ data?: readonly ScatterValueType[];
15
15
  markerSize?: number;
16
16
  /**
17
17
  * The label to display on the tooltip or the legend. It can be a string or a function.
@@ -2,7 +2,7 @@ import type { ScaleOrdinal, ScaleSequential, ScaleThreshold } from '@mui/x-chart
2
2
  import { ContinuousColorConfig, OrdinalColorConfig, PiecewiseColorConfig } from "./colorMapping.js";
3
3
  export interface ZAxisConfig<V = any> {
4
4
  id: string;
5
- data?: V[];
5
+ data?: readonly V[];
6
6
  /**
7
7
  * The key used to retrieve `data` from the `dataset` prop.
8
8
  */
@@ -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 {}