@mui/x-charts 7.12.1 → 7.14.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 (128) hide show
  1. package/BarChart/BarChart.js +2 -0
  2. package/BarChart/BarPlot.js +4 -3
  3. package/BarChart/extremums.js +46 -9
  4. package/CHANGELOG.md +162 -1
  5. package/ChartContainer/ChartContainer.d.ts +3 -3
  6. package/ChartContainer/ChartContainer.js +4 -2
  7. package/ChartContainer/useChartContainerProps.d.ts +4 -2
  8. package/ChartContainer/useChartContainerProps.js +3 -3
  9. package/ChartContainer/useDefaultizeAxis.d.ts +3 -1
  10. package/ChartContainer/useDefaultizeAxis.js +16 -5
  11. package/ChartsAxisHighlight/ChartsAxisHighlight.js +23 -9
  12. package/ChartsGrid/ChartsGrid.js +6 -4
  13. package/ChartsTooltip/utils.js +4 -2
  14. package/ChartsXAxis/ChartsXAxis.js +25 -8
  15. package/ChartsYAxis/ChartsYAxis.js +19 -7
  16. package/LineChart/AreaPlot.js +11 -1
  17. package/LineChart/LineChart.js +2 -0
  18. package/LineChart/extremums.js +23 -18
  19. package/PieChart/PieChart.js +2 -0
  20. package/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -0
  21. package/ResponsiveChartContainer/useResponsiveChartContainerProps.d.ts +1 -1
  22. package/ScatterChart/ScatterChart.js +2 -0
  23. package/ScatterChart/extremums.js +30 -22
  24. package/SparkLineChart/SparkLineChart.js +2 -0
  25. package/context/CartesianProvider/Cartesian.types.d.ts +59 -0
  26. package/context/CartesianProvider/Cartesian.types.js +5 -0
  27. package/context/CartesianProvider/CartesianContext.d.ts +1 -22
  28. package/context/CartesianProvider/CartesianProvider.d.ts +3 -23
  29. package/context/CartesianProvider/CartesianProvider.js +4 -7
  30. package/context/CartesianProvider/computeValue.d.ts +18 -31
  31. package/context/CartesianProvider/computeValue.js +20 -23
  32. package/context/CartesianProvider/defaultizeAxis.d.ts +1 -0
  33. package/context/CartesianProvider/getAxisExtremum.d.ts +3 -2
  34. package/context/CartesianProvider/getAxisExtremum.js +10 -11
  35. package/context/CartesianProvider/index.d.ts +1 -0
  36. package/context/CartesianProvider/index.js +12 -0
  37. package/context/CartesianProvider/useCartesianContext.d.ts +1 -1
  38. package/context/CartesianProvider/zoom.d.ts +10 -0
  39. package/context/CartesianProvider/zoom.js +26 -0
  40. package/context/DrawingProvider.d.ts +7 -2
  41. package/context/DrawingProvider.js +11 -3
  42. package/context/PluginProvider/ExtremumGetter.types.d.ts +12 -2
  43. package/esm/BarChart/BarChart.js +2 -0
  44. package/esm/BarChart/BarPlot.js +4 -3
  45. package/esm/BarChart/extremums.js +46 -9
  46. package/esm/ChartContainer/ChartContainer.js +5 -3
  47. package/esm/ChartContainer/useChartContainerProps.js +3 -3
  48. package/esm/ChartContainer/useDefaultizeAxis.js +16 -5
  49. package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +23 -9
  50. package/esm/ChartsGrid/ChartsGrid.js +6 -4
  51. package/esm/ChartsTooltip/utils.js +4 -2
  52. package/esm/ChartsXAxis/ChartsXAxis.js +25 -8
  53. package/esm/ChartsYAxis/ChartsYAxis.js +19 -7
  54. package/esm/LineChart/AreaPlot.js +11 -1
  55. package/esm/LineChart/LineChart.js +2 -0
  56. package/esm/LineChart/extremums.js +23 -18
  57. package/esm/PieChart/PieChart.js +2 -0
  58. package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -0
  59. package/esm/ScatterChart/ScatterChart.js +2 -0
  60. package/esm/ScatterChart/extremums.js +30 -22
  61. package/esm/SparkLineChart/SparkLineChart.js +2 -0
  62. package/esm/context/CartesianProvider/Cartesian.types.js +1 -0
  63. package/esm/context/CartesianProvider/CartesianProvider.js +4 -7
  64. package/esm/context/CartesianProvider/computeValue.js +20 -23
  65. package/esm/context/CartesianProvider/getAxisExtremum.js +10 -11
  66. package/esm/context/CartesianProvider/index.js +1 -0
  67. package/esm/context/CartesianProvider/zoom.js +19 -0
  68. package/esm/context/DrawingProvider.js +11 -3
  69. package/esm/hooks/useAxisEvents.js +3 -1
  70. package/esm/hooks/useTicks.js +5 -2
  71. package/esm/internals/domUtils.js +16 -3
  72. package/esm/internals/index.js +3 -0
  73. package/esm/internals/isInfinity.js +3 -0
  74. package/esm/models/axis.js +5 -0
  75. package/esm/tests/firePointerEvent.js +35 -0
  76. package/hooks/useAxisEvents.js +3 -1
  77. package/hooks/useTicks.js +5 -2
  78. package/index.js +1 -1
  79. package/internals/defaultizeColor.d.ts +1 -0
  80. package/internals/domUtils.d.ts +2 -0
  81. package/internals/domUtils.js +19 -5
  82. package/internals/index.d.ts +2 -0
  83. package/internals/index.js +17 -1
  84. package/internals/isInfinity.d.ts +1 -0
  85. package/internals/isInfinity.js +9 -0
  86. package/models/axis.d.ts +6 -0
  87. package/models/axis.js +5 -0
  88. package/models/seriesType/line.d.ts +10 -0
  89. package/modern/BarChart/BarChart.js +2 -0
  90. package/modern/BarChart/BarPlot.js +4 -3
  91. package/modern/BarChart/extremums.js +46 -9
  92. package/modern/ChartContainer/ChartContainer.js +5 -3
  93. package/modern/ChartContainer/useChartContainerProps.js +3 -3
  94. package/modern/ChartContainer/useDefaultizeAxis.js +16 -5
  95. package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +23 -9
  96. package/modern/ChartsGrid/ChartsGrid.js +6 -4
  97. package/modern/ChartsTooltip/utils.js +4 -2
  98. package/modern/ChartsXAxis/ChartsXAxis.js +25 -8
  99. package/modern/ChartsYAxis/ChartsYAxis.js +19 -7
  100. package/modern/LineChart/AreaPlot.js +11 -1
  101. package/modern/LineChart/LineChart.js +2 -0
  102. package/modern/LineChart/extremums.js +23 -18
  103. package/modern/PieChart/PieChart.js +2 -0
  104. package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +2 -0
  105. package/modern/ScatterChart/ScatterChart.js +2 -0
  106. package/modern/ScatterChart/extremums.js +30 -22
  107. package/modern/SparkLineChart/SparkLineChart.js +2 -0
  108. package/modern/context/CartesianProvider/Cartesian.types.js +1 -0
  109. package/modern/context/CartesianProvider/CartesianProvider.js +4 -7
  110. package/modern/context/CartesianProvider/computeValue.js +20 -23
  111. package/modern/context/CartesianProvider/getAxisExtremum.js +10 -11
  112. package/modern/context/CartesianProvider/index.js +1 -0
  113. package/modern/context/CartesianProvider/zoom.js +19 -0
  114. package/modern/context/DrawingProvider.js +11 -3
  115. package/modern/hooks/useAxisEvents.js +3 -1
  116. package/modern/hooks/useTicks.js +5 -2
  117. package/modern/index.js +1 -1
  118. package/modern/internals/domUtils.js +16 -3
  119. package/modern/internals/index.js +3 -0
  120. package/modern/internals/isInfinity.js +3 -0
  121. package/modern/models/axis.js +5 -0
  122. package/modern/tests/firePointerEvent.js +35 -0
  123. package/package.json +4 -4
  124. package/tests/firePointerEvent.js +42 -0
  125. package/context/CartesianProvider/normalizeAxis.d.ts +0 -5
  126. package/context/CartesianProvider/normalizeAxis.js +0 -23
  127. package/esm/context/CartesianProvider/normalizeAxis.js +0 -15
  128. package/modern/context/CartesianProvider/normalizeAxis.js +0 -15
