@mui/x-charts-pro 9.5.0 → 9.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChartPro/BarChartPro.js +5 -3
- package/BarChartPro/BarChartPro.mjs +5 -3
- package/CHANGELOG.md +151 -0
- package/ChartsDataProviderPro/ChartsDataProviderPro.js +7 -3
- package/ChartsDataProviderPro/ChartsDataProviderPro.mjs +7 -3
- package/ChartsToolbarPro/ChartsToolbarImageExportTrigger.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarImageExportTrigger.mjs +1 -1
- package/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.mjs +1 -1
- package/ChartsToolbarPro/ChartsToolbarPro.js +3 -2
- package/ChartsToolbarPro/ChartsToolbarPro.mjs +3 -2
- package/ChartsToolbarPro/ChartsToolbarRangeButtonTrigger.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarRangeButtonTrigger.mjs +1 -1
- package/ChartsToolbarPro/ChartsToolbarZoomInTrigger.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarZoomInTrigger.mjs +1 -1
- package/ChartsToolbarPro/ChartsToolbarZoomOutTrigger.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarZoomOutTrigger.mjs +1 -1
- package/FunnelChart/FunnelChart.js +1 -1
- package/FunnelChart/FunnelChart.mjs +1 -1
- package/FunnelChart/FunnelPlot.js +5 -1
- package/FunnelChart/FunnelPlot.mjs +5 -1
- package/Heatmap/Heatmap.js +5 -3
- package/Heatmap/Heatmap.mjs +5 -3
- package/Heatmap/HeatmapCell.js +1 -1
- package/Heatmap/HeatmapCell.mjs +1 -1
- package/Heatmap/HeatmapPlot.js +1 -1
- package/Heatmap/HeatmapPlot.mjs +1 -1
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.js +5 -25
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.mjs +5 -25
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.js +1 -1
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.mjs +1 -1
- package/LineChartPro/LineChartPro.js +5 -3
- package/LineChartPro/LineChartPro.mjs +5 -3
- package/PieChartPro/PieChartPro.js +1 -1
- package/PieChartPro/PieChartPro.mjs +1 -1
- package/RadarChartPro/RadarChartPro.js +1 -1
- package/RadarChartPro/RadarChartPro.mjs +1 -1
- package/SankeyChart/SankeyChart.js +1 -1
- package/SankeyChart/SankeyChart.mjs +1 -1
- package/SankeyChart/SankeyDataProvider.d.mts +3 -0
- package/SankeyChart/SankeyDataProvider.d.ts +3 -0
- package/SankeyChart/SankeyDataProvider.js +170 -1
- package/SankeyChart/SankeyDataProvider.mjs +169 -0
- package/SankeyChart/SankeyLinkLabelPlot.d.mts +3 -0
- package/SankeyChart/SankeyLinkLabelPlot.d.ts +3 -0
- package/SankeyChart/SankeyLinkLabelPlot.js +12 -1
- package/SankeyChart/SankeyLinkLabelPlot.mjs +11 -0
- package/SankeyChart/SankeyLinkPlot.d.mts +3 -0
- package/SankeyChart/SankeyLinkPlot.d.ts +3 -0
- package/SankeyChart/SankeyLinkPlot.js +18 -1
- package/SankeyChart/SankeyLinkPlot.mjs +17 -0
- package/SankeyChart/SankeyNodeLabelPlot.d.mts +3 -0
- package/SankeyChart/SankeyNodeLabelPlot.d.ts +3 -0
- package/SankeyChart/SankeyNodeLabelPlot.js +12 -1
- package/SankeyChart/SankeyNodeLabelPlot.mjs +11 -0
- package/SankeyChart/SankeyNodePlot.d.mts +3 -0
- package/SankeyChart/SankeyNodePlot.d.ts +3 -0
- package/SankeyChart/SankeyNodePlot.js +18 -1
- package/SankeyChart/SankeyNodePlot.mjs +17 -0
- package/SankeyChart/SankeyPlot.js +5 -1
- package/SankeyChart/SankeyPlot.mjs +5 -1
- package/SankeyChart/SankeyTooltip/SankeyTooltip.js +8 -28
- package/SankeyChart/SankeyTooltip/SankeyTooltip.mjs +8 -28
- package/SankeyChart/SankeyTooltip/SankeyTooltipContent.js +1 -1
- package/SankeyChart/SankeyTooltip/SankeyTooltipContent.mjs +1 -1
- package/ScatterChartPro/ScatterChartPro.js +5 -3
- package/ScatterChartPro/ScatterChartPro.mjs +5 -3
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/plugins/useChartProZoom/gestureHooks/useRegisterZoomGestures.d.mts +10 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useRegisterZoomGestures.d.ts +10 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useRegisterZoomGestures.js +49 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useRegisterZoomGestures.mjs +42 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.js +2 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.mjs +2 -0
- package/internals/plugins/zoomGestures/useWheelGesture.js +1 -1
- package/internals/plugins/zoomGestures/useWheelGesture.mjs +1 -1
- package/package.json +10 -7
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { PanGesture, PinchGesture, PressAndDragGesture, TapAndDragGesture, TapGesture, TurnWheelGesture } from '@mui/x-internal-gestures/core';
|
|
5
|
+
/**
|
|
6
|
+
* Registers the gestures required by the zoom feature.
|
|
7
|
+
* They are registered here instead of in the core interaction listener plugin
|
|
8
|
+
* so their implementations are only bundled with the zoom plugin.
|
|
9
|
+
*/
|
|
10
|
+
export const useRegisterZoomGestures = ({
|
|
11
|
+
instance
|
|
12
|
+
}) => {
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
return instance.registerGestures([new PanGesture({
|
|
15
|
+
name: 'zoomPan',
|
|
16
|
+
threshold: 0,
|
|
17
|
+
preventIf: ['zoomTapAndDrag', 'zoomPressAndDrag']
|
|
18
|
+
}), new PinchGesture({
|
|
19
|
+
name: 'zoomPinch',
|
|
20
|
+
threshold: 5
|
|
21
|
+
}), new TurnWheelGesture({
|
|
22
|
+
name: 'zoomTurnWheel',
|
|
23
|
+
sensitivity: 0.01,
|
|
24
|
+
initialDelta: 1,
|
|
25
|
+
passive: false
|
|
26
|
+
}), new TurnWheelGesture({
|
|
27
|
+
name: 'panTurnWheel',
|
|
28
|
+
sensitivity: 0.5,
|
|
29
|
+
passive: false
|
|
30
|
+
}), new TapAndDragGesture({
|
|
31
|
+
name: 'zoomTapAndDrag',
|
|
32
|
+
dragThreshold: 10
|
|
33
|
+
}), new PressAndDragGesture({
|
|
34
|
+
name: 'zoomPressAndDrag',
|
|
35
|
+
dragThreshold: 10,
|
|
36
|
+
preventIf: ['zoomPinch']
|
|
37
|
+
}), new TapGesture({
|
|
38
|
+
name: 'zoomDoubleTapReset',
|
|
39
|
+
taps: 2
|
|
40
|
+
})]);
|
|
41
|
+
}, [instance]);
|
|
42
|
+
};
|
|
@@ -27,6 +27,7 @@ var _useZoomOnBrush = require("./gestureHooks/useZoomOnBrush");
|
|
|
27
27
|
var _useZoomOnDoubleTapReset = require("./gestureHooks/useZoomOnDoubleTapReset");
|
|
28
28
|
var _initializeZoomInteractionConfig = require("./initializeZoomInteractionConfig");
|
|
29
29
|
var _initializeZoomData = require("./initializeZoomData");
|
|
30
|
+
var _useRegisterZoomGestures = require("./gestureHooks/useRegisterZoomGestures");
|
|
30
31
|
/**
|
|
31
32
|
* Type guard for `initialZoom` entries provided as a range value.
|
|
32
33
|
*/
|
|
@@ -193,6 +194,7 @@ const useChartProZoom = pluginData => {
|
|
|
193
194
|
}, [removeIsInteracting]);
|
|
194
195
|
|
|
195
196
|
// Add events
|
|
197
|
+
(0, _useRegisterZoomGestures.useRegisterZoomGestures)(pluginData);
|
|
196
198
|
(0, _usePanOnDrag.usePanOnDrag)(pluginData, setZoomDataCallback);
|
|
197
199
|
(0, _usePanOnPressAndDrag.usePanOnPressAndDrag)(pluginData, setZoomDataCallback);
|
|
198
200
|
(0, _usePanOnWheel.usePanOnWheel)(pluginData, setZoomDataCallback);
|
|
@@ -20,6 +20,7 @@ import { useZoomOnBrush } from "./gestureHooks/useZoomOnBrush.mjs";
|
|
|
20
20
|
import { useZoomOnDoubleTapReset } from "./gestureHooks/useZoomOnDoubleTapReset.mjs";
|
|
21
21
|
import { initializeZoomInteractionConfig } from "./initializeZoomInteractionConfig.mjs";
|
|
22
22
|
import { initializeZoomData } from "./initializeZoomData.mjs";
|
|
23
|
+
import { useRegisterZoomGestures } from "./gestureHooks/useRegisterZoomGestures.mjs";
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Type guard for `initialZoom` entries provided as a range value.
|
|
@@ -187,6 +188,7 @@ export const useChartProZoom = pluginData => {
|
|
|
187
188
|
}, [removeIsInteracting]);
|
|
188
189
|
|
|
189
190
|
// Add events
|
|
191
|
+
useRegisterZoomGestures(pluginData);
|
|
190
192
|
usePanOnDrag(pluginData, setZoomDataCallback);
|
|
191
193
|
usePanOnPressAndDrag(pluginData, setZoomDataCallback);
|
|
192
194
|
usePanOnWheel(pluginData, setZoomDataCallback);
|
|
@@ -42,7 +42,7 @@ function useWheelGesture(instance, options) {
|
|
|
42
42
|
if (element === null || !enabled) {
|
|
43
43
|
return () => {};
|
|
44
44
|
}
|
|
45
|
-
const rafThrottledOnWheel = (0, _rafThrottle.rafThrottle)(onWheelRef.current);
|
|
45
|
+
const rafThrottledOnWheel = (0, _rafThrottle.rafThrottle)((point, event) => onWheelRef.current(point, event));
|
|
46
46
|
const handler = instance.addInteractionListener('zoomTurnWheel', event => {
|
|
47
47
|
const point = (0, _internals.getChartPoint)(element, {
|
|
48
48
|
clientX: event.detail.centroid.x,
|
|
@@ -36,7 +36,7 @@ export function useWheelGesture(instance, options) {
|
|
|
36
36
|
if (element === null || !enabled) {
|
|
37
37
|
return () => {};
|
|
38
38
|
}
|
|
39
|
-
const rafThrottledOnWheel = rafThrottle(onWheelRef.current);
|
|
39
|
+
const rafThrottledOnWheel = rafThrottle((point, event) => onWheelRef.current(point, event));
|
|
40
40
|
const handler = instance.addInteractionListener('zoomTurnWheel', event => {
|
|
41
41
|
const point = getChartPoint(element, {
|
|
42
42
|
clientX: event.detail.centroid.x,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts-pro",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.6.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Pro plan edition of the MUI X Charts components.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.29.7",
|
|
31
|
-
"@mui/utils": "9.0.1",
|
|
31
|
+
"@mui/utils": "^9.0.1",
|
|
32
32
|
"clsx": "^2.1.1",
|
|
33
33
|
"prop-types": "^15.8.1",
|
|
34
|
-
"@mui/x-charts": "^9.
|
|
35
|
-
"@mui/x-
|
|
36
|
-
"@mui/x-
|
|
37
|
-
"@mui/x-
|
|
38
|
-
"@mui/x-
|
|
34
|
+
"@mui/x-charts": "^9.6.0",
|
|
35
|
+
"@mui/x-internals": "^9.6.0",
|
|
36
|
+
"@mui/x-internal-gestures": "^9.6.0",
|
|
37
|
+
"@mui/x-license": "^9.6.0",
|
|
38
|
+
"@mui/x-charts-vendor": "^9.4.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@emotion/react": "^11.9.0",
|
|
@@ -889,6 +889,9 @@
|
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
},
|
|
892
|
+
"imports": {
|
|
893
|
+
"#formatErrorMessage": "@mui/x-internals/formatErrorMessage"
|
|
894
|
+
},
|
|
892
895
|
"main": "./index.js",
|
|
893
896
|
"types": "./index.d.ts"
|
|
894
897
|
}
|