@mui/x-charts 7.0.0-beta.0 → 7.0.0-beta.2

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 (258) hide show
  1. package/BarChart/BarChart.d.ts +2 -1
  2. package/BarChart/BarChart.js +33 -12
  3. package/BarChart/BarElement.d.ts +20 -13
  4. package/BarChart/BarElement.js +7 -3
  5. package/BarChart/BarPlot.d.ts +11 -6
  6. package/BarChart/BarPlot.js +28 -15
  7. package/BarChart/formatter.js +1 -1
  8. package/CHANGELOG.md +406 -1
  9. package/ChartContainer/ChartContainer.js +6 -4
  10. package/ChartsAxis/ChartsAxis.js +4 -4
  11. package/ChartsLegend/ChartsLegend.d.ts +5 -54
  12. package/ChartsLegend/ChartsLegend.js +2 -307
  13. package/ChartsLegend/DefaultChartsLegend.d.ts +60 -0
  14. package/ChartsLegend/DefaultChartsLegend.js +294 -0
  15. package/ChartsLegend/index.d.ts +1 -0
  16. package/ChartsLegend/index.js +11 -0
  17. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.d.ts +20 -0
  18. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +83 -0
  19. package/ChartsOnAxisClickHandler/index.d.ts +1 -0
  20. package/ChartsOnAxisClickHandler/index.js +16 -0
  21. package/ChartsOnAxisClickHandler/package.json +6 -0
  22. package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  23. package/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
  24. package/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
  25. package/ChartsReferenceLine/common.d.ts +2 -1
  26. package/ChartsTooltip/ChartsAxisTooltipContent.js +6 -5
  27. package/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  28. package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +7 -5
  29. package/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  30. package/ChartsTooltip/utils.d.ts +4 -1
  31. package/ChartsTooltip/utils.js +15 -0
  32. package/ChartsVoronoiHandler/ChartsVoronoiHandler.d.ts +7 -0
  33. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +92 -44
  34. package/ChartsXAxis/ChartsXAxis.js +13 -9
  35. package/ChartsYAxis/ChartsYAxis.js +1 -1
  36. package/LineChart/AnimatedArea.d.ts +1361 -0
  37. package/LineChart/AnimatedArea.js +111 -0
  38. package/LineChart/AnimatedLine.d.ts +1361 -0
  39. package/LineChart/AnimatedLine.js +113 -0
  40. package/LineChart/AreaElement.d.ts +19 -18
  41. package/LineChart/AreaElement.js +17 -34
  42. package/LineChart/AreaPlot.d.ts +12 -7
  43. package/LineChart/AreaPlot.js +91 -58
  44. package/LineChart/LineChart.d.ts +13 -4
  45. package/LineChart/LineChart.js +45 -14
  46. package/LineChart/LineElement.d.ts +19 -18
  47. package/LineChart/LineElement.js +16 -36
  48. package/LineChart/LineHighlightElement.d.ts +3 -2
  49. package/LineChart/LineHighlightElement.js +5 -3
  50. package/LineChart/LinePlot.d.ts +12 -7
  51. package/LineChart/LinePlot.js +89 -56
  52. package/LineChart/MarkElement.d.ts +8 -4
  53. package/LineChart/MarkElement.js +27 -13
  54. package/LineChart/MarkPlot.d.ts +8 -1
  55. package/LineChart/MarkPlot.js +80 -51
  56. package/LineChart/formatter.js +1 -1
  57. package/LineChart/index.d.ts +2 -0
  58. package/LineChart/index.js +22 -0
  59. package/PieChart/PieArc.d.ts +3 -2
  60. package/PieChart/PieArc.js +1 -0
  61. package/PieChart/PieArcLabel.d.ts +3 -2
  62. package/PieChart/PieArcLabel.js +1 -0
  63. package/PieChart/PieArcLabelPlot.d.ts +1 -1
  64. package/PieChart/PieArcLabelPlot.js +2 -2
  65. package/PieChart/PieArcPlot.d.ts +2 -2
  66. package/PieChart/PieArcPlot.js +7 -7
  67. package/PieChart/PieChart.d.ts +1 -1
  68. package/PieChart/PieChart.js +14 -12
  69. package/PieChart/PiePlot.d.ts +1 -1
  70. package/PieChart/PiePlot.js +4 -4
  71. package/ResponsiveChartContainer/ResponsiveChartContainer.js +6 -4
  72. package/ScatterChart/Scatter.d.ts +7 -1
  73. package/ScatterChart/Scatter.js +17 -3
  74. package/ScatterChart/ScatterChart.d.ts +8 -2
  75. package/ScatterChart/ScatterChart.js +21 -10
  76. package/ScatterChart/ScatterPlot.d.ts +1 -1
  77. package/ScatterChart/ScatterPlot.js +10 -2
  78. package/SparkLineChart/SparkLineChart.d.ts +1 -1
  79. package/SparkLineChart/SparkLineChart.js +7 -4
  80. package/context/CartesianContextProvider.js +8 -6
  81. package/context/DrawingProvider.d.ts +6 -1
  82. package/context/DrawingProvider.js +9 -2
  83. package/context/InteractionProvider.d.ts +3 -3
  84. package/esm/BarChart/BarChart.js +33 -12
  85. package/esm/BarChart/BarElement.js +7 -3
  86. package/esm/BarChart/BarPlot.js +27 -15
  87. package/esm/BarChart/formatter.js +1 -1
  88. package/esm/ChartContainer/ChartContainer.js +6 -4
  89. package/esm/ChartsAxis/ChartsAxis.js +4 -4
  90. package/esm/ChartsLegend/ChartsLegend.js +2 -307
  91. package/esm/ChartsLegend/DefaultChartsLegend.js +286 -0
  92. package/esm/ChartsLegend/index.js +1 -0
  93. package/esm/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +77 -0
  94. package/esm/ChartsOnAxisClickHandler/index.js +1 -0
  95. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  96. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
  97. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
  98. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +6 -5
  99. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  100. package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +8 -5
  101. package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  102. package/esm/ChartsTooltip/utils.js +12 -0
  103. package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +92 -44
  104. package/esm/ChartsXAxis/ChartsXAxis.js +13 -9
  105. package/esm/ChartsYAxis/ChartsYAxis.js +1 -1
  106. package/esm/LineChart/AnimatedArea.js +103 -0
  107. package/esm/LineChart/AnimatedLine.js +105 -0
  108. package/esm/LineChart/AreaElement.js +16 -33
  109. package/esm/LineChart/AreaPlot.js +92 -59
  110. package/esm/LineChart/LineChart.js +45 -14
  111. package/esm/LineChart/LineElement.js +16 -35
  112. package/esm/LineChart/LineHighlightElement.js +5 -3
  113. package/esm/LineChart/LinePlot.js +90 -57
  114. package/esm/LineChart/MarkElement.js +27 -13
  115. package/esm/LineChart/MarkPlot.js +80 -51
  116. package/esm/LineChart/formatter.js +1 -1
  117. package/esm/LineChart/index.js +2 -0
  118. package/esm/PieChart/PieArc.js +1 -0
  119. package/esm/PieChart/PieArcLabel.js +1 -0
  120. package/esm/PieChart/PieArcLabelPlot.js +2 -2
  121. package/esm/PieChart/PieArcPlot.js +7 -7
  122. package/esm/PieChart/PieChart.js +14 -12
  123. package/esm/PieChart/PiePlot.js +4 -4
  124. package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +6 -4
  125. package/esm/ScatterChart/Scatter.js +17 -3
  126. package/esm/ScatterChart/ScatterChart.js +21 -10
  127. package/esm/ScatterChart/ScatterPlot.js +10 -2
  128. package/esm/SparkLineChart/SparkLineChart.js +7 -4
  129. package/esm/context/CartesianContextProvider.js +8 -6
  130. package/esm/context/DrawingProvider.js +9 -2
  131. package/esm/hooks/useDrawingArea.js +7 -3
  132. package/esm/index.js +1 -0
  133. package/esm/internals/geometry.js +1 -1
  134. package/esm/internals/useAnimatedPath.js +29 -0
  135. package/esm/internals/utils.js +7 -0
  136. package/hooks/useDrawingArea.d.ts +2 -0
  137. package/hooks/useDrawingArea.js +7 -3
  138. package/index.d.ts +1 -0
  139. package/index.js +12 -1
  140. package/internals/defaultizeColor.d.ts +16 -16
  141. package/internals/defaultizeValueFormatter.d.ts +4 -7
  142. package/internals/geometry.js +1 -1
  143. package/internals/stackSeries.d.ts +4 -7
  144. package/internals/useAnimatedPath.d.ts +1 -0
  145. package/internals/useAnimatedPath.js +38 -0
  146. package/internals/utils.d.ts +4 -0
  147. package/internals/utils.js +8 -0
  148. package/legacy/BarChart/BarChart.js +33 -12
  149. package/legacy/BarChart/BarElement.js +6 -2
  150. package/legacy/BarChart/BarPlot.js +28 -14
  151. package/legacy/BarChart/formatter.js +1 -1
  152. package/legacy/ChartContainer/ChartContainer.js +6 -4
  153. package/legacy/ChartsAxis/ChartsAxis.js +4 -4
  154. package/legacy/ChartsLegend/ChartsLegend.js +2 -323
  155. package/legacy/ChartsLegend/DefaultChartsLegend.js +302 -0
  156. package/legacy/ChartsLegend/index.js +1 -0
  157. package/legacy/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +75 -0
  158. package/legacy/ChartsOnAxisClickHandler/index.js +1 -0
  159. package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  160. package/legacy/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
  161. package/legacy/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
  162. package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +6 -7
  163. package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  164. package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +8 -5
  165. package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  166. package/legacy/ChartsTooltip/utils.js +12 -0
  167. package/legacy/ChartsVoronoiHandler/ChartsVoronoiHandler.js +88 -44
  168. package/legacy/ChartsXAxis/ChartsXAxis.js +12 -8
  169. package/legacy/ChartsYAxis/ChartsYAxis.js +1 -1
  170. package/legacy/LineChart/AnimatedArea.js +102 -0
  171. package/legacy/LineChart/AnimatedLine.js +104 -0
  172. package/legacy/LineChart/AreaElement.js +15 -35
  173. package/legacy/LineChart/AreaPlot.js +102 -66
  174. package/legacy/LineChart/LineChart.js +45 -14
  175. package/legacy/LineChart/LineElement.js +15 -37
  176. package/legacy/LineChart/LineHighlightElement.js +5 -3
  177. package/legacy/LineChart/LinePlot.js +97 -63
  178. package/legacy/LineChart/MarkElement.js +30 -12
  179. package/legacy/LineChart/MarkPlot.js +83 -53
  180. package/legacy/LineChart/formatter.js +1 -1
  181. package/legacy/LineChart/index.js +2 -0
  182. package/legacy/PieChart/PieArc.js +1 -0
  183. package/legacy/PieChart/PieArcLabel.js +1 -0
  184. package/legacy/PieChart/PieArcLabelPlot.js +2 -2
  185. package/legacy/PieChart/PieArcPlot.js +7 -7
  186. package/legacy/PieChart/PieChart.js +14 -12
  187. package/legacy/PieChart/PiePlot.js +4 -4
  188. package/legacy/ResponsiveChartContainer/ResponsiveChartContainer.js +6 -4
  189. package/legacy/ScatterChart/Scatter.js +19 -3
  190. package/legacy/ScatterChart/ScatterChart.js +21 -10
  191. package/legacy/ScatterChart/ScatterPlot.js +10 -2
  192. package/legacy/SparkLineChart/SparkLineChart.js +8 -5
  193. package/legacy/context/CartesianContextProvider.js +8 -6
  194. package/legacy/context/DrawingProvider.js +11 -2
  195. package/legacy/hooks/useDrawingArea.js +7 -3
  196. package/legacy/index.js +2 -1
  197. package/legacy/internals/geometry.js +1 -1
  198. package/legacy/internals/useAnimatedPath.js +32 -0
  199. package/legacy/internals/utils.js +7 -0
  200. package/models/axis.d.ts +7 -2
  201. package/models/seriesType/common.d.ts +2 -1
  202. package/models/seriesType/config.d.ts +7 -12
  203. package/models/seriesType/line.d.ts +2 -2
  204. package/models/seriesType/pie.d.ts +7 -3
  205. package/models/seriesType/scatter.d.ts +5 -2
  206. package/modern/BarChart/BarChart.js +33 -12
  207. package/modern/BarChart/BarElement.js +7 -3
  208. package/modern/BarChart/BarPlot.js +27 -15
  209. package/modern/BarChart/formatter.js +1 -1
  210. package/modern/ChartContainer/ChartContainer.js +6 -4
  211. package/modern/ChartsAxis/ChartsAxis.js +4 -4
  212. package/modern/ChartsLegend/ChartsLegend.js +2 -307
  213. package/modern/ChartsLegend/DefaultChartsLegend.js +286 -0
  214. package/modern/ChartsLegend/index.js +1 -0
  215. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +75 -0
  216. package/modern/ChartsOnAxisClickHandler/index.js +1 -0
  217. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  218. package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +1 -1
  219. package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +1 -1
  220. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +6 -5
  221. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
  222. package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +7 -5
  223. package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
  224. package/modern/ChartsTooltip/utils.js +12 -0
  225. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +92 -44
  226. package/modern/ChartsXAxis/ChartsXAxis.js +13 -9
  227. package/modern/ChartsYAxis/ChartsYAxis.js +1 -1
  228. package/modern/LineChart/AnimatedArea.js +103 -0
  229. package/modern/LineChart/AnimatedLine.js +105 -0
  230. package/modern/LineChart/AreaElement.js +16 -33
  231. package/modern/LineChart/AreaPlot.js +91 -58
  232. package/modern/LineChart/LineChart.js +45 -14
  233. package/modern/LineChart/LineElement.js +16 -35
  234. package/modern/LineChart/LineHighlightElement.js +5 -3
  235. package/modern/LineChart/LinePlot.js +89 -56
  236. package/modern/LineChart/MarkElement.js +27 -13
  237. package/modern/LineChart/MarkPlot.js +80 -51
  238. package/modern/LineChart/formatter.js +1 -1
  239. package/modern/LineChart/index.js +2 -0
  240. package/modern/PieChart/PieArc.js +1 -0
  241. package/modern/PieChart/PieArcLabel.js +1 -0
  242. package/modern/PieChart/PieArcLabelPlot.js +2 -2
  243. package/modern/PieChart/PieArcPlot.js +7 -7
  244. package/modern/PieChart/PieChart.js +14 -12
  245. package/modern/PieChart/PiePlot.js +4 -4
  246. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +6 -4
  247. package/modern/ScatterChart/Scatter.js +17 -3
  248. package/modern/ScatterChart/ScatterChart.js +21 -10
  249. package/modern/ScatterChart/ScatterPlot.js +10 -2
  250. package/modern/SparkLineChart/SparkLineChart.js +7 -4
  251. package/modern/context/CartesianContextProvider.js +8 -6
  252. package/modern/context/DrawingProvider.js +9 -2
  253. package/modern/hooks/useDrawingArea.js +7 -3
  254. package/modern/index.js +2 -1
  255. package/modern/internals/geometry.js +1 -1
  256. package/modern/internals/useAnimatedPath.js +29 -0
  257. package/modern/internals/utils.js +7 -0
  258. package/package.json +6 -5
