@mui/x-charts-pro 8.15.0 → 8.16.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 +11 -2
- package/BarChartPro/BarChartPro.plugins.d.ts +1 -1
- package/BarChartPro/BarChartPro.plugins.js +1 -1
- package/CHANGELOG.md +100 -0
- package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/FunnelChart/FunnelPlot.js +3 -23
- package/FunnelChart/coordinateMapper.d.ts +3 -0
- package/FunnelChart/coordinateMapper.js +18 -0
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.js +1 -2
- package/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +5 -6
- package/FunnelChart/seriesConfig/index.js +2 -0
- package/FunnelChart/seriesConfig/tooltipPosition.d.ts +3 -0
- package/FunnelChart/seriesConfig/tooltipPosition.js +62 -0
- package/Heatmap/Heatmap.plugins.d.ts +1 -1
- package/Heatmap/Heatmap.plugins.js +1 -1
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.js +9 -0
- package/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +3 -2
- package/Heatmap/seriesConfig/index.js +2 -0
- package/Heatmap/seriesConfig/tooltipPosition.d.ts +3 -0
- package/Heatmap/seriesConfig/tooltipPosition.js +57 -0
- package/LineChartPro/LineChartPro.js +11 -2
- package/LineChartPro/LineChartPro.plugins.d.ts +1 -1
- package/LineChartPro/LineChartPro.plugins.js +1 -1
- package/RadarChartPro/RadarChartPro.plugins.d.ts +1 -1
- package/RadarChartPro/RadarChartPro.plugins.js +1 -1
- package/SankeyChart/SankeyTooltip/SankeyTooltip.js +9 -0
- package/ScatterChartPro/ScatterChartPro.js +11 -2
- package/ScatterChartPro/ScatterChartPro.plugins.d.ts +1 -1
- package/ScatterChartPro/ScatterChartPro.plugins.js +1 -1
- package/esm/BarChartPro/BarChartPro.js +11 -2
- package/esm/BarChartPro/BarChartPro.plugins.d.ts +1 -1
- package/esm/BarChartPro/BarChartPro.plugins.js +1 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/esm/FunnelChart/FunnelPlot.js +4 -24
- package/esm/FunnelChart/coordinateMapper.d.ts +3 -0
- package/esm/FunnelChart/coordinateMapper.js +11 -0
- package/esm/FunnelChart/funnelAxisPlugin/computeAxisValue.js +1 -2
- package/esm/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +5 -6
- package/esm/FunnelChart/seriesConfig/index.js +2 -0
- package/esm/FunnelChart/seriesConfig/tooltipPosition.d.ts +3 -0
- package/esm/FunnelChart/seriesConfig/tooltipPosition.js +56 -0
- package/esm/Heatmap/Heatmap.plugins.d.ts +1 -1
- package/esm/Heatmap/Heatmap.plugins.js +1 -1
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.js +9 -0
- package/esm/Heatmap/seriesConfig/getSeriesWithDefaultValues.js +3 -2
- package/esm/Heatmap/seriesConfig/index.js +2 -0
- package/esm/Heatmap/seriesConfig/tooltipPosition.d.ts +3 -0
- package/esm/Heatmap/seriesConfig/tooltipPosition.js +51 -0
- package/esm/LineChartPro/LineChartPro.js +11 -2
- package/esm/LineChartPro/LineChartPro.plugins.d.ts +1 -1
- package/esm/LineChartPro/LineChartPro.plugins.js +1 -1
- package/esm/RadarChartPro/RadarChartPro.plugins.d.ts +1 -1
- package/esm/RadarChartPro/RadarChartPro.plugins.js +1 -1
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.js +9 -0
- package/esm/ScatterChartPro/ScatterChartPro.js +11 -2
- package/esm/ScatterChartPro/ScatterChartPro.plugins.d.ts +1 -1
- package/esm/ScatterChartPro/ScatterChartPro.plugins.js +1 -1
- package/esm/index.js +1 -1
- package/esm/internals/plugins/allPlugins.d.ts +5 -5
- package/esm/internals/plugins/allPlugins.js +3 -3
- package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +11 -2
- package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.js +3 -2
- package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +11 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +1 -1
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +1 -1
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.js +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +8 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +100 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +8 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +57 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +1 -1
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +1 -1
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +1 -1
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +4 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +1 -1
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +2 -2
- package/index.js +1 -1
- package/internals/plugins/allPlugins.d.ts +5 -5
- package/internals/plugins/allPlugins.js +2 -2
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +11 -2
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.js +3 -2
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.types.d.ts +11 -3
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +1 -1
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +1 -1
- package/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.d.ts +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoom.utils.js +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +8 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +107 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +8 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +64 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +1 -1
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +1 -1
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +1 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.js +4 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +1 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +2 -2
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature, UseChartBrushSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
3
|
import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
|
|
4
|
-
export type ScatterChartProPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<'scatter'>,
|
|
4
|
+
export type ScatterChartProPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature, UseChartProZoomSignature, UseChartProExportSignature];
|
|
5
5
|
export declare const SCATTER_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<ScatterChartProPluginSignatures>;
|
|
@@ -7,4 +7,4 @@ exports.SCATTER_CHART_PRO_PLUGINS = void 0;
|
|
|
7
7
|
var _internals = require("@mui/x-charts/internals");
|
|
8
8
|
var _useChartProExport = require("../internals/plugins/useChartProExport");
|
|
9
9
|
var _useChartProZoom = require("../internals/plugins/useChartProZoom");
|
|
10
|
-
const SCATTER_CHART_PRO_PLUGINS = exports.SCATTER_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartBrush, _internals.
|
|
10
|
+
const SCATTER_CHART_PRO_PLUGINS = exports.SCATTER_CHART_PRO_PLUGINS = [_internals.useChartZAxis, _internals.useChartBrush, _internals.useChartInteraction, _internals.useChartCartesianAxis, _internals.useChartHighlight, _internals.useChartClosestPoint, _internals.useChartKeyboardNavigation, _useChartProZoom.useChartProZoom, _useChartProExport.useChartProExport];
|
|
@@ -17,6 +17,7 @@ import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
|
17
17
|
import { useBarChartProps } from '@mui/x-charts/internals';
|
|
18
18
|
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
19
19
|
import { ChartsWrapper } from '@mui/x-charts/ChartsWrapper';
|
|
20
|
+
import { ChartsBrushOverlay } from '@mui/x-charts/ChartsBrushOverlay';
|
|
20
21
|
import { ChartZoomSlider } from "../ChartZoomSlider/index.js";
|
|
21
22
|
import { ChartsToolbarPro } from "../ChartsToolbarPro/index.js";
|
|
22
23
|
import { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
@@ -77,7 +78,7 @@ const BarChartPro = /*#__PURE__*/React.forwardRef(function BarChartPro(inProps,
|
|
|
77
78
|
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
78
79
|
children: [/*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
79
80
|
children: [/*#__PURE__*/_jsx(BarPlot, _extends({}, barPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
80
|
-
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartZoomSlider, {}), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
81
|
+
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartZoomSlider, {}), /*#__PURE__*/_jsx(ChartsBrushOverlay, {}), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
81
82
|
})), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip))]
|
|
82
83
|
}))
|
|
83
84
|
}));
|
|
@@ -1446,7 +1447,7 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1446
1447
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1447
1448
|
type: PropTypes.oneOf(['pressAndDrag']).isRequired
|
|
1448
1449
|
})]).isRequired),
|
|
1449
|
-
zoom: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['pinch', 'tapAndDrag', 'wheel']), PropTypes.shape({
|
|
1450
|
+
zoom: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['brush', 'doubleTapReset', 'pinch', 'tapAndDrag', 'wheel']), PropTypes.shape({
|
|
1450
1451
|
pointerMode: PropTypes.any,
|
|
1451
1452
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1452
1453
|
type: PropTypes.oneOf(['wheel']).isRequired
|
|
@@ -1458,6 +1459,14 @@ process.env.NODE_ENV !== "production" ? BarChartPro.propTypes = {
|
|
|
1458
1459
|
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1459
1460
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1460
1461
|
type: PropTypes.oneOf(['tapAndDrag']).isRequired
|
|
1462
|
+
}), PropTypes.shape({
|
|
1463
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1464
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1465
|
+
type: PropTypes.oneOf(['doubleTapReset']).isRequired
|
|
1466
|
+
}), PropTypes.shape({
|
|
1467
|
+
pointerMode: PropTypes.any,
|
|
1468
|
+
requiredKeys: PropTypes.array,
|
|
1469
|
+
type: PropTypes.oneOf(['brush']).isRequired
|
|
1461
1470
|
})]).isRequired)
|
|
1462
1471
|
})
|
|
1463
1472
|
} : void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartBrushSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
3
|
import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
|
|
4
|
-
export type BarChartProPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<'bar'>,
|
|
4
|
+
export type BarChartProPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'bar'>, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartProZoomSignature, UseChartProExportSignature];
|
|
5
5
|
export declare const BAR_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<BarChartProPluginSignatures>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartKeyboardNavigation, 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 BAR_CHART_PRO_PLUGINS = [useChartZAxis, useChartBrush,
|
|
4
|
+
export const BAR_CHART_PRO_PLUGINS = [useChartZAxis, useChartBrush, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartKeyboardNavigation, useChartProZoom, useChartProExport];
|
|
@@ -11,7 +11,7 @@ import { defaultSlotsMaterial } from "../internals/material/index.js";
|
|
|
11
11
|
import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
12
12
|
import { useChartDataProviderProProps } from "./useChartDataProviderProProps.js";
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
const releaseInfo = "
|
|
14
|
+
const releaseInfo = "MTc2MTY5NjAwMDAwMA==";
|
|
15
15
|
const packageIdentifier = 'x-charts-pro';
|
|
16
16
|
/**
|
|
17
17
|
* Orchestrates the data providers for the chart components and hooks.
|
|
@@ -4,13 +4,14 @@ 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, useSelector, useStore
|
|
7
|
+
import { cartesianSeriesTypes, useSelector, 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";
|
|
11
11
|
import { getFunnelCurve } from "./curves/index.js";
|
|
12
12
|
import { FunnelSectionLabel } from "./FunnelSectionLabel.js";
|
|
13
13
|
import { selectorChartXAxis, selectorChartYAxis, selectorFunnelGap } from "./funnelAxisPlugin/useChartFunnelAxisRendering.selectors.js";
|
|
14
|
+
import { createPositionGetter } from "./coordinateMapper.js";
|
|
14
15
|
import { createElement as _createElement } from "react";
|
|
15
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
17
|
cartesianSeriesTypes.addType('funnel');
|
|
@@ -43,31 +44,10 @@ const useAggregatedData = () => {
|
|
|
43
44
|
const yAxisId = currentSeries.yAxisId ?? defaultYAxisId;
|
|
44
45
|
const valueFormatter = currentSeries.valueFormatter;
|
|
45
46
|
const baseScaleConfig = isHorizontal ? xAxis[xAxisId] : yAxis[yAxisId];
|
|
46
|
-
const isXAxisBand = xAxis[xAxisId].scaleType === 'band';
|
|
47
|
-
const isYAxisBand = yAxis[yAxisId].scaleType === 'band';
|
|
48
|
-
const bandWidth = (isXAxisBand || isYAxisBand) && baseScaleConfig.scale?.bandwidth() || 0;
|
|
49
47
|
const xScale = xAxis[xAxisId].scale;
|
|
50
48
|
const yScale = yAxis[yAxisId].scale;
|
|
51
|
-
const xPosition = (
|
|
52
|
-
|
|
53
|
-
const position = xScale(bandIdentifier);
|
|
54
|
-
return useBand ? position + bandWidth : position;
|
|
55
|
-
}
|
|
56
|
-
if (isHorizontal) {
|
|
57
|
-
return xScale(value + (stackOffset || 0)) + bandIndex * gap;
|
|
58
|
-
}
|
|
59
|
-
return xScale(value);
|
|
60
|
-
};
|
|
61
|
-
const yPosition = (value, bandIndex, bandIdentifier, stackOffset, useBand) => {
|
|
62
|
-
if (isOrdinalScale(yScale)) {
|
|
63
|
-
const position = yScale(bandIdentifier);
|
|
64
|
-
return useBand ? position + bandWidth : position;
|
|
65
|
-
}
|
|
66
|
-
if (isHorizontal) {
|
|
67
|
-
return yScale(value);
|
|
68
|
-
}
|
|
69
|
-
return yScale(value + (stackOffset || 0)) + bandIndex * gap;
|
|
70
|
-
};
|
|
49
|
+
const xPosition = createPositionGetter(xScale, isHorizontal, gap);
|
|
50
|
+
const yPosition = createPositionGetter(yScale, !isHorizontal, gap);
|
|
71
51
|
const allY = currentSeries.dataPoints.flatMap((d, dataIndex) => d.flatMap(v => yPosition(v.y, dataIndex, baseScaleConfig.data?.[dataIndex], v.stackOffset, v.useBandWidth)));
|
|
72
52
|
const allX = currentSeries.dataPoints.flatMap((d, dataIndex) => d.flatMap(v => xPosition(v.x, dataIndex, baseScaleConfig.data?.[dataIndex], v.stackOffset, v.useBandWidth)));
|
|
73
53
|
const minPoint = {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isOrdinalScale } from '@mui/x-charts/internals';
|
|
2
|
+
export const createPositionGetter = (scale, isCategoryDirection, gap) => (value, bandIndex, bandIdentifier, stackOffset, useBand) => {
|
|
3
|
+
if (isOrdinalScale(scale)) {
|
|
4
|
+
const position = scale(bandIdentifier);
|
|
5
|
+
return useBand ? position + scale.bandwidth() : position;
|
|
6
|
+
}
|
|
7
|
+
if (isCategoryDirection) {
|
|
8
|
+
return scale(value + (stackOffset || 0)) + bandIndex * gap;
|
|
9
|
+
}
|
|
10
|
+
return scale(value);
|
|
11
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { scaleBand } from '@mui/x-charts
|
|
3
|
-
import { getAxisExtrema, isBandScaleConfig, isPointScaleConfig, isContinuousScaleConfig, getScale, getColorScale, getOrdinalColorScale, getTickNumber, scaleTickNumberByRange, getCartesianAxisTriggerTooltip, isDateData, createDateFormatter, getDefaultTickNumber } from '@mui/x-charts/internals';
|
|
2
|
+
import { getAxisExtrema, isBandScaleConfig, isPointScaleConfig, isContinuousScaleConfig, getScale, getColorScale, getOrdinalColorScale, getTickNumber, scaleTickNumberByRange, getCartesianAxisTriggerTooltip, isDateData, createDateFormatter, getDefaultTickNumber, scaleBand } from '@mui/x-charts/internals';
|
|
4
3
|
export const xRangeGetter = (drawingArea, reverse, removedSpace = 0) => {
|
|
5
4
|
const range = [drawingArea.left, drawingArea.left + drawingArea.width - removedSpace];
|
|
6
5
|
return reverse ? [range[1], range[0]] : [range[0], range[1]];
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
|
|
3
|
-
return _extends({
|
|
4
|
-
id: seriesData.id ?? `auto-generated-id-${seriesIndex}
|
|
5
|
-
}, seriesData, {
|
|
3
|
+
return _extends({}, seriesData, {
|
|
4
|
+
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`,
|
|
6
5
|
borderRadius: seriesData.borderRadius ?? 8,
|
|
7
|
-
data: seriesData.data.map((d, index) => _extends({
|
|
8
|
-
color: colors[index % colors.length]
|
|
9
|
-
}
|
|
6
|
+
data: seriesData.data.map((d, index) => _extends({}, d, {
|
|
7
|
+
color: d.color ?? colors[index % colors.length]
|
|
8
|
+
}))
|
|
10
9
|
});
|
|
11
10
|
};
|
|
12
11
|
export default getSeriesWithDefaultValues;
|
|
@@ -4,11 +4,13 @@ import getColor from "./getColor.js";
|
|
|
4
4
|
import legendGetter from "./legend.js";
|
|
5
5
|
import tooltipGetter from "./tooltip.js";
|
|
6
6
|
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
7
|
+
import tooltipItemPositionGetter from "./tooltipPosition.js";
|
|
7
8
|
export const seriesConfig = {
|
|
8
9
|
seriesProcessor,
|
|
9
10
|
colorProcessor: getColor,
|
|
10
11
|
legendGetter,
|
|
11
12
|
tooltipGetter,
|
|
13
|
+
tooltipItemPositionGetter,
|
|
12
14
|
xExtremumGetter: getExtremumX,
|
|
13
15
|
yExtremumGetter: getExtremumY,
|
|
14
16
|
getSeriesWithDefaultValues
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { findMinMax } from '@mui/x-charts/internals';
|
|
2
|
+
import { createPositionGetter } from "../coordinateMapper.js";
|
|
3
|
+
const tooltipItemPositionGetter = params => {
|
|
4
|
+
const {
|
|
5
|
+
series,
|
|
6
|
+
identifier,
|
|
7
|
+
axesConfig,
|
|
8
|
+
placement
|
|
9
|
+
} = params;
|
|
10
|
+
if (!identifier || identifier.dataIndex === undefined) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const itemSeries = series.funnel?.series[identifier.seriesId];
|
|
14
|
+
if (itemSeries == null) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
if (axesConfig.x === undefined || axesConfig.y === undefined) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const isHorizontal = itemSeries.layout === 'horizontal';
|
|
21
|
+
const baseScaleConfig = isHorizontal ? axesConfig.x : axesConfig.y;
|
|
22
|
+
|
|
23
|
+
// FIXME gap should be obtained from the store.
|
|
24
|
+
// Maybe moving it to the series would be a good idea similar to what we do with bar charts and their stackingGroups
|
|
25
|
+
const gap = 0;
|
|
26
|
+
const xPosition = createPositionGetter(axesConfig.x.scale, isHorizontal, gap);
|
|
27
|
+
const yPosition = createPositionGetter(axesConfig.y.scale, !isHorizontal, gap);
|
|
28
|
+
const allY = itemSeries.dataPoints[identifier.dataIndex].map(v => yPosition(v.y, identifier.dataIndex, baseScaleConfig.data?.[identifier.dataIndex], v.stackOffset, v.useBandWidth));
|
|
29
|
+
const allX = itemSeries.dataPoints[identifier.dataIndex].map(v => xPosition(v.x, identifier.dataIndex, baseScaleConfig.data?.[identifier.dataIndex], v.stackOffset, v.useBandWidth));
|
|
30
|
+
const [x0, x1] = findMinMax(allX);
|
|
31
|
+
const [y0, y1] = findMinMax(allY);
|
|
32
|
+
switch (placement) {
|
|
33
|
+
case 'bottom':
|
|
34
|
+
return {
|
|
35
|
+
x: (x1 + x0) / 2,
|
|
36
|
+
y: y1
|
|
37
|
+
};
|
|
38
|
+
case 'left':
|
|
39
|
+
return {
|
|
40
|
+
x: x0,
|
|
41
|
+
y: (y1 + y0) / 2
|
|
42
|
+
};
|
|
43
|
+
case 'right':
|
|
44
|
+
return {
|
|
45
|
+
x: x1,
|
|
46
|
+
y: (y1 + y0) / 2
|
|
47
|
+
};
|
|
48
|
+
case 'top':
|
|
49
|
+
default:
|
|
50
|
+
return {
|
|
51
|
+
x: (x1 + x0) / 2,
|
|
52
|
+
y: y0
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
export default tooltipItemPositionGetter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
export type HeatmapPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'heatmap'>,
|
|
3
|
+
export type HeatmapPluginSignatures = [UseChartZAxisSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'heatmap'>, UseChartHighlightSignature, UseChartProExportSignature];
|
|
4
4
|
export declare const HEATMAP_PLUGINS: ConvertSignaturesIntoPlugins<HeatmapPluginSignatures>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight } from '@mui/x-charts/internals';
|
|
2
2
|
import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
export const HEATMAP_PLUGINS = [useChartZAxis,
|
|
3
|
+
export const HEATMAP_PLUGINS = [useChartZAxis, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartProExport];
|
|
@@ -26,6 +26,11 @@ process.env.NODE_ENV !== "production" ? HeatmapTooltip.propTypes = {
|
|
|
26
26
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
27
27
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
28
28
|
// ----------------------------------------------------------------------
|
|
29
|
+
/**
|
|
30
|
+
* Determine if the tooltip should be placed on the pointer location or on the node.
|
|
31
|
+
* @default 'pointer'
|
|
32
|
+
*/
|
|
33
|
+
anchor: PropTypes.oneOf(['node', 'pointer']),
|
|
29
34
|
/**
|
|
30
35
|
* An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
|
|
31
36
|
* or a function that returns either.
|
|
@@ -155,6 +160,10 @@ process.env.NODE_ENV !== "production" ? HeatmapTooltip.propTypes = {
|
|
|
155
160
|
update: PropTypes.func.isRequired
|
|
156
161
|
})
|
|
157
162
|
})]),
|
|
163
|
+
/**
|
|
164
|
+
* Determines the tooltip position relatively to the anchor.
|
|
165
|
+
*/
|
|
166
|
+
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
158
167
|
/**
|
|
159
168
|
* The props used for each slot inside the Popper.
|
|
160
169
|
* @default {}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
|
|
3
3
|
return _extends({
|
|
4
|
-
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`,
|
|
5
4
|
color: colors[seriesIndex % colors.length]
|
|
6
|
-
}, seriesData
|
|
5
|
+
}, seriesData, {
|
|
6
|
+
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`
|
|
7
|
+
});
|
|
7
8
|
};
|
|
8
9
|
export default getSeriesWithDefaultValues;
|
|
@@ -3,11 +3,13 @@ import seriesProcessor from "./seriesProcessor.js";
|
|
|
3
3
|
import getColor from "./getColor.js";
|
|
4
4
|
import tooltipGetter from "./tooltip.js";
|
|
5
5
|
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
6
|
+
import tooltipItemPositionGetter from "./tooltipPosition.js";
|
|
6
7
|
export const seriesConfig = {
|
|
7
8
|
seriesProcessor,
|
|
8
9
|
colorProcessor: getColor,
|
|
9
10
|
legendGetter: () => [],
|
|
10
11
|
tooltipGetter,
|
|
12
|
+
tooltipItemPositionGetter,
|
|
11
13
|
xExtremumGetter: getBaseExtremum,
|
|
12
14
|
yExtremumGetter: getBaseExtremum,
|
|
13
15
|
getSeriesWithDefaultValues
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { isBandScaleConfig } from '@mui/x-charts/internals';
|
|
2
|
+
const tooltipItemPositionGetter = params => {
|
|
3
|
+
const {
|
|
4
|
+
series,
|
|
5
|
+
identifier,
|
|
6
|
+
axesConfig,
|
|
7
|
+
placement
|
|
8
|
+
} = params;
|
|
9
|
+
if (!identifier || identifier.dataIndex === undefined) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
const itemSeries = series.heatmap?.series[identifier.seriesId];
|
|
13
|
+
if (itemSeries == null) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
if (axesConfig.x === undefined || axesConfig.y === undefined || !isBandScaleConfig(axesConfig.x) || !isBandScaleConfig(axesConfig.y)) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
const [xIndex, yIndex] = itemSeries.data[identifier.dataIndex];
|
|
20
|
+
const x = axesConfig.x.scale(axesConfig.x.scale.domain()[xIndex]);
|
|
21
|
+
const y = axesConfig.y.scale(axesConfig.y.scale.domain()[yIndex]);
|
|
22
|
+
if (x === undefined || y === undefined) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const width = axesConfig.x.scale.bandwidth();
|
|
26
|
+
const height = axesConfig.y.scale.bandwidth();
|
|
27
|
+
switch (placement) {
|
|
28
|
+
case 'bottom':
|
|
29
|
+
return {
|
|
30
|
+
x: x + width / 2,
|
|
31
|
+
y: y + height
|
|
32
|
+
};
|
|
33
|
+
case 'left':
|
|
34
|
+
return {
|
|
35
|
+
x,
|
|
36
|
+
y: y + height / 2
|
|
37
|
+
};
|
|
38
|
+
case 'right':
|
|
39
|
+
return {
|
|
40
|
+
x: x + width,
|
|
41
|
+
y: y + height / 2
|
|
42
|
+
};
|
|
43
|
+
case 'top':
|
|
44
|
+
default:
|
|
45
|
+
return {
|
|
46
|
+
x: x + width / 2,
|
|
47
|
+
y
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
export default tooltipItemPositionGetter;
|
|
@@ -17,6 +17,7 @@ import { ChartsClipPath } from '@mui/x-charts/ChartsClipPath';
|
|
|
17
17
|
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
18
18
|
import { useLineChartProps } from '@mui/x-charts/internals';
|
|
19
19
|
import { ChartsWrapper } from '@mui/x-charts/ChartsWrapper';
|
|
20
|
+
import { ChartsBrushOverlay } from '@mui/x-charts/ChartsBrushOverlay';
|
|
20
21
|
import { ChartZoomSlider } from "../ChartZoomSlider/index.js";
|
|
21
22
|
import { ChartsToolbarPro } from "../ChartsToolbarPro/index.js";
|
|
22
23
|
import { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
@@ -82,7 +83,7 @@ const LineChartPro = /*#__PURE__*/React.forwardRef(function LineChartPro(inProps
|
|
|
82
83
|
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartZoomSlider, {}), /*#__PURE__*/_jsx("g", {
|
|
83
84
|
"data-drawing-container": true,
|
|
84
85
|
children: /*#__PURE__*/_jsx(MarkPlot, _extends({}, markPlotProps))
|
|
85
|
-
}), /*#__PURE__*/_jsx(LineHighlightPlot, _extends({}, lineHighlightPlotProps)), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
86
|
+
}), /*#__PURE__*/_jsx(LineHighlightPlot, _extends({}, lineHighlightPlotProps)), /*#__PURE__*/_jsx(ChartsBrushOverlay, {}), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
86
87
|
})), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({}, props.slotProps?.tooltip))]
|
|
87
88
|
}))
|
|
88
89
|
}));
|
|
@@ -1449,7 +1450,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1449
1450
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1450
1451
|
type: PropTypes.oneOf(['pressAndDrag']).isRequired
|
|
1451
1452
|
})]).isRequired),
|
|
1452
|
-
zoom: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['pinch', 'tapAndDrag', 'wheel']), PropTypes.shape({
|
|
1453
|
+
zoom: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['brush', 'doubleTapReset', 'pinch', 'tapAndDrag', 'wheel']), PropTypes.shape({
|
|
1453
1454
|
pointerMode: PropTypes.any,
|
|
1454
1455
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1455
1456
|
type: PropTypes.oneOf(['wheel']).isRequired
|
|
@@ -1461,6 +1462,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1461
1462
|
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1462
1463
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1463
1464
|
type: PropTypes.oneOf(['tapAndDrag']).isRequired
|
|
1465
|
+
}), PropTypes.shape({
|
|
1466
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1467
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1468
|
+
type: PropTypes.oneOf(['doubleTapReset']).isRequired
|
|
1469
|
+
}), PropTypes.shape({
|
|
1470
|
+
pointerMode: PropTypes.any,
|
|
1471
|
+
requiredKeys: PropTypes.array,
|
|
1472
|
+
type: PropTypes.oneOf(['brush']).isRequired
|
|
1464
1473
|
})]).isRequired)
|
|
1465
1474
|
})
|
|
1466
1475
|
} : void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartBrushSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
3
|
import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
|
|
4
|
-
export type LineChartProPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<'line'>,
|
|
4
|
+
export type LineChartProPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'line'>, UseChartHighlightSignature, UseChartKeyboardNavigationSignature, UseChartProZoomSignature, UseChartProExportSignature];
|
|
5
5
|
export declare const LINE_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<LineChartProPluginSignatures>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartKeyboardNavigation, 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 LINE_CHART_PRO_PLUGINS = [useChartZAxis, useChartBrush,
|
|
4
|
+
export const LINE_CHART_PRO_PLUGINS = [useChartZAxis, useChartBrush, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartKeyboardNavigation, useChartProZoom, useChartProExport];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ConvertSignaturesIntoPlugins, UseChartHighlightSignature, UseChartInteractionSignature, UseChartPolarAxisSignature } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
export type RadarChartProPluginSignatures = [
|
|
3
|
+
export type RadarChartProPluginSignatures = [UseChartInteractionSignature, UseChartPolarAxisSignature, UseChartHighlightSignature, UseChartProExportSignature];
|
|
4
4
|
export declare const RADAR_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<RadarChartProPluginSignatures>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { useChartHighlight, useChartInteraction, useChartPolarAxis } from '@mui/x-charts/internals';
|
|
2
2
|
import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
export const RADAR_CHART_PRO_PLUGINS = [
|
|
3
|
+
export const RADAR_CHART_PRO_PLUGINS = [useChartInteraction, useChartPolarAxis, useChartHighlight, useChartProExport];
|
|
@@ -23,6 +23,11 @@ process.env.NODE_ENV !== "production" ? SankeyTooltip.propTypes = {
|
|
|
23
23
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
24
24
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
25
25
|
// ----------------------------------------------------------------------
|
|
26
|
+
/**
|
|
27
|
+
* Determine if the tooltip should be placed on the pointer location or on the node.
|
|
28
|
+
* @default 'pointer'
|
|
29
|
+
*/
|
|
30
|
+
anchor: PropTypes.oneOf(['node', 'pointer']),
|
|
26
31
|
/**
|
|
27
32
|
* An HTML element, [virtualElement](https://popper.js.org/docs/v2/virtual-elements/),
|
|
28
33
|
* or a function that returns either.
|
|
@@ -171,6 +176,10 @@ process.env.NODE_ENV !== "production" ? SankeyTooltip.propTypes = {
|
|
|
171
176
|
update: PropTypes.func.isRequired
|
|
172
177
|
})
|
|
173
178
|
})]),
|
|
179
|
+
/**
|
|
180
|
+
* Determines the tooltip position relatively to the anchor.
|
|
181
|
+
*/
|
|
182
|
+
position: PropTypes.oneOf(['bottom', 'left', 'right', 'top']),
|
|
174
183
|
/**
|
|
175
184
|
* The props used for each slot inside the Popper.
|
|
176
185
|
* @default {}
|
|
@@ -16,6 +16,7 @@ import { ChartsAxisHighlight } from '@mui/x-charts/ChartsAxisHighlight';
|
|
|
16
16
|
import { ChartsTooltip } from '@mui/x-charts/ChartsTooltip';
|
|
17
17
|
import { useScatterChartProps } from '@mui/x-charts/internals';
|
|
18
18
|
import { ChartsWrapper } from '@mui/x-charts/ChartsWrapper';
|
|
19
|
+
import { ChartsBrushOverlay } from '@mui/x-charts/ChartsBrushOverlay';
|
|
19
20
|
import { ChartZoomSlider } from "../ChartZoomSlider/index.js";
|
|
20
21
|
import { ChartsToolbarPro } from "../ChartsToolbarPro/index.js";
|
|
21
22
|
import { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
@@ -74,7 +75,7 @@ const ScatterChartPro = /*#__PURE__*/React.forwardRef(function ScatterChartPro(i
|
|
|
74
75
|
children: [/*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartZoomSlider, {}), /*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsx("g", {
|
|
75
76
|
"data-drawing-container": true,
|
|
76
77
|
children: /*#__PURE__*/_jsx(ScatterPlot, _extends({}, scatterPlotProps))
|
|
77
|
-
}), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), children]
|
|
78
|
+
}), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), /*#__PURE__*/_jsx(ChartsBrushOverlay, {}), children]
|
|
78
79
|
})), !props.loading && /*#__PURE__*/_jsx(Tooltip, _extends({
|
|
79
80
|
trigger: "item"
|
|
80
81
|
}, props.slotProps?.tooltip))]
|
|
@@ -1431,7 +1432,7 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
1431
1432
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1432
1433
|
type: PropTypes.oneOf(['pressAndDrag']).isRequired
|
|
1433
1434
|
})]).isRequired),
|
|
1434
|
-
zoom: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['pinch', 'tapAndDrag', 'wheel']), PropTypes.shape({
|
|
1435
|
+
zoom: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(['brush', 'doubleTapReset', 'pinch', 'tapAndDrag', 'wheel']), PropTypes.shape({
|
|
1435
1436
|
pointerMode: PropTypes.any,
|
|
1436
1437
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1437
1438
|
type: PropTypes.oneOf(['wheel']).isRequired
|
|
@@ -1443,6 +1444,14 @@ process.env.NODE_ENV !== "production" ? ScatterChartPro.propTypes = {
|
|
|
1443
1444
|
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1444
1445
|
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1445
1446
|
type: PropTypes.oneOf(['tapAndDrag']).isRequired
|
|
1447
|
+
}), PropTypes.shape({
|
|
1448
|
+
pointerMode: PropTypes.oneOf(['mouse', 'touch']),
|
|
1449
|
+
requiredKeys: PropTypes.arrayOf(PropTypes.string),
|
|
1450
|
+
type: PropTypes.oneOf(['doubleTapReset']).isRequired
|
|
1451
|
+
}), PropTypes.shape({
|
|
1452
|
+
pointerMode: PropTypes.any,
|
|
1453
|
+
requiredKeys: PropTypes.array,
|
|
1454
|
+
type: PropTypes.oneOf(['brush']).isRequired
|
|
1446
1455
|
})]).isRequired)
|
|
1447
1456
|
})
|
|
1448
1457
|
} : void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseChartZAxisSignature, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature, UseChartBrushSignature, ConvertSignaturesIntoPlugins } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
3
|
import { UseChartProZoomSignature } from "../internals/plugins/useChartProZoom/index.js";
|
|
4
|
-
export type ScatterChartProPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartCartesianAxisSignature<'scatter'>,
|
|
4
|
+
export type ScatterChartProPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature, UseChartProZoomSignature, UseChartProExportSignature];
|
|
5
5
|
export declare const SCATTER_CHART_PRO_PLUGINS: ConvertSignaturesIntoPlugins<ScatterChartProPluginSignatures>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartClosestPoint, useChartKeyboardNavigation, 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 SCATTER_CHART_PRO_PLUGINS = [useChartZAxis, useChartBrush,
|
|
4
|
+
export const SCATTER_CHART_PRO_PLUGINS = [useChartZAxis, useChartBrush, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartClosestPoint, useChartKeyboardNavigation, useChartProZoom, useChartProExport];
|
package/esm/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature, UseChartPolarAxisSignature } from '@mui/x-charts/internals';
|
|
1
|
+
import { ChartSeriesType, ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartZAxisSignature, UseChartHighlightSignature, UseChartPolarAxisSignature, UseChartBrushSignature } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "./useChartProExport/index.js";
|
|
3
3
|
import { UseChartProZoomSignature } from "./useChartProZoom/index.js";
|
|
4
|
-
export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>,
|
|
4
|
+
export type AllPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>, UseChartHighlightSignature, UseChartProZoomSignature, UseChartProExportSignature];
|
|
5
5
|
export type AllPluginsType<TSeries extends ChartSeriesType = ChartSeriesType> = ConvertSignaturesIntoPlugins<AllPluginSignatures<TSeries>>;
|
|
6
|
-
export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature> | 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>> | import("@mui/x-charts/internals").ChartPlugin<UseChartPolarAxisSignature<any>>)[];
|
|
7
|
-
export type DefaultPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>,
|
|
6
|
+
export declare const ALL_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartBrushSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>> | import("@mui/x-charts/internals").ChartPlugin<UseChartPolarAxisSignature<any>>)[];
|
|
7
|
+
export type DefaultPluginSignatures<TSeries extends ChartSeriesType = ChartSeriesType> = [UseChartZAxisSignature, UseChartBrushSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<TSeries>, UseChartPolarAxisSignature<TSeries>, UseChartHighlightSignature, UseChartProZoomSignature, UseChartProExportSignature];
|
|
8
8
|
export type DefaultPluginsType<TSeries extends ChartSeriesType = ChartSeriesType> = ConvertSignaturesIntoPlugins<DefaultPluginSignatures<TSeries>>;
|
|
9
|
-
export declare const DEFAULT_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature> | 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>>)[];
|
|
9
|
+
export declare const DEFAULT_PLUGINS: (import("@mui/x-charts/internals").ChartPlugin<UseChartProZoomSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartProExportSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartZAxisSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartBrushSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartInteractionSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartHighlightSignature> | import("@mui/x-charts/internals").ChartPlugin<UseChartCartesianAxisSignature<any>>)[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// This file should be removed after creating all plugins in favor of a file per chart type.
|
|
2
2
|
|
|
3
|
-
import { useChartCartesianAxis, useChartInteraction, useChartZAxis, useChartHighlight, useChartPolarAxis } from '@mui/x-charts/internals';
|
|
3
|
+
import { useChartCartesianAxis, useChartInteraction, useChartZAxis, useChartHighlight, useChartPolarAxis, useChartBrush } from '@mui/x-charts/internals';
|
|
4
4
|
import { useChartProExport } from "./useChartProExport/index.js";
|
|
5
5
|
import { useChartProZoom } from "./useChartProZoom/index.js";
|
|
6
|
-
export const ALL_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartPolarAxis,
|
|
7
|
-
export const DEFAULT_PLUGINS = [useChartZAxis,
|
|
6
|
+
export const ALL_PLUGINS = [useChartZAxis, useChartBrush, useChartInteraction, useChartCartesianAxis, useChartPolarAxis, useChartHighlight, useChartProZoom, useChartProExport];
|
|
7
|
+
export const DEFAULT_PLUGINS = [useChartZAxis, useChartBrush, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartProZoom, useChartProExport];
|
|
@@ -6,7 +6,7 @@ export declare const selectorZoomInteractionConfig: import("reselect").Selector<
|
|
|
6
6
|
requiredKeys?: import("@mui/x-internal-gestures/core").KeyboardKey[];
|
|
7
7
|
};
|
|
8
8
|
pointerMode?: import("@mui/x-internal-gestures/core").PointerMode[];
|
|
9
|
-
}) | null, [interactionName: "wheel" | "pinch" | "tapAndDrag"]>;
|
|
9
|
+
}) | null, [interactionName: "wheel" | "pinch" | "tapAndDrag" | "doubleTapReset" | "brush"]>;
|
|
10
10
|
export declare const selectorPanInteractionConfig: import("reselect").Selector<any, (Omit<import("./ZoomInteractionConfig.types.js").PanInteraction, "pointerMode"> & {
|
|
11
11
|
mouse: {
|
|
12
12
|
requiredKeys?: import("@mui/x-internal-gestures/core").KeyboardKey[];
|
|
@@ -15,4 +15,13 @@ export declare const selectorPanInteractionConfig: import("reselect").Selector<a
|
|
|
15
15
|
requiredKeys?: import("@mui/x-internal-gestures/core").KeyboardKey[];
|
|
16
16
|
};
|
|
17
17
|
pointerMode?: import("@mui/x-internal-gestures/core").PointerMode[];
|
|
18
|
-
}) | null, [interactionName: "drag" | "pressAndDrag"]>;
|
|
18
|
+
}) | null, [interactionName: "drag" | "pressAndDrag"]>;
|
|
19
|
+
export declare const selectorIsZoomBrushEnabled: import("reselect").Selector<any, false | (Omit<import("./ZoomInteractionConfig.types.js").ZoomInteraction, "pointerMode"> & {
|
|
20
|
+
mouse: {
|
|
21
|
+
requiredKeys?: import("@mui/x-internal-gestures/core").KeyboardKey[];
|
|
22
|
+
};
|
|
23
|
+
touch: {
|
|
24
|
+
requiredKeys?: import("@mui/x-internal-gestures/core").KeyboardKey[];
|
|
25
|
+
};
|
|
26
|
+
pointerMode?: import("@mui/x-internal-gestures/core").PointerMode[];
|
|
27
|
+
}), []>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { createSelector } from '@mui/x-charts/internals';
|
|
1
|
+
import { createSelector, selectorChartZoomOptionsLookup } from '@mui/x-charts/internals';
|
|
2
2
|
import { selectorChartZoomState } from "./useChartProZoom.selectors.js";
|
|
3
3
|
export const selectorZoomInteractionConfig = createSelector([selectorChartZoomState, (_state, interactionName) => interactionName], (zoomState, interactionName) => zoomState.zoomInteractionConfig.zoom[interactionName] ?? null);
|
|
4
|
-
export const selectorPanInteractionConfig = createSelector([selectorChartZoomState, (_state, interactionName) => interactionName], (zoomState, interactionName) => zoomState.zoomInteractionConfig.pan[interactionName] ?? null);
|
|
4
|
+
export const selectorPanInteractionConfig = createSelector([selectorChartZoomState, (_state, interactionName) => interactionName], (zoomState, interactionName) => zoomState.zoomInteractionConfig.pan[interactionName] ?? null);
|
|
5
|
+
export const selectorIsZoomBrushEnabled = createSelector([selectorChartZoomOptionsLookup, state => selectorZoomInteractionConfig(state, 'brush')], (zoomOptions, zoomInteractionConfig) => Object.keys(zoomOptions).length > 0 && zoomInteractionConfig || false);
|