@mui/x-charts 7.11.0 → 7.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/BarChart/BarChart.js +0 -2
  2. package/BarChart/BarElement.d.ts +22 -21
  3. package/BarChart/BarElement.js +3 -3
  4. package/BarChart/BarLabel/BarLabel.d.ts +20 -20
  5. package/BarChart/BarLabel/BarLabelItem.d.ts +2 -1
  6. package/BarChart/BarLabel/BarLabelItem.js +2 -2
  7. package/BarChart/BarPlot.js +8 -8
  8. package/BarChart/checkScaleErrors.d.ts +4 -4
  9. package/BarChart/checkScaleErrors.js +11 -11
  10. package/BarChart/extremums.js +4 -1
  11. package/BarChart/formatter.js +3 -3
  12. package/CHANGELOG.md +194 -4
  13. package/ChartContainer/ChartContainer.d.ts +3 -3
  14. package/ChartContainer/ChartContainer.js +3 -5
  15. package/ChartContainer/useChartContainerProps.d.ts +50 -52
  16. package/ChartContainer/useChartContainerProps.js +2 -2
  17. package/ChartContainer/useDefaultizeAxis.d.ts +24 -25
  18. package/ChartContainer/usePluginsMerge.d.ts +1 -1
  19. package/ChartsAxis/ChartsAxis.js +4 -4
  20. package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  21. package/ChartsLegend/ChartsLegend.js +6 -6
  22. package/ChartsLegend/DefaultChartsLegend.d.ts +1 -1
  23. package/ChartsLegend/LegendPerItem.js +2 -2
  24. package/ChartsLegend/utils.d.ts +1 -1
  25. package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
  26. package/ChartsOverlay/ChartsOverlay.d.ts +3 -2
  27. package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  28. package/ChartsReferenceLine/ChartsXReferenceLine.js +1 -2
  29. package/ChartsReferenceLine/ChartsYReferenceLine.js +1 -2
  30. package/ChartsTooltip/ChartsAxisTooltipContent.js +9 -5
  31. package/ChartsTooltip/ChartsItemTooltipContent.js +6 -6
  32. package/ChartsTooltip/ChartsTooltip.d.ts +1 -1
  33. package/ChartsTooltip/ChartsTooltip.js +10 -10
  34. package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +5 -3
  35. package/ChartsXAxis/ChartsXAxis.js +5 -5
  36. package/ChartsYAxis/ChartsYAxis.js +6 -6
  37. package/Gauge/GaugeReferenceArc.js +1 -1
  38. package/Gauge/GaugeValueArc.js +1 -1
  39. package/LineChart/AnimatedArea.d.ts +20 -20
  40. package/LineChart/AnimatedArea.js +1 -1
  41. package/LineChart/AnimatedLine.d.ts +20 -20
  42. package/LineChart/AnimatedLine.js +1 -1
  43. package/LineChart/AreaElement.d.ts +2 -1
  44. package/LineChart/AreaElement.js +2 -2
  45. package/LineChart/AreaPlot.js +11 -7
  46. package/LineChart/LineChart.js +4 -3
  47. package/LineChart/LineElement.d.ts +2 -1
  48. package/LineChart/LineElement.js +2 -2
  49. package/LineChart/LineHighlightPlot.d.ts +2 -1
  50. package/LineChart/LineHighlightPlot.js +9 -5
  51. package/LineChart/LinePlot.js +11 -7
  52. package/LineChart/MarkElement.js +1 -1
  53. package/LineChart/MarkPlot.js +9 -5
  54. package/LineChart/extremums.js +4 -1
  55. package/LineChart/formatter.js +3 -3
  56. package/PieChart/PieArc.js +2 -1
  57. package/PieChart/PieArcLabel.js +1 -1
  58. package/PieChart/PieChart.js +0 -2
  59. package/PieChart/formatter.js +1 -1
  60. package/ResponsiveChartContainer/ResponsiveChartContainer.js +0 -2
  61. package/ResponsiveChartContainer/useChartContainerDimensions.js +2 -2
  62. package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +2 -2
  63. package/ScatterChart/ScatterChart.js +4 -3
  64. package/ScatterChart/ScatterPlot.js +6 -3
  65. package/ScatterChart/extremums.js +8 -2
  66. package/SparkLineChart/SparkLineChart.js +0 -2
  67. package/context/CartesianProvider/CartesianContext.d.ts +1 -1
  68. package/context/CartesianProvider/computeValue.d.ts +1 -1
  69. package/context/CartesianProvider/computeValue.js +1 -1
  70. package/context/CartesianProvider/defaultizeAxis.d.ts +24 -25
  71. package/context/CartesianProvider/getAxisExtremum.d.ts +1 -1
  72. package/context/CartesianProvider/normalizeAxis.js +1 -1
  73. package/context/DrawingProvider.d.ts +2 -1
  74. package/context/DrawingProvider.js +7 -1
  75. package/context/{SeriesContextProvider.d.ts → SeriesProvider/Series.types.d.ts} +4 -8
  76. package/context/SeriesProvider/Series.types.js +5 -0
  77. package/context/SeriesProvider/SeriesContext.d.ts +4 -0
  78. package/context/SeriesProvider/SeriesContext.js +16 -0
  79. package/context/SeriesProvider/SeriesProvider.d.ts +5 -0
  80. package/context/SeriesProvider/SeriesProvider.js +37 -0
  81. package/context/SeriesProvider/index.d.ts +12 -0
  82. package/context/SeriesProvider/index.js +49 -0
  83. package/context/SeriesProvider/processSeries.d.ts +17 -0
  84. package/context/SeriesProvider/processSeries.js +55 -0
  85. package/context/ZAxisContextProvider.d.ts +1 -1
  86. package/context/ZAxisContextProvider.js +1 -1
  87. package/esm/BarChart/BarChart.js +0 -2
  88. package/esm/BarChart/BarElement.js +2 -2
  89. package/esm/BarChart/BarLabel/BarLabelItem.js +1 -1
  90. package/esm/BarChart/BarPlot.js +8 -8
  91. package/esm/BarChart/checkScaleErrors.js +11 -11
  92. package/esm/BarChart/extremums.js +4 -1
  93. package/esm/BarChart/formatter.js +3 -3
  94. package/esm/ChartContainer/ChartContainer.js +3 -5
  95. package/esm/ChartContainer/useChartContainerProps.js +2 -2
  96. package/esm/ChartsAxis/ChartsAxis.js +4 -4
  97. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  98. package/esm/ChartsLegend/ChartsLegend.js +2 -2
  99. package/esm/ChartsLegend/LegendPerItem.js +1 -1
  100. package/esm/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
  101. package/esm/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  102. package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +2 -3
  103. package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +2 -3
  104. package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
  105. package/esm/ChartsTooltip/ChartsItemTooltipContent.js +5 -5
  106. package/esm/ChartsTooltip/ChartsTooltip.js +3 -3
  107. package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +5 -3
  108. package/esm/ChartsXAxis/ChartsXAxis.js +2 -2
  109. package/esm/ChartsYAxis/ChartsYAxis.js +2 -2
  110. package/esm/Gauge/GaugeReferenceArc.js +1 -1
  111. package/esm/Gauge/GaugeValueArc.js +1 -1
  112. package/esm/LineChart/AnimatedArea.js +1 -1
  113. package/esm/LineChart/AnimatedLine.js +1 -1
  114. package/esm/LineChart/AreaElement.js +1 -1
  115. package/esm/LineChart/AreaPlot.js +11 -7
  116. package/esm/LineChart/LineChart.js +4 -3
  117. package/esm/LineChart/LineElement.js +1 -1
  118. package/esm/LineChart/LineHighlightPlot.js +9 -5
  119. package/esm/LineChart/LinePlot.js +11 -7
  120. package/esm/LineChart/MarkElement.js +1 -1
  121. package/esm/LineChart/MarkPlot.js +9 -5
  122. package/esm/LineChart/extremums.js +4 -1
  123. package/esm/LineChart/formatter.js +3 -3
  124. package/esm/PieChart/PieArc.js +2 -1
  125. package/esm/PieChart/PieArcLabel.js +1 -1
  126. package/esm/PieChart/PieChart.js +0 -2
  127. package/esm/PieChart/formatter.js +1 -1
  128. package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +0 -2
  129. package/esm/ResponsiveChartContainer/useChartContainerDimensions.js +2 -2
  130. package/esm/ScatterChart/ScatterChart.js +4 -3
  131. package/esm/ScatterChart/ScatterPlot.js +6 -3
  132. package/esm/ScatterChart/extremums.js +8 -2
  133. package/esm/SparkLineChart/SparkLineChart.js +0 -2
  134. package/esm/context/CartesianProvider/computeValue.js +1 -1
  135. package/esm/context/CartesianProvider/normalizeAxis.js +1 -1
  136. package/esm/context/DrawingProvider.js +7 -1
  137. package/esm/context/SeriesProvider/Series.types.js +1 -0
  138. package/esm/context/SeriesProvider/SeriesContext.js +8 -0
  139. package/esm/context/SeriesProvider/SeriesProvider.js +30 -0
  140. package/esm/context/SeriesProvider/index.js +8 -0
  141. package/esm/context/{SeriesContextProvider.js → SeriesProvider/processSeries.js} +10 -35
  142. package/esm/context/ZAxisContextProvider.js +1 -1
  143. package/esm/hooks/useAxisEvents.js +12 -8
  144. package/esm/hooks/useReducedMotion.js +2 -2
  145. package/esm/hooks/useSeries.js +1 -1
  146. package/esm/internals/SlotComponentPropsFromProps.js +1 -0
  147. package/esm/internals/colorScale.js +1 -1
  148. package/esm/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +1 -1
  149. package/esm/internals/geometry.js +1 -1
  150. package/esm/internals/getCurve.js +1 -1
  151. package/esm/internals/getPercentageValue.js +1 -1
  152. package/esm/internals/getScale.js +1 -1
  153. package/esm/internals/index.js +1 -1
  154. package/esm/internals/stackSeries.js +1 -1
  155. package/esm/internals/useAnimatedPath.js +1 -1
  156. package/esm/internals/warning.js +19 -11
  157. package/hooks/useAxisEvents.js +12 -8
  158. package/hooks/useReducedMotion.js +2 -2
  159. package/hooks/useSeries.d.ts +1 -1
  160. package/hooks/useSeries.js +2 -2
  161. package/hooks/useTicks.d.ts +1 -1
  162. package/index.js +1 -1
  163. package/internals/SlotComponentPropsFromProps.d.ts +1 -0
  164. package/internals/SlotComponentPropsFromProps.js +5 -0
  165. package/internals/colorScale.d.ts +3 -3
  166. package/internals/colorScale.js +1 -1
  167. package/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +1 -1
  168. package/internals/defaultizeColor.d.ts +8 -1
  169. package/internals/geometry.js +1 -1
  170. package/internals/getCurve.d.ts +1 -1
  171. package/internals/getCurve.js +1 -1
  172. package/internals/getPercentageValue.js +1 -1
  173. package/internals/getScale.js +1 -1
  174. package/internals/index.d.ts +1 -1
  175. package/internals/index.js +4 -4
  176. package/internals/isBandScale.d.ts +1 -1
  177. package/internals/stackSeries.d.ts +1 -1
  178. package/internals/stackSeries.js +1 -1
  179. package/internals/useAnimatedPath.js +1 -1
  180. package/internals/warning.d.ts +2 -1
  181. package/internals/warning.js +21 -12
  182. package/models/axis.d.ts +2 -2
  183. package/models/seriesType/common.d.ts +10 -0
  184. package/models/seriesType/pie.d.ts +1 -1
  185. package/models/seriesType/scatter.d.ts +5 -0
  186. package/models/z-axis.d.ts +1 -1
  187. package/modern/BarChart/BarChart.js +0 -2
  188. package/modern/BarChart/BarElement.js +2 -2
  189. package/modern/BarChart/BarLabel/BarLabelItem.js +1 -1
  190. package/modern/BarChart/BarPlot.js +8 -8
  191. package/modern/BarChart/checkScaleErrors.js +11 -11
  192. package/modern/BarChart/extremums.js +4 -1
  193. package/modern/BarChart/formatter.js +3 -3
  194. package/modern/ChartContainer/ChartContainer.js +3 -5
  195. package/modern/ChartContainer/useChartContainerProps.js +2 -2
  196. package/modern/ChartsAxis/ChartsAxis.js +4 -4
  197. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
  198. package/modern/ChartsLegend/ChartsLegend.js +2 -2
  199. package/modern/ChartsLegend/LegendPerItem.js +1 -1
  200. package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +3 -1
  201. package/modern/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
  202. package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +2 -3
  203. package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +2 -3
  204. package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +8 -4
  205. package/modern/ChartsTooltip/ChartsItemTooltipContent.js +5 -5
  206. package/modern/ChartsTooltip/ChartsTooltip.js +3 -3
  207. package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +5 -3
  208. package/modern/ChartsXAxis/ChartsXAxis.js +2 -2
  209. package/modern/ChartsYAxis/ChartsYAxis.js +2 -2
  210. package/modern/Gauge/GaugeReferenceArc.js +1 -1
  211. package/modern/Gauge/GaugeValueArc.js +1 -1
  212. package/modern/LineChart/AnimatedArea.js +1 -1
  213. package/modern/LineChart/AnimatedLine.js +1 -1
  214. package/modern/LineChart/AreaElement.js +1 -1
  215. package/modern/LineChart/AreaPlot.js +11 -7
  216. package/modern/LineChart/LineChart.js +4 -3
  217. package/modern/LineChart/LineElement.js +1 -1
  218. package/modern/LineChart/LineHighlightPlot.js +9 -5
  219. package/modern/LineChart/LinePlot.js +11 -7
  220. package/modern/LineChart/MarkElement.js +1 -1
  221. package/modern/LineChart/MarkPlot.js +9 -5
  222. package/modern/LineChart/extremums.js +4 -1
  223. package/modern/LineChart/formatter.js +3 -3
  224. package/modern/PieChart/PieArc.js +2 -1
  225. package/modern/PieChart/PieArcLabel.js +1 -1
  226. package/modern/PieChart/PieChart.js +0 -2
  227. package/modern/PieChart/formatter.js +1 -1
  228. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +0 -2
  229. package/modern/ResponsiveChartContainer/useChartContainerDimensions.js +2 -2
  230. package/modern/ScatterChart/ScatterChart.js +4 -3
  231. package/modern/ScatterChart/ScatterPlot.js +6 -3
  232. package/modern/ScatterChart/extremums.js +8 -2
  233. package/modern/SparkLineChart/SparkLineChart.js +0 -2
  234. package/modern/context/CartesianProvider/computeValue.js +1 -1
  235. package/modern/context/CartesianProvider/normalizeAxis.js +1 -1
  236. package/modern/context/DrawingProvider.js +7 -1
  237. package/modern/context/SeriesProvider/Series.types.js +1 -0
  238. package/modern/context/SeriesProvider/SeriesContext.js +8 -0
  239. package/modern/context/SeriesProvider/SeriesProvider.js +30 -0
  240. package/modern/context/SeriesProvider/index.js +8 -0
  241. package/modern/context/{SeriesContextProvider.js → SeriesProvider/processSeries.js} +10 -35
  242. package/modern/context/ZAxisContextProvider.js +1 -1
  243. package/modern/hooks/useAxisEvents.js +12 -8
  244. package/modern/hooks/useReducedMotion.js +2 -2
  245. package/modern/hooks/useSeries.js +1 -1
  246. package/modern/index.js +1 -1
  247. package/modern/internals/SlotComponentPropsFromProps.js +1 -0
  248. package/modern/internals/colorScale.js +1 -1
  249. package/modern/internals/components/ChartsAxesGradients/ChartsContinuousGradient.js +1 -1
  250. package/modern/internals/geometry.js +1 -1
  251. package/modern/internals/getCurve.js +1 -1
  252. package/modern/internals/getPercentageValue.js +1 -1
  253. package/modern/internals/getScale.js +1 -1
  254. package/modern/internals/index.js +1 -1
  255. package/modern/internals/stackSeries.js +1 -1
  256. package/modern/internals/useAnimatedPath.js +1 -1
  257. package/modern/internals/warning.js +19 -11
  258. package/package.json +8 -25
  259. package/context/SeriesContextProvider.js +0 -81