package/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export * from './ChartsTooltip';
13
13
  export * from './ChartsLegend';
14
14
  export * from './ChartsAxisHighlight';
15
15
  export * from './ChartsVoronoiHandler';
16
+ export * from './ChartsOnAxisClickHandler';
16
17
  export * from './BarChart';
17
18
  export * from './LineChart';
18
19
  export * from './PieChart';
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v7.0.0-beta.0
2
+ * @mui/x-charts v7.0.0-beta.2
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -175,6 +175,17 @@ Object.keys(_ChartsVoronoiHandler).forEach(function (key) {
175
175
  }
176
176
  });
177
177
  });
178
+ var _ChartsOnAxisClickHandler = require("./ChartsOnAxisClickHandler");
179
+ Object.keys(_ChartsOnAxisClickHandler).forEach(function (key) {
180
+ if (key === "default" || key === "__esModule") return;
181
+ if (key in exports && exports[key] === _ChartsOnAxisClickHandler[key]) return;
182
+ Object.defineProperty(exports, key, {
183
+ enumerable: true,
184
+ get: function () {
185
+ return _ChartsOnAxisClickHandler[key];
186
+ }
187
+ });
188
+ });
178
189
  var _BarChart = require("./BarChart");
179
190
  Object.keys(_BarChart).forEach(function (key) {
180
191
  if (key === "default" || key === "__esModule") return;
@@ -4,7 +4,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
4
4
  color: string;
5
5
  label?: string | undefined;
6
6
  value: number;
7
- id?: string | number | undefined;
7
+ id?: import("../models/seriesType").PieItemId | undefined;
8
8
  }[];
9
9
  type: "pie";
10
10
  innerRadius?: string | number | undefined;
@@ -37,7 +37,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
37
37
  arcLabelRadius?: number | undefined;
38
38
  color?: string | undefined;
39
39
  } | undefined;
