@mui/x-charts-pro 8.0.0-alpha.1 → 8.0.0-alpha.11
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 +75 -34
- package/BarChartPro/BarChartPro.plugins.d.ts +10 -0
- package/BarChartPro/BarChartPro.plugins.js +3 -0
- package/CHANGELOG.md +2007 -230
- package/ChartContainerPro/ChartContainerPro.d.ts +33 -5
- package/ChartContainerPro/ChartContainerPro.js +55 -37
- package/ChartContainerPro/useChartContainerProProps.d.ts +6 -5
- package/ChartContainerPro/useChartContainerProProps.js +17 -13
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +37 -0
- package/ChartDataProviderPro/ChartDataProviderPro.js +105 -0
- 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 +1 -2
- package/Heatmap/Heatmap.js +36 -13
- package/Heatmap/Heatmap.plugins.d.ts +8 -0
- package/Heatmap/Heatmap.plugins.js +2 -0
- package/Heatmap/HeatmapItem.js +1 -1
- package/Heatmap/HeatmapTooltip.js +8 -28
- 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/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 +81 -54
- package/LineChartPro/LineChartPro.plugins.d.ts +10 -0
- package/LineChartPro/LineChartPro.plugins.js +3 -0
- package/README.md +1 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +2 -2
- package/ScatterChartPro/ScatterChartPro.js +59 -34
- package/ScatterChartPro/ScatterChartPro.plugins.d.ts +10 -0
- package/ScatterChartPro/ScatterChartPro.plugins.js +3 -0
- 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 -2
- package/index.js +5 -6
- 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 +75 -34
- package/modern/BarChartPro/BarChartPro.plugins.js +3 -0
- package/modern/ChartContainerPro/ChartContainerPro.js +55 -37
- package/modern/ChartContainerPro/useChartContainerProProps.js +17 -13
- package/modern/ChartDataProviderPro/ChartDataProviderPro.js +105 -0
- package/modern/ChartDataProviderPro/useChartDataProviderProProps.js +15 -0
- package/modern/Heatmap/Heatmap.js +36 -13
- package/modern/Heatmap/Heatmap.plugins.js +2 -0
- package/modern/Heatmap/HeatmapItem.js +1 -1
- package/modern/Heatmap/HeatmapTooltip.js +8 -28
- package/modern/Heatmap/formatter.js +2 -1
- package/modern/Heatmap/heatmapClasses.js +2 -1
- package/modern/Heatmap/plugin.js +4 -2
- package/modern/Heatmap/tooltip.js +25 -0
- package/modern/LineChartPro/LineChartPro.js +81 -54
- package/modern/LineChartPro/LineChartPro.plugins.js +3 -0
- package/modern/ScatterChartPro/ScatterChartPro.js +59 -34
- package/modern/ScatterChartPro/ScatterChartPro.plugins.js +3 -0
- 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 -6
- 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 +74 -33
- package/node/BarChartPro/BarChartPro.plugins.js +9 -0
- package/node/ChartContainerPro/ChartContainerPro.js +54 -36
- package/node/ChartContainerPro/useChartContainerProProps.js +17 -13
- package/node/ChartDataProviderPro/ChartDataProviderPro.js +111 -0
- package/node/ChartDataProviderPro/useChartDataProviderProProps.js +21 -0
- package/node/Heatmap/Heatmap.js +36 -13
- package/node/Heatmap/Heatmap.plugins.js +8 -0
- package/node/Heatmap/HeatmapItem.js +2 -2
- package/node/Heatmap/HeatmapTooltip.js +6 -26
- package/node/Heatmap/formatter.js +2 -1
- package/node/Heatmap/heatmapClasses.js +5 -4
- package/node/Heatmap/plugin.js +4 -2
- package/node/Heatmap/tooltip.js +31 -0
- package/node/LineChartPro/LineChartPro.js +80 -53
- package/node/LineChartPro/LineChartPro.plugins.js +9 -0
- package/node/ScatterChartPro/ScatterChartPro.js +58 -33
- package/node/ScatterChartPro/ScatterChartPro.plugins.js +9 -0
- 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 -23
- 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 +6 -6
- 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 -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 -10
- package/context/ChartDataProviderPro/ChartDataProviderPro.js +0 -299
- 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/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 -299
- 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 -305
- 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,22 +2,23 @@
|
|
|
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
|
+
import { SCATTER_CHART_PRO_PLUGINS } from "./ScatterChartPro.plugins.js";
|
|
21
22
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
23
|
/**
|
|
23
24
|
* Demos:
|
|
@@ -35,13 +36,14 @@ const ScatterChartPro = /*#__PURE__*/React.forwardRef(function ScatterChartPro(i
|
|
|
35
36
|
name: 'MuiScatterChartPro'
|
|
36
37
|
});
|
|
37
38
|
const {
|
|
38
|
-
|
|
39
|
-
onZoomChange
|
|
39
|
+
initialZoom,
|
|
40
|
+
onZoomChange,
|
|
41
|
+
apiRef
|
|
40
42
|
} = props,
|
|
41
43
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
42
44
|
const {
|
|
45
|
+
chartsWrapperProps,
|
|
43
46
|
chartContainerProps,
|
|
44
|
-
zAxisProps,
|
|
45
47
|
voronoiHandlerProps,
|
|
46
48
|
chartsAxisProps,
|
|
47
49
|
gridProps,
|
|
@@ -51,17 +53,26 @@ const ScatterChartPro = /*#__PURE__*/React.forwardRef(function ScatterChartPro(i
|
|
|
51
53
|
axisHighlightProps,
|
|
52
54
|
children
|
|
53
55
|
} = useScatterChartProps(other);
|
|
56
|
+
const {
|
|
57
|
+
chartDataProviderProProps,
|
|
58
|
+
chartsSurfaceProps
|
|
59
|
+
} = useChartContainerProProps(_extends({}, chartContainerProps, {
|
|
60
|
+
initialZoom,
|
|
61
|
+
onZoomChange,
|
|
62
|
+
apiRef,
|
|
63
|
+
plugins: SCATTER_CHART_PRO_PLUGINS
|
|
64
|
+
}), ref);
|
|
54
65
|
const Tooltip = props.slots?.tooltip ?? ChartsTooltip;
|
|
55
|
-
return /*#__PURE__*/_jsx(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
})
|
|
66
|
+
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
67
|
+
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
68
|
+
children: [!props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
69
|
+
children: [!props.disableVoronoi && /*#__PURE__*/_jsx(ChartsVoronoiHandler, _extends({}, voronoiHandlerProps)), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsx("g", {
|
|
70
|
+
"data-drawing-container": true,
|
|
71
|
+
children: /*#__PURE__*/_jsx(ScatterPlot, _extends({}, scatterPlotProps))
|
|
72
|
+
}), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props?.slotProps?.tooltip, {
|
|
73
|
+
trigger: "item"
|
|
74
|
+
})), children]
|
|
75
|
+
}))]
|
|
65
76
|
}))
|
|
66
77
|
}));
|
|
67
78
|
});
|
|
@@ -70,6 +81,11 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
70
81
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
71
82
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
72
83
|
// ----------------------------------------------------------------------
|
|
84
|
+
apiRef: PropTypes.shape({
|
|
85
|
+
current: PropTypes.shape({
|
|
86
|
+
setZoomData: PropTypes.func.isRequired
|
|
87
|
+
})
|
|
88
|
+
}),
|
|
73
89
|
/**
|
|
74
90
|
* The configuration of axes highlight.
|
|
75
91
|
* @see See {@link https://mui.com/x/react-charts/highlighting/ highlighting docs} for more details.
|
|
@@ -89,7 +105,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
89
105
|
className: PropTypes.string,
|
|
90
106
|
/**
|
|
91
107
|
* Color palette used to colorize multiple series.
|
|
92
|
-
* @default
|
|
108
|
+
* @default rainbowSurgePalette
|
|
93
109
|
*/
|
|
94
110
|
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
95
111
|
/**
|
|
@@ -124,12 +140,26 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
124
140
|
*/
|
|
125
141
|
hideLegend: PropTypes.bool,
|
|
126
142
|
/**
|
|
127
|
-
* The
|
|
143
|
+
* The highlighted item.
|
|
144
|
+
* Used when the highlight is controlled.
|
|
128
145
|
*/
|
|
129
146
|
highlightedItem: PropTypes.shape({
|
|
130
147
|
dataIndex: PropTypes.number,
|
|
131
|
-
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
148
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
132
149
|
}),
|
|
150
|
+
/**
|
|
151
|
+
* This prop is used to help implement the accessibility logic.
|
|
152
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
153
|
+
*/
|
|
154
|
+
id: PropTypes.string,
|
|
155
|
+
/**
|
|
156
|
+
* The list of zoom data related to each axis.
|
|
157
|
+
*/
|
|
158
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
159
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
160
|
+
end: PropTypes.number.isRequired,
|
|
161
|
+
start: PropTypes.number.isRequired
|
|
162
|
+
})),
|
|
133
163
|
/**
|
|
134
164
|
* Indicate which axis to display the left of the charts.
|
|
135
165
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -145,7 +175,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
145
175
|
* The margin between the SVG and the drawing area.
|
|
146
176
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
147
177
|
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
148
|
-
* @default object Depends on the charts type.
|
|
149
178
|
*/
|
|
150
179
|
margin: PropTypes.shape({
|
|
151
180
|
bottom: PropTypes.number,
|
|
@@ -153,6 +182,13 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
153
182
|
right: PropTypes.number,
|
|
154
183
|
top: PropTypes.number
|
|
155
184
|
}),
|
|
185
|
+
/**
|
|
186
|
+
* The function called for onClick events.
|
|
187
|
+
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
188
|
+
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
|
|
189
|
+
* @param {null | AxisData} data The data about the clicked axis and items associated with it.
|
|
190
|
+
*/
|
|
191
|
+
onAxisClick: PropTypes.func,
|
|
156
192
|
/**
|
|
157
193
|
* The callback fired when the highlighted item changes.
|
|
158
194
|
*
|
|
@@ -198,6 +234,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
198
234
|
*/
|
|
199
235
|
slots: PropTypes.object,
|
|
200
236
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
237
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
201
238
|
title: PropTypes.string,
|
|
202
239
|
/**
|
|
203
240
|
* Indicate which axis to display the top of the charts.
|
|
@@ -245,7 +282,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
245
282
|
hideTooltip: PropTypes.bool,
|
|
246
283
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
247
284
|
label: PropTypes.string,
|
|
248
|
-
labelFontSize: PropTypes.number,
|
|
249
285
|
labelStyle: PropTypes.object,
|
|
250
286
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
251
287
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -256,7 +292,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
256
292
|
slots: PropTypes.object,
|
|
257
293
|
stroke: PropTypes.string,
|
|
258
294
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
259
|
-
tickFontSize: PropTypes.number,
|
|
260
295
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
261
296
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
262
297
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -308,7 +343,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
308
343
|
hideTooltip: PropTypes.bool,
|
|
309
344
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
310
345
|
label: PropTypes.string,
|
|
311
|
-
labelFontSize: PropTypes.number,
|
|
312
346
|
labelStyle: PropTypes.object,
|
|
313
347
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
314
348
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -319,7 +353,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
319
353
|
slots: PropTypes.object,
|
|
320
354
|
stroke: PropTypes.string,
|
|
321
355
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
322
|
-
tickFontSize: PropTypes.number,
|
|
323
356
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
324
357
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
325
358
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -364,14 +397,6 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
364
397
|
id: PropTypes.string,
|
|
365
398
|
max: PropTypes.number,
|
|
366
399
|
min: PropTypes.number
|
|
367
|
-
})),
|
|
368
|
-
/**
|
|
369
|
-
* The list of zoom data related to each axis.
|
|
370
|
-
*/
|
|
371
|
-
zoom: PropTypes.arrayOf(PropTypes.shape({
|
|
372
|
-
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
373
|
-
end: PropTypes.number.isRequired,
|
|
374
|
-
start: PropTypes.number.isRequired
|
|
375
400
|
}))
|
|
376
401
|
} : void 0;
|
|
377
402
|
export { ScatterChartPro };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
|
+
import { UseChartProZoomSignature } from '../internals/plugins/useChartProZoom';
|
|
3
|
+
export type ScatterChartProPluginsSignatures = [
|
|
4
|
+
UseChartZAxisSignature,
|
|
5
|
+
UseChartCartesianAxisSignature<'scatter'>,
|
|
6
|
+
UseChartInteractionSignature,
|
|
7
|
+
UseChartHighlightSignature,
|
|
8
|
+
UseChartProZoomSignature
|
|
9
|
+
];
|
|
10
|
+
export declare const SCATTER_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<ScatterChartProPluginsSignatures>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight } from '@mui/x-charts/internals';
|
|
2
|
+
import { useChartProZoom } from "../internals/plugins/useChartProZoom/index.js";
|
|
3
|
+
export const SCATTER_CHART_PRO_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProZoom];
|
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
|
@@ -14,7 +14,6 @@ export * from '@mui/x-charts/ChartsTooltip';
|
|
|
14
14
|
export * from '@mui/x-charts/ChartsLegend';
|
|
15
15
|
export * from '@mui/x-charts/ChartsAxisHighlight';
|
|
16
16
|
export * from '@mui/x-charts/ChartsVoronoiHandler';
|
|
17
|
-
export * from '@mui/x-charts/ChartsOnAxisClickHandler';
|
|
18
17
|
export * from '@mui/x-charts/BarChart';
|
|
19
18
|
export * from '@mui/x-charts/LineChart';
|
|
20
19
|
export * from '@mui/x-charts/PieChart';
|
|
@@ -22,9 +21,11 @@ export * from '@mui/x-charts/ScatterChart';
|
|
|
22
21
|
export * from '@mui/x-charts/SparkLineChart';
|
|
23
22
|
export * from '@mui/x-charts/Gauge';
|
|
24
23
|
export * from '@mui/x-charts/ChartsSurface';
|
|
24
|
+
export * from '@mui/x-charts/ChartDataProvider';
|
|
25
|
+
export * from '@mui/x-charts/ChartsLabel';
|
|
25
26
|
export * from './Heatmap';
|
|
26
27
|
export * from './ChartContainerPro';
|
|
28
|
+
export * from './ChartDataProviderPro';
|
|
27
29
|
export * from './ScatterChartPro';
|
|
28
30
|
export * from './BarChartPro';
|
|
29
31
|
export * from './LineChartPro';
|
|
30
|
-
export * from './context';
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts-pro v8.0.0-alpha.
|
|
2
|
+
* @mui/x-charts-pro v8.0.0-alpha.11
|
|
3
3
|
*
|
|
4
4
|
* @license MUI X Commercial
|
|
5
5
|
* This source code is licensed under the commercial license found in the
|
|
@@ -24,7 +24,6 @@ export * from '@mui/x-charts/ChartsTooltip';
|
|
|
24
24
|
export * from '@mui/x-charts/ChartsLegend';
|
|
25
25
|
export * from '@mui/x-charts/ChartsAxisHighlight';
|
|
26
26
|
export * from '@mui/x-charts/ChartsVoronoiHandler';
|
|
27
|
-
export * from '@mui/x-charts/ChartsOnAxisClickHandler';
|
|
28
27
|
export * from '@mui/x-charts/BarChart';
|
|
29
28
|
export * from '@mui/x-charts/LineChart';
|
|
30
29
|
export * from '@mui/x-charts/PieChart';
|
|
@@ -32,13 +31,13 @@ export * from '@mui/x-charts/ScatterChart';
|
|
|
32
31
|
export * from '@mui/x-charts/SparkLineChart';
|
|
33
32
|
export * from '@mui/x-charts/Gauge';
|
|
34
33
|
export * from '@mui/x-charts/ChartsSurface';
|
|
34
|
+
export * from '@mui/x-charts/ChartDataProvider';
|
|
35
|
+
export * from '@mui/x-charts/ChartsLabel';
|
|
35
36
|
|
|
36
37
|
// Pro components
|
|
37
38
|
export * from "./Heatmap/index.js";
|
|
38
39
|
export * from "./ChartContainerPro/index.js";
|
|
40
|
+
export * from "./ChartDataProviderPro/index.js";
|
|
39
41
|
export * from "./ScatterChartPro/index.js";
|
|
40
42
|
export * from "./BarChartPro/index.js";
|
|
41
|
-
export * from "./LineChartPro/index.js";
|
|
42
|
-
|
|
43
|
-
// Pro context
|
|
44
|
-
export * from "./context/index.js";
|
|
43
|
+
export * from "./LineChartPro/index.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature } from '@mui/x-charts/internals';
|
|
2
|
+
import { UseChartProZoomSignature } from './useChartProZoom';
|
|
3
|
+
export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [
|
|
4
|
+
UseChartZAxisSignature,
|
|
5
|
+
UseChartCartesianAxisSignature<TSeries>,
|
|
6
|
+
UseChartInteractionSignature,
|
|
7
|
+
UseChartHighlightSignature,
|
|
8
|
+
UseChartProZoomSignature
|
|
9
|
+
];
|
|
10
|
+
export type AllPluginsType<TSeries extends ChartSeriesType = ChartSeriesType> = ConvertSignaturesIntoPlugins<AllPluginSignatures<TSeries>>;
|
|
11
|
+
export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>>)[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This file should be removed after creating all plugins in favor of a file per chart type.
|
|
2
|
+
|
|
3
|
+
import { useChartCartesianAxis, useChartInteraction, useChartZAxis, useChartHighlight } from '@mui/x-charts/internals';
|
|
4
|
+
import { useChartProZoom } from "./useChartProZoom/index.js";
|
|
5
|
+
export const ALL_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartProZoom];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AxisId, DefaultizedZoomOptions } from '@mui/x-charts/internals';
|
|
2
|
+
import { AxisConfig, ChartsXAxisProps, ChartsYAxisProps, ScaleName } from '@mui/x-charts/models';
|
|
3
|
+
export declare const creatZoomLookup: (axisDirection: "x" | "y") => (axes: AxisConfig<ScaleName, any, ChartsXAxisProps | ChartsYAxisProps>[]) => Record<AxisId, DefaultizedZoomOptions>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defaultizeZoom } from "./defaultizeZoom.js";
|
|
2
|
+
export const creatZoomLookup = axisDirection => axes => axes.reduce((acc, v) => {
|
|
3
|
+
const {
|
|
4
|
+
zoom,
|
|
5
|
+
id: axisId
|
|
6
|
+
} = v;
|
|
7
|
+
const defaultizedZoom = defaultizeZoom(zoom, axisId, axisDirection);
|
|
8
|
+
if (defaultizedZoom) {
|
|
9
|
+
acc[axisId] = defaultizedZoom;
|
|
10
|
+
}
|
|
11
|
+
return acc;
|
|
12
|
+
}, {});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
const defaultZoomOptions = {
|
|
3
|
+
minStart: 0,
|
|
4
|
+
maxEnd: 100,
|
|
5
|
+
step: 5,
|
|
6
|
+
minSpan: 10,
|
|
7
|
+
maxSpan: 100,
|
|
8
|
+
panning: true,
|
|
9
|
+
filterMode: 'keep'
|
|
10
|
+
};
|
|
11
|
+
export const defaultizeZoom = (zoom, axisId, axisDirection) => {
|
|
12
|
+
if (!zoom) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
if (zoom === true) {
|
|
16
|
+
return _extends({
|
|
17
|
+
axisId,
|
|
18
|
+
axisDirection
|
|
19
|
+
}, defaultZoomOptions);
|
|
20
|
+
}
|
|
21
|
+
return _extends({
|
|
22
|
+
axisId,
|
|
23
|
+
axisDirection
|
|
24
|
+
}, defaultZoomOptions, zoom);
|
|
25
|
+
};
|