@@ -41,7 +41,7 @@ export interface TickParams {
41
41
  tickLabelPlacement?: 'middle' | 'tick';
42
42
  }
43
43
  export declare function getTickNumber(params: TickParams & {
44
- range: any[];
44
+ range: number[];
45
45
  domain: any[];
46
46
  }): number;
47
47
  export type TickItemType = {
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v7.11.0
2
+ * @mui/x-charts v7.12.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -0,0 +1 @@
1
+ export type SlotComponentPropsFromProps<TProps extends {}, TOverrides extends {}, TOwnerState extends {}> = (Partial<TProps> & TOverrides) | ((ownerState: TOwnerState) => Partial<TProps> & TOverrides);
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -1,5 +1,5 @@
1
- import { ScaleOrdinal } from 'd3-scale';
1
+ import { ScaleOrdinal } from '@mui/x-charts-vendor/d3-scale';
2
2
  import { ContinuousColorConfig, PiecewiseColorConfig, OrdinalColorConfig } from '../models/colorMapping';
3
- export declare function getSequentialColorScale<Value extends number | Date>(config: ContinuousColorConfig<Value> | PiecewiseColorConfig<Value>): import("d3-scale").ScaleThreshold<Value, string, never> | import("d3-scale").ScaleSequential<string, never>;
3
+ export declare function getSequentialColorScale<Value extends number | Date>(config: ContinuousColorConfig<Value> | PiecewiseColorConfig<Value>): import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<Value, string, never> | import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, never>;
4
4
  export declare function getOrdinalColorScale<Value extends number | Date | string>(config: OrdinalColorConfig<Value>): ScaleOrdinal<Value, string, null | string> | ScaleOrdinal<number, string, null | string>;
5
- export declare function getColorScale(config: ContinuousColorConfig | PiecewiseColorConfig | OrdinalColorConfig): import("d3-scale").ScaleSequential<string, never> | ScaleOrdinal<number, string, string | null> | ScaleOrdinal<string | number | Date, string, string | null> | import("d3-scale").ScaleThreshold<number | Date, string, never>;
5
+ export declare function getColorScale(config: ContinuousColorConfig | PiecewiseColorConfig | OrdinalColorConfig): import("@mui/x-charts-vendor/d3-scale").ScaleSequential<string, never> | ScaleOrdinal<number, string, string | null> | ScaleOrdinal<string | number | Date, string, string | null> | import("@mui/x-charts-vendor/d3-scale").ScaleThreshold<number | Date, string, never>;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.getColorScale = getColorScale;
7
7
  exports.getOrdinalColorScale = getOrdinalColorScale;
8
8
  exports.getSequentialColorScale = getSequentialColorScale;
9
- var _d3Scale = require("d3-scale");
9
+ var _d3Scale = require("@mui/x-charts-vendor/d3-scale");
10
10
  function getSequentialColorScale(config) {
11
11
  if (config.type === 'piecewise') {
12
12
  return (0, _d3Scale.scaleThreshold)(config.thresholds, config.colors);
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = ChartsContinuousGradient;
7
7
  var React = _interopRequireWildcard(require("react"));
8
- var _d3Interpolate = require("d3-interpolate");
8
+ var _d3Interpolate = require("@mui/x-charts-vendor/d3-interpolate");
9
9
  var _jsxRuntime = require("react/jsx-runtime");
10
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
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 && {}.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; }
@@ -2,7 +2,7 @@ import { AllSeriesType } from '../models/seriesType';
2
2
  export declare function defaultizeColor(series: AllSeriesType, seriesIndex: number, colors?: string[]): {
3
3
  data: {
4
4
  color: string;
5
- label?: string | ((location: "tooltip" | "legend" | "arc") => string);
5
+ label?: (string | ((location: "tooltip" | "legend" | "arc") => string)) | undefined;
6
6
  value: number;
7
7
  id?: import("../models/seriesType").PieItemId | undefined;
8
8
  }[];
@@ -56,6 +56,8 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
56
56
  highlightScope?: Partial<import("..").HighlightScope>;
57
57
  xAxisKey?: string;
58
58
  yAxisKey?: string;
59
+ xAxisId?: string;
60
+ yAxisId?: string;
59
61
  stack?: string;
60
62
  stackOrder?: import("..").StackOrderType;
61
63
  } | {
@@ -76,6 +78,8 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
76
78
  highlightScope?: Partial<import("..").HighlightScope>;
77
79
  xAxisKey?: string;
78
80
  yAxisKey?: string;
81
+ xAxisId?: string;
82
+ yAxisId?: string;
79
83
  stackOrder?: import("..").StackOrderType;
80
84
  } | {
81
85
  type: "scatter";
@@ -84,10 +88,13 @@ export declare function defaultizeColor(series: AllSeriesType, seriesIndex: numb
84
88
  label?: string | ((location: "tooltip" | "legend") => string);
85
89
  disableHover?: boolean;
86
90
  zAxisKey?: string;
91
+ zAxisId?: string;
87
92
  id?: import(".").SeriesId;
88
93
  color: string;
89
94
  valueFormatter?: import(".").SeriesValueFormatter<import("../models/seriesType").ScatterValueType> | undefined;
90
95
  highlightScope?: Partial<import("..").HighlightScope>;
91
96
  xAxisKey?: string;
92
97
  yAxisKey?: string;
98
+ xAxisId?: string;
99
+ yAxisId?: string;
93
100
  };
@@ -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 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'));
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'));
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,2 +1,2 @@
1
1
  import { CurveType } from '../models/seriesType/line';
2
- export default function getCurveFactory(curveType?: CurveType): import("d3-shape").CurveFactory;
2
+ export default function getCurveFactory(curveType?: CurveType): import("@mui/x-charts-vendor/d3-shape").CurveFactory;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = getCurveFactory;
7
- var _d3Shape = require("d3-shape");
7
+ var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
8
8
  function getCurveFactory(curveType) {
9
9
  switch (curveType) {
10
10
  case 'catmullRom':
@@ -30,5 +30,5 @@ function getPercentageValue(value, refValue) {
30
30
  return val;
31
31
  }
32
32
  }
33
- throw Error(`MUI X Charts: Received an unknown value "${value}". It should be a number, or a string with a percentage value.`);
33
+ throw Error(`MUI X: Received an unknown value "${value}". It should be a number, or a string with a percentage value.`);
34
34
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getScale = getScale;
7
- var _d3Scale = require("d3-scale");
7
+ var _d3Scale = require("@mui/x-charts-vendor/d3-scale");
8
8
  function getScale(scaleType, domain, range) {
9
9
  switch (scaleType) {
10
10
  case 'log':
@@ -19,7 +19,7 @@ export * from '../context/CartesianProvider';
19
19
  export * from '../context/DrawingProvider';
20
20
  export * from '../context/ColorProvider';
21
21
  export * from '../context/InteractionProvider';
22
- export * from '../context/SeriesContextProvider';
22
+ export * from '../context/SeriesProvider';
23
23
  export * from '../context/ZAxisContextProvider';
24
24
  export type * from '../context/context.types';
25
25
  export * from '../models/seriesType/config';
@@ -221,15 +221,15 @@ Object.keys(_InteractionProvider).forEach(function (key) {
221
221
  }
222
222
  });
223
223
  });
224
- var _SeriesContextProvider = require("../context/SeriesContextProvider");
225
- Object.keys(_SeriesContextProvider).forEach(function (key) {
224
+ var _SeriesProvider = require("../context/SeriesProvider");
225
+ Object.keys(_SeriesProvider).forEach(function (key) {
226
226
  if (key === "default" || key === "__esModule") return;
227
227
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
228
- if (key in exports && exports[key] === _SeriesContextProvider[key]) return;
228
+ if (key in exports && exports[key] === _SeriesProvider[key]) return;
229
229
  Object.defineProperty(exports, key, {
230
230
  enumerable: true,
231
231
  get: function () {
232
- return _SeriesContextProvider[key];
232
+ return _SeriesProvider[key];
233
233
  }
234
234
  });
235
235
  });
@@ -1,4 +1,4 @@
1
- import type { ScaleBand, ScalePoint } from 'd3-scale';
1
+ import type { ScaleBand, ScalePoint } from '@mui/x-charts-vendor/d3-scale';
2
2
  import { D3Scale } from '../models/axis';
3
3
  export declare function isBandScale<T extends {
4
4
  toString(): string;
@@ -1,4 +1,4 @@
1
- import { Series } from 'd3-shape';
1
+ import { Series } from '@mui/x-charts-vendor/d3-shape';
2
2
  import type { BarSeriesType, LineSeriesType } from '../models/seriesType';
3
3
  import type { StackOffsetType, StackOrderType } from '../models/stacking';
4
4
  import { SeriesId } from '../models/seriesType/common';
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getStackingGroups = exports.StackOrder = exports.StackOffset = void 0;
7
- var _d3Shape = require("d3-shape");
7
+ var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
8
8
  const StackOrder = exports.StackOrder = {
9
9
  /**
10
10
  * Series order such that the earliest series (according to the maximum value) is at the bottom.
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useAnimatedPath = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
- var _d3Interpolate = require("d3-interpolate");
8
+ var _d3Interpolate = require("@mui/x-charts-vendor/d3-interpolate");
9
9
  var _web = require("@react-spring/web");
10
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
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 && {}.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; }
@@ -1 +1,2 @@
1
- export declare function buildWarning(message: (...args: any) => string, gravity?: 'warning' | 'error'): (...args: any) => void;
1
+ export declare function warnOnce(message: string | string[], gravity?: 'warning' | 'error'): void;
2
+ export declare function clearWarningsCache(): void;
@@ -3,17 +3,26 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.buildWarning = buildWarning;
7
- function buildWarning(message, gravity = 'warning') {
8
- let alreadyWarned = false;
9
- return (...args) => {
10
- if (!alreadyWarned) {
11
- alreadyWarned = true;
12
- if (gravity === 'error') {
13
- console.error(message(...args));
14
- } else {
15
- console.warn(message(...args));
16
- }
6
+ exports.clearWarningsCache = clearWarningsCache;
7
+ exports.warnOnce = warnOnce;
8
+ const warnedOnceCache = new Set();
9
+
10
+ // TODO move to @mui/x-internals
11
+ // TODO eventually move to @base_ui/internals. Base UI, etc. too need this helper.
12
+ function warnOnce(message, gravity = 'warning') {
13
+ if (process.env.NODE_ENV === 'production') {
14
+ return;
15
+ }
16
+ const cleanMessage = Array.isArray(message) ? message.join('\n') : message;
17
+ if (!warnedOnceCache.has(cleanMessage)) {
18
+ warnedOnceCache.add(cleanMessage);
19
+ if (gravity === 'error') {
20
+ console.error(cleanMessage);
21
+ } else {
22
+ console.warn(cleanMessage);
17
23
  }
18
- };
24
+ }
25
+ }
26
+ function clearWarningsCache() {
27
+ warnedOnceCache.clear();
19
28
  }
package/models/axis.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ScaleBand, ScaleLogarithmic, ScalePower, ScaleTime, ScaleLinear, ScalePoint, ScaleOrdinal, ScaleSequential, ScaleThreshold } from 'd3-scale';
1
+ import type { ScaleBand, ScaleLogarithmic, ScalePower, ScaleTime, ScaleLinear, ScalePoint, ScaleOrdinal, ScaleSequential, ScaleThreshold } from '@mui/x-charts-vendor/d3-scale';
2
2
  import { ChartsAxisClasses } from '../ChartsAxis/axisClasses';
3
3
  import type { TickParams } from '../hooks/useTicks';
4
4
  import { ChartsTextProps } from '../ChartsText';
@@ -254,7 +254,7 @@ export type AxisConfig<S extends ScaleName = ScaleName, V = any, AxisProps = Cha
254
254
  * If `true`, Reverse the axis scaleBand.
255
255
  */
256
256
  reverse?: boolean;
257
- } & Partial<AxisProps> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & TickParams & AxisConfigExtension;
257
+ } & Omit<Partial<AxisProps>, 'axisId'> & Partial<Omit<AxisScaleConfig[S], 'scale'>> & TickParams & AxisConfigExtension;
258
258
  export interface AxisConfigExtension {
259
259
  }
260
260
  export type AxisDefaultized<S extends ScaleName = ScaleName, V = any, AxisProps = ChartsXAxisProps | ChartsYAxisProps> = Omit<AxisConfig<S, V, AxisProps>, 'scaleType'> & AxisScaleConfig[S] & AxisScaleComputedConfig[S] & {
@@ -27,12 +27,22 @@ export type CommonDefaultizedProps = 'id' | 'valueFormatter' | 'data';
27
27
  export type CartesianSeriesType = {
28
28
  /**
29
29
  * The id of the x-axis used to render the series.
30
+ * @deprecated Use `xAxisId` instead
30
31
  */
31
32
  xAxisKey?: string;
32
33
  /**
33
34
  * The id of the y-axis used to render the series.
35
+ * @deprecated Use `xAxisId` instead
34
36
  */
35
37
  yAxisKey?: string;
38
+ /**
39
+ * The id of the x-axis used to render the series.
40
+ */
41
+ xAxisId?: string;
42
+ /**
43
+ * The id of the y-axis used to render the series.
44
+ */
45
+ yAxisId?: string;
36
46
  };
37
47
  export type StackableSeriesType = {
38
48
  /**
@@ -1,4 +1,4 @@
1
- import { PieArcDatum as D3PieArcDatum } from 'd3-shape';
1
+ import { PieArcDatum as D3PieArcDatum } from '@mui/x-charts-vendor/d3-shape';
2
2
  import { DefaultizedProps } from '../helpers';
3
3
  import { CommonDefaultizedProps, CommonSeriesType, SeriesId } from './common';
4
4
  export type PieItemId = string | number;
@@ -24,8 +24,13 @@ export interface ScatterSeriesType extends CommonSeriesType<ScatterValueType>, C
24
24
  disableHover?: boolean;
25
25
  /**
26
26
  * The id of the z-axis used to render the series.
27
+ * @deprecated Use `zAxisId` instead.
27
28
  */
28
29
  zAxisKey?: string;
30
+ /**
31
+ * The id of the z-axis used to render the series.
32
+ */
33
+ zAxisId?: string;
29
34
  }
30
35
  /**
31
36
  * An object that allows to identify a single scatter item.
@@ -1,4 +1,4 @@
1
- import type { ScaleOrdinal, ScaleSequential, ScaleThreshold } from 'd3-scale';
1
+ import type { ScaleOrdinal, ScaleSequential, ScaleThreshold } from '@mui/x-charts-vendor/d3-scale';
2
2
  import { ContinuousColorConfig, OrdinalColorConfig, PiecewiseColorConfig } from './colorMapping';
3
3
  export interface ZAxisConfig<V = any> {
4
4
  id: string;
@@ -239,7 +239,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
239
239
  * An array of [[AxisConfig]] objects.
240
240
  */
241
241
  xAxis: PropTypes.arrayOf(PropTypes.shape({
242
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
243
242
  classes: PropTypes.object,
244
243
  colorMap: PropTypes.oneOfType([PropTypes.shape({
245
244
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -292,7 +291,6 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
292
291
  * An array of [[AxisConfig]] objects.
293
292
  */
294
293
  yAxis: PropTypes.arrayOf(PropTypes.shape({
295
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
296
294
  classes: PropTypes.object,
297
295
  colorMap: PropTypes.oneOfType([PropTypes.shape({
298
296
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -4,11 +4,11 @@ const _excluded = ["id", "dataIndex", "classes", "color", "slots", "slotProps",
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import composeClasses from '@mui/utils/composeClasses';
7
- import { useSlotProps } from '@mui/base/utils';
7
+ import useSlotProps from '@mui/utils/useSlotProps';
8
8
  import generateUtilityClass from '@mui/utils/generateUtilityClass';
9
9
  import { styled } from '@mui/material/styles';
10
- import { color as d3Color } from 'd3-color';
11
10
  import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
11
+ import { color as d3Color } from '@mui/x-charts-vendor/d3-color';
12
12
  import { animated } from '@react-spring/web';
13
13
  import { useInteractionItemProps } from '../hooks/useInteractionItemProps';
14
14
  import { useItemHighlighted } from '../context';
@@ -3,7 +3,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
  const _excluded = ["seriesId", "classes", "color", "style", "dataIndex", "barLabel", "slots", "slotProps", "height", "width", "value"],
4
4
  _excluded2 = ["ownerState"];
5
5
  import * as React from 'react';
6
- import { useSlotProps } from '@mui/base/utils';
6
+ import useSlotProps from '@mui/utils/useSlotProps';
7
7
  import PropTypes from 'prop-types';
8
8
  import { useUtilityClasses } from './barLabelClasses';
9
9
  import { getBarLabel } from './getBarLabel';
@@ -66,16 +66,16 @@ const useAggregatedData = () => {
66
66
  ids: groupIds
67
67
  }, groupIndex) => {
68
68
  return groupIds.flatMap(seriesId => {
69
- const xAxisKey = series[seriesId].xAxisKey ?? defaultXAxisId;
70
- const yAxisKey = series[seriesId].yAxisKey ?? defaultYAxisId;
71
- const xAxisConfig = xAxis[xAxisKey];
72
- const yAxisConfig = yAxis[yAxisKey];
69
+ const xAxisId = series[seriesId].xAxisId ?? series[seriesId].xAxisKey ?? defaultXAxisId;
70
+ const yAxisId = series[seriesId].yAxisId ?? series[seriesId].yAxisKey ?? defaultYAxisId;
71
+ const xAxisConfig = xAxis[xAxisId];
72
+ const yAxisConfig = yAxis[yAxisId];
73
73
  const verticalLayout = series[seriesId].layout === 'vertical';
74
- checkScaleErrors(verticalLayout, seriesId, xAxisKey, xAxis, yAxisKey, yAxis);
74
+ checkScaleErrors(verticalLayout, seriesId, xAxisId, xAxis, yAxisId, yAxis);
75
75
  const baseScaleConfig = verticalLayout ? xAxisConfig : yAxisConfig;
76
76
  const xScale = xAxisConfig.scale;
77
77
  const yScale = yAxisConfig.scale;
78
- const colorGetter = getColor(series[seriesId], xAxis[xAxisKey], yAxis[yAxisKey]);
78
+ const colorGetter = getColor(series[seriesId], xAxis[xAxisId], yAxis[yAxisId]);
79
79
  const bandWidth = baseScaleConfig.scale.bandwidth();
80
80
  const {
81
81
  barWidth,
@@ -98,8 +98,8 @@ const useAggregatedData = () => {
98
98
  seriesId,
99
99
  dataIndex,
100
100
  layout: series[seriesId].layout,
101
- x: verticalLayout ? xScale(xAxis[xAxisKey].data?.[dataIndex]) + barOffset : minValueCoord,
102
- y: verticalLayout ? minValueCoord : yScale(yAxis[yAxisKey].data?.[dataIndex]) + barOffset,
101
+ x: verticalLayout ? xScale(xAxis[xAxisId].data?.[dataIndex]) + barOffset : minValueCoord,
102
+ y: verticalLayout ? minValueCoord : yScale(yAxis[yAxisId].data?.[dataIndex]) + barOffset,
103
103
  xOrigin: xScale(0),
104
104
  yOrigin: yScale(0),
105
105
  height: verticalLayout ? maxValueCoord - minValueCoord : barWidth,
@@ -1,27 +1,27 @@
1
1
  import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '../constants';
2
2
  import { isBandScaleConfig, isPointScaleConfig } from '../models/axis';
3
- const getAxisMessage = (axisDirection, axisKey) => {
3
+ const getAxisMessage = (axisDirection, axisId) => {
4
4
  const axisName = `${axisDirection}-axis`;
5
- const axisKeyName = `${axisDirection}Axis`;
5
+ const axisIdName = `${axisDirection}Axis`;
6
6
  const axisDefaultKey = axisDirection === 'x' ? DEFAULT_X_AXIS_KEY : DEFAULT_Y_AXIS_KEY;
7
- return axisKey === axisDefaultKey ? `The first \`${axisKeyName}\`` : `The ${axisName} with id "${axisKey}"`;
7
+ return axisId === axisDefaultKey ? `The first \`${axisIdName}\`` : `The ${axisName} with id "${axisId}"`;
8
8
  };
9
- export function checkScaleErrors(verticalLayout, seriesId, xAxisKey, xAxis, yAxisKey, yAxis) {
10
- const xAxisConfig = xAxis[xAxisKey];
11
- const yAxisConfig = yAxis[yAxisKey];
9
+ export function checkScaleErrors(verticalLayout, seriesId, xAxisId, xAxis, yAxisId, yAxis) {
10
+ const xAxisConfig = xAxis[xAxisId];
11
+ const yAxisConfig = yAxis[yAxisId];
12
12
  const discreteAxisConfig = verticalLayout ? xAxisConfig : yAxisConfig;
13
13
  const continuousAxisConfig = verticalLayout ? yAxisConfig : xAxisConfig;
14
- const discreteAxisKey = verticalLayout ? xAxisKey : yAxisKey;
15
- const continuousAxisKey = verticalLayout ? yAxisKey : xAxisKey;
14
+ const discreteAxisId = verticalLayout ? xAxisId : yAxisId;
15
+ const continuousAxisId = verticalLayout ? yAxisId : xAxisId;
16
16
  const discreteAxisDirection = verticalLayout ? 'x' : 'y';
17
17
  const continuousAxisDirection = verticalLayout ? 'y' : 'x';
18
18
  if (!isBandScaleConfig(discreteAxisConfig)) {
19
- throw new Error(`MUI X Charts: ${getAxisMessage(discreteAxisDirection, discreteAxisKey)} should be of type "band" to display the bar series of id "${seriesId}".`);
19
+ throw new Error(`MUI X: ${getAxisMessage(discreteAxisDirection, discreteAxisId)} should be of type "band" to display the bar series of id "${seriesId}".`);
20
20
  }
21
21
  if (discreteAxisConfig.data === undefined) {
22
- throw new Error(`MUI X Charts: ${getAxisMessage(discreteAxisDirection, discreteAxisKey)} should have data property.`);
22
+ throw new Error(`MUI X: ${getAxisMessage(discreteAxisDirection, discreteAxisId)} should have data property.`);
23
23
  }
24
24
  if (isBandScaleConfig(continuousAxisConfig) || isPointScaleConfig(continuousAxisConfig)) {
25
- throw new Error(`MUI X Charts: ${getAxisMessage(continuousAxisDirection, continuousAxisKey)} should be a continuous type to display the bar series of id "${seriesId}".`);
25
+ throw new Error(`MUI X: ${getAxisMessage(continuousAxisDirection, continuousAxisId)} should be a continuous type to display the bar series of id "${seriesId}".`);
26
26
  }
27
27
  }
@@ -12,7 +12,10 @@ const getValueExtremum = params => {
12
12
  axis,
13
13
  isDefaultAxis
14
14
  } = params;
15
- return Object.keys(series).filter(seriesId => series[seriesId].yAxisKey === axis.id || isDefaultAxis && series[seriesId].yAxisKey === undefined).reduce((acc, seriesId) => {
15
+ return Object.keys(series).filter(seriesId => {
16
+ const yAxisId = series[seriesId].yAxisId ?? series[seriesId].yAxisKey;
17
+ return yAxisId === axis.id || isDefaultAxis && yAxisId === undefined;
18
+ }).reduce((acc, seriesId) => {
16
19
  const [seriesMin, seriesMax] = series[seriesId].stackedData?.reduce((seriesAcc, values) => [Math.min(...values, ...(seriesAcc[0] === null ? [] : [seriesAcc[0]])), Math.max(...values, ...(seriesAcc[1] === null ? [] : [seriesAcc[1]]))], series[seriesId].stackedData[0]) ?? [null, null];
17
20
  return [acc[0] === null ? seriesMin : Math.min(seriesMin, acc[0]), acc[1] === null ? seriesMax : Math.max(seriesMax, acc[1])];
18
21
  }, [null, null]);
@@ -1,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { stack as d3Stack } from 'd3-shape';
2
+ import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
3
3
  import { getStackingGroups } from '../internals/stackSeries';
4
4
  import { defaultizeValueFormatter } from '../internals/defaultizeValueFormatter';
5
5
  let warnOnce = false;
@@ -25,7 +25,7 @@ const formatter = (params, dataset) => {
25
25
  }
26
26
  });
27
27
  } else if (dataset === undefined) {
28
- throw new Error([`MUI X Charts: bar series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
28
+ throw new Error([`MUI X: bar series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
29
29
  }
30
30
  });
31
31
  const completedSeries = {};
@@ -52,7 +52,7 @@ const formatter = (params, dataset) => {
52
52
  if (typeof value !== 'number') {
53
53
  if (process.env.NODE_ENV !== 'production' && !warnOnce && value !== null) {
54
54
  warnOnce = true;
55
- console.error([`MUI X charts: your dataset key "${dataKey}" is used for plotting bars, but contains nonnumerical elements.`, 'Bar plots only support numbers and null values.']);
55
+ console.error([`MUI X charts: your dataset key "${dataKey}" is used for plotting bars, but contains nonnumerical elements.`, 'Bar plots only support numbers and null values.'].join('\n'));
56
56
  }
57
57
  return 0;
58
58
  }
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { DrawingProvider } from '../context/DrawingProvider';
5
- import { SeriesContextProvider } from '../context/SeriesContextProvider';
5
+ import { SeriesProvider } from '../context/SeriesProvider';
6
6
  import { InteractionProvider } from '../context/InteractionProvider';
7
7
  import { ColorProvider } from '../context/ColorProvider';
8
8
  import { ChartsSurface } from '../ChartsSurface';
@@ -16,7 +16,7 @@ const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(pro
16
16
  children,
17
17
  drawingProviderProps,
18
18
  colorProviderProps,
19
- seriesContextProps,
19
+ seriesProviderProps,
20
20
  cartesianContextProps,
21
21
  zAxisContextProps,
22
22
  highlightedProviderProps,
@@ -24,7 +24,7 @@ const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(pro
24
24
  } = useChartContainerProps(props, ref);
25
25
  return /*#__PURE__*/_jsx(DrawingProvider, _extends({}, drawingProviderProps, {
26
26
  children: /*#__PURE__*/_jsx(ColorProvider, _extends({}, colorProviderProps, {
27
- children: /*#__PURE__*/_jsx(SeriesContextProvider, _extends({}, seriesContextProps, {
27
+ children: /*#__PURE__*/_jsx(SeriesProvider, _extends({}, seriesProviderProps, {
28
28
  children: /*#__PURE__*/_jsx(CartesianContextProvider, _extends({}, cartesianContextProps, {
29
29
  children: /*#__PURE__*/_jsx(ZAxisContextProvider, _extends({}, zAxisContextProps, {
30
30
  children: /*#__PURE__*/_jsx(InteractionProvider, {
@@ -121,7 +121,6 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
121
121
  * An array of [[AxisConfig]] objects.
122
122
  */
123
123
  xAxis: PropTypes.arrayOf(PropTypes.shape({
124
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
125
124
  classes: PropTypes.object,
126
125
  colorMap: PropTypes.oneOfType([PropTypes.shape({
127
126
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -174,7 +173,6 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
174
173
  * An array of [[AxisConfig]] objects.
175
174
  */
176
175
  yAxis: PropTypes.arrayOf(PropTypes.shape({
177
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
178
176
  classes: PropTypes.object,
179
177
  colorMap: PropTypes.oneOfType([PropTypes.shape({
180
178
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -42,7 +42,7 @@ export const useChartContainerProps = (props, ref) => {
42
42
  const colorProviderProps = {
43
43
  colorProcessors
44
44
  };
45
- const seriesContextProps = {
45
+ const seriesProviderProps = {
46
46
  series,
47
47
  colors,
48
48
  dataset,
@@ -76,7 +76,7 @@ export const useChartContainerProps = (props, ref) => {
76
76
  children,
77
77
  drawingProviderProps,
78
78
  colorProviderProps,
79
- seriesContextProps,
79
+ seriesProviderProps,
80
80
  cartesianContextProps,
81
81
  zAxisContextProps,
82
82
  highlightedProviderProps,
@@ -57,16 +57,16 @@ function ChartsAxis(props) {
57
57
  const topId = getAxisId(topAxis, xAxisIds[0]);
58
58
  const rightId = getAxisId(rightAxis, yAxisIds[0]);
59
59
  if (topId !== null && !xAxis[topId]) {
60
- throw Error([`MUI X Charts: id used for top axis "${topId}" is not defined.`, `Available ids are: ${xAxisIds.join(', ')}.`].join('\n'));
60
+ throw Error([`MUI X: id used for top axis "${topId}" is not defined.`, `Available ids are: ${xAxisIds.join(', ')}.`].join('\n'));
61
61
  }
62
62
  if (leftId !== null && !yAxis[leftId]) {
63
- throw Error([`MUI X Charts: id used for left axis "${leftId}" is not defined.`, `Available ids are: ${yAxisIds.join(', ')}.`].join('\n'));
63
+ throw Error([`MUI X: id used for left axis "${leftId}" is not defined.`, `Available ids are: ${yAxisIds.join(', ')}.`].join('\n'));
64
64
  }
65
65
  if (rightId !== null && !yAxis[rightId]) {
66
- throw Error([`MUI X Charts: id used for right axis "${rightId}" is not defined.`, `Available ids are: ${yAxisIds.join(', ')}.`].join('\n'));
66
+ throw Error([`MUI X: id used for right axis "${rightId}" is not defined.`, `Available ids are: ${yAxisIds.join(', ')}.`].join('\n'));
67
67
  }
68
68
  if (bottomId !== null && !xAxis[bottomId]) {
69
- throw Error([`MUI X Charts: id used for bottom axis "${bottomId}" is not defined.`, `Available ids are: ${xAxisIds.join(', ')}.`].join('\n'));
69
+ throw Error([`MUI X: id used for bottom axis "${bottomId}" is not defined.`, `Available ids are: ${xAxisIds.join(', ')}.`].join('\n'));
70
70
  }
71
71
  const topAxisProps = mergeProps(topAxis, slots, slotProps);
72
72
  const bottomAxisProps = mergeProps(bottomAxis, slots, slotProps);
@@ -74,7 +74,7 @@ function ChartsAxisHighlight(props) {
74
74
  const isXError = isBandScaleX && xScale(axisX.value) === undefined;
75
75
  const isYError = isBandScaleY && yScale(axisY.value) === undefined;
76
76
  if (isXError || isYError) {
77
- console.error([`MUI X Charts: The position value provided for the axis is not valid for the current scale.`, `This probably means something is wrong with the data passed to the chart.`, `The ChartsAxisHighlight component will not be displayed.`].join('\n'));
77
+ console.error([`MUI X: The position value provided for the axis is not valid for the current scale.`, `This probably means something is wrong with the data passed to the chart.`, `The ChartsAxisHighlight component will not be displayed.`].join('\n'));
78
78
  }
79
79
  }
80
80
  return /*#__PURE__*/_jsxs(React.Fragment, {
@@ -1,8 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { useSlotProps } from '@mui/base/utils';
5
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
4
+ import useSlotProps from '@mui/utils/useSlotProps';
5
+ import composeClasses from '@mui/utils/composeClasses';
6
6
  import { useThemeProps, useTheme } from '@mui/material/styles';
7
7
  import { getSeriesToDisplay } from './utils';
8
8
  import { getLegendUtilityClass } from './chartsLegendClasses';
@@ -2,7 +2,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
2
2
  import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["rotate", "dominantBaseline"];
4
4
  import * as React from 'react';
5
- import { NoSsr } from '@mui/base/NoSsr';
5
+ import NoSsr from '@mui/material/NoSsr';
6
6
  import { useTheme, styled } from '@mui/material/styles';
7
7
  import { ChartsText } from '../ChartsText';
8
8
  import { getWordsByLines } from '../internals/getWordsByLines';
@@ -37,7 +37,9 @@ function ChartsOnAxisClickHandler(props) {
37
37
  Object.keys(series).filter(seriesType => ['bar', 'line'].includes(seriesType)).forEach(seriesType => {
38
38
  series[seriesType]?.seriesOrder.forEach(seriesId => {
39
39
  const seriesItem = series[seriesType].series[seriesId];
40
- const axisKey = isXaxis ? seriesItem.xAxisKey : seriesItem.yAxisKey;
40
+ const providedXAxisId = seriesItem.xAxisId ?? seriesItem.xAxisKey;
41
+ const providedYAxisId = seriesItem.yAxisId ?? seriesItem.yAxisKey;
42
+ const axisKey = isXaxis ? providedXAxisId : providedYAxisId;
41
43
  if (axisKey === undefined || axisKey === USED_AXIS_ID) {
42
44
  seriesValues[seriesId] = seriesItem.data[dataIndex];
43
45
  }