40
- id?: string | undefined;
40
+ id?: import("../models/seriesType/common").SeriesId | undefined;
41
41
  color?: string | undefined;
42
42
  valueFormatter?: (<V extends import("../models/helpers").MakeOptional<import("../models/seriesType").PieValueType, "id">>(value: V) => string) | undefined;
43
43
  highlightScope?: Partial<import("..").HighlightScope> | undefined;
@@ -48,7 +48,7 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
48
48
  label?: string | undefined;
49
49
  layout?: "horizontal" | "vertical" | undefined;
50
50
  stackOffset?: import("..").StackOffsetType | undefined;
51
- id?: string | undefined;
51
+ id?: import("../models/seriesType/common").SeriesId | undefined;
52
52
  color: string;
53
53
  valueFormatter?: (<V_1 extends number | null>(value: V_1) => string) | undefined;
54
54
  highlightScope?: Partial<import("..").HighlightScope> | undefined;
@@ -56,6 +56,18 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
56
56
  yAxisKey?: string | undefined;
57
57
  stack?: string | undefined;
58
58
  stackOrder?: import("..").StackOrderType | undefined;
59
+ } | {
60
+ type: "scatter";
61
+ data: import("../models/seriesType").ScatterValueType[];
62
+ markerSize?: number | undefined;
63
+ label?: string | undefined;
64
+ disableHover?: boolean | undefined;
65
+ id?: import("../models/seriesType/common").SeriesId | undefined;
66
+ color: string;
67
+ valueFormatter?: (<V_2 extends import("../models/seriesType").ScatterValueType>(value: V_2) => string) | undefined;
68
+ highlightScope?: Partial<import("..").HighlightScope> | undefined;
69
+ xAxisKey?: string | undefined;
70
+ yAxisKey?: string | undefined;
59
71
  } | {
60
72
  type: "line";
61
73
  data?: (number | null)[] | undefined;
@@ -68,23 +80,11 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
68
80
  disableHighlight?: boolean | undefined;
69
81
  connectNulls?: boolean | undefined;
70
82
  stackOffset?: import("..").StackOffsetType | undefined;
71
- id?: string | undefined;
83
+ id?: import("../models/seriesType/common").SeriesId | undefined;
72
84
  color: string;
73
85
  valueFormatter?: (<V_1 extends number | null>(value: V_1) => string) | undefined;
74
86
  highlightScope?: Partial<import("..").HighlightScope> | undefined;
75
87
  xAxisKey?: string | undefined;
76
88
  yAxisKey?: string | undefined;
77
89
  stackOrder?: import("..").StackOrderType | undefined;
78
- } | {
79
- type: "scatter";
80
- data: import("../models/seriesType").ScatterValueType[];
81
- markerSize?: number | undefined;
82
- label?: string | undefined;
83
- disableHover?: boolean | undefined;
84
- id?: string | undefined;
85
- color: string;
86
- valueFormatter?: (<V_2 extends import("../models/seriesType").ScatterValueType>(value: V_2) => string) | undefined;
87
- highlightScope?: Partial<import("..").HighlightScope> | undefined;
88
- xAxisKey?: string | undefined;
89
- yAxisKey?: string | undefined;
90
90
  };
