@mui/x-charts-pro 8.22.0 → 8.23.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/CHANGELOG.md +202 -0
- package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/ChartZoomSlider/internals/ChartAxisZoomSlider.js +2 -2
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +1 -1
- package/ChartZoomSlider/internals/ChartAxisZoomSliderPreview.js +2 -2
- package/ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.d.ts +2 -3
- package/ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.js +7 -23
- package/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +1 -1
- package/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +2 -2
- package/ChartZoomSlider/internals/previews/BarPreviewPlot.js +2 -2
- package/ChartZoomSlider/internals/previews/LineAreaPreviewPlot.d.ts +4 -0
- package/ChartZoomSlider/internals/previews/LineAreaPreviewPlot.js +22 -0
- package/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +2 -2
- package/ChartZoomSlider/internals/previews/LinePreviewPlot.js +2 -2
- package/ChartZoomSlider/internals/previews/PreviewPlot.types.d.ts +4 -0
- package/ChartZoomSlider/internals/previews/ScatterPreviewPlot.js +2 -2
- package/ChartZoomSlider/internals/seriesPreviewPlotMap.d.ts +3 -0
- package/ChartZoomSlider/internals/seriesPreviewPlotMap.js +10 -0
- package/ChartsToolbarPro/ChartsToolbarPro.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarZoomInTrigger.js +1 -1
- package/ChartsToolbarPro/ChartsToolbarZoomOutTrigger.js +1 -1
- package/FunnelChart/FunnelPlot.js +3 -3
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +2 -2
- package/Heatmap/Heatmap.d.ts +2 -2
- package/Heatmap/Heatmap.js +109 -5
- package/Heatmap/Heatmap.plugins.d.ts +3 -2
- package/Heatmap/Heatmap.plugins.js +2 -1
- package/Heatmap/HeatmapItem.d.ts +10 -1
- package/Heatmap/HeatmapItem.js +3 -9
- package/Heatmap/HeatmapPlot.js +11 -1
- package/Heatmap/index.d.ts +1 -0
- package/SankeyChart/SankeyLinkElement.js +2 -2
- package/SankeyChart/SankeyNodeElement.js +2 -2
- package/SankeyChart/SankeyNodeLabel.js +2 -2
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.js +3 -3
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +2 -2
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderPreview.js +3 -3
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.d.ts +2 -3
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.js +8 -24
- package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +3 -3
- package/esm/ChartZoomSlider/internals/previews/BarPreviewPlot.js +3 -3
- package/esm/ChartZoomSlider/internals/previews/LineAreaPreviewPlot.d.ts +4 -0
- package/esm/ChartZoomSlider/internals/previews/LineAreaPreviewPlot.js +15 -0
- package/esm/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +2 -2
- package/esm/ChartZoomSlider/internals/previews/LinePreviewPlot.js +3 -3
- package/esm/ChartZoomSlider/internals/previews/PreviewPlot.types.d.ts +4 -0
- package/esm/ChartZoomSlider/internals/previews/ScatterPreviewPlot.js +3 -3
- package/esm/ChartZoomSlider/internals/seriesPreviewPlotMap.d.ts +3 -0
- package/esm/ChartZoomSlider/internals/seriesPreviewPlotMap.js +4 -0
- package/esm/ChartsToolbarPro/ChartsToolbarPro.js +2 -2
- package/esm/ChartsToolbarPro/ChartsToolbarZoomInTrigger.js +2 -2
- package/esm/ChartsToolbarPro/ChartsToolbarZoomOutTrigger.js +2 -2
- package/esm/FunnelChart/FunnelPlot.js +4 -4
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +3 -3
- package/esm/Heatmap/Heatmap.d.ts +2 -2
- package/esm/Heatmap/Heatmap.js +109 -5
- package/esm/Heatmap/Heatmap.plugins.d.ts +3 -2
- package/esm/Heatmap/Heatmap.plugins.js +3 -2
- package/esm/Heatmap/HeatmapItem.d.ts +10 -1
- package/esm/Heatmap/HeatmapItem.js +3 -9
- package/esm/Heatmap/HeatmapPlot.js +11 -1
- package/esm/Heatmap/index.d.ts +1 -0
- package/esm/SankeyChart/SankeyLinkElement.js +3 -3
- package/esm/SankeyChart/SankeyNodeElement.js +3 -3
- package/esm/SankeyChart/SankeyNodeLabel.js +3 -3
- package/esm/hooks/useSankeySeries.js +2 -2
- package/esm/hooks/zoom/useIsZoomInteracting.js +2 -2
- package/esm/index.js +1 -1
- package/esm/internals/index.d.ts +4 -0
- package/esm/internals/index.js +2 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +4 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +4 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.js +4 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +4 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +3 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +4 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +4 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +4 -4
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +2 -2
- package/hooks/useSankeySeries.js +1 -1
- package/hooks/zoom/useIsZoomInteracting.js +1 -1
- package/index.js +1 -1
- package/internals/index.d.ts +4 -0
- package/internals/index.js +19 -0
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +3 -3
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +3 -3
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.js +3 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +3 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +3 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +3 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +3 -3
- package/internals/plugins/useChartProZoom/useChartProZoom.js +1 -1
- package/package.json +6 -6
|
@@ -5,7 +5,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["render"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { useChartContext,
|
|
8
|
+
import { useChartContext, useChartsSlots } from '@mui/x-charts/internals';
|
|
9
9
|
import { useComponentRenderer } from '@mui/x-internals/useComponentRenderer';
|
|
10
10
|
import { selectorChartCanZoomIn } from "../internals/plugins/useChartProZoom/index.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -26,7 +26,7 @@ const ChartsToolbarZoomInTrigger = /*#__PURE__*/React.forwardRef(function Charts
|
|
|
26
26
|
instance,
|
|
27
27
|
store
|
|
28
28
|
} = useChartContext();
|
|
29
|
-
const disabled =
|
|
29
|
+
const disabled = store.use(selectorChartCanZoomIn);
|
|
30
30
|
const element = useComponentRenderer(slots.baseButton, render, _extends({}, slotProps.baseButton, {
|
|
31
31
|
onClick: () => instance.zoomIn(),
|
|
32
32
|
disabled
|
|
@@ -5,7 +5,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["render"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { useChartContext,
|
|
8
|
+
import { useChartContext, useChartsSlots } from '@mui/x-charts/internals';
|
|
9
9
|
import { useComponentRenderer } from '@mui/x-internals/useComponentRenderer';
|
|
10
10
|
import { selectorChartCanZoomOut } from "../internals/plugins/useChartProZoom/index.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -26,7 +26,7 @@ const ChartsToolbarZoomOutTrigger = /*#__PURE__*/React.forwardRef(function Chart
|
|
|
26
26
|
instance,
|
|
27
27
|
store
|
|
28
28
|
} = useChartContext();
|
|
29
|
-
const disabled =
|
|
29
|
+
const disabled = store.use(selectorChartCanZoomOut);
|
|
30
30
|
const element = useComponentRenderer(slots.baseButton, render, _extends({}, slotProps.baseButton, {
|
|
31
31
|
onClick: () => instance.zoomOut(),
|
|
32
32
|
disabled
|
|
@@ -4,7 +4,7 @@ const _excluded = ["onItemClick"];
|
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { line as d3Line } from '@mui/x-charts-vendor/d3-shape';
|
|
7
|
-
import { cartesianSeriesTypes,
|
|
7
|
+
import { cartesianSeriesTypes, useStore } from '@mui/x-charts/internals';
|
|
8
8
|
import { FunnelSection } from "./FunnelSection.js";
|
|
9
9
|
import { alignLabel, positionLabel } from "./labelUtils.js";
|
|
10
10
|
import { useFunnelSeriesContext } from "../hooks/useFunnelSeries.js";
|
|
@@ -21,12 +21,12 @@ const useAggregatedData = () => {
|
|
|
21
21
|
const {
|
|
22
22
|
axis: xAxis,
|
|
23
23
|
axisIds: xAxisIds
|
|
24
|
-
} =
|
|
24
|
+
} = store.use(selectorChartXAxis);
|
|
25
25
|
const {
|
|
26
26
|
axis: yAxis,
|
|
27
27
|
axisIds: yAxisIds
|
|
28
|
-
} =
|
|
29
|
-
const gap =
|
|
28
|
+
} = store.use(selectorChartYAxis);
|
|
29
|
+
const gap = store.use(selectorFunnelGap);
|
|
30
30
|
const allData = React.useMemo(() => {
|
|
31
31
|
if (seriesData === undefined) {
|
|
32
32
|
return [];
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
6
|
-
import { getSVGPoint, getCartesianAxisIndex, selectorChartDrawingArea, selectorChartSeriesProcessed, selectorChartsInteractionIsInitialized,
|
|
6
|
+
import { getSVGPoint, getCartesianAxisIndex, selectorChartDrawingArea, selectorChartSeriesProcessed, selectorChartsInteractionIsInitialized, defaultizeXAxis, defaultizeYAxis } from '@mui/x-charts/internals';
|
|
7
7
|
import { selectorChartXAxis, selectorChartYAxis } from "./useChartFunnelAxisRendering.selectors.js";
|
|
8
8
|
export const useChartFunnelAxis = ({
|
|
9
9
|
params,
|
|
@@ -25,8 +25,8 @@ export const useChartFunnelAxis = ({
|
|
|
25
25
|
warnOnce([`MUI X Charts: The following axis ids are duplicated: ${Array.from(duplicates).join(', ')}.`, `Please make sure that each axis has a unique id.`].join('\n'), 'error');
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const drawingArea =
|
|
29
|
-
const isInteractionEnabled =
|
|
28
|
+
const drawingArea = store.use(selectorChartDrawingArea);
|
|
29
|
+
const isInteractionEnabled = store.use(selectorChartsInteractionIsInitialized);
|
|
30
30
|
const isFirstRender = React.useRef(true);
|
|
31
31
|
React.useEffect(() => {
|
|
32
32
|
if (isFirstRender.current) {
|
package/esm/Heatmap/Heatmap.d.ts
CHANGED
|
@@ -34,13 +34,13 @@ export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', Hea
|
|
|
34
34
|
* If not provided, a default axis config is used.
|
|
35
35
|
* An array of [[AxisConfig]] objects.
|
|
36
36
|
*/
|
|
37
|
-
xAxis: Readonly<
|
|
37
|
+
xAxis: Readonly<MakeOptional<XAxis<'band'>, 'scaleType'>[]>;
|
|
38
38
|
/**
|
|
39
39
|
* The configuration of the y-axes.
|
|
40
40
|
* If not provided, a default axis config is used.
|
|
41
41
|
* An array of [[AxisConfig]] objects.
|
|
42
42
|
*/
|
|
43
|
-
yAxis: Readonly<
|
|
43
|
+
yAxis: Readonly<MakeOptional<YAxis<'band'>, 'scaleType'>[]>;
|
|
44
44
|
/**
|
|
45
45
|
* The series to display in the bar chart.
|
|
46
46
|
* An array of [[HeatmapSeries]] objects.
|
package/esm/Heatmap/Heatmap.js
CHANGED
|
@@ -13,6 +13,7 @@ import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
|
13
13
|
import { ChartsOverlay } from '@mui/x-charts/ChartsOverlay';
|
|
14
14
|
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from '@mui/x-charts/constants';
|
|
15
15
|
import { ChartsLegend, ContinuousColorLegend } from '@mui/x-charts/ChartsLegend';
|
|
16
|
+
import { ChartsBrushOverlay } from '@mui/x-charts/ChartsBrushOverlay';
|
|
16
17
|
import { HeatmapPlot } from "./HeatmapPlot.js";
|
|
17
18
|
import { heatmapSeriesConfig } from "./seriesConfig/index.js";
|
|
18
19
|
import { HeatmapTooltip } from "./HeatmapTooltip/index.js";
|
|
@@ -148,7 +149,7 @@ const Heatmap = /*#__PURE__*/React.forwardRef(function Heatmap(inProps, ref) {
|
|
|
148
149
|
slotProps: slotProps
|
|
149
150
|
}), /*#__PURE__*/_jsx(ChartsClipPath, {
|
|
150
151
|
id: clipPathId
|
|
151
|
-
}), children]
|
|
152
|
+
}), /*#__PURE__*/_jsx(ChartsBrushOverlay, {}), children]
|
|
152
153
|
}), !loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps?.tooltip))]
|
|
153
154
|
}))
|
|
154
155
|
});
|
|
@@ -162,9 +163,19 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
162
163
|
apiRef: PropTypes.shape({
|
|
163
164
|
current: PropTypes.shape({
|
|
164
165
|
exportAsImage: PropTypes.func.isRequired,
|
|
165
|
-
exportAsPrint: PropTypes.func.isRequired
|
|
166
|
+
exportAsPrint: PropTypes.func.isRequired,
|
|
167
|
+
setAxisZoomData: PropTypes.func.isRequired,
|
|
168
|
+
setZoomData: PropTypes.func.isRequired
|
|
166
169
|
})
|
|
167
170
|
}),
|
|
171
|
+
/**
|
|
172
|
+
* Configuration for the brush interaction.
|
|
173
|
+
*/
|
|
174
|
+
brushConfig: PropTypes.shape({
|
|
175
|
+
enabled: PropTypes.bool,
|
|
176
|
+
preventHighlight: PropTypes.bool,
|
|
177
|
+
preventTooltip: PropTypes.bool
|
|
178
|
+
}),
|
|
168
179
|
className: PropTypes.string,
|
|
169
180
|
/**
|
|
170
181
|
* Color palette used to colorize multiple series.
|
|
@@ -204,6 +215,15 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
204
215
|
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
205
216
|
*/
|
|
206
217
|
id: PropTypes.string,
|
|
218
|
+
/**
|
|
219
|
+
* The list of zoom data related to each axis.
|
|
220
|
+
* Used to initialize the zoom in a specific configuration without controlling it.
|
|
221
|
+
*/
|
|
222
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
223
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
224
|
+
end: PropTypes.number.isRequired,
|
|
225
|
+
start: PropTypes.number.isRequired
|
|
226
|
+
})),
|
|
207
227
|
/**
|
|
208
228
|
* If `true`, a loading overlay is displayed.
|
|
209
229
|
* @default false
|
|
@@ -238,6 +258,12 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
238
258
|
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
239
259
|
*/
|
|
240
260
|
onHighlightChange: PropTypes.func,
|
|
261
|
+
/**
|
|
262
|
+
* Callback fired when the zoom has changed.
|
|
263
|
+
*
|
|
264
|
+
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
265
|
+
*/
|
|
266
|
+
onZoomChange: PropTypes.func,
|
|
241
267
|
/**
|
|
242
268
|
* The series to display in the bar chart.
|
|
243
269
|
* An array of [[HeatmapSeries]] objects.
|
|
@@ -339,7 +365,22 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
339
365
|
tickPlacement: PropTypes.oneOf(['end', 'extremities', 'middle', 'start']),
|
|
340
366
|
tickSize: PropTypes.number,
|
|
341
367
|
tickSpacing: PropTypes.number,
|
|
342
|
-
valueFormatter: PropTypes.func
|
|
368
|
+
valueFormatter: PropTypes.func,
|
|
369
|
+
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
370
|
+
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
371
|
+
maxEnd: PropTypes.number,
|
|
372
|
+
maxSpan: PropTypes.number,
|
|
373
|
+
minSpan: PropTypes.number,
|
|
374
|
+
minStart: PropTypes.number,
|
|
375
|
+
panning: PropTypes.bool,
|
|
376
|
+
slider: PropTypes.shape({
|
|
377
|
+
enabled: PropTypes.bool,
|
|
378
|
+
preview: PropTypes.bool,
|
|
379
|
+
showTooltip: PropTypes.oneOf(['always', 'hover', 'never']),
|
|
380
|
+
size: PropTypes.number
|
|
381
|
+
}),
|
|
382
|
+
step: PropTypes.number
|
|
383
|
+
}), PropTypes.bool])
|
|
343
384
|
})).isRequired,
|
|
344
385
|
/**
|
|
345
386
|
* The configuration of the y-axes.
|
|
@@ -404,7 +445,22 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
404
445
|
tickSize: PropTypes.number,
|
|
405
446
|
tickSpacing: PropTypes.number,
|
|
406
447
|
valueFormatter: PropTypes.func,
|
|
407
|
-
width: PropTypes.number
|
|
448
|
+
width: PropTypes.number,
|
|
449
|
+
zoom: PropTypes.oneOfType([PropTypes.shape({
|
|
450
|
+
filterMode: PropTypes.oneOf(['discard', 'keep']),
|
|
451
|
+
maxEnd: PropTypes.number,
|
|
452
|
+
maxSpan: PropTypes.number,
|
|
453
|
+
minSpan: PropTypes.number,
|
|
454
|
+
minStart: PropTypes.number,
|
|
455
|
+
panning: PropTypes.bool,
|
|
456
|
+
slider: PropTypes.shape({
|
|
457
|
+
enabled: PropTypes.bool,
|
|
458
|
+
preview: PropTypes.bool,
|
|
459
|
+
showTooltip: PropTypes.oneOf(['always', 'hover', 'never']),
|
|
460
|
+
size: PropTypes.number
|
|
461
|
+
}),
|
|
462
|
+
step: PropTypes.number
|
|
463
|
+
}), PropTypes.bool])
|
|
408
464
|
})).isRequired,
|
|
409
465
|
/**
|
|
410
466
|
* The configuration of the z-axes.
|
|
@@ -430,6 +486,54 @@ process.env.NODE_ENV !== "production" ? Heatmap.propTypes = {
|
|
|
430
486
|
id: PropTypes.string,
|
|
431
487
|
max: PropTypes.number,
|
|
432
488
|
min: PropTypes.number
|
|
433
|
-
}))
|
|
489
|
+
})),
|
|
490
|
+
/**
|
|
491
|
+
* The list of zoom data related to each axis.
|
|
492
|
+
*/
|
|
493
|
+
zoomData: PropTypes.arrayOf(PropTypes.shape({
|
|
494
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
495
|
+
end: PropTypes.number.isRequired,
|
|
496
|
+
start: PropTypes.number.isRequired
|
|
497
|
+
})),
|
|
498
|
+
/**
|
|
499
|
+
* Configuration for zoom interactions.
|
|
500
|
+
*/
|
|
501
|
+
zoomInteractionConfig: PropTypes.shape({
|
|
502
|
+
pan: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['drag', 'pressAndDrag', 'wheel']), PropTypes.shape({
|
|
503
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
504
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
505
|
+
type: PropTypes.oneOf(['drag']).isRequired
|
|
506
|
+
}), PropTypes.shape({
|
|
507
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
508
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
509
|
+
type: PropTypes.oneOf(['pressAndDrag']).isRequired
|
|
510
|
+
}), PropTypes.shape({
|
|
511
|
+
allowedDirection: PropTypes.oneOf(['x', 'xy', 'y']),
|
|
512
|
+
pointerMode: PropTypes.any,
|
|
513
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
514
|
+
type: PropTypes.oneOf(['wheel']).isRequired
|
|
515
|
+
})]).isRequired),
|
|
516
|
+
zoom: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['brush', 'doubleTapReset', 'pinch', 'tapAndDrag', 'wheel']), PropTypes.shape({
|
|
517
|
+
pointerMode: PropTypes.any,
|
|
518
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
519
|
+
type: PropTypes.oneOf(['wheel']).isRequired
|
|
520
|
+
}), PropTypes.shape({
|
|
521
|
+
pointerMode: PropTypes.any,
|
|
522
|
+
requiredKeys: PropTypes.array,
|
|
523
|
+
type: PropTypes.oneOf(['pinch']).isRequired
|
|
524
|
+
}), PropTypes.shape({
|
|
525
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
526
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
527
|
+
type: PropTypes.oneOf(['tapAndDrag']).isRequired
|
|
528
|
+
}), PropTypes.shape({
|
|
529
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
530
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
531
|
+
type: PropTypes.oneOf(['doubleTapReset']).isRequired
|
|
532
|
+
}), PropTypes.shape({
|
|
533
|
+
pointerMode: PropTypes.any,
|
|
534
|
+
requiredKeys: PropTypes.array,
|
|
535
|
+
type: PropTypes.oneOf(['brush']).isRequired
|
|
536
|
+
})]).isRequired)
|
|
537
|
+
})
|
|
434
538
|
} : void 0;
|
|
435
539
|
export { Heatmap };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type UseChartZAxisSignature, type UseChartCartesianAxisSignature, type UseChartTooltipSignature, type UseChartInteractionSignature, type UseChartHighlightSignature, type ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
1
|
+
import { type UseChartZAxisSignature, type UseChartCartesianAxisSignature, type UseChartTooltipSignature, type UseChartInteractionSignature, type UseChartHighlightSignature, type ConvertSignaturesIntoPlugins, type UseChartBrushSignature } from '@mui/x-charts/internals';
|
|
2
2
|
import { type UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
|
|
3
|
+
import { type UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
|
|
4
|
+
export type HeatmapPluginSignatures = [UseChartZAxisSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'heatmap'>, UseChartHighlightSignature, UseChartProExportSignature, UseChartBrushSignature, UseChartProZoomSignature];
|
|
4
5
|
export declare const HEATMAP_PLUGINS: ConvertSignaturesIntoPlugins<HeatmapPluginSignatures>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { useChartZAxis, useChartCartesianAxis, useChartTooltip, useChartInteraction, useChartHighlight } from '@mui/x-charts/internals';
|
|
1
|
+
import { useChartZAxis, useChartCartesianAxis, useChartTooltip, useChartInteraction, useChartHighlight, useChartBrush } from '@mui/x-charts/internals';
|
|
2
2
|
import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
|
|
3
|
+
import { useChartProZoom } from "../internals/plugins/useChartProZoom/index.js";
|
|
4
|
+
export const HEATMAP_PLUGINS = [useChartZAxis, useChartTooltip, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartProExport, useChartBrush, useChartProZoom];
|
|
@@ -9,7 +9,7 @@ export interface HeatmapItemSlots {
|
|
|
9
9
|
cell?: React.ElementType;
|
|
10
10
|
}
|
|
11
11
|
export interface HeatmapItemSlotProps {
|
|
12
|
-
cell?: Partial<
|
|
12
|
+
cell?: Partial<HeatmapCellProps>;
|
|
13
13
|
}
|
|
14
14
|
export interface HeatmapItemProps {
|
|
15
15
|
dataIndex: number;
|
|
@@ -20,6 +20,8 @@ export interface HeatmapItemProps {
|
|
|
20
20
|
x: number;
|
|
21
21
|
y: number;
|
|
22
22
|
color: string;
|
|
23
|
+
isHighlighted?: boolean;
|
|
24
|
+
isFaded?: boolean;
|
|
23
25
|
/**
|
|
24
26
|
* The props used for each component slot.
|
|
25
27
|
* @default {}
|
|
@@ -39,6 +41,13 @@ export interface HeatmapItemOwnerState {
|
|
|
39
41
|
isHighlighted: boolean;
|
|
40
42
|
classes?: Partial<HeatmapClasses>;
|
|
41
43
|
}
|
|
44
|
+
export interface HeatmapCellProps extends React.ComponentPropsWithRef<'rect'> {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
ownerState: HeatmapItemOwnerState;
|
|
50
|
+
}
|
|
42
51
|
/**
|
|
43
52
|
* @ignore - internal component.
|
|
44
53
|
*/
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["seriesId", "dataIndex", "color", "value", "slotProps", "slots"];
|
|
3
|
+
const _excluded = ["seriesId", "dataIndex", "color", "value", "isHighlighted", "isFaded", "slotProps", "slots"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { styled } from '@mui/material/styles';
|
|
7
7
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
9
|
-
import { useItemHighlighted } from '@mui/x-charts/hooks';
|
|
10
9
|
import { useInteractionItemProps } from '@mui/x-charts/internals';
|
|
11
10
|
import { getHeatmapUtilityClass } from "./heatmapClasses.js";
|
|
12
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -43,6 +42,8 @@ function HeatmapItem(props) {
|
|
|
43
42
|
dataIndex,
|
|
44
43
|
color,
|
|
45
44
|
value,
|
|
45
|
+
isHighlighted = false,
|
|
46
|
+
isFaded = false,
|
|
46
47
|
slotProps = {},
|
|
47
48
|
slots = {}
|
|
48
49
|
} = props,
|
|
@@ -52,13 +53,6 @@ function HeatmapItem(props) {
|
|
|
52
53
|
seriesId,
|
|
53
54
|
dataIndex
|
|
54
55
|
});
|
|
55
|
-
const {
|
|
56
|
-
isFaded,
|
|
57
|
-
isHighlighted
|
|
58
|
-
} = useItemHighlighted({
|
|
59
|
-
seriesId,
|
|
60
|
-
dataIndex
|
|
61
|
-
});
|
|
62
56
|
const ownerState = {
|
|
63
57
|
seriesId,
|
|
64
58
|
dataIndex,
|
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { useXScale, useYScale, useZColorScale } from '@mui/x-charts/hooks';
|
|
5
|
+
import { selectorChartsIsFadedCallback, selectorChartsIsHighlightedCallback, useStore } from '@mui/x-charts/internals';
|
|
5
6
|
import { useHeatmapSeriesContext } from "../hooks/useHeatmapSeries.js";
|
|
6
7
|
import { HeatmapItem } from "./HeatmapItem.js";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
function HeatmapPlot(props) {
|
|
10
|
+
const store = useStore();
|
|
9
11
|
const xScale = useXScale();
|
|
10
12
|
const yScale = useYScale();
|
|
11
13
|
const colorScale = useZColorScale();
|
|
12
14
|
const series = useHeatmapSeriesContext();
|
|
15
|
+
const isHighlighted = store.use(selectorChartsIsHighlightedCallback);
|
|
16
|
+
const isFaded = store.use(selectorChartsIsFadedCallback);
|
|
13
17
|
const xDomain = xScale.domain();
|
|
14
18
|
const yDomain = yScale.domain();
|
|
15
19
|
if (!series || series.seriesOrder.length === 0) {
|
|
@@ -24,6 +28,10 @@ function HeatmapPlot(props) {
|
|
|
24
28
|
if (x === undefined || y === undefined || !color) {
|
|
25
29
|
return null;
|
|
26
30
|
}
|
|
31
|
+
const item = {
|
|
32
|
+
seriesId: seriesToDisplay.id,
|
|
33
|
+
dataIndex
|
|
34
|
+
};
|
|
27
35
|
return /*#__PURE__*/_jsx(HeatmapItem, {
|
|
28
36
|
width: xScale.bandwidth(),
|
|
29
37
|
height: yScale.bandwidth(),
|
|
@@ -34,7 +42,9 @@ function HeatmapPlot(props) {
|
|
|
34
42
|
seriesId: series.seriesOrder[0],
|
|
35
43
|
value: value,
|
|
36
44
|
slots: props.slots,
|
|
37
|
-
slotProps: props.slotProps
|
|
45
|
+
slotProps: props.slotProps,
|
|
46
|
+
isHighlighted: isHighlighted(item),
|
|
47
|
+
isFaded: isFaded(item)
|
|
38
48
|
}, `${xIndex}_${yIndex}`);
|
|
39
49
|
})
|
|
40
50
|
});
|
package/esm/Heatmap/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { Heatmap } from "./Heatmap.js";
|
|
2
2
|
export type { HeatmapSeries, HeatmapProps } from "./Heatmap.js";
|
|
3
3
|
export { HeatmapPlot } from "./HeatmapPlot.js";
|
|
4
|
+
export type { HeatmapCellProps } from "./HeatmapItem.js";
|
|
4
5
|
export * from "./HeatmapTooltip/index.js";
|
|
5
6
|
export * from "./Heatmap.plugins.js";
|
|
6
7
|
export * from "./heatmapClasses.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
|
-
import { useInteractionItemProps, useStore
|
|
6
|
+
import { useInteractionItemProps, useStore } from '@mui/x-charts/internals';
|
|
7
7
|
import { selectorIsLinkHighlighted } from "./plugins/index.js";
|
|
8
8
|
import { selectorIsSankeyItemFaded } from "./plugins/useSankeyHighlight.selectors.js";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -26,8 +26,8 @@ export const SankeyLinkElement = /*#__PURE__*/React.forwardRef(function SankeyLi
|
|
|
26
26
|
sourceId: link.source.id,
|
|
27
27
|
link
|
|
28
28
|
};
|
|
29
|
-
const isHighlighted =
|
|
30
|
-
const isFaded =
|
|
29
|
+
const isHighlighted = store.use(selectorIsLinkHighlighted, link);
|
|
30
|
+
const isFaded = store.use(selectorIsSankeyItemFaded, isHighlighted);
|
|
31
31
|
|
|
32
32
|
// Add interaction props for tooltips
|
|
33
33
|
const interactionProps = useInteractionItemProps(identifier);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
|
-
import { useInteractionItemProps, useStore
|
|
6
|
+
import { useInteractionItemProps, useStore } from '@mui/x-charts/internals';
|
|
7
7
|
import { selectorIsNodeHighlighted } from "./plugins/index.js";
|
|
8
8
|
import { selectorIsSankeyItemFaded } from "./plugins/useSankeyHighlight.selectors.js";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -30,8 +30,8 @@ export const SankeyNodeElement = /*#__PURE__*/React.forwardRef(function SankeyNo
|
|
|
30
30
|
nodeId: node.id,
|
|
31
31
|
node
|
|
32
32
|
};
|
|
33
|
-
const isHighlighted =
|
|
34
|
-
const isFaded =
|
|
33
|
+
const isHighlighted = store.use(selectorIsNodeHighlighted, node.id);
|
|
34
|
+
const isFaded = store.use(selectorIsSankeyItemFaded, isHighlighted);
|
|
35
35
|
|
|
36
36
|
// Add interaction props for tooltips
|
|
37
37
|
const interactionProps = useInteractionItemProps(identifier);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { useStore
|
|
4
|
+
import { useStore } from '@mui/x-charts/internals';
|
|
5
5
|
import { useTheme } from '@mui/material/styles';
|
|
6
6
|
import { selectorIsNodeHighlighted } from "./plugins/index.js";
|
|
7
7
|
import { selectorIsSankeyItemFaded } from "./plugins/useSankeyHighlight.selectors.js";
|
|
@@ -25,8 +25,8 @@ export const SankeyNodeLabel = /*#__PURE__*/React.forwardRef(function SankeyNode
|
|
|
25
25
|
: x0 - 6; // Left side for other columns
|
|
26
26
|
|
|
27
27
|
const labelAnchor = node.depth === 0 ? 'start' : 'end';
|
|
28
|
-
const isHighlighted =
|
|
29
|
-
const isFaded =
|
|
28
|
+
const isHighlighted = store.use(selectorIsNodeHighlighted, node.id);
|
|
29
|
+
const isFaded = store.use(selectorIsSankeyItemFaded, isHighlighted);
|
|
30
30
|
let opacity = 1;
|
|
31
31
|
if (isFaded) {
|
|
32
32
|
opacity = 0.3;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { useSeriesOfType, useAllSeriesOfType,
|
|
3
|
+
import { useSeriesOfType, useAllSeriesOfType, useStore, selectorChartSeriesLayout } from '@mui/x-charts/internals';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Get access to the internal state of sankey series.
|
|
@@ -47,7 +47,7 @@ export function useSankeyLayout() {
|
|
|
47
47
|
const store = useStore();
|
|
48
48
|
const seriesContext = useSankeySeriesContext();
|
|
49
49
|
const seriesId = seriesContext?.seriesOrder?.[0];
|
|
50
|
-
const layout =
|
|
50
|
+
const layout = store.use(selectorChartSeriesLayout);
|
|
51
51
|
if (!seriesId) {
|
|
52
52
|
return undefined;
|
|
53
53
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { useStore } from '@mui/x-charts/internals';
|
|
4
4
|
import { selectorChartZoomIsInteracting } from "../../internals/plugins/useChartProZoom/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* Get access to the zoom state.
|
|
@@ -9,6 +9,6 @@ import { selectorChartZoomIsInteracting } from "../../internals/plugins/useChart
|
|
|
9
9
|
*/
|
|
10
10
|
export function useIsZoomInteracting() {
|
|
11
11
|
const store = useStore();
|
|
12
|
-
const isInteracting =
|
|
12
|
+
const isInteracting = store.use(selectorChartZoomIsInteracting);
|
|
13
13
|
return isInteracting;
|
|
14
14
|
}
|
package/esm/index.js
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
2
|
+
export type { ChartsSlotsPro, ChartsSlotPropsPro } from "./material/index.js";
|
|
3
|
+
export { seriesPreviewPlotMap } from "../ChartZoomSlider/internals/seriesPreviewPlotMap.js";
|
|
4
|
+
export type { PreviewPlotProps } from "../ChartZoomSlider/internals/previews/PreviewPlot.types.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { selectorChartDrawingArea, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
5
5
|
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
6
6
|
import { translateZoom } from "./useZoom.utils.js";
|
|
7
7
|
import { selectorPanInteractionConfig } from "../ZoomInteractionConfig.selectors.js";
|
|
@@ -10,9 +10,9 @@ export const usePanOnDrag = ({
|
|
|
10
10
|
instance,
|
|
11
11
|
svgRef
|
|
12
12
|
}, setZoomDataCallback) => {
|
|
13
|
-
const drawingArea =
|
|
14
|
-
const optionsLookup =
|
|
15
|
-
const config =
|
|
13
|
+
const drawingArea = store.use(selectorChartDrawingArea);
|
|
14
|
+
const optionsLookup = store.use(selectorChartZoomOptionsLookup);
|
|
15
|
+
const config = store.use(selectorPanInteractionConfig, 'drag');
|
|
16
16
|
const isPanOnDragEnabled = Object.values(optionsLookup).some(v => v.panning) && Boolean(config);
|
|
17
17
|
React.useEffect(() => {
|
|
18
18
|
if (!isPanOnDragEnabled) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { selectorChartDrawingArea, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
5
5
|
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
6
6
|
import { translateZoom } from "./useZoom.utils.js";
|
|
7
7
|
import { selectorPanInteractionConfig } from "../ZoomInteractionConfig.selectors.js";
|
|
@@ -10,14 +10,14 @@ export const usePanOnPressAndDrag = ({
|
|
|
10
10
|
instance,
|
|
11
11
|
svgRef
|
|
12
12
|
}, setZoomDataCallback) => {
|
|
13
|
-
const drawingArea =
|
|
14
|
-
const optionsLookup =
|
|
13
|
+
const drawingArea = store.use(selectorChartDrawingArea);
|
|
14
|
+
const optionsLookup = store.use(selectorChartZoomOptionsLookup);
|
|
15
15
|
const isInteracting = React.useRef(false);
|
|
16
16
|
const accumulatedChange = React.useRef({
|
|
17
17
|
x: 0,
|
|
18
18
|
y: 0
|
|
19
19
|
});
|
|
20
|
-
const config =
|
|
20
|
+
const config = store.use(selectorPanInteractionConfig, 'pressAndDrag');
|
|
21
21
|
const isPanOnPressAndDragEnabled = Object.values(optionsLookup).some(v => v.panning) && Boolean(config);
|
|
22
22
|
React.useEffect(() => {
|
|
23
23
|
if (!isPanOnPressAndDragEnabled) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { getSVGPoint, selectorChartDrawingArea, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
5
5
|
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
6
6
|
import { translateZoom } from "./useZoom.utils.js";
|
|
7
7
|
import { selectorPanInteractionConfig } from "../ZoomInteractionConfig.selectors.js";
|
|
@@ -10,11 +10,11 @@ export const usePanOnWheel = ({
|
|
|
10
10
|
instance,
|
|
11
11
|
svgRef
|
|
12
12
|
}, setZoomDataCallback) => {
|
|
13
|
-
const drawingArea =
|
|
14
|
-
const optionsLookup =
|
|
13
|
+
const drawingArea = store.use(selectorChartDrawingArea);
|
|
14
|
+
const optionsLookup = store.use(selectorChartZoomOptionsLookup);
|
|
15
15
|
const startedOutsideRef = React.useRef(false);
|
|
16
16
|
const startedOutsideTimeoutRef = React.useRef(null);
|
|
17
|
-
const config =
|
|
17
|
+
const config = store.use(selectorPanInteractionConfig, 'wheel');
|
|
18
18
|
const isPanOnWheelEnabled = Object.keys(optionsLookup).length > 0 && Boolean(config);
|
|
19
19
|
React.useEffect(() => {
|
|
20
20
|
if (!isPanOnWheelEnabled) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { getSVGPoint, selectorChartDrawingArea, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
5
5
|
import { getHorizontalCenterRatio, getVerticalCenterRatio, isSpanValid } from "./useZoom.utils.js";
|
|
6
6
|
import { selectorZoomInteractionConfig } from "../ZoomInteractionConfig.selectors.js";
|
|
7
7
|
export const useZoomOnBrush = ({
|
|
@@ -9,9 +9,9 @@ export const useZoomOnBrush = ({
|
|
|
9
9
|
instance,
|
|
10
10
|
svgRef
|
|
11
11
|
}, setZoomDataCallback) => {
|
|
12
|
-
const drawingArea =
|
|
13
|
-
const optionsLookup =
|
|
14
|
-
const config =
|
|
12
|
+
const drawingArea = store.use(selectorChartDrawingArea);
|
|
13
|
+
const optionsLookup = store.use(selectorChartZoomOptionsLookup);
|
|
14
|
+
const config = store.use(selectorZoomInteractionConfig, 'brush');
|
|
15
15
|
const isZoomOnBrushEnabled = Object.keys(optionsLookup).length > 0 && Boolean(config);
|
|
16
16
|
React.useEffect(() => {
|
|
17
17
|
instance.setZoomBrushEnabled(isZoomOnBrushEnabled);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
5
5
|
import { selectorZoomInteractionConfig } from "../ZoomInteractionConfig.selectors.js";
|
|
6
6
|
export const useZoomOnDoubleTapReset = ({
|
|
7
7
|
store,
|
|
8
8
|
instance,
|
|
9
9
|
svgRef
|
|
10
10
|
}, setZoomDataCallback) => {
|
|
11
|
-
const optionsLookup =
|
|
12
|
-
const config =
|
|
11
|
+
const optionsLookup = store.use(selectorChartZoomOptionsLookup);
|
|
12
|
+
const config = store.use(selectorZoomInteractionConfig, 'doubleTapReset');
|
|
13
13
|
const isZoomOnDoubleTapResetEnabled = Object.keys(optionsLookup).length > 0 && Boolean(config);
|
|
14
14
|
React.useEffect(() => {
|
|
15
15
|
if (!isZoomOnDoubleTapResetEnabled) {
|