@mui/x-charts-pro 7.0.0-beta.3 → 7.0.0-beta.5
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.js +42 -3
- package/CHANGELOG.md +224 -43
- package/ChartContainerPro/ChartContainerPro.js +20 -12
- package/ChartContainerPro/useChartContainerProProps.d.ts +1 -0
- package/ChartContainerPro/useChartContainerProProps.js +3 -1
- package/Heatmap/Heatmap.d.ts +1 -1
- package/LineChartPro/LineChartPro.js +91 -4
- package/ResponsiveChartContainerPro/ResponsiveChartContainerPro.js +5 -0
- package/ResponsiveChartContainerPro/useResponsiveChartContainerProProps.d.ts +1 -0
- package/ScatterChartPro/ScatterChartPro.js +6 -1
- package/index.js +1 -1
- package/internals/utils/releaseInfo.js +1 -1
- package/modern/BarChartPro/BarChartPro.js +42 -3
- package/modern/ChartContainerPro/ChartContainerPro.js +20 -12
- package/modern/ChartContainerPro/useChartContainerProProps.js +3 -1
- package/modern/LineChartPro/LineChartPro.js +91 -4
- package/modern/ResponsiveChartContainerPro/ResponsiveChartContainerPro.js +5 -0
- package/modern/ScatterChartPro/ScatterChartPro.js +6 -1
- package/modern/index.js +1 -1
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/node/BarChartPro/BarChartPro.js +42 -3
- package/node/ChartContainerPro/ChartContainerPro.js +19 -11
- package/node/ChartContainerPro/useChartContainerProProps.js +3 -1
- package/node/LineChartPro/LineChartPro.js +91 -4
- package/node/ResponsiveChartContainerPro/ResponsiveChartContainerPro.js +5 -0
- package/node/ScatterChartPro/ScatterChartPro.js +6 -1
- package/node/index.js +1 -1
- package/node/internals/utils/releaseInfo.js +1 -1
- package/package.json +9 -9
|
@@ -18,6 +18,7 @@ export const useChartContainerProProps = (props, ref) => {
|
|
|
18
18
|
highlightedProviderProps,
|
|
19
19
|
chartsSurfaceProps,
|
|
20
20
|
pluginProviderProps,
|
|
21
|
+
animationProviderProps,
|
|
21
22
|
xAxis,
|
|
22
23
|
yAxis
|
|
23
24
|
} = useChartContainerProps(baseProps, ref);
|
|
@@ -36,6 +37,7 @@ export const useChartContainerProProps = (props, ref) => {
|
|
|
36
37
|
cartesianProviderProps,
|
|
37
38
|
zAxisContextProps,
|
|
38
39
|
highlightedProviderProps,
|
|
39
|
-
chartsSurfaceProps
|
|
40
|
+
chartsSurfaceProps,
|
|
41
|
+
animationProviderProps
|
|
40
42
|
};
|
|
41
43
|
};
|
package/Heatmap/Heatmap.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface HeatmapSlots extends ChartsAxisSlots, Omit<ChartsTooltipSlots<'
|
|
|
11
11
|
}
|
|
12
12
|
export interface HeatmapSlotProps extends ChartsAxisSlotProps, Omit<ChartsTooltipSlotProps<'heatmap'>, 'axisContent'>, ChartsOverlaySlotProps, HeatmapItemSlotProps {
|
|
13
13
|
}
|
|
14
|
-
export interface HeatmapProps extends Omit<ResponsiveChartContainerProProps, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'zoom' | 'onZoomChange'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, ChartsOnAxisClickHandlerProps {
|
|
14
|
+
export interface HeatmapProps extends Omit<ResponsiveChartContainerProProps, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'zoom' | 'onZoomChange' | 'skipAnimation'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, ChartsOnAxisClickHandlerProps {
|
|
15
15
|
/**
|
|
16
16
|
* The configuration of the x-axes.
|
|
17
17
|
* If not provided, a default axis config is used.
|
|
@@ -25,25 +25,112 @@ function AreaPlotZoom(props) {
|
|
|
25
25
|
isInteracting
|
|
26
26
|
} = useZoom();
|
|
27
27
|
return /*#__PURE__*/_jsx(AreaPlot, _extends({}, props, {
|
|
28
|
-
skipAnimation: isInteracting
|
|
28
|
+
skipAnimation: isInteracting || undefined
|
|
29
29
|
}));
|
|
30
30
|
}
|
|
31
|
+
process.env.NODE_ENV !== "production" ? AreaPlotZoom.propTypes = {
|
|
32
|
+
// ----------------------------- Warning --------------------------------
|
|
33
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
34
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
35
|
+
// ----------------------------------------------------------------------
|
|
36
|
+
/**
|
|
37
|
+
* Callback fired when a line area item is clicked.
|
|
38
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
39
|
+
* @param {LineItemIdentifier} lineItemIdentifier The line item identifier.
|
|
40
|
+
*/
|
|
41
|
+
onItemClick: PropTypes.func,
|
|
42
|
+
/**
|
|
43
|
+
* If `true`, animations are skipped.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
skipAnimation: PropTypes.bool,
|
|
47
|
+
/**
|
|
48
|
+
* The props used for each component slot.
|
|
49
|
+
* @default {}
|
|
50
|
+
*/
|
|
51
|
+
slotProps: PropTypes.object,
|
|
52
|
+
/**
|
|
53
|
+
* Overridable component slots.
|
|
54
|
+
* @default {}
|
|
55
|
+
*/
|
|
56
|
+
slots: PropTypes.object
|
|
57
|
+
} : void 0;
|
|
31
58
|
function LinePlotZoom(props) {
|
|
32
59
|
const {
|
|
33
60
|
isInteracting
|
|
34
61
|
} = useZoom();
|
|
35
62
|
return /*#__PURE__*/_jsx(LinePlot, _extends({}, props, {
|
|
36
|
-
skipAnimation: isInteracting
|
|
63
|
+
skipAnimation: isInteracting || undefined
|
|
37
64
|
}));
|
|
38
65
|
}
|
|
66
|
+
process.env.NODE_ENV !== "production" ? LinePlotZoom.propTypes = {
|
|
67
|
+
// ----------------------------- Warning --------------------------------
|
|
68
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
69
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
70
|
+
// ----------------------------------------------------------------------
|
|
71
|
+
/**
|
|
72
|
+
* Callback fired when a line item is clicked.
|
|
73
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
74
|
+
* @param {LineItemIdentifier} lineItemIdentifier The line item identifier.
|
|
75
|
+
*/
|
|
76
|
+
onItemClick: PropTypes.func,
|
|
77
|
+
/**
|
|
78
|
+
* If `true`, animations are skipped.
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
81
|
+
skipAnimation: PropTypes.bool,
|
|
82
|
+
/**
|
|
83
|
+
* The props used for each component slot.
|
|
84
|
+
* @default {}
|
|
85
|
+
*/
|
|
86
|
+
slotProps: PropTypes.object,
|
|
87
|
+
/**
|
|
88
|
+
* Overridable component slots.
|
|
89
|
+
* @default {}
|
|
90
|
+
*/
|
|
91
|
+
slots: PropTypes.object
|
|
92
|
+
} : void 0;
|
|
39
93
|
function MarkPlotZoom(props) {
|
|
40
94
|
const {
|
|
41
95
|
isInteracting
|
|
42
96
|
} = useZoom();
|
|
43
97
|
return /*#__PURE__*/_jsx(MarkPlot, _extends({}, props, {
|
|
44
|
-
skipAnimation: isInteracting
|
|
98
|
+
skipAnimation: isInteracting || undefined
|
|
45
99
|
}));
|
|
46
100
|
}
|
|
101
|
+
process.env.NODE_ENV !== "production" ? MarkPlotZoom.propTypes = {
|
|
102
|
+
// ----------------------------- Warning --------------------------------
|
|
103
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
104
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
105
|
+
// ----------------------------------------------------------------------
|
|
106
|
+
/**
|
|
107
|
+
* If `true` the mark element will only be able to render circle.
|
|
108
|
+
* Giving fewer customization options, but saving around 40ms per 1.000 marks.
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
experimentalRendering: PropTypes.bool,
|
|
112
|
+
/**
|
|
113
|
+
* Callback fired when a line mark item is clicked.
|
|
114
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
115
|
+
* @param {LineItemIdentifier} lineItemIdentifier The line mark item identifier.
|
|
116
|
+
*/
|
|
117
|
+
onItemClick: PropTypes.func,
|
|
118
|
+
/**
|
|
119
|
+
* If `true`, animations are skipped.
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
skipAnimation: PropTypes.bool,
|
|
123
|
+
/**
|
|
124
|
+
* The props used for each component slot.
|
|
125
|
+
* @default {}
|
|
126
|
+
*/
|
|
127
|
+
slotProps: PropTypes.object,
|
|
128
|
+
/**
|
|
129
|
+
* Overridable component slots.
|
|
130
|
+
* @default {}
|
|
131
|
+
*/
|
|
132
|
+
slots: PropTypes.object
|
|
133
|
+
} : void 0;
|
|
47
134
|
/**
|
|
48
135
|
* Demos:
|
|
49
136
|
*
|
|
@@ -101,7 +188,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
101
188
|
// ----------------------------------------------------------------------
|
|
102
189
|
/**
|
|
103
190
|
* The configuration of axes highlight.
|
|
104
|
-
* @see See {@link https://mui.com/x/react-charts/
|
|
191
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
105
192
|
* @default { x: 'line' }
|
|
106
193
|
*/
|
|
107
194
|
axisHighlight: PropTypes.shape({
|
|
@@ -102,6 +102,11 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainerPro.propTypes =
|
|
|
102
102
|
* Please refer to the appropriate docs page to learn more about it.
|
|
103
103
|
*/
|
|
104
104
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
105
|
+
/**
|
|
106
|
+
* If `true`, animations are skipped.
|
|
107
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
108
|
+
*/
|
|
109
|
+
skipAnimation: PropTypes.bool,
|
|
105
110
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
106
111
|
title: PropTypes.string,
|
|
107
112
|
viewBox: PropTypes.shape({
|
|
@@ -19,6 +19,7 @@ export declare const useResponsiveChartContainerProProps: (props: ResponsiveChar
|
|
|
19
19
|
sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
|
|
20
20
|
series: (import("@mui/x-charts").ScatterSeriesType | import("@mui/x-charts").LineSeriesType | import("@mui/x-charts").BarSeriesType | import("@mui/x-charts").PieSeriesType<import("@mui/x-charts/internals").MakeOptional<import("@mui/x-charts").PieValueType, "id">> | import("../models").HeatmapSeriesType)[];
|
|
21
21
|
onHighlightChange?: ((highlightedItem: import("@mui/x-charts").HighlightItemData | null) => void) | undefined;
|
|
22
|
+
skipAnimation?: boolean | undefined;
|
|
22
23
|
zAxis?: import("@mui/x-charts/internals").MakeOptional<import("@mui/x-charts/internals").ZAxisConfig, "id">[] | undefined;
|
|
23
24
|
dataset?: import("@mui/x-charts/internals").DatasetType | undefined;
|
|
24
25
|
colors?: import("@mui/x-charts").ChartsColorPalette | undefined;
|
|
@@ -72,7 +72,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
72
72
|
// ----------------------------------------------------------------------
|
|
73
73
|
/**
|
|
74
74
|
* The configuration of axes highlight.
|
|
75
|
-
* @see See {@link https://mui.com/x/react-charts/
|
|
75
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
76
76
|
* @default { x: 'none', y: 'none' }
|
|
77
77
|
*/
|
|
78
78
|
axisHighlight: PropTypes.shape({
|
|
@@ -214,6 +214,11 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
214
214
|
* An array of [[ScatterSeriesType]] objects.
|
|
215
215
|
*/
|
|
216
216
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
217
|
+
/**
|
|
218
|
+
* If `true`, animations are skipped.
|
|
219
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
220
|
+
*/
|
|
221
|
+
skipAnimation: PropTypes.bool,
|
|
217
222
|
/**
|
|
218
223
|
* The props used for each component slot.
|
|
219
224
|
* @default {}
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcyOTExNjAwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -25,9 +25,48 @@ function BarChartPlotZoom(props) {
|
|
|
25
25
|
isInteracting
|
|
26
26
|
} = useZoom();
|
|
27
27
|
return /*#__PURE__*/_jsx(BarPlot, _extends({}, props, {
|
|
28
|
-
skipAnimation: isInteracting
|
|
28
|
+
skipAnimation: isInteracting || undefined
|
|
29
29
|
}));
|
|
30
30
|
}
|
|
31
|
+
process.env.NODE_ENV !== "production" ? BarChartPlotZoom.propTypes = {
|
|
32
|
+
// ----------------------------- Warning --------------------------------
|
|
33
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
34
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
35
|
+
// ----------------------------------------------------------------------
|
|
36
|
+
/**
|
|
37
|
+
* If provided, the function will be used to format the label of the bar.
|
|
38
|
+
* It can be set to 'value' to display the current value.
|
|
39
|
+
* @param {BarItem} item The item to format.
|
|
40
|
+
* @param {BarLabelContext} context data about the bar.
|
|
41
|
+
* @returns {string} The formatted label.
|
|
42
|
+
*/
|
|
43
|
+
barLabel: PropTypes.oneOfType([PropTypes.oneOf(['value']), PropTypes.func]),
|
|
44
|
+
/**
|
|
45
|
+
* Defines the border radius of the bar element.
|
|
46
|
+
*/
|
|
47
|
+
borderRadius: PropTypes.number,
|
|
48
|
+
/**
|
|
49
|
+
* Callback fired when a bar item is clicked.
|
|
50
|
+
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
51
|
+
* @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
|
|
52
|
+
*/
|
|
53
|
+
onItemClick: PropTypes.func,
|
|
54
|
+
/**
|
|
55
|
+
* If `true`, animations are skipped.
|
|
56
|
+
* @default undefined
|
|
57
|
+
*/
|
|
58
|
+
skipAnimation: PropTypes.bool,
|
|
59
|
+
/**
|
|
60
|
+
* The props used for each component slot.
|
|
61
|
+
* @default {}
|
|
62
|
+
*/
|
|
63
|
+
slotProps: PropTypes.object,
|
|
64
|
+
/**
|
|
65
|
+
* Overridable component slots.
|
|
66
|
+
* @default {}
|
|
67
|
+
*/
|
|
68
|
+
slots: PropTypes.object
|
|
69
|
+
} : void 0;
|
|
31
70
|
/**
|
|
32
71
|
* Demos:
|
|
33
72
|
*
|
|
@@ -82,7 +121,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
82
121
|
* The configuration of axes highlight.
|
|
83
122
|
* Default is set to 'band' in the bar direction.
|
|
84
123
|
* Depends on `layout` prop.
|
|
85
|
-
* @see See {@link https://mui.com/x/react-charts/
|
|
124
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
86
125
|
*/
|
|
87
126
|
axisHighlight: PropTypes.shape({
|
|
88
127
|
x: PropTypes.oneOf(['band', 'line', 'none']),
|
|
@@ -244,7 +283,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
244
283
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
245
284
|
/**
|
|
246
285
|
* If `true`, animations are skipped.
|
|
247
|
-
*
|
|
286
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
248
287
|
*/
|
|
249
288
|
skipAnimation: PropTypes.bool,
|
|
250
289
|
/**
|
|
@@ -5,7 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
7
7
|
import { HighlightedProvider, ZAxisContextProvider } from '@mui/x-charts/context';
|
|
8
|
-
import { ChartsAxesGradients, DrawingProvider, InteractionProvider, PluginProvider, SeriesProvider } from '@mui/x-charts/internals';
|
|
8
|
+
import { ChartsAxesGradients, DrawingProvider, InteractionProvider, PluginProvider, SeriesProvider, AnimationProvider } from '@mui/x-charts/internals';
|
|
9
9
|
import { useLicenseVerifier } from '@mui/x-license/useLicenseVerifier';
|
|
10
10
|
import { getReleaseInfo } from "../internals/utils/releaseInfo.js";
|
|
11
11
|
import { CartesianProviderPro } from "../context/CartesianProviderPro/index.js";
|
|
@@ -23,22 +23,25 @@ const ChartContainerPro = /*#__PURE__*/React.forwardRef(function ChartContainer(
|
|
|
23
23
|
cartesianProviderProps,
|
|
24
24
|
chartsSurfaceProps,
|
|
25
25
|
pluginProviderProps,
|
|
26
|
+
animationProviderProps,
|
|
26
27
|
children
|
|
27
28
|
} = useChartContainerProProps(props, ref);
|
|
28
29
|
useLicenseVerifier('x-charts-pro', releaseInfo);
|
|
29
30
|
return /*#__PURE__*/_jsx(DrawingProvider, _extends({}, drawingProviderProps, {
|
|
30
|
-
children: /*#__PURE__*/_jsx(
|
|
31
|
-
children: /*#__PURE__*/_jsx(
|
|
32
|
-
children: /*#__PURE__*/_jsx(
|
|
33
|
-
children: /*#__PURE__*/_jsx(
|
|
34
|
-
children: /*#__PURE__*/_jsx(
|
|
35
|
-
children: /*#__PURE__*/_jsx(
|
|
36
|
-
children: /*#__PURE__*/_jsx(
|
|
37
|
-
children: /*#__PURE__*/
|
|
38
|
-
children:
|
|
31
|
+
children: /*#__PURE__*/_jsx(AnimationProvider, _extends({}, animationProviderProps, {
|
|
32
|
+
children: /*#__PURE__*/_jsx(PluginProvider, _extends({}, pluginProviderProps, {
|
|
33
|
+
children: /*#__PURE__*/_jsx(ZoomProvider, _extends({}, zoomProviderProps, {
|
|
34
|
+
children: /*#__PURE__*/_jsx(SeriesProvider, _extends({}, seriesProviderProps, {
|
|
35
|
+
children: /*#__PURE__*/_jsx(CartesianProviderPro, _extends({}, cartesianProviderProps, {
|
|
36
|
+
children: /*#__PURE__*/_jsx(ZAxisContextProvider, _extends({}, zAxisContextProps, {
|
|
37
|
+
children: /*#__PURE__*/_jsx(InteractionProvider, {
|
|
38
|
+
children: /*#__PURE__*/_jsx(HighlightedProvider, _extends({}, highlightedProviderProps, {
|
|
39
|
+
children: /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
40
|
+
children: [/*#__PURE__*/_jsx(ChartsAxesGradients, {}), children]
|
|
41
|
+
}))
|
|
39
42
|
}))
|
|
40
|
-
})
|
|
41
|
-
})
|
|
43
|
+
})
|
|
44
|
+
}))
|
|
42
45
|
}))
|
|
43
46
|
}))
|
|
44
47
|
}))
|
|
@@ -115,6 +118,11 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
115
118
|
* Please refer to the appropriate docs page to learn more about it.
|
|
116
119
|
*/
|
|
117
120
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
121
|
+
/**
|
|
122
|
+
* If `true`, animations are skipped.
|
|
123
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
124
|
+
*/
|
|
125
|
+
skipAnimation: PropTypes.bool,
|
|
118
126
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
119
127
|
title: PropTypes.string,
|
|
120
128
|
viewBox: PropTypes.shape({
|
|
@@ -18,6 +18,7 @@ export const useChartContainerProProps = (props, ref) => {
|
|
|
18
18
|
highlightedProviderProps,
|
|
19
19
|
chartsSurfaceProps,
|
|
20
20
|
pluginProviderProps,
|
|
21
|
+
animationProviderProps,
|
|
21
22
|
xAxis,
|
|
22
23
|
yAxis
|
|
23
24
|
} = useChartContainerProps(baseProps, ref);
|
|
@@ -36,6 +37,7 @@ export const useChartContainerProProps = (props, ref) => {
|
|
|
36
37
|
cartesianProviderProps,
|
|
37
38
|
zAxisContextProps,
|
|
38
39
|
highlightedProviderProps,
|
|
39
|
-
chartsSurfaceProps
|
|
40
|
+
chartsSurfaceProps,
|
|
41
|
+
animationProviderProps
|
|
40
42
|
};
|
|
41
43
|
};
|
|
@@ -25,25 +25,112 @@ function AreaPlotZoom(props) {
|
|
|
25
25
|
isInteracting
|
|
26
26
|
} = useZoom();
|
|
27
27
|
return /*#__PURE__*/_jsx(AreaPlot, _extends({}, props, {
|
|
28
|
-
skipAnimation: isInteracting
|
|
28
|
+
skipAnimation: isInteracting || undefined
|
|
29
29
|
}));
|
|
30
30
|
}
|
|
31
|
+
process.env.NODE_ENV !== "production" ? AreaPlotZoom.propTypes = {
|
|
32
|
+
// ----------------------------- Warning --------------------------------
|
|
33
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
34
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
35
|
+
// ----------------------------------------------------------------------
|
|
36
|
+
/**
|
|
37
|
+
* Callback fired when a line area item is clicked.
|
|
38
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
39
|
+
* @param {LineItemIdentifier} lineItemIdentifier The line item identifier.
|
|
40
|
+
*/
|
|
41
|
+
onItemClick: PropTypes.func,
|
|
42
|
+
/**
|
|
43
|
+
* If `true`, animations are skipped.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
skipAnimation: PropTypes.bool,
|
|
47
|
+
/**
|
|
48
|
+
* The props used for each component slot.
|
|
49
|
+
* @default {}
|
|
50
|
+
*/
|
|
51
|
+
slotProps: PropTypes.object,
|
|
52
|
+
/**
|
|
53
|
+
* Overridable component slots.
|
|
54
|
+
* @default {}
|
|
55
|
+
*/
|
|
56
|
+
slots: PropTypes.object
|
|
57
|
+
} : void 0;
|
|
31
58
|
function LinePlotZoom(props) {
|
|
32
59
|
const {
|
|
33
60
|
isInteracting
|
|
34
61
|
} = useZoom();
|
|
35
62
|
return /*#__PURE__*/_jsx(LinePlot, _extends({}, props, {
|
|
36
|
-
skipAnimation: isInteracting
|
|
63
|
+
skipAnimation: isInteracting || undefined
|
|
37
64
|
}));
|
|
38
65
|
}
|
|
66
|
+
process.env.NODE_ENV !== "production" ? LinePlotZoom.propTypes = {
|
|
67
|
+
// ----------------------------- Warning --------------------------------
|
|
68
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
69
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
70
|
+
// ----------------------------------------------------------------------
|
|
71
|
+
/**
|
|
72
|
+
* Callback fired when a line item is clicked.
|
|
73
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
74
|
+
* @param {LineItemIdentifier} lineItemIdentifier The line item identifier.
|
|
75
|
+
*/
|
|
76
|
+
onItemClick: PropTypes.func,
|
|
77
|
+
/**
|
|
78
|
+
* If `true`, animations are skipped.
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
81
|
+
skipAnimation: PropTypes.bool,
|
|
82
|
+
/**
|
|
83
|
+
* The props used for each component slot.
|
|
84
|
+
* @default {}
|
|
85
|
+
*/
|
|
86
|
+
slotProps: PropTypes.object,
|
|
87
|
+
/**
|
|
88
|
+
* Overridable component slots.
|
|
89
|
+
* @default {}
|
|
90
|
+
*/
|
|
91
|
+
slots: PropTypes.object
|
|
92
|
+
} : void 0;
|
|
39
93
|
function MarkPlotZoom(props) {
|
|
40
94
|
const {
|
|
41
95
|
isInteracting
|
|
42
96
|
} = useZoom();
|
|
43
97
|
return /*#__PURE__*/_jsx(MarkPlot, _extends({}, props, {
|
|
44
|
-
skipAnimation: isInteracting
|
|
98
|
+
skipAnimation: isInteracting || undefined
|
|
45
99
|
}));
|
|
46
100
|
}
|
|
101
|
+
process.env.NODE_ENV !== "production" ? MarkPlotZoom.propTypes = {
|
|
102
|
+
// ----------------------------- Warning --------------------------------
|
|
103
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
104
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
105
|
+
// ----------------------------------------------------------------------
|
|
106
|
+
/**
|
|
107
|
+
* If `true` the mark element will only be able to render circle.
|
|
108
|
+
* Giving fewer customization options, but saving around 40ms per 1.000 marks.
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
experimentalRendering: PropTypes.bool,
|
|
112
|
+
/**
|
|
113
|
+
* Callback fired when a line mark item is clicked.
|
|
114
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
115
|
+
* @param {LineItemIdentifier} lineItemIdentifier The line mark item identifier.
|
|
116
|
+
*/
|
|
117
|
+
onItemClick: PropTypes.func,
|
|
118
|
+
/**
|
|
119
|
+
* If `true`, animations are skipped.
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
skipAnimation: PropTypes.bool,
|
|
123
|
+
/**
|
|
124
|
+
* The props used for each component slot.
|
|
125
|
+
* @default {}
|
|
126
|
+
*/
|
|
127
|
+
slotProps: PropTypes.object,
|
|
128
|
+
/**
|
|
129
|
+
* Overridable component slots.
|
|
130
|
+
* @default {}
|
|
131
|
+
*/
|
|
132
|
+
slots: PropTypes.object
|
|
133
|
+
} : void 0;
|
|
47
134
|
/**
|
|
48
135
|
* Demos:
|
|
49
136
|
*
|
|
@@ -101,7 +188,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
101
188
|
// ----------------------------------------------------------------------
|
|
102
189
|
/**
|
|
103
190
|
* The configuration of axes highlight.
|
|
104
|
-
* @see See {@link https://mui.com/x/react-charts/
|
|
191
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
105
192
|
* @default { x: 'line' }
|
|
106
193
|
*/
|
|
107
194
|
axisHighlight: PropTypes.shape({
|
|
@@ -102,6 +102,11 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainerPro.propTypes =
|
|
|
102
102
|
* Please refer to the appropriate docs page to learn more about it.
|
|
103
103
|
*/
|
|
104
104
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
105
|
+
/**
|
|
106
|
+
* If `true`, animations are skipped.
|
|
107
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
108
|
+
*/
|
|
109
|
+
skipAnimation: PropTypes.bool,
|
|
105
110
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
106
111
|
title: PropTypes.string,
|
|
107
112
|
viewBox: PropTypes.shape({
|
|
@@ -72,7 +72,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
72
72
|
// ----------------------------------------------------------------------
|
|
73
73
|
/**
|
|
74
74
|
* The configuration of axes highlight.
|
|
75
|
-
* @see See {@link https://mui.com/x/react-charts/
|
|
75
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
76
76
|
* @default { x: 'none', y: 'none' }
|
|
77
77
|
*/
|
|
78
78
|
axisHighlight: PropTypes.shape({
|
|
@@ -214,6 +214,11 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
214
214
|
* An array of [[ScatterSeriesType]] objects.
|
|
215
215
|
*/
|
|
216
216
|
series: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
217
|
+
/**
|
|
218
|
+
* If `true`, animations are skipped.
|
|
219
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
220
|
+
*/
|
|
221
|
+
skipAnimation: PropTypes.bool,
|
|
217
222
|
/**
|
|
218
223
|
* The props used for each component slot.
|
|
219
224
|
* @default {}
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ponyfillGlobal } from '@mui/utils';
|
|
2
2
|
export const getReleaseInfo = () => {
|
|
3
|
-
const releaseInfo = "
|
|
3
|
+
const releaseInfo = "MTcyOTExNjAwMDAwMA==";
|
|
4
4
|
if (process.env.NODE_ENV !== 'production') {
|
|
5
5
|
// A simple hack to set the value in the test environment (has no build step).
|
|
6
6
|
// eslint-disable-next-line no-useless-concat
|
|
@@ -32,9 +32,48 @@ function BarChartPlotZoom(props) {
|
|
|
32
32
|
isInteracting
|
|
33
33
|
} = (0, _useZoom.useZoom)();
|
|
34
34
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BarChart.BarPlot, (0, _extends2.default)({}, props, {
|
|
35
|
-
skipAnimation: isInteracting
|
|
35
|
+
skipAnimation: isInteracting || undefined
|
|
36
36
|
}));
|
|
37
37
|
}
|
|
38
|
+
process.env.NODE_ENV !== "production" ? BarChartPlotZoom.propTypes = {
|
|
39
|
+
// ----------------------------- Warning --------------------------------
|
|
40
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
41
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
42
|
+
// ----------------------------------------------------------------------
|
|
43
|
+
/**
|
|
44
|
+
* If provided, the function will be used to format the label of the bar.
|
|
45
|
+
* It can be set to 'value' to display the current value.
|
|
46
|
+
* @param {BarItem} item The item to format.
|
|
47
|
+
* @param {BarLabelContext} context data about the bar.
|
|
48
|
+
* @returns {string} The formatted label.
|
|
49
|
+
*/
|
|
50
|
+
barLabel: _propTypes.default.oneOfType([_propTypes.default.oneOf(['value']), _propTypes.default.func]),
|
|
51
|
+
/**
|
|
52
|
+
* Defines the border radius of the bar element.
|
|
53
|
+
*/
|
|
54
|
+
borderRadius: _propTypes.default.number,
|
|
55
|
+
/**
|
|
56
|
+
* Callback fired when a bar item is clicked.
|
|
57
|
+
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
58
|
+
* @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
|
|
59
|
+
*/
|
|
60
|
+
onItemClick: _propTypes.default.func,
|
|
61
|
+
/**
|
|
62
|
+
* If `true`, animations are skipped.
|
|
63
|
+
* @default undefined
|
|
64
|
+
*/
|
|
65
|
+
skipAnimation: _propTypes.default.bool,
|
|
66
|
+
/**
|
|
67
|
+
* The props used for each component slot.
|
|
68
|
+
* @default {}
|
|
69
|
+
*/
|
|
70
|
+
slotProps: _propTypes.default.object,
|
|
71
|
+
/**
|
|
72
|
+
* Overridable component slots.
|
|
73
|
+
* @default {}
|
|
74
|
+
*/
|
|
75
|
+
slots: _propTypes.default.object
|
|
76
|
+
} : void 0;
|
|
38
77
|
/**
|
|
39
78
|
* Demos:
|
|
40
79
|
*
|
|
@@ -89,7 +128,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
89
128
|
* The configuration of axes highlight.
|
|
90
129
|
* Default is set to 'band' in the bar direction.
|
|
91
130
|
* Depends on `layout` prop.
|
|
92
|
-
* @see See {@link https://mui.com/x/react-charts/
|
|
131
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
93
132
|
*/
|
|
94
133
|
axisHighlight: _propTypes.default.shape({
|
|
95
134
|
x: _propTypes.default.oneOf(['band', 'line', 'none']),
|
|
@@ -251,7 +290,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
251
290
|
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
252
291
|
/**
|
|
253
292
|
* If `true`, animations are skipped.
|
|
254
|
-
*
|
|
293
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
255
294
|
*/
|
|
256
295
|
skipAnimation: _propTypes.default.bool,
|
|
257
296
|
/**
|
|
@@ -30,22 +30,25 @@ const ChartContainerPro = exports.ChartContainerPro = /*#__PURE__*/React.forward
|
|
|
30
30
|
cartesianProviderProps,
|
|
31
31
|
chartsSurfaceProps,
|
|
32
32
|
pluginProviderProps,
|
|
33
|
+
animationProviderProps,
|
|
33
34
|
children
|
|
34
35
|
} = (0, _useChartContainerProProps.useChartContainerProProps)(props, ref);
|
|
35
36
|
(0, _useLicenseVerifier.useLicenseVerifier)('x-charts-pro', releaseInfo);
|
|
36
37
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.DrawingProvider, (0, _extends2.default)({}, drawingProviderProps, {
|
|
37
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.
|
|
38
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
39
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
40
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
41
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
42
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
43
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
44
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
45
|
-
children:
|
|
38
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.AnimationProvider, (0, _extends2.default)({}, animationProviderProps, {
|
|
39
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.PluginProvider, (0, _extends2.default)({}, pluginProviderProps, {
|
|
40
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ZoomProvider.ZoomProvider, (0, _extends2.default)({}, zoomProviderProps, {
|
|
41
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.SeriesProvider, (0, _extends2.default)({}, seriesProviderProps, {
|
|
42
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CartesianProviderPro.CartesianProviderPro, (0, _extends2.default)({}, cartesianProviderProps, {
|
|
43
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.ZAxisContextProvider, (0, _extends2.default)({}, zAxisContextProps, {
|
|
44
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.InteractionProvider, {
|
|
45
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.HighlightedProvider, (0, _extends2.default)({}, highlightedProviderProps, {
|
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
47
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.ChartsAxesGradients, {}), children]
|
|
48
|
+
}))
|
|
46
49
|
}))
|
|
47
|
-
})
|
|
48
|
-
})
|
|
50
|
+
})
|
|
51
|
+
}))
|
|
49
52
|
}))
|
|
50
53
|
}))
|
|
51
54
|
}))
|
|
@@ -122,6 +125,11 @@ process.env.NODE_ENV !== "production" ? ChartContainerPro.propTypes = {
|
|
|
122
125
|
* Please refer to the appropriate docs page to learn more about it.
|
|
123
126
|
*/
|
|
124
127
|
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
128
|
+
/**
|
|
129
|
+
* If `true`, animations are skipped.
|
|
130
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
131
|
+
*/
|
|
132
|
+
skipAnimation: _propTypes.default.bool,
|
|
125
133
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
126
134
|
title: _propTypes.default.string,
|
|
127
135
|
viewBox: _propTypes.default.shape({
|