@@ -1,10 +1,7 @@
1
+ import { SeriesId } from '../models/seriesType/common';
1
2
  declare function defaultizeValueFormatter<ISeries extends {
2
3
  valueFormatter?: IFormatter;
3
- }, IFormatter extends (v: any) => string>(series: {
4
- [id: string]: ISeries;
5
- }, defaultValueFormatter: IFormatter): {
6
- [id: string]: ISeries & {
7
- valueFormatter: IFormatter;
8
- };
9
- };
4
+ }, IFormatter extends (v: any) => string>(series: Record<SeriesId, ISeries>, defaultValueFormatter: IFormatter): Record<SeriesId, ISeries & {
5
+ valueFormatter: IFormatter;
6
+ }>;
10
7
  export default defaultizeValueFormatter;
@@ -20,7 +20,7 @@ function getMinXTranslation(width, height, angle = 0) {
20
20
  if (process.env.NODE_ENV !== 'production') {
21
21
  if (!warnedOnce && angle > 90 && angle < -90) {
22
22
  warnedOnce = true;
23
- console.warn([`MUI X: It seems you applied an angle larger than 90° or smaller than -90° to an axis text.`, `This could cause some text overlapping.`, `If you encounter a use case where it's needed, please open an issue.`].join('\n'));
23
+ console.warn([`MUI X Charts: It seems you applied an angle larger than 90° or smaller than -90° to an axis text.`, `This could cause some text overlapping.`, `If you encounter a use case where it's needed, please open an issue.`].join('\n'));
24
24
  }
25
25
  }
26
26
  const standardAngle = Math.min(Math.abs(angle) % 180, Math.abs(Math.abs(angle) % 180 - 180) % 180); // Map from R to [0, 90]
@@ -1,21 +1,18 @@
1
1
  import { Series } from 'd3-shape';
2
2
  import type { BarSeriesType, LineSeriesType } from '../models/seriesType';
3
3
  import type { StackOffsetType, StackOrderType } from '../models/stacking';
4
- type StackableSeries = {
5
- [id: string]: BarSeriesType;
6
- } | {
7
- [id: string]: LineSeriesType;
8
- };
4
+ import { SeriesId } from '../models/seriesType/common';
5
+ type StackableSeries = Record<SeriesId, BarSeriesType> | Record<SeriesId, LineSeriesType>;
9
6
  type FormatterParams = {
10
7
  series: StackableSeries;
11
- seriesOrder: string[];
8
+ seriesOrder: SeriesId[];
12
9
  defaultStrategy?: {
13
10
  stackOrder?: StackOrderType;
14
11
  stackOffset?: StackOffsetType;
15
12
  };
16
13
  };
17
14
  export type StackingGroupsType = {
18
- ids: string[];
15
+ ids: SeriesId[];
19
16
  stackingOrder: (series: Series<any, any>) => number[];
20
17
  stackingOffset: (series: Series<any, any>, order: Iterable<number>) => void;
21
18
  }[];
@@ -0,0 +1 @@
1
+ export declare const useAnimatedPath: (path: string, skipAnimation?: boolean) => import("@react-spring/core").Interpolation<string, any>;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useAnimatedPath = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _d3Interpolate = require("d3-interpolate");
9
+ var _web = require("@react-spring/web");
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ function usePrevious(value) {
13
+ const ref = React.useRef(null);
14
+ React.useEffect(() => {
15
+ ref.current = value;
16
+ }, [value]);
17
+ return ref.current;
18
+ }
19
+
20
+ // Taken from Nivo
21
+ const useAnimatedPath = (path, skipAnimation) => {
22
+ const previousPath = usePrevious(path);
23
+ const interpolator = React.useMemo(() => previousPath ? (0, _d3Interpolate.interpolateString)(previousPath, path) : () => path, [previousPath, path]);
24
+ const {
25
+ value
26
+ } = (0, _web.useSpring)({
27
+ from: {
28
+ value: 0
29
+ },
30
+ to: {
31
+ value: 1
32
+ },
33
+ reset: true,
34
+ immediate: skipAnimation
35
+ });
36
+ return (0, _web.to)([value], interpolator);
37
+ };
38
+ exports.useAnimatedPath = useAnimatedPath;
@@ -17,4 +17,8 @@ export declare function getSVGPoint(svg: SVGSVGElement, event: MouseEvent): DOMP
17
17
  * @returns The numerical value associated to the provided value.
18
18
  */
19
19
  export declare function getPercentageValue(value: number | string, refValue: number): number;
20
+ /**
21
+ * Remove spaces to have viable ids
22
+ */
23
+ export declare function cleanId(id: string): string;
20
24
  export {};
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.cleanId = cleanId;
6
7
  exports.getPercentageValue = getPercentageValue;
7
8
  exports.getSVGPoint = getSVGPoint;
8
9
  exports.getSymbol = getSymbol;
@@ -50,4 +51,11 @@ function getPercentageValue(value, refValue) {
50
51
  }
51
52
  }
