@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
@@ -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
  }
@@ -10,10 +10,10 @@ function ChartsReferenceLine(props) {
10
10
  y
11
11
  } = props;
12
12
  if (x !== undefined && y !== undefined) {
13
- throw new Error('MUI X Charts: The ChartsReferenceLine cannot have both `x` and `y` props set.');
13
+ throw new Error('MUI X: The ChartsReferenceLine cannot have both `x` and `y` props set.');
14
14
  }
15
15
  if (x === undefined && y === undefined) {
16
- throw new Error('MUI X Charts: The ChartsReferenceLine should have a value in `x` or `y` prop.');
16
+ throw new Error('MUI X: The ChartsReferenceLine should have a value in `x` or `y` prop.');
17
17
  }
18
18
  if (x !== undefined) {
19
19
  return /*#__PURE__*/_jsx(ChartsXReferenceLine, _extends({}, props));
@@ -5,7 +5,7 @@ import { useDrawingArea, useXScale } from '../hooks';
5
5
  import { ReferenceLineRoot } from './common';
6
6
  import { ChartsText } from '../ChartsText';
7
7
  import { getReferenceLineUtilityClass } from './chartsReferenceLineClasses';
8
- import { buildWarning } from '../internals/warning';
8
+ import { warnOnce } from '../internals/warning';
9
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  const getTextParams = ({
11
11
  top,
@@ -47,7 +47,6 @@ export function getXReferenceLineClasses(classes) {
47
47
  label: ['label']
48
48
  }, getReferenceLineUtilityClass, classes);
49
49
  }
50
- const valueError = buildWarning((value, id) => `MUI X Charts: the value ${value} does not exist in the data of x axis with id ${id}.`, 'error');
51
50
  function ChartsXReferenceLine(props) {
52
51
  const {
53
52
  x,
@@ -67,7 +66,7 @@ function ChartsXReferenceLine(props) {
67
66
  const xPosition = xAxisScale(x);
68
67
  if (xPosition === undefined) {
69
68
  if (process.env.NODE_ENV !== 'production') {
70
- valueError(x, axisId);
69
+ warnOnce(`MUI X: the value ${x} does not exist in the data of x axis with id ${axisId}.`, 'error');
71
70
  }
72
71
  return null;
73
72
  }
@@ -5,7 +5,7 @@ import { useDrawingArea, useYScale } from '../hooks';
5
5
  import { ReferenceLineRoot } from './common';
6
6
  import { ChartsText } from '../ChartsText';
7
7
  import { getReferenceLineUtilityClass } from './chartsReferenceLineClasses';
8
- import { buildWarning } from '../internals/warning';
8
+ import { warnOnce } from '../internals/warning';
9
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  const getTextParams = ({
11
11
  left,
@@ -47,7 +47,6 @@ export function getYReferenceLineClasses(classes) {
47
47
  label: ['label']
48
48
  }, getReferenceLineUtilityClass, classes);
49
49
  }
50
- const valueError = buildWarning((value, id) => `MUI X Charts: the value ${value} does not exist in the data of y axis with id ${id}.`, 'error');
51
50
  function ChartsYReferenceLine(props) {
52
51
  const {
53
52
  y,
@@ -67,7 +66,7 @@ function ChartsYReferenceLine(props) {
67
66
  const yPosition = yAxisScale(y);
68
67
  if (yPosition === undefined) {
69
68
  if (process.env.NODE_ENV !== 'production') {
70
- valueError(y, axisId);
69
+ warnOnce(`MUI X: the value ${y} does not exist in the data of y axis with id ${axisId}.`, 'error');
71
70
  }
72
71
  return null;
73
72
  }
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { useSlotProps } from '@mui/base/utils';
3
+ import useSlotProps from '@mui/utils/useSlotProps';
4
4
  import { useCartesianContext } from '../context/CartesianProvider';
5
5
  import { DefaultChartsAxisTooltipContent } from './DefaultChartsAxisTooltipContent';
6
6
  import { ZAxisContext } from '../context/ZAxisContextProvider';
@@ -40,11 +40,15 @@ function ChartsAxisTooltipContent(props) {
40
40
  Object.keys(series).filter(isCartesianSeriesType).forEach(seriesType => {
41
41
  series[seriesType].seriesOrder.forEach(seriesId => {
42
42
  const item = series[seriesType].series[seriesId];
43
- const axisKey = isXaxis ? item.xAxisKey : item.yAxisKey;
43
+ const providedXAxisId = item.xAxisId ?? item.xAxisKey;
44
+ const providedYAxisId = item.yAxisId ?? item.yAxisKey;
45
+ const axisKey = isXaxis ? providedXAxisId : providedYAxisId;
44
46
  if (axisKey === undefined || axisKey === USED_AXIS_ID) {
45
47
  const seriesToAdd = series[seriesType].series[seriesId];
46
- const zAxisKey = seriesToAdd.zAxisKey ?? zAxisIds[0];
47
- const getColor = colorProcessors[seriesType]?.(seriesToAdd, xAxis[seriesToAdd.xAxisKey ?? xAxisIds[0]], yAxis[seriesToAdd.yAxisKey ?? yAxisIds[0]], zAxisKey && zAxis[zAxisKey]) ?? (() => '');
48
+ const xAxisId = providedXAxisId ?? xAxisIds[0];
49
+ const yAxisId = providedYAxisId ?? yAxisIds[0];
50
+ const zAxisId = seriesToAdd.zAxisId ?? seriesToAdd.zAxisKey ?? zAxisIds[0];
51
+ const getColor = colorProcessors[seriesType]?.(seriesToAdd, xAxis[xAxisId], yAxis[yAxisId], zAxisId && zAxis[zAxisId]) ?? (() => '');
48
52
  rep.push(_extends({}, seriesToAdd, {
49
53
  getColor
50
54
  }));
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { useSlotProps } from '@mui/base/utils';
3
+ import useSlotProps from '@mui/utils/useSlotProps';
4
4
  import { DefaultChartsItemTooltipContent } from './DefaultChartsItemTooltipContent';
5
5
  import { useCartesianContext } from '../context/CartesianProvider';
6
6
  import { ZAxisContext } from '../context/ZAxisContextProvider';
@@ -30,10 +30,10 @@ function ChartsItemTooltipContent(props) {
30
30
  zAxisIds
31
31
  } = React.useContext(ZAxisContext);
32
32
  const colorProcessors = useColorProcessor();
33
- const xAxisKey = series.xAxisKey ?? xAxisIds[0];
34
- const yAxisKey = series.yAxisKey ?? yAxisIds[0];
35
- const zAxisKey = series.zAxisKey ?? zAxisIds[0];
36
- const getColor = colorProcessors[series.type]?.(series, xAxisKey && xAxis[xAxisKey], yAxisKey && yAxis[yAxisKey], zAxisKey && zAxis[zAxisKey]) ?? (() => '');
33
+ const xAxisId = series.xAxisId ?? series.xAxisKey ?? xAxisIds[0];
34
+ const yAxisId = series.yAxisId ?? series.yAxisKey ?? yAxisIds[0];
35
+ const zAxisId = series.zAxisId ?? series.zAxisKey ?? zAxisIds[0];
36
+ const getColor = colorProcessors[series.type]?.(series, xAxisId && xAxis[xAxisId], yAxisId && yAxis[yAxisId], zAxisId && zAxis[zAxisId]) ?? (() => '');
37
37
  const Content = content ?? DefaultChartsItemTooltipContent;
38
38
  const chartTooltipContentProps = useSlotProps({
39
39
  elementType: Content,
@@ -3,9 +3,9 @@ import * as React from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import composeClasses from '@mui/utils/composeClasses';
5
5
  import { styled, useThemeProps } from '@mui/material/styles';
6
- import { Popper } from '@mui/base/Popper';
7
- import { NoSsr } from '@mui/base/NoSsr';
8
- import { useSlotProps } from '@mui/base/utils';
6
+ import Popper from '@mui/material/Popper';
7
+ import NoSsr from '@mui/material/NoSsr';
8
+ import useSlotProps from '@mui/utils/useSlotProps';
9
9
  import { InteractionContext } from '../context/InteractionProvider';
10
10
  import { generateVirtualElement, useMouseTracker, getTooltipHasData } from './utils';
11
11
  import { ChartsItemTooltipContent } from './ChartsItemTooltipContent';
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { Delaunay } from 'd3-delaunay';
3
+ import { Delaunay } from '@mui/x-charts-vendor/d3-delaunay';
4
4
  import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
5
5
  import { InteractionContext } from '../context/InteractionProvider';
6
6
  import { useCartesianContext } from '../context/CartesianProvider';
@@ -63,11 +63,13 @@ function ChartsVoronoiHandler(props) {
63
63
  seriesOrder.forEach(seriesId => {
64
64
  const {
65
65
  data,
66
+ xAxisId,
67
+ yAxisId,
66
68
  xAxisKey,
67
69
  yAxisKey
68
70
  } = series[seriesId];
69
- const xScale = xAxis[xAxisKey ?? defaultXAxisId].scale;
70
- const yScale = yAxis[yAxisKey ?? defaultYAxisId].scale;
71
+ const xScale = xAxis[xAxisId ?? xAxisKey ?? defaultXAxisId].scale;
72
+ const yScale = yAxis[yAxisId ?? yAxisKey ?? defaultYAxisId].scale;
71
73
  const getXPosition = getValueToPositionMapper(xScale);
72
74
  const getYPosition = getValueToPositionMapper(yScale);
73
75
  const seriesPoints = data.flatMap(({
@@ -3,8 +3,8 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["scale", "tickNumber", "reverse"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import { useSlotProps } from '@mui/base/utils';
7
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
6
+ import useSlotProps from '@mui/utils/useSlotProps';
7
+ import composeClasses from '@mui/utils/composeClasses';
8
8
  import { useThemeProps, useTheme } from '@mui/material/styles';
9
9
  import { useCartesianContext } from '../context/CartesianProvider';
10
10
  import { useTicks } from '../hooks/useTicks';
@@ -3,8 +3,8 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
3
3
  const _excluded = ["scale", "tickNumber"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import { useSlotProps } from '@mui/base/utils';
7
- import { unstable_composeClasses as composeClasses } from '@mui/utils';
6
+ import useSlotProps from '@mui/utils/useSlotProps';
7
+ import composeClasses from '@mui/utils/composeClasses';
8
8
  import { useThemeProps, useTheme } from '@mui/material/styles';
9
9
  import { useCartesianContext } from '../context/CartesianProvider';
10
10
  import { useTicks } from '../hooks/useTicks';
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { arc as d3Arc } from 'd3-shape';
3
+ import { arc as d3Arc } from '@mui/x-charts-vendor/d3-shape';
4
4
  import { styled } from '@mui/material/styles';
5
5
  import { useGaugeState } from './GaugeProvider';
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import * as React from 'react';
3
- import { arc as d3Arc } from 'd3-shape';
3
+ import { arc as d3Arc } from '@mui/x-charts-vendor/d3-shape';
4
4
  import { styled } from '@mui/material/styles';
5
5
  import { useGaugeState } from './GaugeProvider';
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -4,8 +4,8 @@ const _excluded = ["d", "skipAnimation", "ownerState"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { styled } from '@mui/material/styles';
7
- import { color as d3Color } from 'd3-color';
8
7
  import { animated, useSpring } from '@react-spring/web';
8
+ import { color as d3Color } from '@mui/x-charts-vendor/d3-color';
9
9
  import { useAnimatedPath } from '../internals/useAnimatedPath';
10
10
  import { cleanId } from '../internals/cleanId';
11
11
  import { useChartId, useDrawingArea } from '../hooks';
@@ -4,7 +4,7 @@ const _excluded = ["d", "skipAnimation", "ownerState"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import { animated, useSpring } from '@react-spring/web';
7
- import { color as d3Color } from 'd3-color';
7
+ import { color as d3Color } from '@mui/x-charts-vendor/d3-color';
8
8
  import { styled } from '@mui/material/styles';
9
9
  import { useAnimatedPath } from '../internals/useAnimatedPath';
10
10
  import { cleanId } from '../internals/cleanId';
@@ -4,7 +4,7 @@ const _excluded = ["id", "classes", "color", "gradientId", "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 generateUtilityClasses from '@mui/utils/generateUtilityClasses';
10
10
  import { useInteractionItemProps } from '../hooks/useInteractionItemProps';
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["slots", "slotProps", "onItemClick", "skipAnimation"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import { area as d3Area } from 'd3-shape';
6
+ import { area as d3Area } from '@mui/x-charts-vendor/d3-shape';
7
7
  import { useCartesianContext } from '../context/CartesianProvider';
8
8
  import { AreaElement } from './AreaElement';
9
9
  import { getValueToPositionMapper } from '../hooks/useScale';
@@ -36,22 +36,26 @@ const useAggregatedData = () => {
36
36
  return [...groupIds].reverse() // Revert stacked area for a more pleasant animation
37
37
  .map(seriesId => {
38
38
  const {
39
+ xAxisId: xAxisIdProp,
40
+ yAxisId: yAxisIdProp,
39
41
  xAxisKey = defaultXAxisId,
40
42
  yAxisKey = defaultYAxisId,
41
43
  stackedData,
42
44
  data,
43
45
  connectNulls
44
46
  } = series[seriesId];
45
- const xScale = getValueToPositionMapper(xAxis[xAxisKey].scale);
46
- const yScale = yAxis[yAxisKey].scale;
47
- const xData = xAxis[xAxisKey].data;
48
- const gradientUsed = yAxis[yAxisKey].colorScale && [yAxisKey, 'y'] || xAxis[xAxisKey].colorScale && [xAxisKey, 'x'] || undefined;
47
+ const xAxisId = xAxisIdProp ?? xAxisKey;
48
+ const yAxisId = yAxisIdProp ?? yAxisKey;
49
+ const xScale = getValueToPositionMapper(xAxis[xAxisId].scale);
50
+ const yScale = yAxis[yAxisId].scale;
51
+ const xData = xAxis[xAxisId].data;
52
+ const gradientUsed = yAxis[yAxisId].colorScale && [yAxisId, 'y'] || xAxis[xAxisId].colorScale && [xAxisId, 'x'] || undefined;
49
53
  if (process.env.NODE_ENV !== 'production') {
50
54
  if (xData === undefined) {
51
- throw new Error(`MUI X Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should have data property to be able to display a line plot.`);
55
+ throw new Error(`MUI X: ${xAxisId === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisId}"`} should have data property to be able to display a line plot.`);
52
56
  }
53
57
  if (xData.length < stackedData.length) {
54
- throw new Error(`MUI X Charts: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`);
58
+ throw new Error(`MUI X: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`);
55
59
  }
56
60
  }
57
61
  const areaPath = d3Area().x(d => xScale(d.x)).defined((_, i) => connectNulls || data[i] != null).y0(d => {
@@ -49,7 +49,10 @@ const LineChart = /*#__PURE__*/React.forwardRef(function LineChart(props, ref) {
49
49
  }, chartContainerProps, {
50
50
  children: [props.onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, _extends({}, axisClickHandlerProps)), props.grid && /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
51
51
  children: [/*#__PURE__*/_jsx(AreaPlot, _extends({}, areaPlotProps)), /*#__PURE__*/_jsx(LinePlot, _extends({}, linePlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
52
- })), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(MarkPlot, _extends({}, markPlotProps)), /*#__PURE__*/_jsx(LineHighlightPlot, _extends({}, lineHighlightPlotProps)), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
52
+ })), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx("g", {
53
+ "data-drawing-container": true,
54
+ children: /*#__PURE__*/_jsx(MarkPlot, _extends({}, markPlotProps))
55
+ }), /*#__PURE__*/_jsx(LineHighlightPlot, _extends({}, lineHighlightPlotProps)), /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), !props.loading && /*#__PURE__*/_jsx(ChartsTooltip, _extends({}, tooltipProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
53
56
  }));
54
57
  });
55
58
  process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
@@ -237,7 +240,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
237
240
  * An array of [[AxisConfig]] objects.
238
241
  */
239
242
  xAxis: PropTypes.arrayOf(PropTypes.shape({
240
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
241
243
  classes: PropTypes.object,
242
244
  colorMap: PropTypes.oneOfType([PropTypes.shape({
243
245
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -290,7 +292,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
290
292
  * An array of [[AxisConfig]] objects.
291
293
  */
292
294
  yAxis: PropTypes.arrayOf(PropTypes.shape({
293
- axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
294
295
  classes: PropTypes.object,
295
296
  colorMap: PropTypes.oneOfType([PropTypes.shape({
296
297
  colors: PropTypes.arrayOf(PropTypes.string).isRequired,
@@ -4,7 +4,7 @@ const _excluded = ["id", "classes", "color", "gradientId", "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 generateUtilityClasses from '@mui/utils/generateUtilityClasses';
10
10
  import { useInteractionItemProps } from '../hooks/useInteractionItemProps';
@@ -60,20 +60,24 @@ function LineHighlightPlot(props) {
60
60
  }) => {
61
61
  return groupIds.flatMap(seriesId => {
62
62
  const {
63
+ xAxisId: xAxisIdProp,
64
+ yAxisId: yAxisIdProp,
63
65
  xAxisKey = defaultXAxisId,
64
66
  yAxisKey = defaultYAxisId,
65
67
  stackedData,
66
68
  data,
67
69
  disableHighlight
68
70
  } = series[seriesId];
71
+ const xAxisId = xAxisIdProp ?? xAxisKey;
72
+ const yAxisId = yAxisIdProp ?? yAxisKey;
69
73
  if (disableHighlight || data[highlightedIndex] == null) {
70
74
  return null;
71
75
  }
72
- const xScale = getValueToPositionMapper(xAxis[xAxisKey].scale);
73
- const yScale = yAxis[yAxisKey].scale;
74
- const xData = xAxis[xAxisKey].data;
76
+ const xScale = getValueToPositionMapper(xAxis[xAxisId].scale);
77
+ const yScale = yAxis[yAxisId].scale;
78
+ const xData = xAxis[xAxisId].data;
75
79
  if (xData === undefined) {
76
- throw new Error(`MUI X Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should have data property to be able to display a line plot.`);
80
+ throw new Error(`MUI X: ${xAxisId === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisId}"`} should have data property to be able to display a line plot.`);
77
81
  }
78
82
  const x = xScale(xData[highlightedIndex]);
79
83
  const y = yScale(stackedData[highlightedIndex][1]); // This should not be undefined since y should not be a band scale
@@ -84,7 +88,7 @@ function LineHighlightPlot(props) {
84
88
  })) {
85
89
  return null;
86
90
  }
87
- const colorGetter = getColor(series[seriesId], xAxis[xAxisKey], yAxis[yAxisKey]);
91
+ const colorGetter = getColor(series[seriesId], xAxis[xAxisId], yAxis[yAxisId]);
88
92
  return /*#__PURE__*/_jsx(Element, _extends({
89
93
  id: seriesId,
90
94
  color: colorGetter(highlightedIndex),
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
3
3
  const _excluded = ["slots", "slotProps", "skipAnimation", "onItemClick"];
4
4
  import * as React from 'react';
5
5
  import PropTypes from 'prop-types';
6
- import { line as d3Line } from 'd3-shape';
6
+ import { line as d3Line } from '@mui/x-charts-vendor/d3-shape';
7
7
  import { useCartesianContext } from '../context/CartesianProvider';
8
8
  import { LineElement } from './LineElement';
9
9
  import { getValueToPositionMapper } from '../hooks/useScale';
@@ -35,22 +35,26 @@ const useAggregatedData = () => {
35
35
  }) => {
36
36
  return groupIds.flatMap(seriesId => {
37
37
  const {
38
+ xAxisId: xAxisIdProp,
39
+ yAxisId: yAxisIdProp,
38
40
  xAxisKey = defaultXAxisId,
39
41
  yAxisKey = defaultYAxisId,
40
42
  stackedData,
41
43
  data,
42
44
  connectNulls
43
45
  } = series[seriesId];
44
- const xScale = getValueToPositionMapper(xAxis[xAxisKey].scale);
45
- const yScale = yAxis[yAxisKey].scale;
46
- const xData = xAxis[xAxisKey].data;
47
- const gradientUsed = yAxis[yAxisKey].colorScale && [yAxisKey, 'y'] || xAxis[xAxisKey].colorScale && [xAxisKey, 'x'] || undefined;
46
+ const xAxisId = xAxisIdProp ?? xAxisKey;
47
+ const yAxisId = yAxisIdProp ?? yAxisKey;
48
+ const xScale = getValueToPositionMapper(xAxis[xAxisId].scale);
49
+ const yScale = yAxis[yAxisId].scale;
50
+ const xData = xAxis[xAxisId].data;
51
+ const gradientUsed = yAxis[yAxisId].colorScale && [yAxisId, 'y'] || xAxis[xAxisId].colorScale && [xAxisId, 'x'] || undefined;
48
52
  if (process.env.NODE_ENV !== 'production') {
49
53
  if (xData === undefined) {
50
- throw new Error(`MUI X Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should have data property to be able to display a line plot.`);
54
+ throw new Error(`MUI X: ${xAxisId === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisId}"`} should have data property to be able to display a line plot.`);
51
55
  }
52
56
  if (xData.length < stackedData.length) {
53
- throw new Error(`MUI X Charts: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`);
57
+ throw new Error(`MUI X: The data length of the x axis (${xData.length} items) is lower than the length of series (${stackedData.length} items).`);
54
58
  }
55
59
  }
56
60
  const linePath = d3Line().x(d => xScale(d.x)).defined((_, i) => connectNulls || data[i] != null).y(d => yScale(d.y[1]));
@@ -7,7 +7,7 @@ import composeClasses from '@mui/utils/composeClasses';
7
7
  import generateUtilityClass from '@mui/utils/generateUtilityClass';
8
8
  import { styled } from '@mui/material/styles';
9
9
  import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
10
- import { symbol as d3Symbol, symbolsFill as d3SymbolsFill } from 'd3-shape';
10
+ import { symbol as d3Symbol, symbolsFill as d3SymbolsFill } from '@mui/x-charts-vendor/d3-shape';
11
11
  import { animated, to, useSpring } from '@react-spring/web';
12
12
  import { getSymbol } from '../internals/getSymbol';
13
13
  import { InteractionContext } from '../context/InteractionProvider';
@@ -57,6 +57,8 @@ function MarkPlot(props) {
57
57
  }) => {
58
58
  return groupIds.map(seriesId => {
59
59
  const {
60
+ xAxisId: xAxisIdProp,
61
+ yAxisId: yAxisIdProp,
60
62
  xAxisKey = defaultXAxisId,
61
63
  yAxisKey = defaultYAxisId,
62
64
  stackedData,
@@ -66,15 +68,17 @@ function MarkPlot(props) {
66
68
  if (showMark === false) {
67
69
  return null;
68
70
  }
69
- const xScale = getValueToPositionMapper(xAxis[xAxisKey].scale);
70
- const yScale = yAxis[yAxisKey].scale;
71
- const xData = xAxis[xAxisKey].data;
71
+ const xAxisId = xAxisIdProp ?? xAxisKey;
72
+ const yAxisId = yAxisIdProp ?? yAxisKey;
73
+ const xScale = getValueToPositionMapper(xAxis[xAxisId].scale);
74
+ const yScale = yAxis[yAxisId].scale;
75
+ const xData = xAxis[xAxisId].data;
72
76
  if (xData === undefined) {
73
- throw new Error(`MUI X Charts: ${xAxisKey === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisKey}"`} should have data property to be able to display a line plot.`);
77
+ throw new Error(`MUI X: ${xAxisId === DEFAULT_X_AXIS_KEY ? 'The first `xAxis`' : `The x-axis with id "${xAxisId}"`} should have data property to be able to display a line plot.`);
74
78
  }
75
79
  const clipId = cleanId(`${chartId}-${seriesId}-line-clip`); // We assume that if displaying line mark, the line will also be rendered
76
80
 
77
- const colorGetter = getColor(series[seriesId], xAxis[xAxisKey], yAxis[yAxisKey]);
81
+ const colorGetter = getColor(series[seriesId], xAxis[xAxisId], yAxis[yAxisId]);
78
82
  return /*#__PURE__*/_jsx("g", {
79
83
  clipPath: `url(#${clipId})`,
80
84
  children: xData?.map((x, index) => {
@@ -24,7 +24,10 @@ export const getExtremumY = params => {
24
24
  axis,
25
25
  isDefaultAxis
26
26
  } = params;
27
- return Object.keys(series).filter(seriesId => series[seriesId].yAxisKey === axis.id || isDefaultAxis && series[seriesId].yAxisKey === undefined).reduce((acc, seriesId) => {
27
+ return Object.keys(series).filter(seriesId => {
28
+ const yAxisId = series[seriesId].yAxisId ?? series[seriesId].yAxisKey;
29
+ return yAxisId === axis.id || isDefaultAxis && yAxisId === undefined;
30
+ }).reduce((acc, seriesId) => {
28
31
  const {
29
32
  area,
30
33
  stackedData