@@ -1,21 +1,20 @@
1
- const axisExtremumCallback = (acc, chartType, axis, getters, isDefaultAxis, formattedSeries) => {
1
+ const axisExtremumCallback = (acc, chartType, axis, getters, isDefaultAxis, formattedSeries, getFilters) => {
2
2
  const getter = getters[chartType];
3
3
  const series = formattedSeries[chartType]?.series ?? {};
4
4
  const [minChartTypeData, maxChartTypeData] = getter?.({
5
5
  series,
6
6
  axis,
7
- isDefaultAxis
8
- }) ?? [null, null];
7
+ isDefaultAxis,
8
+ getFilters
9
+ }) ?? [Infinity, -Infinity];
9
10
  const [minData, maxData] = acc;
10
- if (minData === null || maxData === null) {
11
- return [minChartTypeData, maxChartTypeData];
12
- }
13
- if (minChartTypeData === null || maxChartTypeData === null) {
14
- return [minData, maxData];
15
- }
16
11
  return [Math.min(minChartTypeData, minData), Math.max(maxChartTypeData, maxData)];
17
12
  };
18
- export const getAxisExtremum = (axis, getters, isDefaultAxis, formattedSeries) => {
13
+ export const getAxisExtremum = (axis, getters, isDefaultAxis, formattedSeries, getFilters) => {
19
14
  const charTypes = Object.keys(getters);
20
- return charTypes.reduce((acc, charType) => axisExtremumCallback(acc, charType, axis, getters, isDefaultAxis, formattedSeries), [null, null]);
15
+ const extremums = charTypes.reduce((acc, charType) => axisExtremumCallback(acc, charType, axis, getters, isDefaultAxis, formattedSeries, getFilters), [Infinity, -Infinity]);
16
+ if (Number.isNaN(extremums[0]) || Number.isNaN(extremums[1])) {
17
+ return [Infinity, -Infinity];
18
+ }
19
+ return extremums;
21
20
  };
@@ -2,6 +2,7 @@ import { computeValue } from './computeValue';
2
2
  export * from './CartesianProvider';
3
3
  export * from './CartesianContext';
4
4
  export * from './useCartesianContext';
5
+ export * from './Cartesian.types';
5
6
  const cartesianProviderUtils = {
6
7
  computeValue
7
8
  };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Applies the zoom into the scale range.
3
+ * It changes the screen coordinates that the scale covers.
4
+ * Not the data that is displayed.
5
+ *
6
+ * @param scaleRange the original range in real screen coordinates.
7
+ * @param zoomRange the zoom range in percentage.
8
+ * @returns zoomed range in real screen coordinates.
9
+ */
10
+ export const zoomScaleRange = (scaleRange, zoomRange) => {
11
+ const rangeGap = scaleRange[1] - scaleRange[0];
12
+ const zoomGap = zoomRange[1] - zoomRange[0];
13
+
14
+ // If current zoom show the scale between p1 and p2 percents
15
+ // The range should be extended by adding [0, p1] and [p2, 100] segments
16
+ const min = scaleRange[0] - zoomRange[0] * rangeGap / zoomGap;
17
+ const max = scaleRange[1] + (100 - zoomRange[1]) * rangeGap / zoomGap;
18
+ return [min, max];
19
+ };
@@ -42,12 +42,20 @@ export function DrawingProvider(props) {
42
42
  const isPointInside = React.useCallback(({
43
43
  x,
44
44
  y
45
- }, targetElement) => {
45
+ }, options) => {
46
46
  // For element allowed to overflow, wrapping them in <g data-drawing-container /> make them fully part of the drawing area.
47
- if (targetElement && targetElement.closest('[data-drawing-container]')) {
47
+ if (options?.targetElement && options?.targetElement.closest('[data-drawing-container]')) {
48
48
  return true;
49
49
  }
50
- return x >= drawingArea.left && x <= drawingArea.left + drawingArea.width && y >= drawingArea.top && y <= drawingArea.top + drawingArea.height;
50
+ const isInsideX = x >= drawingArea.left - 1 && x <= drawingArea.left + drawingArea.width;
51
+ const isInsideY = y >= drawingArea.top - 1 && y <= drawingArea.top + drawingArea.height;
52
+ if (options?.direction === 'x') {
53
+ return isInsideX;
54
+ }
55
+ if (options?.direction === 'y') {
56
+ return isInsideY;
57
+ }
58
+ return isInsideX && isInsideY;
51
59
  }, [drawingArea]);
52
60
  const value = React.useMemo(() => _extends({
53
61
  chartId: chartId ?? ''
@@ -98,7 +98,9 @@ export const useAxisEvents = disableAxisListener => {
98
98
  const svgPoint = getSVGPoint(element, target);
99
99
  mousePosition.current.x = svgPoint.x;
100
100
  mousePosition.current.y = svgPoint.y;
101
- if (!drawingArea.isPointInside(svgPoint, event.target)) {
101
+ if (!drawingArea.isPointInside(svgPoint, {
102
+ targetElement: event.target
103
+ })) {
102
104
  if (mousePosition.current.isInChart) {
103
105
  dispatch({
104
106
  type: 'exitChart'
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { isBandScale } from '../internals/isBandScale';
3
+ import { isInfinity } from '../internals/isInfinity';
3
4
  export function getTickNumber(params) {
4
5
  const {
5
6
  tickMaxStep,
@@ -60,8 +61,10 @@ export function useTicks(options) {
60
61
  labelOffset: 0
61
62
  }));
62
63
  }
63
- if (scale.domain().length === 0 || scale.domain()[0] === scale.domain()[1]) {
64
- // The axis should not be visible, so ticks should also be hidden.
64
+ const domain = scale.domain();
65
+ // Skip axis rendering if no data is available
66
+ // - The domains contains Infinity for continuous scales.
67
+ if (domain.some(isInfinity)) {
65
68
  return [];
66
69
  }
67
70
  const ticks = typeof tickInterval === 'object' ? tickInterval : scale.ticks(tickNumber);
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/x-charts v7.12.1
2
+ * @mui/x-charts v7.14.0
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -20,7 +20,7 @@ const SPAN_STYLE = {
20
20
  whiteSpace: 'pre'
21
21
  };
22
22
  const STYLE_LIST = ['minWidth', 'maxWidth', 'width', 'minHeight', 'maxHeight', 'height', 'top', 'left', 'fontSize', 'padding', 'margin', 'paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom'];
23
- const MEASUREMENT_SPAN_ID = 'mui_measurement_span';
23
+ export const MEASUREMENT_SPAN_ID = 'mui_measurement_span';
24
24
 
25
25
  /**
26
26
  *
@@ -57,7 +57,7 @@ function camelToMiddleLine(text) {
57
57
  * @returns CSS styling string
58
58
  */
59
59
  export const getStyleString = style => Object.keys(style).sort().reduce((result, s) => `${result}${camelToMiddleLine(s)}:${autoCompleteStyle(s, style[s])};`, '');
60
-
60
+ let domCleanTimeout;
61
61
  /**
62
62
  *
63
63
  * @param text The string to estimate
@@ -105,6 +105,13 @@ export const getStringSize = (text, style = {}) => {
105
105
  } else {
106
106
  stringCache.cacheCount += 1;
107
107
  }
108
+ if (domCleanTimeout) {
109
+ clearTimeout(domCleanTimeout);
110
+ }
111
+ domCleanTimeout = setTimeout(() => {
112
+ // Limit node cleaning to once per render cycle
113
+ measurementSpan.textContent = '';
114
+ }, 0);
108
115
  return result;
109
116
  } catch (e) {
110
117
  return {
@@ -112,4 +119,10 @@ export const getStringSize = (text, style = {}) => {
112
119
  height: 0
113
120
  };
114
121
  }
115
- };
122
+ };
123
+
124
+ // eslint-disable-next-line @typescript-eslint/naming-convention
125
+ export function unstable_cleanupDOM() {
126
+ // const measurementSpan = document.getElementById(MEASUREMENT_SPAN_ID);
127
+ // measurementSpan?.remove();
128
+ }
@@ -20,6 +20,7 @@ export * from './configInit';
20
20
  export * from './getLabel';
21
21
  export * from './getSVGPoint';
22
22
  export * from './isDefined';
23
+ export { unstable_cleanupDOM } from './domUtils';
23
24
 
24
25
  // contexts
25
26
 
@@ -29,6 +30,8 @@ export * from '../context/InteractionProvider';
29
30
  export * from '../context/SeriesProvider';
30
31
  export * from '../context/ZAxisContextProvider';
31
32
  export * from '../context/PluginProvider';
33
+ export { getAxisExtremum } from '../context/CartesianProvider/getAxisExtremum';
34
+
32
35
  // series configuration
33
36
  export * from '../models/seriesType/config';
34
37
  export * from '../models/seriesType/common';
@@ -0,0 +1,3 @@
1
+ export function isInfinity(v) {
2
+ return typeof v === 'number' && !Number.isFinite(v);
3
+ }
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Use this type instead of `AxisScaleConfig` when the values
3
+ * shouldn't be provided by the user.
4
+ */
5
+
1
6
  export function isBandScaleConfig(scaleConfig) {
2
7
  return scaleConfig.scaleType === 'band';
3
8
  }
@@ -0,0 +1,35 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import { fireEvent } from '@mui/internal-test-utils';
3
+ export function firePointerEvent(target, type, options) {
4
+ const originalGetBoundingClientRect = target.getBoundingClientRect;
5
+ target.getBoundingClientRect = () => ({
6
+ x: 0,
7
+ y: 0,
8
+ bottom: 0,
9
+ height: 0,
10
+ left: 0,
11
+ right: 0,
12
+ top: 0,
13
+ width: 0,
14
+ toJSON() {
15
+ return {
16
+ x: 0,
17
+ y: 0,
18
+ bottom: 0,
19
+ height: 0,
20
+ left: 0,
21
+ right: 0,
22
+ top: 0,
23
+ width: 0
24
+ };
25
+ }
26
+ });
27
+ const event = new window.PointerEvent(type, _extends({
28
+ bubbles: true,
29
+ cancelable: true,
30
+ composed: true,
31
+ isPrimary: true
32
+ }, options));
33
+ fireEvent(target, event);
34
+ target.getBoundingClientRect = originalGetBoundingClientRect;
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/x-charts",
3
- "version": "7.12.1",
3
+ "version": "7.14.0",
4
4
  "description": "The community edition of the Charts components (MUI X).",
5
5
  "author": "MUI Team",
6
6
  "main": "./index.js",
@@ -30,13 +30,13 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@babel/runtime": "^7.25.0",
33
- "@mui/system": "^5.16.5",
34
- "@mui/utils": "^5.16.5",
33
+ "@mui/system": "^5.16.7",
34
+ "@mui/utils": "^5.16.6",
35
35
  "@react-spring/rafz": "^9.7.4",
36
36
  "@react-spring/web": "^9.7.4",
37
37
  "clsx": "^2.1.1",
38
38
  "prop-types": "^15.8.1",
39
- "@mui/x-charts-vendor": "7.12.1"
39
+ "@mui/x-charts-vendor": "7.14.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@emotion/react": "^11.9.0",
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.firePointerEvent = firePointerEvent;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+ var _internalTestUtils = require("@mui/internal-test-utils");
10
+ function firePointerEvent(target, type, options) {
11
+ const originalGetBoundingClientRect = target.getBoundingClientRect;
12
+ target.getBoundingClientRect = () => ({
13
+ x: 0,
14
+ y: 0,
15
+ bottom: 0,
16
+ height: 0,
17
+ left: 0,
18
+ right: 0,
19
+ top: 0,
20
+ width: 0,
21
+ toJSON() {
22
+ return {
23
+ x: 0,
24
+ y: 0,
25
+ bottom: 0,
26
+ height: 0,
27
+ left: 0,
28
+ right: 0,
29
+ top: 0,
30
+ width: 0
31
+ };
32
+ }
33
+ });
34
+ const event = new window.PointerEvent(type, (0, _extends2.default)({
35
+ bubbles: true,
36
+ cancelable: true,
37
+ composed: true,
38
+ isPrimary: true
39
+ }, options));
40
+ (0, _internalTestUtils.fireEvent)(target, event);
41
+ target.getBoundingClientRect = originalGetBoundingClientRect;
42
+ }
@@ -1,5 +0,0 @@
1
- import type { AxisConfig, ScaleName } from '../../models';
2
- import { ChartsAxisProps } from '../../models/axis';
3
- import { MakeOptional } from '../../models/helpers';
4
- import { DatasetType } from '../../models/seriesType/config';
5
- export declare const normalizeAxis: <T extends ChartsAxisProps, R extends MakeOptional<AxisConfig<ScaleName, any, T>, "id">>(axis: R[] | undefined, dataset: DatasetType | undefined, axisName: "x" | "y") => R[];
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.normalizeAxis = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- const normalizeAxis = (axis, dataset, axisName) => {
10
- return axis?.map(axisConfig => {
11
- const dataKey = axisConfig.dataKey;
12
- if (dataKey === undefined || axisConfig.data !== undefined) {
13
- return axisConfig;
14
- }
15
- if (dataset === undefined) {
16
- throw Error(`MUI X: ${axisName}-axis uses \`dataKey\` but no \`dataset\` is provided.`);
17
- }
18
- return (0, _extends2.default)({}, axisConfig, {
19
- data: dataset.map(d => d[dataKey])
20
- });
21
- }) ?? [];
22
- };
23
- exports.normalizeAxis = normalizeAxis;
@@ -1,15 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- export const normalizeAxis = (axis, dataset, axisName) => {
3
- return axis?.map(axisConfig => {
4
- const dataKey = axisConfig.dataKey;
5
- if (dataKey === undefined || axisConfig.data !== undefined) {
6
- return axisConfig;
7
- }
8
- if (dataset === undefined) {
9
- throw Error(`MUI X: ${axisName}-axis uses \`dataKey\` but no \`dataset\` is provided.`);
10
- }
11
- return _extends({}, axisConfig, {
12
- data: dataset.map(d => d[dataKey])
13
- });
14
- }) ?? [];
15
- };
@@ -1,15 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- export const normalizeAxis = (axis, dataset, axisName) => {
3
- return axis?.map(axisConfig => {
4
- const dataKey = axisConfig.dataKey;
5
- if (dataKey === undefined || axisConfig.data !== undefined) {
6
- return axisConfig;
7
- }
8
- if (dataset === undefined) {
9
- throw Error(`MUI X: ${axisName}-axis uses \`dataKey\` but no \`dataset\` is provided.`);
10
- }
11
- return _extends({}, axisConfig, {
12
- data: dataset.map(d => d[dataKey])
13
- });
14
- }) ?? [];
15
- };