52
53
  throw Error(`MUI-Charts: Received an unknown value "${value}". It should be a number, or a string with a percentage value.`);
54
+ }
55
+
56
+ /**
57
+ * Remove spaces to have viable ids
58
+ */
59
+ function cleanId(id) {
60
+ return id.replace(' ', '_');
53
61
  }
@@ -11,6 +11,7 @@ import { ChartsTooltip } from '../ChartsTooltip';
11
11
  import { ChartsLegend } from '../ChartsLegend';
12
12
  import { ChartsAxisHighlight } from '../ChartsAxisHighlight';
13
13
  import { ChartsClipPath } from '../ChartsClipPath';
14
+ import { ChartsOnAxisClickHandler } from '../ChartsOnAxisClickHandler';
14
15
  import { jsx as _jsx } from "react/jsx-runtime";
15
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
16
17
  /**
@@ -43,6 +44,8 @@ var BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
43
44
  rightAxis = props.rightAxis,
44
45
  bottomAxis = props.bottomAxis,
45
46
  skipAnimation = props.skipAnimation,
47
+ onItemClick = props.onItemClick,
48
+ onAxisClick = props.onAxisClick,
46
49
  children = props.children,
47
50
  slots = props.slots,
48
51
  slotProps = props.slotProps;
@@ -88,13 +91,16 @@ var BarChart = /*#__PURE__*/React.forwardRef(function BarChart(props, ref) {
88
91
  colors: colors,
89
92
  dataset: dataset,
90
93
  sx: sx,
91
- disableAxisListener: (tooltip == null ? void 0 : tooltip.trigger) !== 'axis' && (axisHighlight == null ? void 0 : axisHighlight.x) === 'none' && (axisHighlight == null ? void 0 : axisHighlight.y) === 'none',
92
- children: [/*#__PURE__*/_jsx("g", {
94
+ disableAxisListener: (tooltip == null ? void 0 : tooltip.trigger) !== 'axis' && (axisHighlight == null ? void 0 : axisHighlight.x) === 'none' && (axisHighlight == null ? void 0 : axisHighlight.y) === 'none' && !onAxisClick,
95
+ children: [onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, {
96
+ onAxisClick: onAxisClick
97
+ }), /*#__PURE__*/_jsx("g", {
93
98
  clipPath: "url(#".concat(clipPathId, ")"),
94
99
  children: /*#__PURE__*/_jsx(BarPlot, {
95
100
  slots: slots,
96
101
  slotProps: slotProps,
97
- skipAnimation: skipAnimation
102
+ skipAnimation: skipAnimation,
103
+ onItemClick: onItemClick
98
104
  })
99
105
  }), /*#__PURE__*/_jsx(ChartsAxis, {
100
106
  topAxis: topAxis,
@@ -136,7 +142,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
136
142
  * @default xAxisIds[0] The id of the first provided axis
137
143
  */
138
144
  bottomAxis: PropTypes.oneOfType([PropTypes.shape({
139
- axisId: PropTypes.string,
145
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
140
146
  classes: PropTypes.object,
141
147
  disableLine: PropTypes.bool,
142
148
  disableTicks: PropTypes.bool,
@@ -187,7 +193,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
187
193
  * @default yAxisIds[0] The id of the first provided axis
188
194
  */
189
195
  leftAxis: PropTypes.oneOfType([PropTypes.shape({
190
- axisId: PropTypes.string,
196
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
191
197
  classes: PropTypes.object,
192
198
  disableLine: PropTypes.bool,
193
199
  disableTicks: PropTypes.bool,
@@ -234,13 +240,26 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
234
240
  right: PropTypes.number,
235
241
  top: PropTypes.number
236
242
  }),
243
+ /**
244
+ * The function called for onClick events.
245
+ * The second argument contains information about all line/bar elements at the current mouse position.
246
+ * @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
247
+ * @param {null | AxisData} data The data about the clicked axis and items associated with it.
248
+ */
249
+ onAxisClick: PropTypes.func,
250
+ /**
251
+ * Callback fired when a bar item is clicked.
252
+ * @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
253
+ * @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
254
+ */
255
+ onItemClick: PropTypes.func,
237
256
  /**
238
257
  * Indicate which axis to display the right of the charts.
239
258
  * Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
240
259
  * @default null
241
260
  */
242
261
  rightAxis: PropTypes.oneOfType([PropTypes.shape({
243
- axisId: PropTypes.string,
262
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
244
263
  classes: PropTypes.object,
245
264
  disableLine: PropTypes.bool,
246
265
  disableTicks: PropTypes.bool,
@@ -263,7 +282,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
263
282
  }), PropTypes.string]),
264
283
  series: PropTypes.arrayOf(PropTypes.object).isRequired,
265
284
  /**
266
- * If `true`, animations are skiped.
285
+ * If `true`, animations are skipped.
267
286
  * @default false
268
287
  */
269
288
  skipAnimation: PropTypes.bool,
@@ -293,7 +312,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
293
312
  * @default null
294
313
  */
295
314
  topAxis: PropTypes.oneOfType([PropTypes.shape({
296
- axisId: PropTypes.string,
315
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
297
316
  classes: PropTypes.object,
298
317
  disableLine: PropTypes.bool,
299
318
  disableTicks: PropTypes.bool,
@@ -330,7 +349,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
330
349
  * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
331
350
  */
332
351
  xAxis: PropTypes.arrayOf(PropTypes.shape({
333
- axisId: PropTypes.string,
352
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
334
353
  classes: PropTypes.object,
335
354
  data: PropTypes.array,
336
355
  dataKey: PropTypes.string,
@@ -338,13 +357,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
338
357
  disableTicks: PropTypes.bool,
339
358
  fill: PropTypes.string,
340
359
  hideTooltip: PropTypes.bool,
341
- id: PropTypes.string,
360
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
342
361
  label: PropTypes.string,
343
362
  labelFontSize: PropTypes.number,
344
363
  labelStyle: PropTypes.object,
345
364
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
346
365
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
347
366
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
367
+ reverse: PropTypes.bool,
348
368
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
349
369
  slotProps: PropTypes.object,
350
370
  slots: PropTypes.object,
@@ -364,7 +384,7 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
364
384
  * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
365
385
  */
366
386
  yAxis: PropTypes.arrayOf(PropTypes.shape({
367
- axisId: PropTypes.string,
387
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
368
388
  classes: PropTypes.object,
369
389
  data: PropTypes.array,
370
390
  dataKey: PropTypes.string,
@@ -372,13 +392,14 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
372
392
  disableTicks: PropTypes.bool,
373
393
  fill: PropTypes.string,
374
394
  hideTooltip: PropTypes.bool,
375
- id: PropTypes.string,
395
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
376
396
  label: PropTypes.string,
377
397
  labelFontSize: PropTypes.number,
378
398
  labelStyle: PropTypes.object,
379
399
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
380
400
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
381
401
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
402
+ reverse: PropTypes.bool,
382
403
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
383
404
  slotProps: PropTypes.object,
384
405
  slots: PropTypes.object,
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "slots", "slotProps", "style"];
3
+ var _excluded = ["id", "dataIndex", "classes", "color", "highlightScope", "slots", "slotProps", "style", "onClick"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import composeClasses from '@mui/utils/composeClasses';
@@ -51,6 +51,7 @@ function BarElement(props) {
51
51
  slots = props.slots,
52
52
  slotProps = props.slotProps,
53
53
  style = props.style,
54
+ onClick = props.onClick,
54
55
  other = _objectWithoutProperties(props, _excluded);
55
56
  var getInteractionItemProps = useInteractionItemProps(highlightScope);
56
57
  var _React$useContext = React.useContext(InteractionContext),
@@ -84,7 +85,9 @@ function BarElement(props) {
84
85
  dataIndex: dataIndex
85
86
  }), {
86
87
  style: style,
87
- className: classes.root
88
+ className: classes.root,
89
+ onClick: onClick,
90
+ cursor: onClick ? 'pointer' : 'unset'
88
91
  }),
89
92
  ownerState: ownerState
90
93
  });
@@ -101,6 +104,7 @@ process.env.NODE_ENV !== "production" ? BarElement.propTypes = {
101
104
  faded: PropTypes.oneOf(['global', 'none', 'series']),
102
105
  highlighted: PropTypes.oneOf(['item', 'none', 'series'])
103
106
  }),
107
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
104
108
  /**
105
109
  * The props used for each component slot.
106
110
  * @default {}
@@ -1,7 +1,7 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
4
- var _excluded = ["skipAnimation"];
4
+ var _excluded = ["skipAnimation", "onItemClick"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import { useTransition } from '@react-spring/web';
@@ -10,7 +10,7 @@ import { CartesianContext } from '../context/CartesianContextProvider';
10
10
  import { BarElement } from './BarElement';
11
11
  import { isBandScaleConfig } from '../models/axis';
12
12
  import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '../constants';
13
-
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  /**
15
15
  * Solution of the equations
16
16
  * W = barWidth * N + offset * (N-1)
@@ -20,7 +20,6 @@ import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '../constants';
20
20
  * @param gapRatio The ratio of the gap between bars over the bar width.
21
21
  * @returns The bar width and the offset between bars.
22
22
  */
23
- import { jsx as _jsx } from "react/jsx-runtime";
24
23
  function getBandSize(_ref) {
25
24
  var W = _ref.bandWidth,
26
25
  N = _ref.numberOfGroups,
@@ -38,7 +37,7 @@ function getBandSize(_ref) {
38
37
  offset: offset
39
38
  };
40
39
  }
41
- var useCompletedData = function useCompletedData() {
40
+ var useAggregatedData = function useAggregatedData() {
42
41
  var _React$useContext$bar;
43
42
  var seriesData = (_React$useContext$bar = React.useContext(SeriesContext).bar) != null ? _React$useContext$bar : {
44
43
  series: {},
@@ -97,20 +96,21 @@ var useCompletedData = function useCompletedData() {
97
96
  color = _series$seriesId.color;
98
97
  return stackedData.map(function (values, dataIndex) {
99
98
  var _xAxis$xAxisKey$data, _yAxis$yAxisKey$data;
100
- var bottom = Math.min.apply(Math, _toConsumableArray(values));
101
- var top = Math.max.apply(Math, _toConsumableArray(values));
99
+ var valueCoordinates = values.map(function (v) {
100
+ return verticalLayout ? yScale(v) : xScale(v);
101
+ });
102
+ var minValueCoord = Math.min.apply(Math, _toConsumableArray(valueCoordinates));
103
+ var maxValueCoord = Math.max.apply(Math, _toConsumableArray(valueCoordinates));
102
104
  return {
103
- bottom: bottom,
104
- top: top,
105
105
  seriesId: seriesId,
106
106
  dataIndex: dataIndex,
107
107
  layout: series[seriesId].layout,
108
- x: verticalLayout ? xScale((_xAxis$xAxisKey$data = xAxis[xAxisKey].data) == null ? void 0 : _xAxis$xAxisKey$data[dataIndex]) + barOffset : xScale(bottom),
109
- y: verticalLayout ? yScale(top) : yScale((_yAxis$yAxisKey$data = yAxis[yAxisKey].data) == null ? void 0 : _yAxis$yAxisKey$data[dataIndex]) + barOffset,
108
+ x: verticalLayout ? xScale((_xAxis$xAxisKey$data = xAxis[xAxisKey].data) == null ? void 0 : _xAxis$xAxisKey$data[dataIndex]) + barOffset : minValueCoord,
109
+ y: verticalLayout ? minValueCoord : yScale((_yAxis$yAxisKey$data = yAxis[yAxisKey].data) == null ? void 0 : _yAxis$yAxisKey$data[dataIndex]) + barOffset,
110
110
  xOrigin: xScale(0),
111
111
  yOrigin: yScale(0),
112
- height: verticalLayout ? Math.abs(yScale(bottom) - yScale(top)) : barWidth,
113
- width: verticalLayout ? barWidth : Math.abs(xScale(bottom) - xScale(top)),
112
+ height: verticalLayout ? maxValueCoord - minValueCoord : barWidth,
113
+ width: verticalLayout ? barWidth : maxValueCoord - minValueCoord,
114
114
  color: color,
115
115
  highlightScope: series[seriesId].highlightScope
116
116
  };
@@ -164,8 +164,9 @@ var getInStyle = function getInStyle(_ref4) {
164
164
  * - [BarPlot API](https://mui.com/x/api/charts/bar-plot/)
165
165
  */
166
166
  function BarPlot(props) {
167
- var completedData = useCompletedData();
167
+ var completedData = useAggregatedData();
168
168
  var skipAnimation = props.skipAnimation,
169
+ onItemClick = props.onItemClick,
169
170
  other = _objectWithoutProperties(props, _excluded);
170
171
  var transition = useTransition(completedData, {
171
172
  keys: function keys(bar) {
@@ -189,6 +190,13 @@ function BarPlot(props) {
189
190
  highlightScope: highlightScope,
190
191
  color: color
191
192
  }, other, {
193
+ onClick: onItemClick && function (event) {
194
+ onItemClick(event, {
195
+ type: 'bar',
196
+ seriesId: seriesId,
197
+ dataIndex: dataIndex
198
+ });
199
+ },
192
200
  style: style
193
201
  }));
194
202
  })
@@ -200,7 +208,13 @@ process.env.NODE_ENV !== "production" ? BarPlot.propTypes = {
200
208
  // | To update them edit the TypeScript types and run "yarn proptypes" |
201
209
  // ----------------------------------------------------------------------
202
210
  /**
203
- * If `true`, animations are skiped.
211
+ * Callback fired when a bar item is clicked.
212
+ * @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
213
+ * @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
214
+ */
215
+ onItemClick: PropTypes.func,
216
+ /**
217
+ * If `true`, animations are skipped.
204
218
  * @default false
205
219
  */
206
220
  skipAnimation: PropTypes.bool,
@@ -71,7 +71,7 @@ var formatter = function formatter(params, dataset) {
71
71
  seriesOrder: seriesOrder,
72
72
  stackingGroups: stackingGroups,
73
73
  series: defaultizeValueFormatter(completedSeries, function (v) {
74
- return v === null ? '' : v.toLocaleString();
74
+ return v == null ? '' : v.toLocaleString();
75
75
  })
76
76
  };
77
77
  };
@@ -120,7 +120,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
120
120
  * If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
121
121
  */
122
122
  xAxis: PropTypes.arrayOf(PropTypes.shape({
123
- axisId: PropTypes.string,
123
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
124
124
  classes: PropTypes.object,
125
125
  data: PropTypes.array,
126
126
  dataKey: PropTypes.string,
@@ -128,13 +128,14 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
128
128
  disableTicks: PropTypes.bool,
129
129
  fill: PropTypes.string,
130
130
  hideTooltip: PropTypes.bool,
131
- id: PropTypes.string,
131
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
132
132
  label: PropTypes.string,
133
133
  labelFontSize: PropTypes.number,
134
134
  labelStyle: PropTypes.object,
135
135
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
136
136
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
137
137
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
138
+ reverse: PropTypes.bool,
138
139
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
139
140
  slotProps: PropTypes.object,
140
141
  slots: PropTypes.object,
@@ -154,7 +155,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
154
155
  * If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
155
156
  */
156
157
  yAxis: PropTypes.arrayOf(PropTypes.shape({
157
- axisId: PropTypes.string,
158
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
158
159
  classes: PropTypes.object,
159
160
  data: PropTypes.array,
160
161
  dataKey: PropTypes.string,
@@ -162,13 +163,14 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
162
163
  disableTicks: PropTypes.bool,
163
164
  fill: PropTypes.string,
164
165
  hideTooltip: PropTypes.bool,
165
- id: PropTypes.string,
166
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
166
167
  label: PropTypes.string,
167
168
  labelFontSize: PropTypes.number,
168
169
  labelStyle: PropTypes.object,
169
170
  max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
170
171
  min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
171
172
  position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
173
+ reverse: PropTypes.bool,
172
174
  scaleType: PropTypes.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
173
175
  slotProps: PropTypes.object,
174
176
  slots: PropTypes.object,
@@ -99,7 +99,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
99
99
  * @default xAxisIds[0] The id of the first provided axis
100
100
  */
101
101
  bottomAxis: PropTypes.oneOfType([PropTypes.shape({
102
- axisId: PropTypes.string,
102
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
103
103
  classes: PropTypes.object,
104
104
  disableLine: PropTypes.bool,
105
105
  disableTicks: PropTypes.bool,
@@ -126,7 +126,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
126
126
  * @default yAxisIds[0] The id of the first provided axis
127
127
  */
128
128
  leftAxis: PropTypes.oneOfType([PropTypes.shape({
129
- axisId: PropTypes.string,
129
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
130
130
  classes: PropTypes.object,
131
131
  disableLine: PropTypes.bool,
132
132
  disableTicks: PropTypes.bool,
@@ -153,7 +153,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
153
153
  * @default null
154
154
  */
155
155
  rightAxis: PropTypes.oneOfType([PropTypes.shape({
156
- axisId: PropTypes.string,
156
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
157
157
  classes: PropTypes.object,
158
158
  disableLine: PropTypes.bool,
159
159
  disableTicks: PropTypes.bool,
@@ -190,7 +190,7 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
190
190
  * @default null
191
191
  */
192
192
  topAxis: PropTypes.oneOfType([PropTypes.shape({
193
- axisId: PropTypes.string,
193
+ axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
194
194
  classes: PropTypes.object,
195
195
  disableLine: PropTypes.bool,
196
196
  disableTicks: PropTypes.bool,