@mui/x-charts-pro 8.0.0-alpha.6 → 8.0.0-alpha.8
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/BarChartPro/BarChartPro.d.ts +2 -2
- package/BarChartPro/BarChartPro.js +68 -23
- package/CHANGELOG.md +242 -1
- package/ChartContainerPro/ChartContainerPro.d.ts +32 -4
- package/ChartContainerPro/ChartContainerPro.js +53 -18
- package/ChartContainerPro/useChartContainerProProps.d.ts +5 -5
- package/ChartContainerPro/useChartContainerProProps.js +11 -5
- package/Heatmap/Heatmap.js +28 -2
- package/Heatmap/HeatmapTooltip.js +6 -4
- package/Heatmap/extremums.d.ts +2 -2
- package/Heatmap/formatter.d.ts +2 -2
- package/Heatmap/formatter.js +2 -1
- package/Heatmap/plugin.d.ts +2 -2
- package/Heatmap/plugin.js +1 -2
- package/LineChartPro/LineChartPro.d.ts +2 -2
- package/LineChartPro/LineChartPro.js +73 -32
- package/ScatterChartPro/ScatterChartPro.d.ts +2 -2
- package/ScatterChartPro/ScatterChartPro.js +46 -28
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/zoom/index.d.ts +1 -0
- package/hooks/zoom/index.js +1 -0
- package/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
- package/hooks/zoom/useIsZoomInteracting.js +14 -0
- package/index.d.ts +0 -1
- package/index.js +2 -5
- package/internals/plugins/allPlugins.d.ts +10 -0
- package/internals/plugins/allPlugins.js +5 -0
- package/internals/plugins/useChartProZoom/defaultizeZoom.d.ts +2 -0
- package/internals/plugins/useChartProZoom/defaultizeZoom.js +25 -0
- package/internals/plugins/useChartProZoom/index.d.ts +3 -0
- package/internals/plugins/useChartProZoom/index.js +3 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.js +324 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +149 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +6 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +54 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.js +126 -0
- package/internals/plugins/useChartProZoom/zoom.types.d.ts +53 -0
- package/internals/utils/releaseInfo.js +1 -1
- package/models/index.d.ts +1 -0
- package/models/index.js +2 -1
- package/modern/BarChartPro/BarChartPro.js +68 -23
- package/modern/ChartContainerPro/ChartContainerPro.js +53 -18
- package/modern/ChartContainerPro/useChartContainerProProps.js +11 -5
- package/modern/Heatmap/Heatmap.js +28 -2
- package/modern/Heatmap/HeatmapTooltip.js +6 -4
- package/modern/Heatmap/formatter.js +2 -1
- package/modern/Heatmap/plugin.js +1 -2
- package/modern/LineChartPro/LineChartPro.js +73 -32
- package/modern/ScatterChartPro/ScatterChartPro.js +46 -28
- package/modern/hooks/index.js +2 -1
- package/modern/hooks/zoom/index.js +1 -0
- package/modern/hooks/zoom/useIsZoomInteracting.js +14 -0
- package/modern/index.js +2 -5
- package/modern/internals/plugins/allPlugins.js +5 -0
- package/modern/internals/plugins/useChartProZoom/defaultizeZoom.js +25 -0
- package/modern/internals/plugins/useChartProZoom/index.js +3 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +324 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +6 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.js +1 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.js +126 -0
- package/modern/internals/plugins/useChartProZoom/zoom.types.js +1 -0
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/models/index.js +2 -1
- package/node/BarChartPro/BarChartPro.js +67 -22
- package/node/ChartContainerPro/ChartContainerPro.js +53 -18
- package/node/ChartContainerPro/useChartContainerProProps.js +11 -5
- package/node/Heatmap/Heatmap.js +28 -2
- package/node/Heatmap/HeatmapTooltip.js +4 -2
- package/node/Heatmap/formatter.js +2 -1
- package/node/Heatmap/plugin.js +1 -2
- package/node/LineChartPro/LineChartPro.js +72 -31
- package/node/ScatterChartPro/ScatterChartPro.js +44 -26
- package/node/hooks/index.js +16 -1
- package/node/{context/CartesianProviderPro → hooks/zoom}/index.js +4 -4
- package/node/hooks/zoom/useIsZoomInteracting.js +19 -0
- package/node/index.js +1 -12
- package/node/internals/plugins/allPlugins.js +11 -0
- package/node/internals/plugins/useChartProZoom/defaultizeZoom.js +33 -0
- package/node/internals/plugins/useChartProZoom/index.js +38 -0
- package/node/internals/plugins/useChartProZoom/useChartProZoom.js +331 -0
- package/node/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +13 -0
- package/node/internals/plugins/useChartProZoom/useChartProZoom.utils.js +140 -0
- package/node/internals/plugins/useChartProZoom/zoom.types.js +5 -0
- package/node/internals/utils/releaseInfo.js +1 -1
- package/package.json +5 -5
- package/typeOverloads/modules.d.ts +8 -1
- package/context/CartesianProviderPro/CartesianProviderPro.d.ts +0 -6
- package/context/CartesianProviderPro/CartesianProviderPro.js +0 -89
- package/context/CartesianProviderPro/createAxisFilterMapper.d.ts +0 -13
- package/context/CartesianProviderPro/createAxisFilterMapper.js +0 -60
- package/context/CartesianProviderPro/index.d.ts +0 -1
- package/context/CartesianProviderPro/index.js +0 -1
- package/context/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -7
- package/context/ChartDataProviderPro/ChartDataProviderPro.js +0 -50
- package/context/ChartDataProviderPro/index.d.ts +0 -1
- package/context/ChartDataProviderPro/index.js +0 -1
- package/context/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -14
- package/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -43
- package/context/ZoomProvider/Zoom.types.d.ts +0 -144
- package/context/ZoomProvider/ZoomContext.d.ts +0 -4
- package/context/ZoomProvider/ZoomContext.js +0 -16
- package/context/ZoomProvider/ZoomProvider.d.ts +0 -3
- package/context/ZoomProvider/ZoomProvider.js +0 -56
- package/context/ZoomProvider/ZoomSetup.d.ts +0 -9
- package/context/ZoomProvider/ZoomSetup.js +0 -16
- package/context/ZoomProvider/defaultizeZoom.d.ts +0 -2
- package/context/ZoomProvider/defaultizeZoom.js +0 -32
- package/context/ZoomProvider/index.d.ts +0 -3
- package/context/ZoomProvider/index.js +0 -3
- package/context/ZoomProvider/initializeZoomData.d.ts +0 -6
- package/context/ZoomProvider/initializeZoomData.js +0 -13
- package/context/ZoomProvider/useSetupPan.d.ts +0 -1
- package/context/ZoomProvider/useSetupPan.js +0 -106
- package/context/ZoomProvider/useSetupZoom.d.ts +0 -1
- package/context/ZoomProvider/useSetupZoom.js +0 -274
- package/context/ZoomProvider/useZoom.d.ts +0 -7
- package/context/ZoomProvider/useZoom.js +0 -19
- package/context/index.d.ts +0 -3
- package/context/index.js +0 -5
- package/context/package.json +0 -6
- package/modern/context/CartesianProviderPro/CartesianProviderPro.js +0 -89
- package/modern/context/CartesianProviderPro/createAxisFilterMapper.js +0 -60
- package/modern/context/CartesianProviderPro/index.js +0 -1
- package/modern/context/ChartDataProviderPro/ChartDataProviderPro.js +0 -50
- package/modern/context/ChartDataProviderPro/index.js +0 -1
- package/modern/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -43
- package/modern/context/ZoomProvider/ZoomContext.js +0 -16
- package/modern/context/ZoomProvider/ZoomProvider.js +0 -56
- package/modern/context/ZoomProvider/ZoomSetup.js +0 -16
- package/modern/context/ZoomProvider/defaultizeZoom.js +0 -32
- package/modern/context/ZoomProvider/index.js +0 -3
- package/modern/context/ZoomProvider/initializeZoomData.js +0 -13
- package/modern/context/ZoomProvider/useSetupPan.js +0 -106
- package/modern/context/ZoomProvider/useSetupZoom.js +0 -274
- package/modern/context/ZoomProvider/useZoom.js +0 -19
- package/modern/context/index.js +0 -5
- package/node/context/CartesianProviderPro/CartesianProviderPro.js +0 -95
- package/node/context/CartesianProviderPro/createAxisFilterMapper.js +0 -68
- package/node/context/ChartDataProviderPro/ChartDataProviderPro.js +0 -56
- package/node/context/ChartDataProviderPro/index.js +0 -16
- package/node/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -50
- package/node/context/ZoomProvider/ZoomContext.js +0 -23
- package/node/context/ZoomProvider/ZoomProvider.js +0 -63
- package/node/context/ZoomProvider/ZoomSetup.js +0 -20
- package/node/context/ZoomProvider/defaultizeZoom.js +0 -40
- package/node/context/ZoomProvider/index.js +0 -38
- package/node/context/ZoomProvider/initializeZoomData.js +0 -20
- package/node/context/ZoomProvider/useSetupPan.js +0 -114
- package/node/context/ZoomProvider/useSetupZoom.js +0 -281
- package/node/context/ZoomProvider/useZoom.js +0 -25
- package/node/context/index.js +0 -27
- /package/{context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
- /package/{modern/context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/zoom.types.js} +0 -0
- /package/node/{context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BarChartProps } from '@mui/x-charts/BarChart';
|
|
3
|
-
import {
|
|
4
|
-
export interface BarChartProProps extends BarChartProps,
|
|
3
|
+
import { ChartContainerProProps } from '../ChartContainerPro';
|
|
4
|
+
export interface BarChartProProps extends Omit<BarChartProps, 'apiRef'>, Omit<ChartContainerProProps<'bar'>, 'series' | 'plugins' | 'seriesConfig'> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Demos:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["
|
|
5
|
+
const _excluded = ["initialZoom", "onZoomChange", "apiRef"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { useThemeProps } from '@mui/material/styles';
|
|
@@ -15,15 +15,14 @@ import { ChartsLegend } from '@mui/x-charts/ChartsLegend';
|
|
|
15
15
|
import { ChartsAxisHighlight } from '@mui/x-charts/ChartsAxisHighlight';
|
|
16
16
|
import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
|
|
17
17
|
import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
18
|
-
import { useBarChartProps } from '@mui/x-charts/internals';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
18
|
+
import { useBarChartProps, ChartsWrapper } from '@mui/x-charts/internals';
|
|
19
|
+
import { ChartDataProvider } from '@mui/x-charts/context';
|
|
20
|
+
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
21
|
+
import { useIsZoomInteracting } from "../hooks/zoom/index.js";
|
|
22
|
+
import { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
22
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
24
|
function BarChartPlotZoom(props) {
|
|
24
|
-
const
|
|
25
|
-
isInteracting
|
|
26
|
-
} = useZoom();
|
|
25
|
+
const isInteracting = useIsZoomInteracting();
|
|
27
26
|
return /*#__PURE__*/_jsx(BarPlot, _extends({}, props, {
|
|
28
27
|
skipAnimation: isInteracting || undefined
|
|
29
28
|
}));
|
|
@@ -84,11 +83,13 @@ const BarChartPro = /*#__PURE__*/React.forwardRef(function BarChartPro(inProps,
|
|
|
84
83
|
name: 'MuiBarChartPro'
|
|
85
84
|
});
|
|
86
85
|
const {
|
|
87
|
-
|
|
88
|
-
onZoomChange
|
|
86
|
+
initialZoom,
|
|
87
|
+
onZoomChange,
|
|
88
|
+
apiRef
|
|
89
89
|
} = props,
|
|
90
90
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
91
91
|
const {
|
|
92
|
+
chartsWrapperProps,
|
|
92
93
|
chartContainerProps,
|
|
93
94
|
barPlotProps,
|
|
94
95
|
axisClickHandlerProps,
|
|
@@ -101,15 +102,24 @@ const BarChartPro = /*#__PURE__*/React.forwardRef(function BarChartPro(inProps,
|
|
|
101
102
|
legendProps,
|
|
102
103
|
children
|
|
103
104
|
} = useBarChartProps(other);
|
|
105
|
+
const {
|
|
106
|
+
chartDataProviderProProps,
|
|
107
|
+
chartsSurfaceProps
|
|
108
|
+
} = useChartContainerProProps(_extends({}, chartContainerProps, {
|
|
109
|
+
apiRef
|
|
110
|
+
}), ref);
|
|
104
111
|
const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
|
|
105
|
-
return /*#__PURE__*/
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
zoom: zoom,
|
|
112
|
+
return /*#__PURE__*/_jsx(ChartDataProvider, _extends({}, chartDataProviderProProps, {
|
|
113
|
+
apiRef: apiRef,
|
|
114
|
+
initialZoom: initialZoom,
|
|
109
115
|
onZoomChange: onZoomChange,
|
|
110
|
-
children:
|
|
111
|
-
children: [/*#__PURE__*/_jsx(
|
|
112
|
-
|
|
116
|
+
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
117
|
+
children: [!props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
118
|
+
children: [props.onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, _extends({}, axisClickHandlerProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
119
|
+
children: [/*#__PURE__*/_jsx(BarChartPlotZoom, _extends({}, barPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
120
|
+
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
121
|
+
}))]
|
|
122
|
+
}))
|
|
113
123
|
}));
|
|
114
124
|
});
|
|
115
125
|
process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
@@ -117,6 +127,11 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
117
127
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
118
128
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
119
129
|
// ----------------------------------------------------------------------
|
|
130
|
+
apiRef: PropTypes.shape({
|
|
131
|
+
current: PropTypes.shape({
|
|
132
|
+
setZoomData: PropTypes.func.isRequired
|
|
133
|
+
})
|
|
134
|
+
}),
|
|
120
135
|
/**
|
|
121
136
|
* The configuration of axes highlight.
|
|
122
137
|
* Default is set to 'band' in the bar direction.
|
|
@@ -185,6 +200,19 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
185
200
|
dataIndex: PropTypes.number,
|
|
186
201
|
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
187
202
|
}),
|
|
203
|
+
/**
|
|
204
|
+
* This prop is used to help implement the accessibility logic.
|
|
205
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
206
|
+
*/
|
|
207
|
+
id: PropTypes.string,
|
|
208
|
+
/**
|
|
209
|
+
* The list of zoom data related to each axis.
|
|
210
|
+
*/
|
|
211
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
212
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
213
|
+
end: PropTypes.number.isRequired,
|
|
214
|
+
start: PropTypes.number.isRequired
|
|
215
|
+
})),
|
|
188
216
|
/**
|
|
189
217
|
* The direction of the bar elements.
|
|
190
218
|
* @default 'vertical'
|
|
@@ -205,7 +233,6 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
205
233
|
* The margin between the SVG and the drawing area.
|
|
206
234
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
207
235
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
208
|
-
* @default object Depends on the charts type.
|
|
209
236
|
*/
|
|
210
237
|
margin: PropTypes.shape({
|
|
211
238
|
bottom: PropTypes.number,
|
|
@@ -265,6 +292,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
265
292
|
*/
|
|
266
293
|
slots: PropTypes.object,
|
|
267
294
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
295
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
268
296
|
title: PropTypes.string,
|
|
269
297
|
/**
|
|
270
298
|
* Indicate which axis to display the top of the charts.
|
|
@@ -399,12 +427,29 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
399
427
|
}), PropTypes.bool])
|
|
400
428
|
})),
|
|
401
429
|
/**
|
|
402
|
-
* The
|
|
430
|
+
* The configuration of the z-axes.
|
|
403
431
|
*/
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
432
|
+
zAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
433
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
434
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
435
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
436
|
+
unknownColor: PropTypes.string,
|
|
437
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
438
|
+
}), PropTypes.shape({
|
|
439
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
440
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
441
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
442
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
443
|
+
}), PropTypes.shape({
|
|
444
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
445
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
446
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
447
|
+
})]),
|
|
448
|
+
data: PropTypes.array,
|
|
449
|
+
dataKey: PropTypes.string,
|
|
450
|
+
id: PropTypes.string,
|
|
451
|
+
max: PropTypes.number,
|
|
452
|
+
min: PropTypes.number
|
|
408
453
|
}))
|
|
409
454
|
} : void 0;
|
|
410
455
|
export { BarChartPro };
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,247 @@
|
|
|
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.0.0-alpha.8
|
|
9
|
+
|
|
10
|
+
_Jan 16, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🍬 Improved design for Data Grid [Header filters](https://next.mui.com/x/react-data-grid/filtering/header-filters/)
|
|
15
|
+
|
|
16
|
+
<img width="100%" alt="Data Grid Header filters" src="https://github.com/user-attachments/assets/74a50cd9-7a55-41fc-a2b8-f8a0d5b9120e" />
|
|
17
|
+
|
|
18
|
+
- 🔄 Data Grid [Scroll restoration](https://next.mui.com/x/react-data-grid/scrolling/#scroll-restoration)
|
|
19
|
+
- 📊 Charts support server-side rendering under [some conditions](https://next.mui.com/x/react-charts/getting-started/#server-side-rendering)
|
|
20
|
+
- 🐞 Bugfixes
|
|
21
|
+
|
|
22
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
23
|
+
@lauri865.
|
|
24
|
+
Following are all team members who have contributed to this release:
|
|
25
|
+
@arminmeh, @romgrk, @samuelsycamore, @alexfauquette, @cherniavskii, @flaviendelangle, @JCQuintas, @KenanYusuf, @LukasTy, @michelengelen.
|
|
26
|
+
|
|
27
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
28
|
+
|
|
29
|
+
### Data Grid
|
|
30
|
+
|
|
31
|
+
#### Breaking changes
|
|
32
|
+
|
|
33
|
+
- The clear button in header filter cells has been moved to the header filter menu. Use `slotProps={{ headerFilterCell: { showClearIcon: true } }}` to restore the clear button in the cell.
|
|
34
|
+
|
|
35
|
+
#### `@mui/x-data-grid@8.0.0-alpha.8`
|
|
36
|
+
|
|
37
|
+
- [DataGrid] Improve scrollbar deadzone with overlay scrollbars (#15961) @lauri865
|
|
38
|
+
- [DataGrid] Header filter design improvements (#15991) @KenanYusuf
|
|
39
|
+
- [DataGrid] Scroll restoration (#15623) @lauri865
|
|
40
|
+
- [DataGrid] Fix row, cell and header memoizations (#15666) @lauri865
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-data-grid-pro@8.0.0-alpha.8` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
43
|
+
|
|
44
|
+
Same changes as in `@mui/x-data-grid@8.0.0-alpha.8`, plus:
|
|
45
|
+
|
|
46
|
+
- [DataGridPro] Add test for column pinning with disabled column virtualization (#16176) @cherniavskii
|
|
47
|
+
- [DataGridPro] Fix width of right-pinned column group during resize (#16199) @cherniavskii
|
|
48
|
+
|
|
49
|
+
#### `@mui/x-data-grid-premium@8.0.0-alpha.8` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
50
|
+
|
|
51
|
+
Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.8`.
|
|
52
|
+
|
|
53
|
+
### Date and Time Pickers
|
|
54
|
+
|
|
55
|
+
#### Breaking changes
|
|
56
|
+
|
|
57
|
+
- The field is now editable if rendered inside a mobile Picker — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#field-editing-on-mobile-pickers)
|
|
58
|
+
- The `useMultiInputDateRangeField`, `useMultiInputTimeRangeField`, and `useMultiInputDateTimeRangeField` hooks have been removed in favor of the new `useMultiInputRangeField` hook — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#usemultiinputdaterangefield)
|
|
59
|
+
- The component passed to the `field` slot no longer receives the `value`, `onChange`, `timezone`, `format`, `disabled`, `formatDensity`, `enableAccessibleFieldDOMStructure`, `selectedSections` and `onSelectedSectionsChange` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-field)
|
|
60
|
+
|
|
61
|
+
#### `@mui/x-date-pickers@8.0.0-alpha.8`
|
|
62
|
+
|
|
63
|
+
- [pickers] Let the field components handle their opening UI, and allow field editing on mobile pickers (#15671) @flaviendelangle
|
|
64
|
+
- [pickers] Remove code duplication for the multi input range fields (#15505) @flaviendelangle
|
|
65
|
+
- [pickers] Rename `onRangePositionChange` into `setRangePosition` in `usePickerRangePositionContext` (#16189) @flaviendelangle
|
|
66
|
+
- [pickers] Use context to pass props from the picker to the field (#16042) @flaviendelangle
|
|
67
|
+
|
|
68
|
+
#### `@mui/x-date-pickers-pro@8.0.0-alpha.8` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
69
|
+
|
|
70
|
+
Same changes as in `@mui/x-date-pickers@8.0.0-alpha.8`.
|
|
71
|
+
|
|
72
|
+
### Charts
|
|
73
|
+
|
|
74
|
+
#### Breaking changes
|
|
75
|
+
|
|
76
|
+
- Charts tooltip markers now have different styles for each chart type. The tooltip and legend marks are now the same.
|
|
77
|
+
- Duplicate axis id's across `x` and `y` axis now log a warning in dev mode. Axis ids should be unique to prevent internal issues.
|
|
78
|
+
|
|
79
|
+
#### `@mui/x-charts@8.0.0-alpha.8`
|
|
80
|
+
|
|
81
|
+
- [charts] Fix flaky charts tests (#16180) @JCQuintas
|
|
82
|
+
- [charts] Handle case where gradient stop `offset` could be `Infinite` (#16131) @JCQuintas
|
|
83
|
+
- [charts] Make `useChartGradientId` public (#16106) @JCQuintas
|
|
84
|
+
- [charts] Move z-axis to plugin (#16130) @alexfauquette
|
|
85
|
+
- [charts] Plot data at first render if `skipAnimation` is set to `true` (#16166) @alexfauquette
|
|
86
|
+
- [charts] Replace tooltip mark with style (#16117) @JCQuintas
|
|
87
|
+
- [charts] Support `rtl` for gradient legend (#16115) @JCQuintas
|
|
88
|
+
- [charts] Use plugin system for series and axes (#15865) @alexfauquette
|
|
89
|
+
|
|
90
|
+
#### `@mui/x-charts-pro@8.0.0-alpha.8` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
91
|
+
|
|
92
|
+
Same changes as in `@mui/x-charts@8.0.0-alpha.8`.
|
|
93
|
+
|
|
94
|
+
### Tree View
|
|
95
|
+
|
|
96
|
+
#### `@mui/x-tree-view@8.0.0-alpha.8`
|
|
97
|
+
|
|
98
|
+
No changes since `@mui/x-tree-view-pro@v8.0.0-alpha.7`.
|
|
99
|
+
|
|
100
|
+
#### `@mui/x-tree-view-pro@8.0.0-alpha.8` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
101
|
+
|
|
102
|
+
Same changes as in `@mui/x-tree-view@8.0.0-alpha.8`.
|
|
103
|
+
|
|
104
|
+
### Docs
|
|
105
|
+
|
|
106
|
+
- [docs] Add example for custom legend (#16169) @alexfauquette
|
|
107
|
+
- [docs] Add full custom field creation example (#15194) @flaviendelangle
|
|
108
|
+
- [docs] Copyedit the Data Grid cell selection page (#16099) @samuelsycamore
|
|
109
|
+
- [docs] Fix demo rendering issue on Codesandbox (#16118) @arminmeh
|
|
110
|
+
- [docs] Remove broken links (#16167) @alexfauquette
|
|
111
|
+
- [docs] Split the Data Grid editing page (#14931) @MBilalShafi
|
|
112
|
+
- [docs] Fix wrong props warnings (#16119) @JCQuintas
|
|
113
|
+
|
|
114
|
+
### Core
|
|
115
|
+
|
|
116
|
+
- [core] Type all references as `RefObject` (#16124) @arminmeh
|
|
117
|
+
- [code-infra] Refactor `react` and `react-dom` definitions to simplify dep resolving (#16160) @LukasTy
|
|
118
|
+
- [code-infra] Stop renovate from updating `date-fns-v2` (#16158) @LukasTy
|
|
119
|
+
- [infra] Improve cherry-pick action target list (#16184) @michelengelen
|
|
120
|
+
- [test] Fix flaky column pinning unit test (#16202) @cherniavskii
|
|
121
|
+
- [test] Fix flaky screenshot (#16182) @cherniavskii
|
|
122
|
+
|
|
123
|
+
## 8.0.0-alpha.7
|
|
124
|
+
|
|
125
|
+
_Jan 9, 2025_
|
|
126
|
+
|
|
127
|
+
We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
128
|
+
|
|
129
|
+
- 📊 Charts legend is now an HTML element which can be styled more easily
|
|
130
|
+
- 💫 Support [aggregation with server-side data](/x/react-data-grid/server-side-data/aggregation/)
|
|
131
|
+
- 🏎️ Improve Data Grid aggregation performance
|
|
132
|
+
- 🌍 Add Chinese (Taiwan) (zh-TW) locale on the Date and Time Pickers
|
|
133
|
+
- 🌍 Improve Norwegian (nb-NO) locale on the Date and Time Pickers
|
|
134
|
+
- 🐞 Bugfixes
|
|
135
|
+
|
|
136
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
137
|
+
@derek-0000, @josteinjhauge, @k-rajat19, @nusr, @tomashauser.
|
|
138
|
+
Following are all team members who have contributed to this release:
|
|
139
|
+
@cherniavskii, @flaviendelangle, @JCQuintas, @LukasTy, @MBilalShafi, @arminmeh, @romgrk, @oliviertassinari.
|
|
140
|
+
|
|
141
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
142
|
+
|
|
143
|
+
### Data Grid
|
|
144
|
+
|
|
145
|
+
#### `@mui/x-data-grid@8.0.0-alpha.7`
|
|
146
|
+
|
|
147
|
+
- [DataGrid] Improve React 19 support (#15769) @LukasTy
|
|
148
|
+
- [DataGrid] Add `name` attribute to the checkbox selection column (#15178) @derek-0000
|
|
149
|
+
- [DataGrid] Fix number filter field formatting values while typing (#16062) @arminmeh
|
|
150
|
+
- [DataGrid] Fix select all checkbox state reset with server side data (#16034) @MBilalShafi
|
|
151
|
+
- [DataGrid] Refactor: create base button props (#15930) @romgrk
|
|
152
|
+
- [DataGrid] Refactor: create tooltip props (#16086) @romgrk
|
|
153
|
+
- [DataGrid] Fix TS error (#16046) @cherniavskii
|
|
154
|
+
|
|
155
|
+
#### `@mui/x-data-grid-pro@8.0.0-alpha.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
156
|
+
|
|
157
|
+
Same changes as in `@mui/x-data-grid@8.0.0-alpha.7`.
|
|
158
|
+
|
|
159
|
+
#### `@mui/x-data-grid-premium@8.0.0-alpha.7` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
160
|
+
|
|
161
|
+
Same changes as in `@mui/x-data-grid-pro@8.0.0-alpha.7`, plus:
|
|
162
|
+
|
|
163
|
+
- [DataGridPremium] Improve aggregation performance for multiple columns (#16097) @cherniavskii
|
|
164
|
+
- [DataGridPremium] Make Aggregation keyboard accessible in the column menu (#15934) @k-rajat19
|
|
165
|
+
- [DataGridPremium] Server-side aggregation with data source (#15741) @MBilalShafi
|
|
166
|
+
|
|
167
|
+
### Date and Time Pickers
|
|
168
|
+
|
|
169
|
+
#### Breaking changes
|
|
170
|
+
|
|
171
|
+
- The `date-fns` and `date-fns-jalali` date library adapters have been renamed to better align with the current stable major versions — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#✅-rename-date-fns-adapter-imports)
|
|
172
|
+
- Update default `closeOnSelect` and Action Bar `actions` values - [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#update-default-closeonselect-and-action-bar-actions-values)
|
|
173
|
+
- The component passed to the `layout` slot no longer receives the `value`, `onChange` and `onSelectShortcut` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-layout).
|
|
174
|
+
- The component passed to the `toolbar` slot no longer receives the `value`, `onChange` and `isLandscape` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-toolbar).
|
|
175
|
+
- The component passed to the `shortcuts` slot no longer receives the `onChange`, `isValid` and `isLandscape` props — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-shortcuts).
|
|
176
|
+
- The `PickerShortcutChangeImportance` type has been renamed `PickerChangeImportance` — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#renamed-variables-and-types).
|
|
177
|
+
- The component passed to the `layout` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-layout).
|
|
178
|
+
- The component passed to the `toolbar` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-toolbar).
|
|
179
|
+
- The component passed to the `tabs` slot no longer receives the `rangePosition` and `onRangePositionChange` on range pickers — [Learn more](https://next.mui.com/x/migration/migration-pickers-v7/#slot-tabs).
|
|
180
|
+
|
|
181
|
+
#### `@mui/x-date-pickers@8.0.0-alpha.7`
|
|
182
|
+
|
|
183
|
+
- [fields] Handle focusing container with `inputRef.current.focus` on `accessibleFieldDOMStructure` (#15985) @LukasTy
|
|
184
|
+
- [pickers] Always use `setValue` internally to update the picker value (#16056) @flaviendelangle
|
|
185
|
+
- [pickers] Create a new context to pass the range position props to the layout components and to the views (#15846) @flaviendelangle
|
|
186
|
+
- [pickers] Introduce a new concept of `manager` (#15339) @flaviendelangle
|
|
187
|
+
- [pickers] Improve React 19 support (#15769) @LukasTy
|
|
188
|
+
- [pickers] Memoize `<PickersActionBar />` (#16071) @LukasTy
|
|
189
|
+
- [pickers] Remove `NonEmptyDateRange` type (#16035) @flaviendelangle
|
|
190
|
+
- [pickers] Rename `AdapterDateFns` into `AdapterDateFnsV2` and `AdapterDateFnsV3` into `AdapterDateFns` (#16082) @LukasTy
|
|
191
|
+
- [pickers] Rename `ctx.onViewChange` to `ctx.setView` and add it to the actions context (#16044) @flaviendelangle
|
|
192
|
+
- [pickers] Support `date-fns-jalali` v4 (#16011) @LukasTy
|
|
193
|
+
- [pickers] Update `closeOnSelect` and `actionBar.actions` default values (#15944) @LukasTy
|
|
194
|
+
- [pickers] Use `usePickerContext()` and `usePickerActionsContext()` instead of passing props to the `shortcuts` and `toolbar` slots (#15948) @flaviendelangle
|
|
195
|
+
- [l10n] Add Chinese (Taiwan) (zh-TW) locale (#16033) @nusr
|
|
196
|
+
- [l10n] Improve Norwegian (nb-NO) locale (#16089) @josteinjhauge
|
|
197
|
+
|
|
198
|
+
#### `@mui/x-date-pickers-pro@8.0.0-alpha.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
199
|
+
|
|
200
|
+
Same changes as in `@mui/x-date-pickers@8.0.0-alpha.7`.
|
|
201
|
+
|
|
202
|
+
### Charts
|
|
203
|
+
|
|
204
|
+
#### Breaking changes
|
|
205
|
+
|
|
206
|
+
- Removed `DefaultChartsLegend` component, since it is now easier to create custom legends — [Learn more](https://next.mui.com/x/react-charts/components/#html-components).
|
|
207
|
+
- The default legend is now an HTML element and can be styled more easily.
|
|
208
|
+
- The `width` and `height` properties of the charts now only apply to the `svg` element, and not their wrappers, this might cause some layout shifts.
|
|
209
|
+
- `slotProps.legend.direction` now accepts `'horizontal' | 'vertical'` instead of `'row' | 'column'` — [Learn more](https://next.mui.com/x/migration/migration-charts-v7/#legend-direction-value-change-✅).
|
|
210
|
+
- The `getSeriesToDisplay` function was removed in favor of the `useLegend` hook. — [Learn more](https://next.mui.com/x/migration/migration-charts-v7/#the-getseriestodisplay-function-was-removed).
|
|
211
|
+
|
|
212
|
+
#### `@mui/x-charts@8.0.0-alpha.7`
|
|
213
|
+
|
|
214
|
+
- [charts] New HTML legend & styles (#15733) @JCQuintas
|
|
215
|
+
- [charts] Improve React 19 support (#15769) @LukasTy
|
|
216
|
+
- [charts] Fix 301 redirection in the API documentation @oliviertassinari
|
|
217
|
+
|
|
218
|
+
#### `@mui/x-charts-pro@8.0.0-alpha.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
219
|
+
|
|
220
|
+
Same changes as in `@mui/x-charts@8.0.0-alpha.7`.
|
|
221
|
+
|
|
222
|
+
### Tree View
|
|
223
|
+
|
|
224
|
+
#### `@mui/x-tree-view@8.0.0-alpha.7`
|
|
225
|
+
|
|
226
|
+
- [TreeView] Improve React 19 support (#15769) @LukasTy
|
|
227
|
+
|
|
228
|
+
#### `@mui/x-tree-view-pro@8.0.0-alpha.7` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
229
|
+
|
|
230
|
+
Same changes as in `@mui/x-tree-view@8.0.0-alpha.7`.
|
|
231
|
+
|
|
232
|
+
### Docs
|
|
233
|
+
|
|
234
|
+
- [docs] Fix `EditingWithDatePickers` demo (#15967) @k-rajat19
|
|
235
|
+
- [docs] Fix inconsistent multi input range field separators (#16043) @flaviendelangle
|
|
236
|
+
- [docs] Fix non-existing "adapter" property of `LocalizationProvider` (#16084) @tomashauser
|
|
237
|
+
- [docs] Refactor Data Grid with Date Pickers example (#15992) @LukasTy
|
|
238
|
+
- [docs] Unify the wording of the pickers slots breaking changes (#16036) @flaviendelangle
|
|
239
|
+
|
|
240
|
+
### Core
|
|
241
|
+
|
|
242
|
+
- [core] Clarify the release strategy (#16014) @MBilalShafi
|
|
243
|
+
- [core] Small fixes on docs @oliviertassinari
|
|
244
|
+
- [core] Sync with other repos @oliviertassinari
|
|
245
|
+
- [core] Update the `release:version` docs (#16038) @cherniavskii
|
|
246
|
+
- [code-infra] Add `testSkipIf` and `describeSkipIf` (#16049) @JCQuintas
|
|
247
|
+
- [test] Stabilize flaky Data Grid tests (#16053) @LukasTy
|
|
248
|
+
|
|
8
249
|
## 8.0.0-alpha.6
|
|
9
250
|
|
|
10
251
|
_Dec 26, 2024_
|
|
@@ -104,7 +345,7 @@ Following are all team members who have contributed to this release:
|
|
|
104
345
|
|
|
105
346
|
#### Breaking changes
|
|
106
347
|
|
|
107
|
-
- Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps
|
|
348
|
+
- Passing additional props (like `data-*`, `aria-*`) directly on the Data Grid component is no longer supported. To pass the props, use `slotProps`:
|
|
108
349
|
|
|
109
350
|
- For `.root` element, use `slotProps.root`.
|
|
110
351
|
- For `.main` element (the one with `role="grid"`), use `slotProps.main`.
|
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { ChartsSurfaceProps } from '@mui/x-charts/ChartsSurface';
|
|
3
|
+
import { ChartDataProviderProps } from '@mui/x-charts/context';
|
|
4
|
+
import { ChartSeriesType } from '@mui/x-charts/internals';
|
|
5
|
+
import { AllPluginSignatures } from '../internals/plugins/allPlugins';
|
|
6
|
+
export interface ChartContainerProProps<TSeries extends ChartSeriesType = ChartSeriesType> extends ChartDataProviderProps<TSeries, AllPluginSignatures<TSeries>>, ChartsSurfaceProps {
|
|
5
7
|
}
|
|
6
|
-
|
|
8
|
+
/**
|
|
9
|
+
* It sets up the data providers as well as the `<svg>` for the chart.
|
|
10
|
+
*
|
|
11
|
+
* This is a combination of both the `ChartDataProvider` and `ChartsSurface` components.
|
|
12
|
+
*
|
|
13
|
+
* Demos:
|
|
14
|
+
*
|
|
15
|
+
* - [Composition](http://localhost:3001/x/react-charts/composition/)
|
|
16
|
+
*
|
|
17
|
+
* API:
|
|
18
|
+
*
|
|
19
|
+
* - [ChartContainer API](https://mui.com/x/api/charts/chart-container/)
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```jsx
|
|
23
|
+
* <ChartContainerPro
|
|
24
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
25
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
26
|
+
* >
|
|
27
|
+
* <BarPlot />
|
|
28
|
+
* <ChartsXAxis position="bottom" axisId="x-axis" />
|
|
29
|
+
* </ChartContainerPro>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare const ChartContainerPro: <TSeries extends ChartSeriesType = ChartSeriesType>(props: ChartContainerProProps<TSeries> & {
|
|
33
|
+
ref?: React.ForwardedRef<SVGSVGElement>;
|
|
34
|
+
}) => React.JSX.Element;
|
|
7
35
|
export { ChartContainerPro };
|
|
@@ -4,19 +4,46 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { Watermark } from '@mui/x-license/Watermark';
|
|
7
|
+
import { useLicenseVerifier } from '@mui/x-license/useLicenseVerifier';
|
|
7
8
|
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
9
|
+
import { ChartDataProvider } from '@mui/x-charts/context';
|
|
8
10
|
import { getReleaseInfo } from "../internals/utils/releaseInfo.js";
|
|
9
|
-
import { ChartDataProviderPro } from "../context/ChartDataProviderPro/index.js";
|
|
10
11
|
import { useChartContainerProProps } from "./useChartContainerProProps.js";
|
|
11
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
const releaseInfo = getReleaseInfo();
|
|
13
|
-
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* It sets up the data providers as well as the `<svg>` for the chart.
|
|
17
|
+
*
|
|
18
|
+
* This is a combination of both the `ChartDataProvider` and `ChartsSurface` components.
|
|
19
|
+
*
|
|
20
|
+
* Demos:
|
|
21
|
+
*
|
|
22
|
+
* - [Composition](http://localhost:3001/x/react-charts/composition/)
|
|
23
|
+
*
|
|
24
|
+
* API:
|
|
25
|
+
*
|
|
26
|
+
* - [ChartContainer API](https://mui.com/x/api/charts/chart-container/)
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```jsx
|
|
30
|
+
* <ChartContainerPro
|
|
31
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
32
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
33
|
+
* >
|
|
34
|
+
* <BarPlot />
|
|
35
|
+
* <ChartsXAxis position="bottom" axisId="x-axis" />
|
|
36
|
+
* </ChartContainerPro>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
const ChartContainerPro = /*#__PURE__*/React.forwardRef(function ChartContainerProInner(props, ref) {
|
|
14
40
|
const {
|
|
15
41
|
chartDataProviderProProps,
|
|
16
42
|
children,
|
|
17
43
|
chartsSurfaceProps
|
|
18
44
|
} = useChartContainerProProps(props, ref);
|
|
19
|
-
|
|
45
|
+
useLicenseVerifier('x-charts-pro', releaseInfo);
|
|
46
|
+
return /*#__PURE__*/_jsxs(ChartDataProvider, _extends({}, chartDataProviderProProps, {
|
|
20
47
|
children: [/*#__PURE__*/_jsx(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
21
48
|
children: children
|
|
22
49
|
})), /*#__PURE__*/_jsx(Watermark, {
|
|
@@ -25,11 +52,19 @@ const ChartContainerPro = /*#__PURE__*/React.forwardRef(function ChartContainerP
|
|
|
25
52
|
})]
|
|
26
53
|
}));
|
|
27
54
|
});
|
|
55
|
+
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
|
|
28
58
|
process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
29
59
|
// ----------------------------- Warning --------------------------------
|
|
30
60
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
31
61
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
32
62
|
// ----------------------------------------------------------------------
|
|
63
|
+
apiRef: PropTypes.shape({
|
|
64
|
+
current: PropTypes.shape({
|
|
65
|
+
setZoomData: PropTypes.func.isRequired
|
|
66
|
+
})
|
|
67
|
+
}),
|
|
33
68
|
children: PropTypes.node,
|
|
34
69
|
className: PropTypes.string,
|
|
35
70
|
/**
|
|
@@ -59,11 +94,23 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
59
94
|
dataIndex: PropTypes.number,
|
|
60
95
|
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
61
96
|
}),
|
|
97
|
+
/**
|
|
98
|
+
* This prop is used to help implement the accessibility logic.
|
|
99
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
100
|
+
*/
|
|
101
|
+
id: PropTypes.string,
|
|
102
|
+
/**
|
|
103
|
+
* The list of zoom data related to each axis.
|
|
104
|
+
*/
|
|
105
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
106
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
107
|
+
end: PropTypes.number.isRequired,
|
|
108
|
+
start: PropTypes.number.isRequired
|
|
109
|
+
})),
|
|
62
110
|
/**
|
|
63
111
|
* The margin between the SVG and the drawing area.
|
|
64
112
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
65
113
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
66
|
-
* @default object Depends on the charts type.
|
|
67
114
|
*/
|
|
68
115
|
margin: PropTypes.shape({
|
|
69
116
|
bottom: PropTypes.number,
|
|
@@ -83,23 +130,19 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
83
130
|
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
84
131
|
*/
|
|
85
132
|
onZoomChange: PropTypes.func,
|
|
86
|
-
/**
|
|
87
|
-
* An array of plugins defining how to preprocess data.
|
|
88
|
-
* If not provided, the container supports line, bar, scatter and pie charts.
|
|
89
|
-
*/
|
|
90
|
-
plugins: PropTypes.arrayOf(PropTypes.object),
|
|
91
133
|
/**
|
|
92
134
|
* The array of series to display.
|
|
93
135
|
* Each type of series has its own specificity.
|
|
94
136
|
* Please refer to the appropriate docs page to learn more about it.
|
|
95
137
|
*/
|
|
96
|
-
series: PropTypes.arrayOf(PropTypes.object)
|
|
138
|
+
series: PropTypes.arrayOf(PropTypes.object),
|
|
97
139
|
/**
|
|
98
140
|
* If `true`, animations are skipped.
|
|
99
141
|
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
100
142
|
*/
|
|
101
143
|
skipAnimation: PropTypes.bool,
|
|
102
144
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
145
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
103
146
|
title: PropTypes.string,
|
|
104
147
|
/**
|
|
105
148
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
@@ -251,14 +294,6 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
251
294
|
id: PropTypes.string,
|
|
252
295
|
max: PropTypes.number,
|
|
253
296
|
min: PropTypes.number
|
|
254
|
-
})),
|
|
255
|
-
/**
|
|
256
|
-
* The list of zoom data related to each axis.
|
|
257
|
-
*/
|
|
258
|
-
zoom: PropTypes.arrayOf(PropTypes.shape({
|
|
259
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
260
|
-
end: PropTypes.number.isRequired,
|
|
261
|
-
start: PropTypes.number.isRequired
|
|
262
297
|
}))
|
|
263
298
|
} : void 0;
|
|
264
299
|
export { ChartContainerPro };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { UseChartContainerPropsReturnValue } from '@mui/x-charts/internals';
|
|
1
|
+
import { ChartDataProviderProps, ChartSeriesType, UseChartContainerPropsReturnValue } from '@mui/x-charts/internals';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import type { ChartDataProviderProProps } from '../context/ChartDataProviderPro';
|
|
4
3
|
import type { ChartContainerProProps } from './ChartContainerPro';
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { AllPluginSignatures } from '../internals/plugins/allPlugins';
|
|
5
|
+
export type UseChartContainerProPropsReturnValue<TSeries extends ChartSeriesType> = Pick<UseChartContainerPropsReturnValue<TSeries>, 'chartsSurfaceProps' | 'children'> & {
|
|
6
|
+
chartDataProviderProProps: ChartDataProviderProps<TSeries, AllPluginSignatures<TSeries>>;
|
|
7
7
|
};
|
|
8
|
-
export declare const useChartContainerProProps: (props: ChartContainerProProps
|
|
8
|
+
export declare const useChartContainerProProps: <TSeries extends ChartSeriesType = keyof import("@mui/x-charts/internals").ChartsSeriesConfig>(props: ChartContainerProProps<TSeries>, ref: React.Ref<SVGSVGElement>) => UseChartContainerProPropsReturnValue<TSeries>;
|
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["
|
|
5
|
+
const _excluded = ["initialZoom", "onZoomChange", "plugins", "apiRef"];
|
|
6
6
|
import { useChartContainerProps } from '@mui/x-charts/internals';
|
|
7
|
+
import { ALL_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
7
8
|
export const useChartContainerProProps = (props, ref) => {
|
|
8
9
|
const {
|
|
9
|
-
|
|
10
|
-
onZoomChange
|
|
10
|
+
initialZoom,
|
|
11
|
+
onZoomChange,
|
|
12
|
+
plugins,
|
|
13
|
+
apiRef
|
|
11
14
|
} = props,
|
|
12
15
|
baseProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
13
16
|
const chartDataProviderProProps = {
|
|
14
|
-
|
|
17
|
+
initialZoom,
|
|
15
18
|
onZoomChange
|
|
16
19
|
};
|
|
17
20
|
const {
|
|
@@ -20,7 +23,10 @@ export const useChartContainerProProps = (props, ref) => {
|
|
|
20
23
|
children
|
|
21
24
|
} = useChartContainerProps(baseProps, ref);
|
|
22
25
|
return {
|
|
23
|
-
chartDataProviderProProps: _extends({}, chartDataProviderProps, chartDataProviderProProps
|
|
26
|
+
chartDataProviderProProps: _extends({}, chartDataProviderProps, chartDataProviderProProps, {
|
|
27
|
+
apiRef,
|
|
28
|
+
plugins: plugins ?? ALL_PLUGINS
|
|
29
|
+
}),
|
|
24
30
|
chartsSurfaceProps,
|
|
25
31
|
children
|
|
26
32
|
};
|