@mui/x-charts 8.18.0 → 8.19.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.
- package/BarChart/seriesConfig/bar/seriesProcessor.js +15 -9
- package/CHANGELOG.md +113 -0
- package/ChartsSurface/ChartsSurface.js +5 -2
- package/LineChart/seriesConfig/seriesProcessor.js +15 -10
- package/PieChart/PieArcPlot.js +5 -3
- package/esm/BarChart/seriesConfig/bar/seriesProcessor.js +15 -9
- package/esm/ChartsSurface/ChartsSurface.js +5 -2
- package/esm/LineChart/seriesConfig/seriesProcessor.js +15 -10
- package/esm/PieChart/PieArcPlot.js +5 -3
- package/esm/hooks/useBarSeries.js +3 -5
- package/esm/hooks/useLineSeries.js +3 -5
- package/esm/hooks/usePieSeries.js +3 -5
- package/esm/hooks/useRadarSeries.js +3 -5
- package/esm/hooks/useScatterSeries.js +3 -5
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/internals/domUtils.js +30 -14
- package/esm/internals/getScale.d.ts +2 -1
- package/esm/internals/index.d.ts +1 -1
- package/esm/internals/index.js +1 -1
- package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.js +2 -2
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +5 -6
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +2 -2
- package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +2 -2
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +4 -1
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +3 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +4 -4
- package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +15 -15
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +5 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +11 -11
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +5 -6
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +7 -8
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +11 -12
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +8 -8
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.js +4 -4
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +11 -11
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.js +6 -6
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +7 -8
- package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.js +2 -2
- package/esm/internals/plugins/utils/selectors.d.ts +1 -14
- package/esm/internals/plugins/utils/selectors.js +1 -5
- package/esm/internals/seriesSelectorOfType.d.ts +20 -0
- package/esm/internals/seriesSelectorOfType.js +38 -0
- package/esm/models/seriesType/config.d.ts +2 -2
- package/esm/utils/index.d.ts +4 -0
- package/esm/utils/index.js +5 -0
- package/esm/utils/niceDomain.d.ts +20 -0
- package/esm/utils/niceDomain.js +24 -0
- package/hooks/useBarSeries.js +3 -6
- package/hooks/useLineSeries.js +3 -6
- package/hooks/usePieSeries.js +3 -6
- package/hooks/useRadarSeries.js +3 -6
- package/hooks/useScatterSeries.js +3 -6
- package/index.d.ts +2 -1
- package/index.js +13 -1
- package/internals/domUtils.js +30 -14
- package/internals/getScale.d.ts +2 -1
- package/internals/index.d.ts +1 -1
- package/internals/index.js +4 -4
- package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.js +2 -2
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +4 -5
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +2 -2
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +2 -2
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +4 -1
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +3 -1
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +4 -4
- package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.selectors.js +15 -15
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +5 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +11 -11
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +4 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +6 -7
- package/internals/plugins/featurePlugins/useChartClosestPoint/findClosestPoints.js +2 -2
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +2 -2
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +10 -11
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +8 -8
- package/internals/plugins/featurePlugins/useChartInteraction/useChartTooltip.selectors.js +4 -4
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +11 -11
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.js +6 -6
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.js +6 -7
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.js +2 -2
- package/internals/plugins/utils/selectors.d.ts +1 -14
- package/internals/plugins/utils/selectors.js +1 -8
- package/internals/seriesSelectorOfType.d.ts +20 -0
- package/internals/seriesSelectorOfType.js +46 -0
- package/models/seriesType/config.d.ts +2 -2
- package/package.json +4 -4
- package/utils/index.d.ts +4 -0
- package/utils/index.js +16 -0
- package/utils/niceDomain.d.ts +20 -0
- package/utils/niceDomain.js +29 -0
- package/esm/internals/createSeriesSelectorOfType.d.ts +0 -4
- package/esm/internals/createSeriesSelectorOfType.js +0 -45
- package/internals/createSeriesSelectorOfType.d.ts +0 -4
- package/internals/createSeriesSelectorOfType.js +0 -53
|
@@ -34,6 +34,20 @@ const seriesProcessor = (params, dataset) => {
|
|
|
34
34
|
} else if (dataset === undefined) {
|
|
35
35
|
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'));
|
|
36
36
|
}
|
|
37
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
38
|
+
if (!data && dataset) {
|
|
39
|
+
const dataKey = series[id].dataKey;
|
|
40
|
+
if (!dataKey) {
|
|
41
|
+
throw new Error([`MUI X Charts: bar series with id='${id}' has no data and no dataKey.`, 'You must provide a dataKey when using the dataset prop.'].join('\n'));
|
|
42
|
+
}
|
|
43
|
+
dataset.forEach((entry, index) => {
|
|
44
|
+
const value = entry[dataKey];
|
|
45
|
+
if (value != null && typeof value !== 'number') {
|
|
46
|
+
(0, _warning.warnOnce)([`MUI X Charts: your dataset key "${dataKey}" is used for plotting bars, but the dataset contains the non-null non-numerical element "${value}" at index ${index}.`, 'Bar plots only support numeric and null values.'].join('\n'));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
37
51
|
});
|
|
38
52
|
const completedSeries = {};
|
|
39
53
|
stackingGroups.forEach(stackingGroup => {
|
|
@@ -59,15 +73,7 @@ const seriesProcessor = (params, dataset) => {
|
|
|
59
73
|
}, series[id], {
|
|
60
74
|
data: dataKey ? dataset.map(data => {
|
|
61
75
|
const value = data[dataKey];
|
|
62
|
-
|
|
63
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
64
|
-
if (value !== null) {
|
|
65
|
-
(0, _warning.warnOnce)([`MUI X Charts: your dataset key "${dataKey}" is used for plotting bars, but contains nonnumerical elements.`, 'Bar plots only support numbers and null values.']);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
return value;
|
|
76
|
+
return typeof value === 'number' ? value : null;
|
|
71
77
|
}) : series[id].data,
|
|
72
78
|
stackedData: stackedSeries[index].map(([a, b]) => [a, b])
|
|
73
79
|
});
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,119 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.19.0
|
|
9
|
+
|
|
10
|
+
_Nov 20, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🔎 Add pan on `wheel` to the charts zoom
|
|
15
|
+
- ⌨️ Allow opt-in to [tab navigation](https://mui.com/x/react-data-grid/accessibility/#tab-navigation) inside the Data Grid.
|
|
16
|
+
- ⚙️ New way of defining [action columns](https://mui.com/x/react-data-grid/column-definition/#ActionsWithModalGrid.tsx) in the Data Grid that makes it easier to keep `columns` prop stable.
|
|
17
|
+
- 🐞 Bugfixes
|
|
18
|
+
- 📚 Documentation improvements
|
|
19
|
+
|
|
20
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
21
|
+
@lauri865, @noobyogi0010, @sai6855
|
|
22
|
+
|
|
23
|
+
The following team members contributed to this release:
|
|
24
|
+
@alexfauquette, @arminmeh, @bernardobelchior, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @mj12albert, @noraleonte, @rita-codes, @siriwatknp, @ZeeshanTamboli
|
|
25
|
+
|
|
26
|
+
### Data Grid
|
|
27
|
+
|
|
28
|
+
#### `@mui/x-data-grid@8.19.0`
|
|
29
|
+
|
|
30
|
+
- [DataGrid] Add `tabNavigation` prop to control tab navigation in the grid (#20286) @arminmeh
|
|
31
|
+
- [DataGrid] Allow to focus disabled checkbox cells (#19959) @mj12albert
|
|
32
|
+
- [DataGrid] Alternative actions column definition API (#15041) @cherniavskii
|
|
33
|
+
- [DataGrid] Fix failing tests (#20332) @cherniavskii
|
|
34
|
+
- [DataGrid] Prevent Safari 26 error in the event handler (#20369) @arminmeh
|
|
35
|
+
- [DataGrid] Undeprecate the `autoHeight` prop (#20363) @cherniavskii
|
|
36
|
+
- [DataGrid] Fix print export grid dimensions with dynamic row height and print styles (#19835) @cherniavskii
|
|
37
|
+
|
|
38
|
+
#### `@mui/x-data-grid-pro@8.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
39
|
+
|
|
40
|
+
Same changes as in `@mui/x-data-grid@8.19.0`.
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-data-grid-premium@8.19.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
43
|
+
|
|
44
|
+
Same changes as in `@mui/x-data-grid-pro@8.19.0`, plus:
|
|
45
|
+
|
|
46
|
+
- [DataGridPremium] Fix aggregation with sorting (#19892) @lauri865
|
|
47
|
+
- [DataGridPremium] Lock `ExcelJS` version (#20329) @cherniavskii
|
|
48
|
+
|
|
49
|
+
### Date and Time Pickers
|
|
50
|
+
|
|
51
|
+
#### `@mui/x-date-pickers@8.19.0`
|
|
52
|
+
|
|
53
|
+
- [pickers] Do not loose `slotProps.field.slotProps` (#20322) @flaviendelangle
|
|
54
|
+
|
|
55
|
+
#### `@mui/x-date-pickers-pro@8.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
56
|
+
|
|
57
|
+
Same changes as in `@mui/x-date-pickers@8.19.0`.
|
|
58
|
+
|
|
59
|
+
### Charts
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-charts@8.19.0`
|
|
62
|
+
|
|
63
|
+
- [charts] Expose `niceDomain` utility (#20250) @bernardobelchior
|
|
64
|
+
- [charts] Fix benchmark regression by downgrading to JSDOM v26 (#20405) @bernardobelchior
|
|
65
|
+
- [charts] Fix Pie Chart keyboard focus highlight (#20358) @JCQuintas
|
|
66
|
+
- [charts] Memoize series selectors (#20326) @JCQuintas
|
|
67
|
+
- [charts] Relax dataset type (#20294) @bernardobelchior
|
|
68
|
+
- [charts] Remove `touch-action: pan-y` when zoom is disabled (#20204) @bernardobelchior
|
|
69
|
+
- [charts] Use `getBBox()` for correct SVG sizes in firefox (#20309) @JCQuintas
|
|
70
|
+
- [charts] Use directly selector from `@mui/x-internals` (#20365) @alexfauquette
|
|
71
|
+
- [charts] Fix unnecessary errors in dev mode (#20380) @JCQuintas
|
|
72
|
+
|
|
73
|
+
#### `@mui/x-charts-pro@8.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
74
|
+
|
|
75
|
+
Same changes as in `@mui/x-charts@8.19.0`, plus:
|
|
76
|
+
|
|
77
|
+
- [charts-pro] Add pan on `wheel` to zoom (#19998) @JCQuintas
|
|
78
|
+
- [charts-pro] Fix zoom slider preview having an opaque background in dark mode (#20367) @bernardobelchior
|
|
79
|
+
|
|
80
|
+
#### `@mui/x-charts-premium@8.19.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
81
|
+
|
|
82
|
+
Same changes as in `@mui/x-charts-pro@8.19.0`.
|
|
83
|
+
|
|
84
|
+
### Tree View
|
|
85
|
+
|
|
86
|
+
#### `@mui/x-tree-view@8.19.0`
|
|
87
|
+
|
|
88
|
+
- [tree view] Enable lazy load when children count is not know in tree view (#18680) @noobyogi0010
|
|
89
|
+
- [tree view] Fix unwanted behaviors on the item re-ordering (#20368) @flaviendelangle
|
|
90
|
+
|
|
91
|
+
#### `@mui/x-tree-view-pro@8.19.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
92
|
+
|
|
93
|
+
Same changes as in `@mui/x-tree-view@8.19.0`.
|
|
94
|
+
|
|
95
|
+
### Codemod
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-codemod@8.19.0`
|
|
98
|
+
|
|
99
|
+
Internal changes.
|
|
100
|
+
|
|
101
|
+
### Docs
|
|
102
|
+
|
|
103
|
+
- [docs] Add minimum Typescript version to migration guide (#20320) @siriwatknp
|
|
104
|
+
- [docs] Fix Autosizing documentation (#20348) @siriwatknp
|
|
105
|
+
- [docs] Fix separator opacity in demo (#20293) @sai6855
|
|
106
|
+
- [docs] Replace deprecated `LoadingButton` with `Button` component (#20208) @Janpot
|
|
107
|
+
|
|
108
|
+
### Core
|
|
109
|
+
|
|
110
|
+
- [code-infra] Add new broken links checker (#20120) @Janpot
|
|
111
|
+
- [code-infra] Disable Codspeed pipeline (#20370) @JCQuintas
|
|
112
|
+
- [code-infra] Optimize `checkMaterialVersion` (#20307) @Janpot
|
|
113
|
+
- [code-infra] Use utils from code-infra for changelog and PR creation (#20406) @brijeshb42
|
|
114
|
+
- [docs-infra] Revert `@docsearch/react` (#20313) @Janpot
|
|
115
|
+
|
|
116
|
+
### Miscellaneous
|
|
117
|
+
|
|
118
|
+
- [test] Fix browser tests skipping some projects (#20318) @cherniavskii
|
|
119
|
+
- [test] Update `use-react-version` pnpm script (#20319) @cherniavskii
|
|
120
|
+
|
|
8
121
|
## 8.18.0
|
|
9
122
|
|
|
10
123
|
<!-- generated comparing v8.17.0..master -->
|
|
@@ -21,6 +21,7 @@ var _useStore = require("../internals/store/useStore");
|
|
|
21
21
|
var _useChartDimensions = require("../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors");
|
|
22
22
|
var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
|
|
23
23
|
var _chartsSurfaceClasses = require("./chartsSurfaceClasses");
|
|
24
|
+
var _useChartCartesianAxisRendering = require("../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors");
|
|
24
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
26
|
const _excluded = ["children", "className", "title", "desc"];
|
|
26
27
|
const ChartsSurfaceStyles = (0, _styles.styled)('svg', {
|
|
@@ -40,7 +41,7 @@ const ChartsSurfaceStyles = (0, _styles.styled)('svg', {
|
|
|
40
41
|
overflow: 'hidden',
|
|
41
42
|
// This prevents default touch actions when using the svg on mobile devices.
|
|
42
43
|
// For example, prevent page scroll & zoom.
|
|
43
|
-
touchAction: 'pan-y',
|
|
44
|
+
touchAction: ownerState.hasZoom ? 'pan-y' : undefined,
|
|
44
45
|
userSelect: 'none',
|
|
45
46
|
gridArea: 'chart',
|
|
46
47
|
'&:focus': {
|
|
@@ -81,6 +82,7 @@ const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(func
|
|
|
81
82
|
const propsHeight = (0, _useSelector.useSelector)(store, _useChartDimensions.selectorChartPropsHeight);
|
|
82
83
|
const isKeyboardNavigationEnabled = (0, _useSelector.useSelector)(store, _useChartKeyboardNavigation.selectorChartsIsKeyboardNavigationEnabled);
|
|
83
84
|
const hasFocusedItem = (0, _useSelector.useSelector)(store, _useChartKeyboardNavigation.selectorChartsHasFocusedItem);
|
|
85
|
+
const hasZoom = (0, _useSelector.useSelector)(store, _useChartCartesianAxisRendering.selectorChartHasZoom);
|
|
84
86
|
const svgRef = (0, _useSvgRef.useSvgRef)();
|
|
85
87
|
const handleRef = (0, _useForkRef.default)(svgRef, ref);
|
|
86
88
|
const themeProps = (0, _styles.useThemeProps)({
|
|
@@ -99,7 +101,8 @@ const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(func
|
|
|
99
101
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ChartsSurfaceStyles, (0, _extends2.default)({
|
|
100
102
|
ownerState: {
|
|
101
103
|
width: propsWidth,
|
|
102
|
-
height: propsHeight
|
|
104
|
+
height: propsHeight,
|
|
105
|
+
hasZoom
|
|
103
106
|
},
|
|
104
107
|
viewBox: `${0} ${0} ${svgWidth} ${svgHeight}`,
|
|
105
108
|
className: (0, _clsx.default)(classes.root, className),
|
|
@@ -10,7 +10,6 @@ var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
|
10
10
|
var _warning = require("@mui/x-internals/warning");
|
|
11
11
|
var _stackSeries = require("../../internals/stackSeries");
|
|
12
12
|
var _defaultizeValueFormatter = require("../../internals/defaultizeValueFormatter");
|
|
13
|
-
// For now it's a copy past of bar charts formatter, but maybe will diverge later
|
|
14
13
|
const seriesProcessor = (params, dataset) => {
|
|
15
14
|
const {
|
|
16
15
|
seriesOrder,
|
|
@@ -39,6 +38,20 @@ const seriesProcessor = (params, dataset) => {
|
|
|
39
38
|
} else if (dataset === undefined && process.env.NODE_ENV !== 'production') {
|
|
40
39
|
throw new Error([`MUI X Charts: line series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
|
|
41
40
|
}
|
|
41
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
42
|
+
if (!data && dataset) {
|
|
43
|
+
const dataKey = series[id].dataKey;
|
|
44
|
+
if (!dataKey) {
|
|
45
|
+
throw new Error([`MUI X Charts: line series with id='${id}' has no data and no dataKey.`, 'You must provide a dataKey when using the dataset prop.'].join('\n'));
|
|
46
|
+
}
|
|
47
|
+
dataset.forEach((entry, index) => {
|
|
48
|
+
const value = entry[dataKey];
|
|
49
|
+
if (value != null && typeof value !== 'number') {
|
|
50
|
+
(0, _warning.warnOnce)([`MUI X Charts: your dataset key "${dataKey}" is used for plotting lines, but the dataset contains the non-null non-numerical element "${value}" at index ${index}.`, 'Line plots only support numeric and null values.'].join('\n'));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
42
55
|
});
|
|
43
56
|
const completedSeries = {};
|
|
44
57
|
stackingGroups.forEach(stackingGroup => {
|
|
@@ -61,15 +74,7 @@ const seriesProcessor = (params, dataset) => {
|
|
|
61
74
|
}, series[id], {
|
|
62
75
|
data: dataKey ? dataset.map(data => {
|
|
63
76
|
const value = data[dataKey];
|
|
64
|
-
|
|
65
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
66
|
-
if (value !== null) {
|
|
67
|
-
(0, _warning.warnOnce)([`MUI X Charts: Your dataset key "${dataKey}" is used for plotting line, but contains nonnumerical elements.`, 'Line plots only support numbers and null values.']);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
return value;
|
|
77
|
+
return typeof value === 'number' ? value : null;
|
|
73
78
|
}) : series[id].data,
|
|
74
79
|
stackedData: stackedSeries[index].map(([a, b]) => [a, b])
|
|
75
80
|
});
|
package/PieChart/PieArcPlot.js
CHANGED
|
@@ -47,9 +47,11 @@ function PieArcPlot(props) {
|
|
|
47
47
|
data
|
|
48
48
|
});
|
|
49
49
|
const {
|
|
50
|
-
dataIndex
|
|
50
|
+
dataIndex,
|
|
51
|
+
seriesId,
|
|
52
|
+
seriesType
|
|
51
53
|
} = (0, _useFocusedItem.useFocusedItem)() ?? {};
|
|
52
|
-
const focusedItem =
|
|
54
|
+
const focusedItem = dataIndex !== undefined && seriesId === id && seriesType === 'pie' ? transformedData[dataIndex] : null;
|
|
53
55
|
if (data.length === 0) {
|
|
54
56
|
return null;
|
|
55
57
|
}
|
|
@@ -90,7 +92,7 @@ function PieArcPlot(props) {
|
|
|
90
92
|
stroke: (theme.vars ?? theme).palette.text.primary,
|
|
91
93
|
id: id,
|
|
92
94
|
className: _PieArc.pieArcClasses.focusIndicator,
|
|
93
|
-
dataIndex:
|
|
95
|
+
dataIndex: focusedItem.dataIndex,
|
|
94
96
|
isFaded: false,
|
|
95
97
|
isHighlighted: false,
|
|
96
98
|
isFocused: false,
|
|
@@ -27,6 +27,20 @@ const seriesProcessor = (params, dataset) => {
|
|
|
27
27
|
} else if (dataset === undefined) {
|
|
28
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'));
|
|
29
29
|
}
|
|
30
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
31
|
+
if (!data && dataset) {
|
|
32
|
+
const dataKey = series[id].dataKey;
|
|
33
|
+
if (!dataKey) {
|
|
34
|
+
throw new Error([`MUI X Charts: bar series with id='${id}' has no data and no dataKey.`, 'You must provide a dataKey when using the dataset prop.'].join('\n'));
|
|
35
|
+
}
|
|
36
|
+
dataset.forEach((entry, index) => {
|
|
37
|
+
const value = entry[dataKey];
|
|
38
|
+
if (value != null && typeof value !== 'number') {
|
|
39
|
+
warnOnce([`MUI X Charts: your dataset key "${dataKey}" is used for plotting bars, but the dataset contains the non-null non-numerical element "${value}" at index ${index}.`, 'Bar plots only support numeric and null values.'].join('\n'));
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
30
44
|
});
|
|
31
45
|
const completedSeries = {};
|
|
32
46
|
stackingGroups.forEach(stackingGroup => {
|
|
@@ -52,15 +66,7 @@ const seriesProcessor = (params, dataset) => {
|
|
|
52
66
|
}, series[id], {
|
|
53
67
|
data: dataKey ? dataset.map(data => {
|
|
54
68
|
const value = data[dataKey];
|
|
55
|
-
|
|
56
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
57
|
-
if (value !== null) {
|
|
58
|
-
warnOnce([`MUI X Charts: your dataset key "${dataKey}" is used for plotting bars, but contains nonnumerical elements.`, 'Bar plots only support numbers and null values.']);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
return value;
|
|
69
|
+
return typeof value === 'number' ? value : null;
|
|
64
70
|
}) : series[id].data,
|
|
65
71
|
stackedData: stackedSeries[index].map(([a, b]) => [a, b])
|
|
66
72
|
});
|
|
@@ -15,6 +15,7 @@ import { useStore } from "../internals/store/useStore.js";
|
|
|
15
15
|
import { selectorChartPropsHeight, selectorChartPropsWidth, selectorChartSvgWidth, selectorChartSvgHeight } from "../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js";
|
|
16
16
|
import { selectorChartsHasFocusedItem, selectorChartsIsKeyboardNavigationEnabled } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
17
17
|
import { useUtilityClasses } from "./chartsSurfaceClasses.js";
|
|
18
|
+
import { selectorChartHasZoom } from "../internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js";
|
|
18
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
20
|
const ChartsSurfaceStyles = styled('svg', {
|
|
20
21
|
name: 'MuiChartsSurface',
|
|
@@ -33,7 +34,7 @@ const ChartsSurfaceStyles = styled('svg', {
|
|
|
33
34
|
overflow: 'hidden',
|
|
34
35
|
// This prevents default touch actions when using the svg on mobile devices.
|
|
35
36
|
// For example, prevent page scroll & zoom.
|
|
36
|
-
touchAction: 'pan-y',
|
|
37
|
+
touchAction: ownerState.hasZoom ? 'pan-y' : undefined,
|
|
37
38
|
userSelect: 'none',
|
|
38
39
|
gridArea: 'chart',
|
|
39
40
|
'&:focus': {
|
|
@@ -74,6 +75,7 @@ const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inPro
|
|
|
74
75
|
const propsHeight = useSelector(store, selectorChartPropsHeight);
|
|
75
76
|
const isKeyboardNavigationEnabled = useSelector(store, selectorChartsIsKeyboardNavigationEnabled);
|
|
76
77
|
const hasFocusedItem = useSelector(store, selectorChartsHasFocusedItem);
|
|
78
|
+
const hasZoom = useSelector(store, selectorChartHasZoom);
|
|
77
79
|
const svgRef = useSvgRef();
|
|
78
80
|
const handleRef = useForkRef(svgRef, ref);
|
|
79
81
|
const themeProps = useThemeProps({
|
|
@@ -92,7 +94,8 @@ const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inPro
|
|
|
92
94
|
return /*#__PURE__*/_jsxs(ChartsSurfaceStyles, _extends({
|
|
93
95
|
ownerState: {
|
|
94
96
|
width: propsWidth,
|
|
95
|
-
height: propsHeight
|
|
97
|
+
height: propsHeight,
|
|
98
|
+
hasZoom
|
|
96
99
|
},
|
|
97
100
|
viewBox: `${0} ${0} ${svgWidth} ${svgHeight}`,
|
|
98
101
|
className: clsx(classes.root, className),
|
|
@@ -3,7 +3,6 @@ import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
|
|
|
3
3
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
4
4
|
import { getStackingGroups } from "../../internals/stackSeries.js";
|
|
5
5
|
import { defaultizeValueFormatter } from "../../internals/defaultizeValueFormatter.js";
|
|
6
|
-
// For now it's a copy past of bar charts formatter, but maybe will diverge later
|
|
7
6
|
const seriesProcessor = (params, dataset) => {
|
|
8
7
|
const {
|
|
9
8
|
seriesOrder,
|
|
@@ -32,6 +31,20 @@ const seriesProcessor = (params, dataset) => {
|
|
|
32
31
|
} else if (dataset === undefined && process.env.NODE_ENV !== 'production') {
|
|
33
32
|
throw new Error([`MUI X Charts: line series with id='${id}' has no data.`, 'Either provide a data property to the series or use the dataset prop.'].join('\n'));
|
|
34
33
|
}
|
|
34
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
35
|
+
if (!data && dataset) {
|
|
36
|
+
const dataKey = series[id].dataKey;
|
|
37
|
+
if (!dataKey) {
|
|
38
|
+
throw new Error([`MUI X Charts: line series with id='${id}' has no data and no dataKey.`, 'You must provide a dataKey when using the dataset prop.'].join('\n'));
|
|
39
|
+
}
|
|
40
|
+
dataset.forEach((entry, index) => {
|
|
41
|
+
const value = entry[dataKey];
|
|
42
|
+
if (value != null && typeof value !== 'number') {
|
|
43
|
+
warnOnce([`MUI X Charts: your dataset key "${dataKey}" is used for plotting lines, but the dataset contains the non-null non-numerical element "${value}" at index ${index}.`, 'Line plots only support numeric and null values.'].join('\n'));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
35
48
|
});
|
|
36
49
|
const completedSeries = {};
|
|
37
50
|
stackingGroups.forEach(stackingGroup => {
|
|
@@ -54,15 +67,7 @@ const seriesProcessor = (params, dataset) => {
|
|
|
54
67
|
}, series[id], {
|
|
55
68
|
data: dataKey ? dataset.map(data => {
|
|
56
69
|
const value = data[dataKey];
|
|
57
|
-
|
|
58
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
59
|
-
if (value !== null) {
|
|
60
|
-
warnOnce([`MUI X Charts: Your dataset key "${dataKey}" is used for plotting line, but contains nonnumerical elements.`, 'Line plots only support numbers and null values.']);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
return value;
|
|
70
|
+
return typeof value === 'number' ? value : null;
|
|
66
71
|
}) : series[id].data,
|
|
67
72
|
stackedData: stackedSeries[index].map(([a, b]) => [a, b])
|
|
68
73
|
});
|
|
@@ -40,9 +40,11 @@ function PieArcPlot(props) {
|
|
|
40
40
|
data
|
|
41
41
|
});
|
|
42
42
|
const {
|
|
43
|
-
dataIndex
|
|
43
|
+
dataIndex,
|
|
44
|
+
seriesId,
|
|
45
|
+
seriesType
|
|
44
46
|
} = useFocusedItem() ?? {};
|
|
45
|
-
const focusedItem =
|
|
47
|
+
const focusedItem = dataIndex !== undefined && seriesId === id && seriesType === 'pie' ? transformedData[dataIndex] : null;
|
|
46
48
|
if (data.length === 0) {
|
|
47
49
|
return null;
|
|
48
50
|
}
|
|
@@ -83,7 +85,7 @@ function PieArcPlot(props) {
|
|
|
83
85
|
stroke: (theme.vars ?? theme).palette.text.primary,
|
|
84
86
|
id: id,
|
|
85
87
|
className: pieArcClasses.focusIndicator,
|
|
86
|
-
dataIndex:
|
|
88
|
+
dataIndex: focusedItem.dataIndex,
|
|
87
89
|
isFaded: false,
|
|
88
90
|
isHighlighted: false,
|
|
89
91
|
isFocused: false,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
const useSelectorSeries = createSeriesSelectorsOfType('bar');
|
|
5
|
-
const useSelectorSeriesContext = createAllSeriesSelectorOfType('bar');
|
|
3
|
+
import { useSeriesOfType, useAllSeriesOfType } from "../internals/seriesSelectorOfType.js";
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* Get access to the internal state of bar series.
|
|
@@ -27,7 +25,7 @@ const useSelectorSeriesContext = createAllSeriesSelectorOfType('bar');
|
|
|
27
25
|
*/
|
|
28
26
|
|
|
29
27
|
export function useBarSeries(seriesIds) {
|
|
30
|
-
return
|
|
28
|
+
return useSeriesOfType('bar', seriesIds);
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
/**
|
|
@@ -39,5 +37,5 @@ export function useBarSeries(seriesIds) {
|
|
|
39
37
|
* @returns the bar series
|
|
40
38
|
*/
|
|
41
39
|
export function useBarSeriesContext() {
|
|
42
|
-
return
|
|
40
|
+
return useAllSeriesOfType('bar');
|
|
43
41
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
const useSelectorSeries = createSeriesSelectorsOfType('line');
|
|
5
|
-
const useSelectorSeriesContext = createAllSeriesSelectorOfType('line');
|
|
3
|
+
import { useSeriesOfType, useAllSeriesOfType } from "../internals/seriesSelectorOfType.js";
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* Get access to the internal state of line series.
|
|
@@ -27,7 +25,7 @@ const useSelectorSeriesContext = createAllSeriesSelectorOfType('line');
|
|
|
27
25
|
*/
|
|
28
26
|
|
|
29
27
|
export function useLineSeries(seriesIds) {
|
|
30
|
-
return
|
|
28
|
+
return useSeriesOfType('line', seriesIds);
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
/**
|
|
@@ -39,5 +37,5 @@ export function useLineSeries(seriesIds) {
|
|
|
39
37
|
* @returns the line series
|
|
40
38
|
*/
|
|
41
39
|
export function useLineSeriesContext() {
|
|
42
|
-
return
|
|
40
|
+
return useAllSeriesOfType('line');
|
|
43
41
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
const useSelectorSeries = createSeriesSelectorsOfType('pie');
|
|
5
|
-
const useSelectorSeriesContext = createAllSeriesSelectorOfType('pie');
|
|
3
|
+
import { useSeriesOfType, useAllSeriesOfType } from "../internals/seriesSelectorOfType.js";
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* Get access to the internal state of pie series.
|
|
@@ -27,7 +25,7 @@ const useSelectorSeriesContext = createAllSeriesSelectorOfType('pie');
|
|
|
27
25
|
*/
|
|
28
26
|
|
|
29
27
|
export function usePieSeries(seriesIds) {
|
|
30
|
-
return
|
|
28
|
+
return useSeriesOfType('pie', seriesIds);
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
/**
|
|
@@ -38,5 +36,5 @@ export function usePieSeries(seriesIds) {
|
|
|
38
36
|
* @returns the pie series
|
|
39
37
|
*/
|
|
40
38
|
export function usePieSeriesContext() {
|
|
41
|
-
return
|
|
39
|
+
return useAllSeriesOfType('pie');
|
|
42
40
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
const useSelectorSeries = createSeriesSelectorsOfType('radar');
|
|
5
|
-
const useSelectorSeriesContext = createAllSeriesSelectorOfType('radar');
|
|
3
|
+
import { useSeriesOfType, useAllSeriesOfType } from "../internals/seriesSelectorOfType.js";
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* Get access to the internal state of radar series.
|
|
@@ -27,7 +25,7 @@ const useSelectorSeriesContext = createAllSeriesSelectorOfType('radar');
|
|
|
27
25
|
*/
|
|
28
26
|
|
|
29
27
|
export function useRadarSeries(seriesIds) {
|
|
30
|
-
return
|
|
28
|
+
return useSeriesOfType('radar', seriesIds);
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
/**
|
|
@@ -38,5 +36,5 @@ export function useRadarSeries(seriesIds) {
|
|
|
38
36
|
* @returns the radar series
|
|
39
37
|
*/
|
|
40
38
|
export function useRadarSeriesContext() {
|
|
41
|
-
return
|
|
39
|
+
return useAllSeriesOfType('radar');
|
|
42
40
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
const useSelectorSeries = createSeriesSelectorsOfType('scatter');
|
|
5
|
-
const useSelectorSeriesContext = createAllSeriesSelectorOfType('scatter');
|
|
3
|
+
import { useSeriesOfType, useAllSeriesOfType } from "../internals/seriesSelectorOfType.js";
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* Get access to the internal state of scatter series.
|
|
@@ -27,7 +25,7 @@ const useSelectorSeriesContext = createAllSeriesSelectorOfType('scatter');
|
|
|
27
25
|
*/
|
|
28
26
|
|
|
29
27
|
export function useScatterSeries(seriesIds) {
|
|
30
|
-
return
|
|
28
|
+
return useSeriesOfType('scatter', seriesIds);
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
/**
|
|
@@ -38,5 +36,5 @@ export function useScatterSeries(seriesIds) {
|
|
|
38
36
|
* @returns the scatter series
|
|
39
37
|
*/
|
|
40
38
|
export function useScatterSeriesContext() {
|
|
41
|
-
return
|
|
39
|
+
return useAllSeriesOfType('scatter');
|
|
42
40
|
}
|
package/esm/index.d.ts
CHANGED
|
@@ -29,4 +29,5 @@ export type { ChartContainerProps } from "./ChartContainer/index.js";
|
|
|
29
29
|
export * from "./ChartDataProvider/index.js";
|
|
30
30
|
export * from "./Toolbar/index.js";
|
|
31
31
|
export * from "./ChartsWrapper/index.js";
|
|
32
|
-
export * from "./ChartsBrushOverlay/index.js";
|
|
32
|
+
export * from "./ChartsBrushOverlay/index.js";
|
|
33
|
+
export * from "./utils/index.js";
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts v8.
|
|
2
|
+
* @mui/x-charts v8.19.0
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -36,6 +36,7 @@ export * from "./ChartDataProvider/index.js";
|
|
|
36
36
|
export * from "./Toolbar/index.js";
|
|
37
37
|
export * from "./ChartsWrapper/index.js";
|
|
38
38
|
export * from "./ChartsBrushOverlay/index.js";
|
|
39
|
+
export * from "./utils/index.js";
|
|
39
40
|
|
|
40
41
|
// Locales should be imported from `@mui/x-charts/locales`
|
|
41
42
|
// export * from './locales';
|
|
@@ -86,11 +86,7 @@ export const getStringSize = (text, style = {}) => {
|
|
|
86
86
|
});
|
|
87
87
|
measurementElem.textContent = str;
|
|
88
88
|
measurementSpanContainer.replaceChildren(measurementElem);
|
|
89
|
-
const
|
|
90
|
-
const result = {
|
|
91
|
-
width: rect.width,
|
|
92
|
-
height: rect.height
|
|
93
|
-
};
|
|
89
|
+
const result = measureSVGTextElement(measurementElem);
|
|
94
90
|
stringCache.set(cacheKey, result);
|
|
95
91
|
if (stringCache.size + 1 > MAX_CACHE_NUM) {
|
|
96
92
|
stringCache.clear();
|
|
@@ -134,21 +130,17 @@ export function batchMeasureStrings(texts, style = {}) {
|
|
|
134
130
|
measurementContainer.style[camelCaseToDashCase(styleKey)] = convertPixelValue(styleKey, measurementSpanStyle[styleKey]);
|
|
135
131
|
return styleKey;
|
|
136
132
|
});
|
|
137
|
-
const
|
|
133
|
+
const measurementElements = [];
|
|
138
134
|
for (const string of textToMeasure) {
|
|
139
135
|
const measurementElem = document.createElementNS('http://www.w3.org/2000/svg', 'text');
|
|
140
136
|
measurementElem.textContent = `${string}`;
|
|
141
|
-
|
|
137
|
+
measurementElements.push(measurementElem);
|
|
142
138
|
}
|
|
143
|
-
measurementContainer.replaceChildren(...
|
|
139
|
+
measurementContainer.replaceChildren(...measurementElements);
|
|
144
140
|
for (let i = 0; i < textToMeasure.length; i += 1) {
|
|
145
141
|
const text = textToMeasure[i];
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
const result = {
|
|
149
|
-
width: rect.width,
|
|
150
|
-
height: rect.height
|
|
151
|
-
};
|
|
142
|
+
const measurementElem = measurementContainer.children[i];
|
|
143
|
+
const result = measureSVGTextElement(measurementElem);
|
|
152
144
|
const cacheKey = `${text}-${styleString}`;
|
|
153
145
|
stringCache.set(cacheKey, result);
|
|
154
146
|
sizeMap.set(text, result);
|
|
@@ -162,6 +154,30 @@ export function batchMeasureStrings(texts, style = {}) {
|
|
|
162
154
|
}
|
|
163
155
|
return sizeMap;
|
|
164
156
|
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Measures an SVG text element using getBBox() with fallback to getBoundingClientRect()
|
|
160
|
+
* @param element SVG text element to measure
|
|
161
|
+
* @returns width and height of the text element
|
|
162
|
+
*/
|
|
163
|
+
function measureSVGTextElement(element) {
|
|
164
|
+
// getBBox() is more reliable across browsers for SVG elements
|
|
165
|
+
try {
|
|
166
|
+
const result = element.getBBox();
|
|
167
|
+
return {
|
|
168
|
+
width: result.width,
|
|
169
|
+
height: result.height
|
|
170
|
+
};
|
|
171
|
+
} catch {
|
|
172
|
+
// Fallback to getBoundingClientRect if getBBox fails
|
|
173
|
+
// This can happen in tests
|
|
174
|
+
const result = element.getBoundingClientRect();
|
|
175
|
+
return {
|
|
176
|
+
width: result.width,
|
|
177
|
+
height: result.height
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
165
181
|
let measurementContainer = null;
|
|
166
182
|
|
|
167
183
|
/**
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { NumberValue } from '@mui/x-charts-vendor/d3-scale';
|
|
1
2
|
import { ContinuousScaleName, D3ContinuousScale } from "../models/axis.js";
|
|
2
|
-
export declare function getScale(scaleType: ContinuousScaleName, domain:
|
|
3
|
+
export declare function getScale<Domain extends NumberValue = any, Range = any>(scaleType: ContinuousScaleName, domain: Iterable<Domain>, range: readonly Range[]): D3ContinuousScale<Range, Range>;
|
package/esm/internals/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export { useBarPlotData } from "../BarChart/useBarPlotData.js";
|
|
|
15
15
|
export { useRadarChartProps } from "../RadarChart/useRadarChartProps.js";
|
|
16
16
|
export * from "../ChartContainer/useChartContainerProps.js";
|
|
17
17
|
export * from "../ChartDataProvider/useChartDataProviderProps.js";
|
|
18
|
-
export * from "./
|
|
18
|
+
export * from "./seriesSelectorOfType.js";
|
|
19
19
|
export * from "./plugins/corePlugins/useChartId/index.js";
|
|
20
20
|
export * from "./plugins/corePlugins/useChartSeries/index.js";
|
|
21
21
|
export * from "./plugins/corePlugins/useChartDimensions/index.js";
|
package/esm/internals/index.js
CHANGED
|
@@ -18,7 +18,7 @@ export { useBarPlotData } from "../BarChart/useBarPlotData.js";
|
|
|
18
18
|
export { useRadarChartProps } from "../RadarChart/useRadarChartProps.js";
|
|
19
19
|
export * from "../ChartContainer/useChartContainerProps.js";
|
|
20
20
|
export * from "../ChartDataProvider/useChartDataProviderProps.js";
|
|
21
|
-
export * from "./
|
|
21
|
+
export * from "./seriesSelectorOfType.js";
|
|
22
22
|
|
|
23
23
|
// plugins
|
|
24
24
|
export * from "./plugins/corePlugins/useChartId/index.js";
|