@mui/x-charts-pro 8.0.0-alpha.0 → 8.0.0-alpha.10
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 +74 -61
- package/CHANGELOG.md +2215 -119
- package/ChartContainerPro/ChartContainerPro.d.ts +33 -4
- package/ChartContainerPro/ChartContainerPro.js +59 -51
- package/ChartContainerPro/useChartContainerProProps.d.ts +7 -43
- package/ChartContainerPro/useChartContainerProProps.js +15 -9
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +71 -80
- package/{context → ChartDataProviderPro}/package.json +1 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +8 -0
- package/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
- package/Heatmap/Heatmap.d.ts +11 -4
- package/Heatmap/Heatmap.js +35 -43
- package/Heatmap/HeatmapItem.js +1 -1
- package/Heatmap/HeatmapTooltip.d.ts +9 -0
- package/Heatmap/HeatmapTooltip.js +274 -0
- package/Heatmap/extremums.d.ts +2 -2
- package/Heatmap/formatter.d.ts +2 -2
- package/Heatmap/formatter.js +2 -1
- package/Heatmap/heatmapClasses.js +2 -1
- package/Heatmap/index.d.ts +1 -1
- package/Heatmap/index.js +1 -1
- package/Heatmap/plugin.d.ts +2 -2
- package/Heatmap/plugin.js +4 -2
- package/Heatmap/tooltip.d.ts +3 -0
- package/Heatmap/tooltip.js +25 -0
- package/LineChartPro/LineChartPro.d.ts +2 -2
- package/LineChartPro/LineChartPro.js +80 -82
- package/README.md +3 -3
- package/ScatterChartPro/ScatterChartPro.d.ts +2 -2
- package/ScatterChartPro/ScatterChartPro.js +51 -64
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/useSeries.d.ts +2 -4
- 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 +3 -1
- package/index.js +5 -5
- package/internals/plugins/allPlugins.d.ts +11 -0
- package/internals/plugins/allPlugins.js +5 -0
- package/internals/plugins/useChartProZoom/creatZoomLookup.d.ts +3 -0
- package/internals/plugins/useChartProZoom/creatZoomLookup.js +12 -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 +303 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +377 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +10 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +50 -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 +2 -2
- package/models/index.d.ts +1 -0
- package/models/index.js +2 -1
- package/modern/BarChartPro/BarChartPro.js +74 -61
- package/modern/ChartContainerPro/ChartContainerPro.js +59 -51
- package/modern/ChartContainerPro/useChartContainerProProps.js +15 -9
- package/modern/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +71 -80
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
- package/modern/Heatmap/Heatmap.js +35 -43
- package/modern/Heatmap/HeatmapItem.js +1 -1
- package/modern/Heatmap/HeatmapTooltip.js +274 -0
- package/modern/Heatmap/formatter.js +2 -1
- package/modern/Heatmap/heatmapClasses.js +2 -1
- package/modern/Heatmap/index.js +1 -1
- package/modern/Heatmap/plugin.js +4 -2
- package/modern/Heatmap/tooltip.js +25 -0
- package/modern/LineChartPro/LineChartPro.js +80 -82
- package/modern/ScatterChartPro/ScatterChartPro.js +51 -64
- 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 +5 -5
- package/modern/internals/plugins/allPlugins.js +5 -0
- package/modern/internals/plugins/useChartProZoom/creatZoomLookup.js +12 -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 +303 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +10 -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 +2 -2
- package/modern/models/index.js +2 -1
- package/node/BarChartPro/BarChartPro.js +73 -60
- package/node/ChartContainerPro/ChartContainerPro.js +58 -50
- package/node/ChartContainerPro/useChartContainerProProps.js +15 -9
- package/node/{context/ChartDataProviderPro → ChartDataProviderPro}/ChartDataProviderPro.js +70 -79
- package/node/ChartDataProviderPro/useChartDataProviderProProps.js +21 -0
- package/node/Heatmap/Heatmap.js +35 -43
- package/node/Heatmap/HeatmapItem.js +2 -2
- package/node/Heatmap/HeatmapTooltip.js +280 -0
- package/node/Heatmap/formatter.js +2 -1
- package/node/Heatmap/heatmapClasses.js +5 -4
- package/node/Heatmap/index.js +4 -4
- package/node/Heatmap/plugin.js +4 -2
- package/node/Heatmap/tooltip.js +31 -0
- package/node/LineChartPro/LineChartPro.js +79 -81
- package/node/ScatterChartPro/ScatterChartPro.js +50 -63
- 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 +34 -12
- package/node/internals/plugins/allPlugins.js +11 -0
- package/node/internals/plugins/useChartProZoom/creatZoomLookup.js +19 -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 +310 -0
- package/node/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +18 -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 +4 -3
- package/package.json +8 -8
- package/typeOverloads/modules.d.ts +8 -1
- package/Heatmap/DefaultHeatmapTooltip.d.ts +0 -7
- package/Heatmap/DefaultHeatmapTooltip.js +0 -99
- package/context/CartesianProviderPro/CartesianProviderPro.d.ts +0 -6
- package/context/CartesianProviderPro/CartesianProviderPro.js +0 -89
- package/context/CartesianProviderPro/createAxisFilterMapper.d.ts +0 -12
- 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/useChartDataProviderProProps.d.ts +0 -16
- 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/modern/Heatmap/DefaultHeatmapTooltip.js +0 -99
- 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/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/Heatmap/DefaultHeatmapTooltip.js +0 -105
- package/node/context/CartesianProviderPro/CartesianProviderPro.js +0 -95
- package/node/context/CartesianProviderPro/createAxisFilterMapper.js +0 -68
- 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/ChartDataProviderPro → ChartDataProviderPro}/index.d.ts +0 -0
- /package/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
- /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/modern/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
- /package/node/{context/ChartDataProviderPro → ChartDataProviderPro}/index.js +0 -0
- /package/node/{context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
|
@@ -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,17 +15,16 @@ import { ChartsAxisHighlight } from '@mui/x-charts/ChartsAxisHighlight';
|
|
|
15
15
|
import { ChartsLegend } from '@mui/x-charts/ChartsLegend';
|
|
16
16
|
import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
|
|
17
17
|
import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
18
|
+
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
19
|
+
import { useLineChartProps, ChartsWrapper } from '@mui/x-charts/internals';
|
|
20
|
+
import { useIsZoomInteracting } from "../hooks/zoom/index.js";
|
|
21
|
+
import { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
22
|
+
import { ChartDataProviderPro } from "../ChartDataProviderPro/index.js";
|
|
22
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
24
|
function AreaPlotZoom(props) {
|
|
24
|
-
const
|
|
25
|
-
isInteracting
|
|
26
|
-
} = useZoom();
|
|
25
|
+
const isInteracting = useIsZoomInteracting();
|
|
27
26
|
return /*#__PURE__*/_jsx(AreaPlot, _extends({}, props, {
|
|
28
|
-
skipAnimation: isInteracting ||
|
|
27
|
+
skipAnimation: isInteracting || props.skipAnimation
|
|
29
28
|
}));
|
|
30
29
|
}
|
|
31
30
|
process.env.NODE_ENV !== "production" ? AreaPlotZoom.propTypes = {
|
|
@@ -56,11 +55,9 @@ process.env.NODE_ENV !== "production" ? AreaPlotZoom.propTypes = {
|
|
|
56
55
|
slots: PropTypes.object
|
|
57
56
|
} : void 0;
|
|
58
57
|
function LinePlotZoom(props) {
|
|
59
|
-
const
|
|
60
|
-
isInteracting
|
|
61
|
-
} = useZoom();
|
|
58
|
+
const isInteracting = useIsZoomInteracting();
|
|
62
59
|
return /*#__PURE__*/_jsx(LinePlot, _extends({}, props, {
|
|
63
|
-
skipAnimation: isInteracting ||
|
|
60
|
+
skipAnimation: isInteracting || props.skipAnimation
|
|
64
61
|
}));
|
|
65
62
|
}
|
|
66
63
|
process.env.NODE_ENV !== "production" ? LinePlotZoom.propTypes = {
|
|
@@ -91,9 +88,7 @@ process.env.NODE_ENV !== "production" ? LinePlotZoom.propTypes = {
|
|
|
91
88
|
slots: PropTypes.object
|
|
92
89
|
} : void 0;
|
|
93
90
|
function MarkPlotZoom(props) {
|
|
94
|
-
const
|
|
95
|
-
isInteracting
|
|
96
|
-
} = useZoom();
|
|
91
|
+
const isInteracting = useIsZoomInteracting();
|
|
97
92
|
return /*#__PURE__*/_jsx(MarkPlot, _extends({}, props, {
|
|
98
93
|
skipAnimation: isInteracting || undefined
|
|
99
94
|
}));
|
|
@@ -103,12 +98,6 @@ process.env.NODE_ENV !== "production" ? MarkPlotZoom.propTypes = {
|
|
|
103
98
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
104
99
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
105
100
|
// ----------------------------------------------------------------------
|
|
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
101
|
/**
|
|
113
102
|
* Callback fired when a line mark item is clicked.
|
|
114
103
|
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
@@ -147,11 +136,13 @@ const LineChartPro = /*#__PURE__*/React.forwardRef(function LineChartPro(inProps
|
|
|
147
136
|
name: 'MuiLineChartPro'
|
|
148
137
|
});
|
|
149
138
|
const {
|
|
150
|
-
|
|
151
|
-
onZoomChange
|
|
139
|
+
initialZoom,
|
|
140
|
+
onZoomChange,
|
|
141
|
+
apiRef
|
|
152
142
|
} = props,
|
|
153
143
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
154
144
|
const {
|
|
145
|
+
chartsWrapperProps,
|
|
155
146
|
chartContainerProps,
|
|
156
147
|
axisClickHandlerProps,
|
|
157
148
|
gridProps,
|
|
@@ -165,20 +156,28 @@ const LineChartPro = /*#__PURE__*/React.forwardRef(function LineChartPro(inProps
|
|
|
165
156
|
axisHighlightProps,
|
|
166
157
|
lineHighlightPlotProps,
|
|
167
158
|
legendProps,
|
|
168
|
-
tooltipProps,
|
|
169
159
|
children
|
|
170
160
|
} = useLineChartProps(other);
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
161
|
+
const {
|
|
162
|
+
chartDataProviderProProps,
|
|
163
|
+
chartsSurfaceProps
|
|
164
|
+
} = useChartContainerProProps(_extends({}, chartContainerProps, {
|
|
165
|
+
initialZoom,
|
|
166
|
+
onZoomChange,
|
|
167
|
+
apiRef
|
|
168
|
+
}), ref);
|
|
169
|
+
const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
|
|
170
|
+
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
171
|
+
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
172
|
+
children: [!props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
173
|
+
children: [props.onAxisClick && /*#__PURE__*/_jsx(ChartsOnAxisClickHandler, _extends({}, axisClickHandlerProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
174
|
+
children: [/*#__PURE__*/_jsx(AreaPlotZoom, _extends({}, areaPlotProps)), /*#__PURE__*/_jsx(LinePlotZoom, _extends({}, linePlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
175
|
+
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx("g", {
|
|
176
|
+
"data-drawing-container": true,
|
|
177
|
+
children: /*#__PURE__*/_jsx(MarkPlotZoom, _extends({}, markPlotProps))
|
|
178
|
+
}), /*#__PURE__*/_jsx(LineHighlightPlot, _extends({}, lineHighlightPlotProps)), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
179
|
+
}))]
|
|
180
|
+
}))
|
|
182
181
|
}));
|
|
183
182
|
});
|
|
184
183
|
process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
@@ -186,9 +185,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
186
185
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
187
186
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
188
187
|
// ----------------------------------------------------------------------
|
|
188
|
+
apiRef: PropTypes.shape({
|
|
189
|
+
current: PropTypes.shape({
|
|
190
|
+
setZoomData: PropTypes.func.isRequired
|
|
191
|
+
})
|
|
192
|
+
}),
|
|
189
193
|
/**
|
|
190
194
|
* The configuration of axes highlight.
|
|
191
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
195
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
192
196
|
* @default { x: 'line' }
|
|
193
197
|
*/
|
|
194
198
|
axisHighlight: PropTypes.shape({
|
|
@@ -223,10 +227,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
223
227
|
* If `true`, render the line highlight item.
|
|
224
228
|
*/
|
|
225
229
|
disableLineItemHighlight: PropTypes.bool,
|
|
226
|
-
/**
|
|
227
|
-
* If `true` marks will render `<circle />` instead of `<path />` and drop theme override for faster rendering.
|
|
228
|
-
*/
|
|
229
|
-
experimentalMarkRendering: PropTypes.bool,
|
|
230
230
|
/**
|
|
231
231
|
* Option to display a cartesian grid in the background.
|
|
232
232
|
*/
|
|
@@ -243,12 +243,26 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
243
243
|
*/
|
|
244
244
|
hideLegend: PropTypes.bool,
|
|
245
245
|
/**
|
|
246
|
-
* The
|
|
246
|
+
* The highlighted item.
|
|
247
|
+
* Used when the highlight is controlled.
|
|
247
248
|
*/
|
|
248
249
|
highlightedItem: PropTypes.shape({
|
|
249
250
|
dataIndex: PropTypes.number,
|
|
250
|
-
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
251
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
251
252
|
}),
|
|
253
|
+
/**
|
|
254
|
+
* This prop is used to help implement the accessibility logic.
|
|
255
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
256
|
+
*/
|
|
257
|
+
id: PropTypes.string,
|
|
258
|
+
/**
|
|
259
|
+
* The list of zoom data related to each axis.
|
|
260
|
+
*/
|
|
261
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
262
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
263
|
+
end: PropTypes.number.isRequired,
|
|
264
|
+
start: PropTypes.number.isRequired
|
|
265
|
+
})),
|
|
252
266
|
/**
|
|
253
267
|
* Indicate which axis to display the left of the charts.
|
|
254
268
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -264,7 +278,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
264
278
|
* The margin between the SVG and the drawing area.
|
|
265
279
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
266
280
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
267
|
-
* @default object Depends on the charts type.
|
|
268
281
|
*/
|
|
269
282
|
margin: PropTypes.shape({
|
|
270
283
|
bottom: PropTypes.number,
|
|
@@ -303,16 +316,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
303
316
|
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
304
317
|
*/
|
|
305
318
|
onZoomChange: PropTypes.func,
|
|
306
|
-
/**
|
|
307
|
-
* The chart will try to wait for the parent container to resolve its size
|
|
308
|
-
* before it renders for the first time.
|
|
309
|
-
*
|
|
310
|
-
* This can be useful in some scenarios where the chart appear to grow after
|
|
311
|
-
* the first render, like when used inside a grid.
|
|
312
|
-
*
|
|
313
|
-
* @default false
|
|
314
|
-
*/
|
|
315
|
-
resolveSizeBeforeRender: PropTypes.bool,
|
|
316
319
|
/**
|
|
317
320
|
* Indicate which axis to display the right of the charts.
|
|
318
321
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -340,32 +343,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
340
343
|
*/
|
|
341
344
|
slots: PropTypes.object,
|
|
342
345
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
346
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
343
347
|
title: PropTypes.string,
|
|
344
|
-
/**
|
|
345
|
-
* The configuration of the tooltip.
|
|
346
|
-
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
347
|
-
* @default { trigger: 'item' }
|
|
348
|
-
*/
|
|
349
|
-
tooltip: PropTypes.shape({
|
|
350
|
-
axisContent: PropTypes.elementType,
|
|
351
|
-
classes: PropTypes.object,
|
|
352
|
-
itemContent: PropTypes.elementType,
|
|
353
|
-
slotProps: PropTypes.object,
|
|
354
|
-
slots: PropTypes.object,
|
|
355
|
-
trigger: PropTypes.oneOf(['axis', 'item', 'none'])
|
|
356
|
-
}),
|
|
357
348
|
/**
|
|
358
349
|
* Indicate which axis to display the top of the charts.
|
|
359
350
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
360
351
|
* @default null
|
|
361
352
|
*/
|
|
362
353
|
topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
363
|
-
viewBox: PropTypes.shape({
|
|
364
|
-
height: PropTypes.number,
|
|
365
|
-
width: PropTypes.number,
|
|
366
|
-
x: PropTypes.number,
|
|
367
|
-
y: PropTypes.number
|
|
368
|
-
}),
|
|
369
354
|
/**
|
|
370
355
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
371
356
|
*/
|
|
@@ -401,7 +386,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
401
386
|
hideTooltip: PropTypes.bool,
|
|
402
387
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
403
388
|
label: PropTypes.string,
|
|
404
|
-
labelFontSize: PropTypes.number,
|
|
405
389
|
labelStyle: PropTypes.object,
|
|
406
390
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
407
391
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -412,7 +396,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
412
396
|
slots: PropTypes.object,
|
|
413
397
|
stroke: PropTypes.string,
|
|
414
398
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
415
|
-
tickFontSize: PropTypes.number,
|
|
416
399
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
417
400
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
418
401
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -464,7 +447,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
464
447
|
hideTooltip: PropTypes.bool,
|
|
465
448
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
466
449
|
label: PropTypes.string,
|
|
467
|
-
labelFontSize: PropTypes.number,
|
|
468
450
|
labelStyle: PropTypes.object,
|
|
469
451
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
470
452
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -475,7 +457,6 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
475
457
|
slots: PropTypes.object,
|
|
476
458
|
stroke: PropTypes.string,
|
|
477
459
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
478
|
-
tickFontSize: PropTypes.number,
|
|
479
460
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
480
461
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
481
462
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -497,12 +478,29 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
497
478
|
}), PropTypes.bool])
|
|
498
479
|
})),
|
|
499
480
|
/**
|
|
500
|
-
* The
|
|
481
|
+
* The configuration of the z-axes.
|
|
501
482
|
*/
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
483
|
+
zAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
484
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
485
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
486
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
487
|
+
unknownColor: PropTypes.string,
|
|
488
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
489
|
+
}), PropTypes.shape({
|
|
490
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
491
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
492
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
493
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
494
|
+
}), PropTypes.shape({
|
|
495
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
496
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
497
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
498
|
+
})]),
|
|
499
|
+
data: PropTypes.array,
|
|
500
|
+
dataKey: PropTypes.string,
|
|
501
|
+
id: PropTypes.string,
|
|
502
|
+
max: PropTypes.number,
|
|
503
|
+
min: PropTypes.number
|
|
506
504
|
}))
|
|
507
505
|
} : void 0;
|
|
508
506
|
export { LineChartPro };
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# MUI X Pro
|
|
2
2
|
|
|
3
3
|
This package is the Pro plan edition of the chart components.
|
|
4
|
-
It's part of [MUI X](https://mui.com/x/), an open-core extension of
|
|
4
|
+
It's part of [MUI X](https://mui.com/x/), an open-core extension of our Core libraries, with advanced components.
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
7
7
|
|
|
@@ -16,8 +16,8 @@ This component has the following peer dependencies that you need to install as w
|
|
|
16
16
|
```json
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@mui/material": "^5.15.14 || ^6.0.0",
|
|
19
|
-
"react": "^17.0.0 || ^18.0.0",
|
|
20
|
-
"react-dom": "^17.0.0 || ^18.0.0"
|
|
19
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
20
|
+
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
21
21
|
},
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ScatterChartProps } from '@mui/x-charts/ScatterChart';
|
|
3
|
-
import {
|
|
4
|
-
export interface ScatterChartProProps extends ScatterChartProps,
|
|
3
|
+
import { ChartContainerProProps } from '../ChartContainerPro/ChartContainerPro';
|
|
4
|
+
export interface ScatterChartProProps extends Omit<ScatterChartProps, 'apiRef'>, Omit<ChartContainerProProps<'scatter'>, 'series' | 'plugins' | 'seriesConfig'> {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Demos:
|
|
@@ -2,22 +2,22 @@
|
|
|
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", "apiRef"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { useThemeProps } from '@mui/material/styles';
|
|
9
9
|
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
10
10
|
import { ScatterPlot } from '@mui/x-charts/ScatterChart';
|
|
11
|
-
import { ZAxisContextProvider } from '@mui/x-charts/context';
|
|
12
11
|
import { ChartsVoronoiHandler } from '@mui/x-charts/ChartsVoronoiHandler';
|
|
13
12
|
import { ChartsAxis } from '@mui/x-charts/ChartsAxis';
|
|
14
13
|
import { ChartsGrid } from '@mui/x-charts/ChartsGrid';
|
|
15
14
|
import { ChartsLegend } from '@mui/x-charts/ChartsLegend';
|
|
15
|
+
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
16
16
|
import { ChartsAxisHighlight } from '@mui/x-charts/ChartsAxisHighlight';
|
|
17
17
|
import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
|
|
18
|
-
import { useScatterChartProps } from '@mui/x-charts/internals';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
18
|
+
import { useScatterChartProps, ChartsWrapper } from '@mui/x-charts/internals';
|
|
19
|
+
import { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
20
|
+
import { ChartDataProviderPro } from "../ChartDataProviderPro/index.js";
|
|
21
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
/**
|
|
23
23
|
* Demos:
|
|
@@ -35,13 +35,14 @@ const ScatterChartPro = /*#__PURE__*/React.forwardRef(function ScatterChartPro(i
|
|
|
35
35
|
name: 'MuiScatterChartPro'
|
|
36
36
|
});
|
|
37
37
|
const {
|
|
38
|
-
|
|
39
|
-
onZoomChange
|
|
38
|
+
initialZoom,
|
|
39
|
+
onZoomChange,
|
|
40
|
+
apiRef
|
|
40
41
|
} = props,
|
|
41
42
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
42
43
|
const {
|
|
44
|
+
chartsWrapperProps,
|
|
43
45
|
chartContainerProps,
|
|
44
|
-
zAxisProps,
|
|
45
46
|
voronoiHandlerProps,
|
|
46
47
|
chartsAxisProps,
|
|
47
48
|
gridProps,
|
|
@@ -49,19 +50,27 @@ const ScatterChartPro = /*#__PURE__*/React.forwardRef(function ScatterChartPro(i
|
|
|
49
50
|
overlayProps,
|
|
50
51
|
legendProps,
|
|
51
52
|
axisHighlightProps,
|
|
52
|
-
tooltipProps,
|
|
53
53
|
children
|
|
54
54
|
} = useScatterChartProps(other);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
const {
|
|
56
|
+
chartDataProviderProProps,
|
|
57
|
+
chartsSurfaceProps
|
|
58
|
+
} = useChartContainerProProps(_extends({}, chartContainerProps, {
|
|
59
|
+
initialZoom,
|
|
60
|
+
onZoomChange,
|
|
61
|
+
apiRef
|
|
62
|
+
}), ref);
|
|
63
|
+
const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
|
|
64
|
+
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
65
|
+
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
66
|
+
children: [!props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
67
|
+
children: [!props.disableVoronoi && /*#__PURE__*/_jsx(ChartsVoronoiHandler, _extends({}, voronoiHandlerProps)), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsx("g", {
|
|
68
|
+
"data-drawing-container": true,
|
|
69
|
+
children: /*#__PURE__*/_jsx(ScatterPlot, _extends({}, scatterPlotProps))
|
|
70
|
+
}), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props?.slotProps?.tooltip, {
|
|
71
|
+
trigger: "item"
|
|
72
|
+
})), children]
|
|
73
|
+
}))]
|
|
65
74
|
}))
|
|
66
75
|
}));
|
|
67
76
|
});
|
|
@@ -70,9 +79,14 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
70
79
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
71
80
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
72
81
|
// ----------------------------------------------------------------------
|
|
82
|
+
apiRef: PropTypes.shape({
|
|
83
|
+
current: PropTypes.shape({
|
|
84
|
+
setZoomData: PropTypes.func.isRequired
|
|
85
|
+
})
|
|
86
|
+
}),
|
|
73
87
|
/**
|
|
74
88
|
* The configuration of axes highlight.
|
|
75
|
-
* @see See {@link https://mui.com/x/react-charts/highlighting highlighting docs} for more details.
|
|
89
|
+
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
76
90
|
* @default { x: 'none', y: 'none' }
|
|
77
91
|
*/
|
|
78
92
|
axisHighlight: PropTypes.shape({
|
|
@@ -124,12 +138,26 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
124
138
|
*/
|
|
125
139
|
hideLegend: PropTypes.bool,
|
|
126
140
|
/**
|
|
127
|
-
* The
|
|
141
|
+
* The highlighted item.
|
|
142
|
+
* Used when the highlight is controlled.
|
|
128
143
|
*/
|
|
129
144
|
highlightedItem: PropTypes.shape({
|
|
130
145
|
dataIndex: PropTypes.number,
|
|
131
|
-
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
146
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
132
147
|
}),
|
|
148
|
+
/**
|
|
149
|
+
* This prop is used to help implement the accessibility logic.
|
|
150
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
151
|
+
*/
|
|
152
|
+
id: PropTypes.string,
|
|
153
|
+
/**
|
|
154
|
+
* The list of zoom data related to each axis.
|
|
155
|
+
*/
|
|
156
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
157
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
158
|
+
end: PropTypes.number.isRequired,
|
|
159
|
+
start: PropTypes.number.isRequired
|
|
160
|
+
})),
|
|
133
161
|
/**
|
|
134
162
|
* Indicate which axis to display the left of the charts.
|
|
135
163
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -145,7 +173,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
145
173
|
* The margin between the SVG and the drawing area.
|
|
146
174
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
147
175
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
148
|
-
* @default object Depends on the charts type.
|
|
149
176
|
*/
|
|
150
177
|
margin: PropTypes.shape({
|
|
151
178
|
bottom: PropTypes.number,
|
|
@@ -171,16 +198,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
171
198
|
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
172
199
|
*/
|
|
173
200
|
onZoomChange: PropTypes.func,
|
|
174
|
-
/**
|
|
175
|
-
* The chart will try to wait for the parent container to resolve its size
|
|
176
|
-
* before it renders for the first time.
|
|
177
|
-
*
|
|
178
|
-
* This can be useful in some scenarios where the chart appear to grow after
|
|
179
|
-
* the first render, like when used inside a grid.
|
|
180
|
-
*
|
|
181
|
-
* @default false
|
|
182
|
-
*/
|
|
183
|
-
resolveSizeBeforeRender: PropTypes.bool,
|
|
184
201
|
/**
|
|
185
202
|
* Indicate which axis to display the right of the charts.
|
|
186
203
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -208,32 +225,14 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
208
225
|
*/
|
|
209
226
|
slots: PropTypes.object,
|
|
210
227
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
228
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
211
229
|
title: PropTypes.string,
|
|
212
|
-
/**
|
|
213
|
-
* The configuration of the tooltip.
|
|
214
|
-
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
215
|
-
* @default { trigger: 'item' }
|
|
216
|
-
*/
|
|
217
|
-
tooltip: PropTypes.shape({
|
|
218
|
-
axisContent: PropTypes.elementType,
|
|
219
|
-
classes: PropTypes.object,
|
|
220
|
-
itemContent: PropTypes.elementType,
|
|
221
|
-
slotProps: PropTypes.object,
|
|
222
|
-
slots: PropTypes.object,
|
|
223
|
-
trigger: PropTypes.oneOf(['axis', 'item', 'none'])
|
|
224
|
-
}),
|
|
225
230
|
/**
|
|
226
231
|
* Indicate which axis to display the top of the charts.
|
|
227
232
|
* Can be a string (the id of the axis) or an object `ChartsXAxisProps`.
|
|
228
233
|
* @default null
|
|
229
234
|
*/
|
|
230
235
|
topAxis: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
231
|
-
viewBox: PropTypes.shape({
|
|
232
|
-
height: PropTypes.number,
|
|
233
|
-
width: PropTypes.number,
|
|
234
|
-
x: PropTypes.number,
|
|
235
|
-
y: PropTypes.number
|
|
236
|
-
}),
|
|
237
236
|
/**
|
|
238
237
|
* Defines the maximal distance between a scatter point and the pointer that triggers the interaction.
|
|
239
238
|
* If `undefined`, the radius is assumed to be infinite.
|
|
@@ -274,7 +273,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
274
273
|
hideTooltip: PropTypes.bool,
|
|
275
274
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
276
275
|
label: PropTypes.string,
|
|
277
|
-
labelFontSize: PropTypes.number,
|
|
278
276
|
labelStyle: PropTypes.object,
|
|
279
277
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
280
278
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -285,7 +283,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
285
283
|
slots: PropTypes.object,
|
|
286
284
|
stroke: PropTypes.string,
|
|
287
285
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
288
|
-
tickFontSize: PropTypes.number,
|
|
289
286
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
290
287
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
291
288
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -337,7 +334,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
337
334
|
hideTooltip: PropTypes.bool,
|
|
338
335
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
339
336
|
label: PropTypes.string,
|
|
340
|
-
labelFontSize: PropTypes.number,
|
|
341
337
|
labelStyle: PropTypes.object,
|
|
342
338
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
343
339
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -348,7 +344,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
348
344
|
slots: PropTypes.object,
|
|
349
345
|
stroke: PropTypes.string,
|
|
350
346
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
351
|
-
tickFontSize: PropTypes.number,
|
|
352
347
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
353
348
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
354
349
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -393,14 +388,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
393
388
|
id: PropTypes.string,
|
|
394
389
|
max: PropTypes.number,
|
|
395
390
|
min: PropTypes.number
|
|
396
|
-
})),
|
|
397
|
-
/**
|
|
398
|
-
* The list of zoom data related to each axis.
|
|
399
|
-
*/
|
|
400
|
-
zoom: PropTypes.arrayOf(PropTypes.shape({
|
|
401
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
402
|
-
end: PropTypes.number.isRequired,
|
|
403
|
-
start: PropTypes.number.isRequired
|
|
404
391
|
}))
|
|
405
392
|
} : void 0;
|
|
406
393
|
export { ScatterChartPro };
|
package/hooks/index.d.ts
CHANGED
package/hooks/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { useHeatmapSeries as unstable_useHeatmapSeries } from "./useSeries.js";
|
|
1
|
+
export { useHeatmapSeries as unstable_useHeatmapSeries } from "./useSeries.js";
|
|
2
|
+
export * from "./zoom/index.js";
|
package/hooks/useSeries.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ProcessedSeries } from '@mui/x-charts/internals';
|
|
1
2
|
/**
|
|
2
3
|
* Get access to the internal state of heatmap series.
|
|
3
4
|
* The returned object contains:
|
|
@@ -5,7 +6,4 @@
|
|
|
5
6
|
* - seriesOrder: the array of series ids.
|
|
6
7
|
* @returns { series: Record<SeriesId, DefaultizedHeatmapSeriesType>; seriesOrder: SeriesId[]; } | undefined heatmapSeries
|
|
7
8
|
*/
|
|
8
|
-
export declare function useHeatmapSeries():
|
|
9
|
-
series: Record<import("@mui/x-charts/internals").SeriesId, import("../models").DefaultizedHeatmapSeriesType>;
|
|
10
|
-
seriesOrder: import("@mui/x-charts/internals").SeriesId[];
|
|
11
|
-
} | undefined;
|
|
9
|
+
export declare function useHeatmapSeries(): ProcessedSeries['heatmap'];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useIsZoomInteracting';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./useIsZoomInteracting.js";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useSelector, useStore } from '@mui/x-charts/internals';
|
|
4
|
+
import { selectorChartZoomIsInteracting } from "../../internals/plugins/useChartProZoom/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Get access to the zoom state.
|
|
7
|
+
*
|
|
8
|
+
* @returns {boolean} Inform the zoom is interacting.
|
|
9
|
+
*/
|
|
10
|
+
export function useIsZoomInteracting() {
|
|
11
|
+
const store = useStore();
|
|
12
|
+
const isInteracting = useSelector(store, selectorChartZoomIsInteracting);
|
|
13
|
+
return isInteracting;
|
|
14
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -22,9 +22,11 @@ export * from '@mui/x-charts/ScatterChart';
|
|
|
22
22
|
export * from '@mui/x-charts/SparkLineChart';
|
|
23
23
|
export * from '@mui/x-charts/Gauge';
|
|
24
24
|
export * from '@mui/x-charts/ChartsSurface';
|
|
25
|
+
export * from '@mui/x-charts/ChartDataProvider';
|
|
26
|
+
export * from '@mui/x-charts/ChartsLabel';
|
|
25
27
|
export * from './Heatmap';
|
|
26
28
|
export * from './ChartContainerPro';
|
|
29
|
+
export * from './ChartDataProviderPro';
|
|
27
30
|
export * from './ScatterChartPro';
|
|
28
31
|
export * from './BarChartPro';
|
|
29
32
|
export * from './LineChartPro';
|
|
30
|
-
export * from './context';
|