@mui/x-charts-pro 8.0.0-alpha.7 → 8.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChartPro/BarChartPro.d.ts +2 -2
- package/BarChartPro/BarChartPro.js +55 -19
- package/CHANGELOG.md +115 -0
- package/ChartContainerPro/ChartContainerPro.d.ts +32 -4
- package/ChartContainerPro/ChartContainerPro.js +53 -18
- package/ChartContainerPro/useChartContainerProProps.d.ts +5 -5
- package/ChartContainerPro/useChartContainerProProps.js +11 -5
- package/Heatmap/Heatmap.js +28 -2
- package/Heatmap/HeatmapTooltip.js +6 -4
- package/Heatmap/extremums.d.ts +2 -2
- package/Heatmap/formatter.d.ts +2 -2
- package/Heatmap/formatter.js +2 -1
- package/Heatmap/plugin.d.ts +2 -2
- package/Heatmap/plugin.js +1 -2
- package/LineChartPro/LineChartPro.d.ts +2 -2
- package/LineChartPro/LineChartPro.js +57 -25
- package/ScatterChartPro/ScatterChartPro.d.ts +2 -2
- package/ScatterChartPro/ScatterChartPro.js +37 -28
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +2 -1
- package/hooks/zoom/index.d.ts +1 -0
- package/hooks/zoom/index.js +1 -0
- package/hooks/zoom/useIsZoomInteracting.d.ts +6 -0
- package/hooks/zoom/useIsZoomInteracting.js +14 -0
- package/index.d.ts +0 -1
- package/index.js +2 -5
- package/internals/plugins/allPlugins.d.ts +10 -0
- package/internals/plugins/allPlugins.js +5 -0
- package/internals/plugins/useChartProZoom/defaultizeZoom.d.ts +2 -0
- package/internals/plugins/useChartProZoom/defaultizeZoom.js +25 -0
- package/internals/plugins/useChartProZoom/index.d.ts +3 -0
- package/internals/plugins/useChartProZoom/index.js +3 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +3 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.js +324 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +149 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +6 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +54 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.d.ts +45 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.utils.js +126 -0
- package/internals/plugins/useChartProZoom/zoom.types.d.ts +53 -0
- package/internals/utils/releaseInfo.js +1 -1
- package/models/index.d.ts +1 -0
- package/models/index.js +2 -1
- package/modern/BarChartPro/BarChartPro.js +55 -19
- package/modern/ChartContainerPro/ChartContainerPro.js +53 -18
- package/modern/ChartContainerPro/useChartContainerProProps.js +11 -5
- package/modern/Heatmap/Heatmap.js +28 -2
- package/modern/Heatmap/HeatmapTooltip.js +6 -4
- package/modern/Heatmap/formatter.js +2 -1
- package/modern/Heatmap/plugin.js +1 -2
- package/modern/LineChartPro/LineChartPro.js +57 -25
- package/modern/ScatterChartPro/ScatterChartPro.js +37 -28
- package/modern/hooks/index.js +2 -1
- package/modern/hooks/zoom/index.js +1 -0
- package/modern/hooks/zoom/useIsZoomInteracting.js +14 -0
- package/modern/index.js +2 -5
- package/modern/internals/plugins/allPlugins.js +5 -0
- package/modern/internals/plugins/useChartProZoom/defaultizeZoom.js +25 -0
- package/modern/internals/plugins/useChartProZoom/index.js +3 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.js +324 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +6 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.types.js +1 -0
- package/modern/internals/plugins/useChartProZoom/useChartProZoom.utils.js +126 -0
- package/modern/internals/plugins/useChartProZoom/zoom.types.js +1 -0
- package/modern/internals/utils/releaseInfo.js +1 -1
- package/modern/models/index.js +2 -1
- package/node/BarChartPro/BarChartPro.js +55 -19
- package/node/ChartContainerPro/ChartContainerPro.js +53 -18
- package/node/ChartContainerPro/useChartContainerProProps.js +11 -5
- package/node/Heatmap/Heatmap.js +28 -2
- package/node/Heatmap/HeatmapTooltip.js +4 -2
- package/node/Heatmap/formatter.js +2 -1
- package/node/Heatmap/plugin.js +1 -2
- package/node/LineChartPro/LineChartPro.js +57 -25
- package/node/ScatterChartPro/ScatterChartPro.js +36 -27
- package/node/hooks/index.js +16 -1
- package/node/{context/CartesianProviderPro → hooks/zoom}/index.js +4 -4
- package/node/hooks/zoom/useIsZoomInteracting.js +19 -0
- package/node/index.js +1 -12
- package/node/internals/plugins/allPlugins.js +11 -0
- package/node/internals/plugins/useChartProZoom/defaultizeZoom.js +33 -0
- package/node/internals/plugins/useChartProZoom/index.js +38 -0
- package/node/internals/plugins/useChartProZoom/useChartProZoom.js +331 -0
- package/node/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +13 -0
- package/node/internals/plugins/useChartProZoom/useChartProZoom.utils.js +140 -0
- package/node/internals/plugins/useChartProZoom/zoom.types.js +5 -0
- package/node/internals/utils/releaseInfo.js +1 -1
- package/package.json +5 -5
- package/typeOverloads/modules.d.ts +8 -1
- package/context/CartesianProviderPro/CartesianProviderPro.d.ts +0 -6
- package/context/CartesianProviderPro/CartesianProviderPro.js +0 -89
- package/context/CartesianProviderPro/createAxisFilterMapper.d.ts +0 -13
- package/context/CartesianProviderPro/createAxisFilterMapper.js +0 -60
- package/context/CartesianProviderPro/index.d.ts +0 -1
- package/context/CartesianProviderPro/index.js +0 -1
- package/context/ChartDataProviderPro/ChartDataProviderPro.d.ts +0 -7
- package/context/ChartDataProviderPro/ChartDataProviderPro.js +0 -50
- package/context/ChartDataProviderPro/index.d.ts +0 -1
- package/context/ChartDataProviderPro/index.js +0 -1
- package/context/ChartDataProviderPro/useChartDataProviderProProps.d.ts +0 -14
- package/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -43
- package/context/ZoomProvider/Zoom.types.d.ts +0 -144
- package/context/ZoomProvider/ZoomContext.d.ts +0 -4
- package/context/ZoomProvider/ZoomContext.js +0 -16
- package/context/ZoomProvider/ZoomProvider.d.ts +0 -3
- package/context/ZoomProvider/ZoomProvider.js +0 -56
- package/context/ZoomProvider/ZoomSetup.d.ts +0 -9
- package/context/ZoomProvider/ZoomSetup.js +0 -16
- package/context/ZoomProvider/defaultizeZoom.d.ts +0 -2
- package/context/ZoomProvider/defaultizeZoom.js +0 -32
- package/context/ZoomProvider/index.d.ts +0 -3
- package/context/ZoomProvider/index.js +0 -3
- package/context/ZoomProvider/initializeZoomData.d.ts +0 -6
- package/context/ZoomProvider/initializeZoomData.js +0 -13
- package/context/ZoomProvider/useSetupPan.d.ts +0 -1
- package/context/ZoomProvider/useSetupPan.js +0 -106
- package/context/ZoomProvider/useSetupZoom.d.ts +0 -1
- package/context/ZoomProvider/useSetupZoom.js +0 -274
- package/context/ZoomProvider/useZoom.d.ts +0 -7
- package/context/ZoomProvider/useZoom.js +0 -19
- package/context/index.d.ts +0 -3
- package/context/index.js +0 -5
- package/context/package.json +0 -6
- package/modern/context/CartesianProviderPro/CartesianProviderPro.js +0 -89
- package/modern/context/CartesianProviderPro/createAxisFilterMapper.js +0 -60
- package/modern/context/CartesianProviderPro/index.js +0 -1
- package/modern/context/ChartDataProviderPro/ChartDataProviderPro.js +0 -50
- package/modern/context/ChartDataProviderPro/index.js +0 -1
- package/modern/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -43
- package/modern/context/ZoomProvider/ZoomContext.js +0 -16
- package/modern/context/ZoomProvider/ZoomProvider.js +0 -56
- package/modern/context/ZoomProvider/ZoomSetup.js +0 -16
- package/modern/context/ZoomProvider/defaultizeZoom.js +0 -32
- package/modern/context/ZoomProvider/index.js +0 -3
- package/modern/context/ZoomProvider/initializeZoomData.js +0 -13
- package/modern/context/ZoomProvider/useSetupPan.js +0 -106
- package/modern/context/ZoomProvider/useSetupZoom.js +0 -274
- package/modern/context/ZoomProvider/useZoom.js +0 -19
- package/modern/context/index.js +0 -5
- package/node/context/CartesianProviderPro/CartesianProviderPro.js +0 -95
- package/node/context/CartesianProviderPro/createAxisFilterMapper.js +0 -68
- package/node/context/ChartDataProviderPro/ChartDataProviderPro.js +0 -56
- package/node/context/ChartDataProviderPro/index.js +0 -16
- package/node/context/ChartDataProviderPro/useChartDataProviderProProps.js +0 -50
- package/node/context/ZoomProvider/ZoomContext.js +0 -23
- package/node/context/ZoomProvider/ZoomProvider.js +0 -63
- package/node/context/ZoomProvider/ZoomSetup.js +0 -20
- package/node/context/ZoomProvider/defaultizeZoom.js +0 -40
- package/node/context/ZoomProvider/index.js +0 -38
- package/node/context/ZoomProvider/initializeZoomData.js +0 -20
- package/node/context/ZoomProvider/useSetupPan.js +0 -114
- package/node/context/ZoomProvider/useSetupZoom.js +0 -281
- package/node/context/ZoomProvider/useZoom.js +0 -25
- package/node/context/index.js +0 -27
- /package/{context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
- /package/{modern/context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/zoom.types.js} +0 -0
- /package/node/{context/ZoomProvider/Zoom.types.js → internals/plugins/useChartProZoom/useChartProZoom.types.js} +0 -0
package/node/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.8
|
|
3
3
|
*
|
|
4
4
|
* @license MUI X Commercial
|
|
5
5
|
* This source code is licensed under the commercial license found in the
|
|
@@ -329,15 +329,4 @@ Object.keys(_LineChartPro).forEach(function (key) {
|
|
|
329
329
|
return _LineChartPro[key];
|
|
330
330
|
}
|
|
331
331
|
});
|
|
332
|
-
});
|
|
333
|
-
var _context2 = require("./context");
|
|
334
|
-
Object.keys(_context2).forEach(function (key) {
|
|
335
|
-
if (key === "default" || key === "__esModule") return;
|
|
336
|
-
if (key in exports && exports[key] === _context2[key]) return;
|
|
337
|
-
Object.defineProperty(exports, key, {
|
|
338
|
-
enumerable: true,
|
|
339
|
-
get: function () {
|
|
340
|
-
return _context2[key];
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
332
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ALL_PLUGINS = void 0;
|
|
7
|
+
var _internals = require("@mui/x-charts/internals");
|
|
8
|
+
var _useChartProZoom = require("./useChartProZoom");
|
|
9
|
+
// This file should be removed after creating all plugins in favor of a file per chart type.
|
|
10
|
+
|
|
11
|
+
const ALL_PLUGINS = exports.ALL_PLUGINS = [_internals.useChartZAxis, _internals.useChartCartesianAxis, _internals.useChartInteraction, _useChartProZoom.useChartProZoom];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.defaultizeZoom = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
const defaultZoomOptions = {
|
|
10
|
+
minStart: 0,
|
|
11
|
+
maxEnd: 100,
|
|
12
|
+
step: 5,
|
|
13
|
+
minSpan: 10,
|
|
14
|
+
maxSpan: 100,
|
|
15
|
+
panning: true,
|
|
16
|
+
filterMode: 'keep'
|
|
17
|
+
};
|
|
18
|
+
const defaultizeZoom = (zoom, axisId, axisDirection) => {
|
|
19
|
+
if (!zoom) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
if (zoom === true) {
|
|
23
|
+
return (0, _extends2.default)({
|
|
24
|
+
axisId,
|
|
25
|
+
axisDirection
|
|
26
|
+
}, defaultZoomOptions);
|
|
27
|
+
}
|
|
28
|
+
return (0, _extends2.default)({
|
|
29
|
+
axisId,
|
|
30
|
+
axisDirection
|
|
31
|
+
}, defaultZoomOptions, zoom);
|
|
32
|
+
};
|
|
33
|
+
exports.defaultizeZoom = defaultizeZoom;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _useChartProZoom = require("./useChartProZoom.selectors");
|
|
7
|
+
Object.keys(_useChartProZoom).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _useChartProZoom[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _useChartProZoom[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _useChartProZoom2 = require("./useChartProZoom");
|
|
18
|
+
Object.keys(_useChartProZoom2).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _useChartProZoom2[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _useChartProZoom2[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _useChartProZoom3 = require("./useChartProZoom.types");
|
|
29
|
+
Object.keys(_useChartProZoom3).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _useChartProZoom3[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _useChartProZoom3[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.useChartProZoom = void 0;
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _internals = require("@mui/x-charts/internals");
|
|
13
|
+
var _defaultizeZoom = require("./defaultizeZoom");
|
|
14
|
+
var _useChartProZoom = require("./useChartProZoom.utils");
|
|
15
|
+
var _useChartProZoom2 = require("./useChartProZoom.selectors");
|
|
16
|
+
// It is helpful to avoid the need to provide the possibly auto-generated id for each axis.
|
|
17
|
+
function initializeZoomData(options) {
|
|
18
|
+
return Object.values(options).map(({
|
|
19
|
+
axisId,
|
|
20
|
+
minStart: start,
|
|
21
|
+
maxEnd: end
|
|
22
|
+
}) => ({
|
|
23
|
+
axisId,
|
|
24
|
+
start,
|
|
25
|
+
end
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
const useChartProZoom = ({
|
|
29
|
+
store,
|
|
30
|
+
instance,
|
|
31
|
+
svgRef,
|
|
32
|
+
params
|
|
33
|
+
}) => {
|
|
34
|
+
const drawingArea = (0, _internals.useSelector)(store, _internals.selectorChartDrawingArea);
|
|
35
|
+
const optionsLookup = (0, _internals.useSelector)(store, _useChartProZoom2.selectorChartZoomOptionsLookup);
|
|
36
|
+
const isZoomEnabled = Object.keys(optionsLookup).length > 0;
|
|
37
|
+
|
|
38
|
+
// Add events
|
|
39
|
+
const panningEventCacheRef = React.useRef([]);
|
|
40
|
+
const zoomEventCacheRef = React.useRef([]);
|
|
41
|
+
const eventPrevDiff = React.useRef(0);
|
|
42
|
+
const interactionTimeoutRef = React.useRef(undefined);
|
|
43
|
+
const setIsInteracting = React.useCallback(isInteracting => {
|
|
44
|
+
store.update(prev => (0, _extends2.default)({}, prev, {
|
|
45
|
+
zoom: (0, _extends2.default)({}, prev.zoom, {
|
|
46
|
+
isInteracting
|
|
47
|
+
})
|
|
48
|
+
}));
|
|
49
|
+
}, [store]);
|
|
50
|
+
const setZoomDataCallback = React.useCallback(zoomData => {
|
|
51
|
+
store.update(prevState => {
|
|
52
|
+
const newZoomData = typeof zoomData === 'function' ? zoomData(prevState.zoom.zoomData) : zoomData;
|
|
53
|
+
params.onZoomChange?.(newZoomData);
|
|
54
|
+
return (0, _extends2.default)({}, prevState, {
|
|
55
|
+
zoom: (0, _extends2.default)({}, prevState.zoom, {
|
|
56
|
+
zoomData: newZoomData
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}, [params, store]);
|
|
61
|
+
|
|
62
|
+
// Add event for chart panning
|
|
63
|
+
const isPanEnabled = React.useMemo(() => Object.values(optionsLookup).some(v => v.panning) || false, [optionsLookup]);
|
|
64
|
+
const isDraggingRef = React.useRef(false);
|
|
65
|
+
const touchStartRef = React.useRef(null);
|
|
66
|
+
React.useEffect(() => {
|
|
67
|
+
const element = svgRef.current;
|
|
68
|
+
if (element === null || !isPanEnabled) {
|
|
69
|
+
return () => {};
|
|
70
|
+
}
|
|
71
|
+
const handlePan = event => {
|
|
72
|
+
if (element === null || !isDraggingRef.current || panningEventCacheRef.current.length > 1) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (touchStartRef.current == null) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const point = (0, _internals.getSVGPoint)(element, event);
|
|
79
|
+
const movementX = point.x - touchStartRef.current.x;
|
|
80
|
+
const movementY = (point.y - touchStartRef.current.y) * -1;
|
|
81
|
+
const newZoomData = touchStartRef.current.zoomData.map(zoom => {
|
|
82
|
+
const options = optionsLookup[zoom.axisId];
|
|
83
|
+
if (!options || !options.panning) {
|
|
84
|
+
return zoom;
|
|
85
|
+
}
|
|
86
|
+
const min = zoom.start;
|
|
87
|
+
const max = zoom.end;
|
|
88
|
+
const span = max - min;
|
|
89
|
+
const MIN_PERCENT = options.minStart;
|
|
90
|
+
const MAX_PERCENT = options.maxEnd;
|
|
91
|
+
const movement = options.axisDirection === 'x' ? movementX : movementY;
|
|
92
|
+
const dimension = options.axisDirection === 'x' ? drawingArea.width : drawingArea.height;
|
|
93
|
+
let newMinPercent = min - movement / dimension * span;
|
|
94
|
+
let newMaxPercent = max - movement / dimension * span;
|
|
95
|
+
if (newMinPercent < MIN_PERCENT) {
|
|
96
|
+
newMinPercent = MIN_PERCENT;
|
|
97
|
+
newMaxPercent = newMinPercent + span;
|
|
98
|
+
}
|
|
99
|
+
if (newMaxPercent > MAX_PERCENT) {
|
|
100
|
+
newMaxPercent = MAX_PERCENT;
|
|
101
|
+
newMinPercent = newMaxPercent - span;
|
|
102
|
+
}
|
|
103
|
+
if (newMinPercent < MIN_PERCENT || newMaxPercent > MAX_PERCENT || span < options.minSpan || span > options.maxSpan) {
|
|
104
|
+
return zoom;
|
|
105
|
+
}
|
|
106
|
+
return (0, _extends2.default)({}, zoom, {
|
|
107
|
+
start: newMinPercent,
|
|
108
|
+
end: newMaxPercent
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
setZoomDataCallback(newZoomData);
|
|
112
|
+
};
|
|
113
|
+
const handleDown = event => {
|
|
114
|
+
panningEventCacheRef.current.push(event);
|
|
115
|
+
const point = (0, _internals.getSVGPoint)(element, event);
|
|
116
|
+
if (!instance.isPointInside(point)) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
// If there is only one pointer, prevent selecting text
|
|
120
|
+
if (panningEventCacheRef.current.length === 1) {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
}
|
|
123
|
+
isDraggingRef.current = true;
|
|
124
|
+
setIsInteracting(true);
|
|
125
|
+
touchStartRef.current = {
|
|
126
|
+
x: point.x,
|
|
127
|
+
y: point.y,
|
|
128
|
+
zoomData: store.getSnapshot().zoom.zoomData
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
const handleUp = event => {
|
|
132
|
+
panningEventCacheRef.current.splice(panningEventCacheRef.current.findIndex(cachedEvent => cachedEvent.pointerId === event.pointerId), 1);
|
|
133
|
+
setIsInteracting(false);
|
|
134
|
+
isDraggingRef.current = false;
|
|
135
|
+
touchStartRef.current = null;
|
|
136
|
+
};
|
|
137
|
+
element.addEventListener('pointerdown', handleDown);
|
|
138
|
+
document.addEventListener('pointermove', handlePan);
|
|
139
|
+
document.addEventListener('pointerup', handleUp);
|
|
140
|
+
document.addEventListener('pointercancel', handleUp);
|
|
141
|
+
document.addEventListener('pointerleave', handleUp);
|
|
142
|
+
return () => {
|
|
143
|
+
element.removeEventListener('pointerdown', handleDown);
|
|
144
|
+
document.removeEventListener('pointermove', handlePan);
|
|
145
|
+
document.removeEventListener('pointerup', handleUp);
|
|
146
|
+
document.removeEventListener('pointercancel', handleUp);
|
|
147
|
+
document.removeEventListener('pointerleave', handleUp);
|
|
148
|
+
};
|
|
149
|
+
}, [instance, svgRef, isDraggingRef, setIsInteracting, isPanEnabled, optionsLookup, drawingArea.width, drawingArea.height, setZoomDataCallback, store]);
|
|
150
|
+
|
|
151
|
+
// Add event for chart zoom in/out
|
|
152
|
+
React.useEffect(() => {
|
|
153
|
+
const element = svgRef.current;
|
|
154
|
+
if (element === null || !isZoomEnabled) {
|
|
155
|
+
return () => {};
|
|
156
|
+
}
|
|
157
|
+
const wheelHandler = event => {
|
|
158
|
+
if (element === null) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const point = (0, _internals.getSVGPoint)(element, event);
|
|
162
|
+
if (!instance.isPointInside(point)) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
event.preventDefault();
|
|
166
|
+
if (interactionTimeoutRef.current) {
|
|
167
|
+
clearTimeout(interactionTimeoutRef.current);
|
|
168
|
+
}
|
|
169
|
+
setIsInteracting(true);
|
|
170
|
+
// Debounce transition to `isInteractive=false`.
|
|
171
|
+
// Useful because wheel events don't have an "end" event.
|
|
172
|
+
interactionTimeoutRef.current = window.setTimeout(() => {
|
|
173
|
+
setIsInteracting(false);
|
|
174
|
+
}, 166);
|
|
175
|
+
setZoomDataCallback(prevZoomData => {
|
|
176
|
+
return prevZoomData.map(zoom => {
|
|
177
|
+
const option = optionsLookup[zoom.axisId];
|
|
178
|
+
if (!option) {
|
|
179
|
+
return zoom;
|
|
180
|
+
}
|
|
181
|
+
const centerRatio = option.axisDirection === 'x' ? (0, _useChartProZoom.getHorizontalCenterRatio)(point, drawingArea) : (0, _useChartProZoom.getVerticalCenterRatio)(point, drawingArea);
|
|
182
|
+
const {
|
|
183
|
+
scaleRatio,
|
|
184
|
+
isZoomIn
|
|
185
|
+
} = (0, _useChartProZoom.getWheelScaleRatio)(event, option.step);
|
|
186
|
+
const [newMinRange, newMaxRange] = (0, _useChartProZoom.zoomAtPoint)(centerRatio, scaleRatio, zoom, option);
|
|
187
|
+
if (!(0, _useChartProZoom.isSpanValid)(newMinRange, newMaxRange, isZoomIn, option)) {
|
|
188
|
+
return zoom;
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
axisId: zoom.axisId,
|
|
192
|
+
start: newMinRange,
|
|
193
|
+
end: newMaxRange
|
|
194
|
+
};
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
function pointerDownHandler(event) {
|
|
199
|
+
zoomEventCacheRef.current.push(event);
|
|
200
|
+
setIsInteracting(true);
|
|
201
|
+
}
|
|
202
|
+
function pointerMoveHandler(event) {
|
|
203
|
+
if (element === null) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
const index = zoomEventCacheRef.current.findIndex(cachedEv => cachedEv.pointerId === event.pointerId);
|
|
207
|
+
zoomEventCacheRef.current[index] = event;
|
|
208
|
+
|
|
209
|
+
// Not a pinch gesture
|
|
210
|
+
if (zoomEventCacheRef.current.length !== 2) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const firstEvent = zoomEventCacheRef.current[0];
|
|
214
|
+
const curDiff = (0, _useChartProZoom.getDiff)(zoomEventCacheRef.current);
|
|
215
|
+
setZoomDataCallback(prevZoomData => {
|
|
216
|
+
const newZoomData = prevZoomData.map(zoom => {
|
|
217
|
+
const option = optionsLookup[zoom.axisId];
|
|
218
|
+
if (!option) {
|
|
219
|
+
return zoom;
|
|
220
|
+
}
|
|
221
|
+
const {
|
|
222
|
+
scaleRatio,
|
|
223
|
+
isZoomIn
|
|
224
|
+
} = (0, _useChartProZoom.getPinchScaleRatio)(curDiff, eventPrevDiff.current, option.step);
|
|
225
|
+
|
|
226
|
+
// If the scale ratio is 0, it means the pinch gesture is not valid.
|
|
227
|
+
if (scaleRatio === 0) {
|
|
228
|
+
return zoom;
|
|
229
|
+
}
|
|
230
|
+
const point = (0, _internals.getSVGPoint)(element, firstEvent);
|
|
231
|
+
const centerRatio = option.axisDirection === 'x' ? (0, _useChartProZoom.getHorizontalCenterRatio)(point, drawingArea) : (0, _useChartProZoom.getVerticalCenterRatio)(point, drawingArea);
|
|
232
|
+
const [newMinRange, newMaxRange] = (0, _useChartProZoom.zoomAtPoint)(centerRatio, scaleRatio, zoom, option);
|
|
233
|
+
if (!(0, _useChartProZoom.isSpanValid)(newMinRange, newMaxRange, isZoomIn, option)) {
|
|
234
|
+
return zoom;
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
axisId: zoom.axisId,
|
|
238
|
+
start: newMinRange,
|
|
239
|
+
end: newMaxRange
|
|
240
|
+
};
|
|
241
|
+
});
|
|
242
|
+
eventPrevDiff.current = curDiff;
|
|
243
|
+
return newZoomData;
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
function pointerUpHandler(event) {
|
|
247
|
+
zoomEventCacheRef.current.splice(zoomEventCacheRef.current.findIndex(cachedEvent => cachedEvent.pointerId === event.pointerId), 1);
|
|
248
|
+
if (zoomEventCacheRef.current.length < 2) {
|
|
249
|
+
eventPrevDiff.current = 0;
|
|
250
|
+
}
|
|
251
|
+
if (event.type === 'pointerup' || event.type === 'pointercancel') {
|
|
252
|
+
setIsInteracting(false);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
element.addEventListener('wheel', wheelHandler);
|
|
256
|
+
element.addEventListener('pointerdown', pointerDownHandler);
|
|
257
|
+
element.addEventListener('pointermove', pointerMoveHandler);
|
|
258
|
+
element.addEventListener('pointerup', pointerUpHandler);
|
|
259
|
+
element.addEventListener('pointercancel', pointerUpHandler);
|
|
260
|
+
element.addEventListener('pointerout', pointerUpHandler);
|
|
261
|
+
element.addEventListener('pointerleave', pointerUpHandler);
|
|
262
|
+
|
|
263
|
+
// Prevent zooming the entire page on touch devices
|
|
264
|
+
element.addEventListener('touchstart', _useChartProZoom.preventDefault);
|
|
265
|
+
element.addEventListener('touchmove', _useChartProZoom.preventDefault);
|
|
266
|
+
return () => {
|
|
267
|
+
element.removeEventListener('wheel', wheelHandler);
|
|
268
|
+
element.removeEventListener('pointerdown', pointerDownHandler);
|
|
269
|
+
element.removeEventListener('pointermove', pointerMoveHandler);
|
|
270
|
+
element.removeEventListener('pointerup', pointerUpHandler);
|
|
271
|
+
element.removeEventListener('pointercancel', pointerUpHandler);
|
|
272
|
+
element.removeEventListener('pointerout', pointerUpHandler);
|
|
273
|
+
element.removeEventListener('pointerleave', pointerUpHandler);
|
|
274
|
+
element.removeEventListener('touchstart', _useChartProZoom.preventDefault);
|
|
275
|
+
element.removeEventListener('touchmove', _useChartProZoom.preventDefault);
|
|
276
|
+
if (interactionTimeoutRef.current) {
|
|
277
|
+
clearTimeout(interactionTimeoutRef.current);
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
}, [svgRef, drawingArea, isZoomEnabled, optionsLookup, setIsInteracting, instance, setZoomDataCallback]);
|
|
281
|
+
return {
|
|
282
|
+
publicAPI: {
|
|
283
|
+
setZoomData: setZoomDataCallback
|
|
284
|
+
},
|
|
285
|
+
instance: {
|
|
286
|
+
setZoomData: setZoomDataCallback
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
exports.useChartProZoom = useChartProZoom;
|
|
291
|
+
useChartProZoom.params = {
|
|
292
|
+
initialZoom: true,
|
|
293
|
+
onZoomChange: true
|
|
294
|
+
};
|
|
295
|
+
useChartProZoom.getDefaultizedParams = ({
|
|
296
|
+
params
|
|
297
|
+
}) => {
|
|
298
|
+
const optionsLookup = (0, _extends2.default)({}, params.defaultizedXAxis.reduce((acc, v) => {
|
|
299
|
+
const {
|
|
300
|
+
zoom,
|
|
301
|
+
id: axisId
|
|
302
|
+
} = v;
|
|
303
|
+
const defaultizedZoom = (0, _defaultizeZoom.defaultizeZoom)(zoom, axisId, 'x');
|
|
304
|
+
if (defaultizedZoom) {
|
|
305
|
+
acc[axisId] = defaultizedZoom;
|
|
306
|
+
}
|
|
307
|
+
return acc;
|
|
308
|
+
}, {}), params.defaultizedYAxis.reduce((acc, v) => {
|
|
309
|
+
const {
|
|
310
|
+
zoom,
|
|
311
|
+
id: axisId
|
|
312
|
+
} = v;
|
|
313
|
+
const defaultizedZoom = (0, _defaultizeZoom.defaultizeZoom)(zoom, axisId, 'y');
|
|
314
|
+
if (defaultizedZoom) {
|
|
315
|
+
acc[axisId] = defaultizedZoom;
|
|
316
|
+
}
|
|
317
|
+
return acc;
|
|
318
|
+
}, {}));
|
|
319
|
+
return (0, _extends2.default)({}, params, {
|
|
320
|
+
optionsLookup
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
useChartProZoom.getInitialState = params => {
|
|
324
|
+
return {
|
|
325
|
+
zoom: {
|
|
326
|
+
optionsLookup: params.optionsLookup,
|
|
327
|
+
zoomData: params.initialZoom === undefined ? initializeZoomData(params.optionsLookup) : params.initialZoom,
|
|
328
|
+
isInteracting: false
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.selectorChartZoomState = exports.selectorChartZoomOptionsLookup = exports.selectorChartZoomIsInteracting = exports.selectorChartZoomIsEnabled = exports.selectorChartZoomData = void 0;
|
|
7
|
+
var _internals = require("@mui/x-charts/internals");
|
|
8
|
+
const selectorChartZoomState = state => state.zoom;
|
|
9
|
+
exports.selectorChartZoomState = selectorChartZoomState;
|
|
10
|
+
const selectorChartZoomOptionsLookup = exports.selectorChartZoomOptionsLookup = (0, _internals.createSelector)(selectorChartZoomState, zoom => zoom.optionsLookup);
|
|
11
|
+
const selectorChartZoomData = exports.selectorChartZoomData = (0, _internals.createSelector)(selectorChartZoomState, zoom => zoom.zoomData);
|
|
12
|
+
const selectorChartZoomIsInteracting = exports.selectorChartZoomIsInteracting = (0, _internals.createSelector)(selectorChartZoomState, zoom => zoom.isInteracting);
|
|
13
|
+
const selectorChartZoomIsEnabled = exports.selectorChartZoomIsEnabled = (0, _internals.createSelector)(selectorChartZoomOptionsLookup, optionsLookup => Object.keys(optionsLookup).length > 0);
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getDiff = getDiff;
|
|
7
|
+
exports.getHorizontalCenterRatio = getHorizontalCenterRatio;
|
|
8
|
+
exports.getPinchScaleRatio = getPinchScaleRatio;
|
|
9
|
+
exports.getVerticalCenterRatio = getVerticalCenterRatio;
|
|
10
|
+
exports.getWheelScaleRatio = getWheelScaleRatio;
|
|
11
|
+
exports.isSpanValid = isSpanValid;
|
|
12
|
+
exports.preventDefault = preventDefault;
|
|
13
|
+
exports.zoomAtPoint = void 0;
|
|
14
|
+
/**
|
|
15
|
+
* Helper to get the range (in percents of a reference range) corresponding to a given scale.
|
|
16
|
+
* @param centerRatio {number} The ratio of the point that should not move between the previous and next range.
|
|
17
|
+
* @param scaleRatio {number} The target scale ratio.
|
|
18
|
+
* @returns The range to display.
|
|
19
|
+
*/
|
|
20
|
+
const zoomAtPoint = (centerRatio, scaleRatio, currentZoomData, options) => {
|
|
21
|
+
const MIN_RANGE = options.minStart;
|
|
22
|
+
const MAX_RANGE = options.maxEnd;
|
|
23
|
+
const MIN_ALLOWED_SPAN = options.minSpan;
|
|
24
|
+
const minRange = currentZoomData.start;
|
|
25
|
+
const maxRange = currentZoomData.end;
|
|
26
|
+
const point = minRange + centerRatio * (maxRange - minRange);
|
|
27
|
+
let newMinRange = (minRange + point * (scaleRatio - 1)) / scaleRatio;
|
|
28
|
+
let newMaxRange = (maxRange + point * (scaleRatio - 1)) / scaleRatio;
|
|
29
|
+
let minSpillover = 0;
|
|
30
|
+
let maxSpillover = 0;
|
|
31
|
+
if (newMinRange < MIN_RANGE) {
|
|
32
|
+
minSpillover = Math.abs(newMinRange);
|
|
33
|
+
newMinRange = MIN_RANGE;
|
|
34
|
+
}
|
|
35
|
+
if (newMaxRange > MAX_RANGE) {
|
|
36
|
+
maxSpillover = Math.abs(newMaxRange - MAX_RANGE);
|
|
37
|
+
newMaxRange = MAX_RANGE;
|
|
38
|
+
}
|
|
39
|
+
if (minSpillover > 0 && maxSpillover > 0) {
|
|
40
|
+
return [MIN_RANGE, MAX_RANGE];
|
|
41
|
+
}
|
|
42
|
+
newMaxRange += minSpillover;
|
|
43
|
+
newMinRange -= maxSpillover;
|
|
44
|
+
newMinRange = Math.min(MAX_RANGE - MIN_ALLOWED_SPAN, Math.max(MIN_RANGE, newMinRange));
|
|
45
|
+
newMaxRange = Math.max(MIN_ALLOWED_SPAN, Math.min(MAX_RANGE, newMaxRange));
|
|
46
|
+
return [newMinRange, newMaxRange];
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Checks if the new span is valid.
|
|
51
|
+
*/
|
|
52
|
+
exports.zoomAtPoint = zoomAtPoint;
|
|
53
|
+
function isSpanValid(minRange, maxRange, isZoomIn, option) {
|
|
54
|
+
const newSpanPercent = maxRange - minRange;
|
|
55
|
+
if (isZoomIn && newSpanPercent < option.minSpan || !isZoomIn && newSpanPercent > option.maxSpan) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
if (minRange < option.minStart || maxRange > option.maxEnd) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
function getMultiplier(event) {
|
|
64
|
+
const ctrlMultiplier = event.ctrlKey ? 3 : 1;
|
|
65
|
+
|
|
66
|
+
// DeltaMode: 0 is pixel, 1 is line, 2 is page
|
|
67
|
+
// This is defined by the browser.
|
|
68
|
+
if (event.deltaMode === 1) {
|
|
69
|
+
return 1 * ctrlMultiplier;
|
|
70
|
+
}
|
|
71
|
+
if (event.deltaMode) {
|
|
72
|
+
return 10 * ctrlMultiplier;
|
|
73
|
+
}
|
|
74
|
+
return 0.2 * ctrlMultiplier;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Get the scale ratio and if it's a zoom in or out from a wheel event.
|
|
79
|
+
*/
|
|
80
|
+
function getWheelScaleRatio(event, step) {
|
|
81
|
+
const deltaY = -event.deltaY;
|
|
82
|
+
const multiplier = getMultiplier(event);
|
|
83
|
+
const scaledStep = step * multiplier * deltaY / 1000;
|
|
84
|
+
// Clamp the scale ratio between 0.1 and 1.9 so that the zoom is not too big or too small.
|
|
85
|
+
const scaleRatio = Math.min(Math.max(1 + scaledStep, 0.1), 1.9);
|
|
86
|
+
const isZoomIn = deltaY > 0;
|
|
87
|
+
return {
|
|
88
|
+
scaleRatio,
|
|
89
|
+
isZoomIn
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Get the scale ratio and if it's a zoom in or out from a pinch gesture.
|
|
95
|
+
*/
|
|
96
|
+
function getPinchScaleRatio(curDiff, prevDiff, step) {
|
|
97
|
+
const scaledStep = step / 1000;
|
|
98
|
+
let scaleRatio = 0;
|
|
99
|
+
let isZoomIn = false;
|
|
100
|
+
const hasMoved = prevDiff > 0;
|
|
101
|
+
if (hasMoved && curDiff > prevDiff) {
|
|
102
|
+
// The distance between the two pointers has increased
|
|
103
|
+
scaleRatio = 1 + scaledStep;
|
|
104
|
+
isZoomIn = true;
|
|
105
|
+
}
|
|
106
|
+
if (hasMoved && curDiff < prevDiff) {
|
|
107
|
+
// The distance between the two pointers has decreased
|
|
108
|
+
scaleRatio = 1 - scaledStep;
|
|
109
|
+
isZoomIn = false;
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
scaleRatio,
|
|
113
|
+
isZoomIn
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function getDiff(eventCache) {
|
|
117
|
+
const [firstEvent, secondEvent] = eventCache;
|
|
118
|
+
return Math.hypot(firstEvent.pageX - secondEvent.pageX, firstEvent.pageY - secondEvent.pageY);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Get the ratio of the point in the horizontal center of the area.
|
|
123
|
+
*/
|
|
124
|
+
function getHorizontalCenterRatio(point, area) {
|
|
125
|
+
const {
|
|
126
|
+
left,
|
|
127
|
+
width
|
|
128
|
+
} = area;
|
|
129
|
+
return (point.x - left) / width;
|
|
130
|
+
}
|
|
131
|
+
function preventDefault(event) {
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
}
|
|
134
|
+
function getVerticalCenterRatio(point, area) {
|
|
135
|
+
const {
|
|
136
|
+
top,
|
|
137
|
+
height
|
|
138
|
+
} = area;
|
|
139
|
+
return (point.y - top) / height * -1 + 1;
|
|
140
|
+
}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.getReleaseInfo = void 0;
|
|
8
8
|
var _ponyfillGlobal = _interopRequireDefault(require("@mui/utils/ponyfillGlobal"));
|
|
9
9
|
const getReleaseInfo = () => {
|
|
10
|
-
const releaseInfo = "
|
|
10
|
+
const releaseInfo = "MTczNjk4MjAwMDAwMA==";
|
|
11
11
|
if (process.env.NODE_ENV !== 'production') {
|
|
12
12
|
// A simple hack to set the value in the test environment (has no build step).
|
|
13
13
|
// eslint-disable-next-line no-useless-concat
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts-pro",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.8",
|
|
4
4
|
"description": "The Pro plan edition of the Charts components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./node/index.js",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"@react-spring/web": "^9.7.5",
|
|
36
36
|
"clsx": "^2.1.1",
|
|
37
37
|
"prop-types": "^15.8.1",
|
|
38
|
-
"@mui/x-charts
|
|
39
|
-
"@mui/x-
|
|
40
|
-
"@mui/x-
|
|
41
|
-
"@mui/x-license": "8.0.0-alpha.
|
|
38
|
+
"@mui/x-charts": "8.0.0-alpha.8",
|
|
39
|
+
"@mui/x-charts-vendor": "8.0.0-alpha.8",
|
|
40
|
+
"@mui/x-internals": "8.0.0-alpha.8",
|
|
41
|
+
"@mui/x-license": "8.0.0-alpha.8"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@emotion/react": "^11.9.0",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DefaultizedProps } from '@mui/x-internals/types';
|
|
2
|
+
import { AxisId } from '@mui/x-charts/internals';
|
|
2
3
|
import { HeatmapItemIdentifier, HeatmapSeriesType, DefaultizedHeatmapSeriesType, HeatmapValueType } from '../models/seriesType/heatmap';
|
|
3
|
-
import { ZoomOptions } from '../
|
|
4
|
+
import { ZoomOptions as ZoomOptionsPro } from '../internals/plugins/useChartProZoom/zoom.types';
|
|
4
5
|
declare module '@mui/x-charts/internals' {
|
|
5
6
|
interface ChartsSeriesConfig {
|
|
6
7
|
heatmap: {
|
|
@@ -12,6 +13,12 @@ declare module '@mui/x-charts/internals' {
|
|
|
12
13
|
cartesian: true;
|
|
13
14
|
};
|
|
14
15
|
}
|
|
16
|
+
interface ZoomOptions extends ZoomOptionsPro {
|
|
17
|
+
}
|
|
18
|
+
interface DefaultizedZoomOptions extends Required<ZoomOptionsPro> {
|
|
19
|
+
axisId: AxisId;
|
|
20
|
+
axisDirection: 'x' | 'y';
|
|
21
|
+
}
|
|
15
22
|
interface AxisConfigExtension {
|
|
16
23
|
zoom?: boolean | ZoomOptions;
|
|
17
24
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CartesianProviderProps } from '@mui/x-charts/internals';
|
|
3
|
-
export interface CartesianProviderProProps extends CartesianProviderProps {
|
|
4
|
-
}
|
|
5
|
-
declare function CartesianProviderPro(props: CartesianProviderProProps): React.JSX.Element;
|
|
6
|
-
export { CartesianProviderPro };
|