@mui/x-charts-pro 8.6.0 → 8.8.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.d.ts +1 -1
- package/BarChartPro/BarChartPro.js +32 -0
- package/CHANGELOG.md +202 -1
- package/ChartContainerPro/index.d.ts +7 -1
- package/ChartContainerPro/index.js +0 -11
- package/ChartDataProviderPro/ChartDataProviderPro.js +7 -1
- package/ChartZoomSlider/index.d.ts +2 -1
- package/ChartZoomSlider/index.js +10 -2
- package/ChartZoomSlider/internals/ChartAxisZoomSlider.js +35 -16
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +4 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +34 -13
- package/ChartZoomSlider/internals/ChartAxisZoomSliderPreview.d.ts +18 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderPreview.js +102 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.d.ts +11 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.js +62 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +9 -1
- package/ChartZoomSlider/internals/chartAxisZoomSliderTrackClasses.d.ts +15 -0
- package/ChartZoomSlider/internals/chartAxisZoomSliderTrackClasses.js +31 -0
- package/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +14 -0
- package/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +61 -0
- package/ChartZoomSlider/internals/previews/BarPreviewPlot.d.ts +10 -0
- package/ChartZoomSlider/internals/previews/BarPreviewPlot.js +62 -0
- package/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +14 -0
- package/ChartZoomSlider/internals/previews/LinePreviewPlot.js +59 -0
- package/ChartZoomSlider/internals/previews/PreviewPlot.types.d.ts +4 -0
- package/ChartZoomSlider/internals/previews/ScatterPreviewPlot.d.ts +16 -0
- package/ChartZoomSlider/internals/previews/ScatterPreviewPlot.js +93 -0
- package/ChartsToolbarPro/ChartsToolbarImageExportTrigger.js +3 -1
- package/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.js +4 -2
- package/ChartsToolbarPro/ChartsToolbarPro.js +2 -0
- package/FunnelChart/FunnelChart.d.ts +1 -1
- package/FunnelChart/FunnelPlot.js +1 -1
- package/FunnelChart/funnel.types.d.ts +14 -9
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +43 -33
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +1 -1
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +3 -3
- package/FunnelChart/seriesConfig/seriesProcessor.js +24 -48
- package/Heatmap/Heatmap.d.ts +1 -1
- package/LineChartPro/LineChartPro.js +38 -0
- package/PieChartPro/PieChartPro.d.ts +1 -1
- package/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +1 -1
- package/ScatterChartPro/ScatterChartPro.js +16 -0
- package/{ChartContainerPro → context}/ChartProApi.d.ts +2 -3
- package/context/ChartProApi.js +5 -0
- package/context/index.d.ts +2 -1
- package/context/index.js +4 -4
- package/context/useChartProApiContext.d.ts +9 -0
- package/context/{useChartApiContext.js → useChartProApiContext.js} +4 -4
- package/esm/BarChartPro/BarChartPro.d.ts +1 -1
- package/esm/BarChartPro/BarChartPro.js +32 -0
- package/esm/ChartContainerPro/index.d.ts +7 -1
- package/esm/ChartContainerPro/index.js +4 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +7 -1
- package/esm/ChartZoomSlider/index.d.ts +2 -1
- package/esm/ChartZoomSlider/index.js +2 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.js +37 -18
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +4 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +36 -14
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderPreview.d.ts +18 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderPreview.js +94 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.d.ts +11 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderPreviewContent.js +54 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +10 -1
- package/esm/ChartZoomSlider/internals/chartAxisZoomSliderTrackClasses.d.ts +15 -0
- package/esm/ChartZoomSlider/internals/chartAxisZoomSliderTrackClasses.js +21 -0
- package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +14 -0
- package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +53 -0
- package/esm/ChartZoomSlider/internals/previews/BarPreviewPlot.d.ts +10 -0
- package/esm/ChartZoomSlider/internals/previews/BarPreviewPlot.js +55 -0
- package/esm/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +14 -0
- package/esm/ChartZoomSlider/internals/previews/LinePreviewPlot.js +51 -0
- package/esm/ChartZoomSlider/internals/previews/PreviewPlot.types.d.ts +4 -0
- package/esm/ChartZoomSlider/internals/previews/ScatterPreviewPlot.d.ts +16 -0
- package/esm/ChartZoomSlider/internals/previews/ScatterPreviewPlot.js +86 -0
- package/esm/ChartsToolbarPro/ChartsToolbarImageExportTrigger.js +4 -2
- package/esm/ChartsToolbarPro/ChartsToolbarPrintExportTrigger.js +5 -3
- package/esm/ChartsToolbarPro/ChartsToolbarPro.js +2 -0
- package/esm/FunnelChart/FunnelChart.d.ts +1 -1
- package/esm/FunnelChart/FunnelPlot.js +1 -1
- package/esm/FunnelChart/funnel.types.d.ts +14 -9
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +43 -33
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +1 -1
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +3 -3
- package/esm/FunnelChart/seriesConfig/seriesProcessor.js +24 -48
- package/esm/Heatmap/Heatmap.d.ts +1 -1
- package/esm/LineChartPro/LineChartPro.js +38 -0
- package/esm/PieChartPro/PieChartPro.d.ts +1 -1
- package/esm/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +1 -1
- package/esm/ScatterChartPro/ScatterChartPro.js +16 -0
- package/esm/{ChartContainerPro → context}/ChartProApi.d.ts +2 -3
- package/esm/context/ChartProApi.js +1 -0
- package/esm/context/index.d.ts +2 -1
- package/esm/context/index.js +2 -1
- package/esm/context/useChartProApiContext.d.ts +9 -0
- package/esm/context/{useChartApiContext.js → useChartProApiContext.js} +3 -3
- package/esm/hooks/index.d.ts +2 -1
- package/esm/hooks/index.js +2 -1
- package/esm/hooks/useChartProApiRef.d.ts +23 -0
- package/esm/hooks/useChartProApiRef.js +20 -0
- package/esm/index.d.ts +4 -2
- package/esm/index.js +3 -3
- package/esm/internals/plugins/allPlugins.d.ts +2 -2
- package/esm/internals/plugins/useChartProExport/exportImage.js +9 -3
- package/esm/internals/plugins/useChartProExport/print.d.ts +3 -1
- package/esm/internals/plugins/useChartProExport/print.js +7 -2
- package/esm/internals/plugins/useChartProExport/useChartProExport.types.d.ts +22 -12
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +8 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +58 -0
- package/esm/internals/plugins/useChartProZoom/{useChartProZoom.utils.d.ts → gestureHooks/useZoom.utils.d.ts} +14 -10
- package/esm/internals/plugins/useChartProZoom/{useChartProZoom.utils.js → gestureHooks/useZoom.utils.js} +41 -31
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +8 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +59 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +8 -0
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +79 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +15 -227
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +4 -4
- package/hooks/index.d.ts +2 -1
- package/hooks/index.js +11 -0
- package/hooks/useChartProApiRef.d.ts +23 -0
- package/hooks/useChartProApiRef.js +28 -0
- package/index.d.ts +4 -2
- package/index.js +58 -22
- package/internals/plugins/allPlugins.d.ts +2 -2
- package/internals/plugins/useChartProExport/exportImage.js +9 -3
- package/internals/plugins/useChartProExport/print.d.ts +3 -1
- package/internals/plugins/useChartProExport/print.js +7 -2
- package/internals/plugins/useChartProExport/useChartProExport.types.d.ts +22 -12
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +8 -0
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +65 -0
- package/internals/plugins/useChartProZoom/{useChartProZoom.utils.d.ts → gestureHooks/useZoom.utils.d.ts} +14 -10
- package/internals/plugins/useChartProZoom/{useChartProZoom.utils.js → gestureHooks/useZoom.utils.js} +43 -34
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +8 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +66 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +8 -0
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +86 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.js +14 -226
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +4 -4
- package/package.json +6 -5
- package/context/useChartApiContext.d.ts +0 -9
- package/esm/context/useChartApiContext.d.ts +0 -9
- /package/{ChartContainerPro/ChartProApi.js → ChartZoomSlider/internals/previews/PreviewPlot.types.js} +0 -0
- /package/esm/{ChartContainerPro/ChartProApi.js → ChartZoomSlider/internals/previews/PreviewPlot.types.js} +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ScatterPreviewPlot = ScatterPreviewPlot;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _internals = require("@mui/x-charts/internals");
|
|
10
|
+
var _hooks = require("@mui/x-charts/hooks");
|
|
11
|
+
var _ScatterChart = require("@mui/x-charts/ScatterChart");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function ScatterPreviewPlot({
|
|
14
|
+
axisId,
|
|
15
|
+
x,
|
|
16
|
+
y,
|
|
17
|
+
height,
|
|
18
|
+
width
|
|
19
|
+
}) {
|
|
20
|
+
const store = (0, _internals.useStore)();
|
|
21
|
+
const seriesData = (0, _hooks.useScatterSeriesContext)();
|
|
22
|
+
const xAxes = (0, _internals.useSelector)(store, _internals.selectorChartPreviewComputedXAxis, [axisId]);
|
|
23
|
+
const yAxes = (0, _internals.useSelector)(store, _internals.selectorChartPreviewComputedYAxis, [axisId]);
|
|
24
|
+
const defaultXAxisId = (0, _hooks.useXAxes)().xAxisIds[0];
|
|
25
|
+
const defaultYAxisId = (0, _hooks.useYAxes)().yAxisIds[0];
|
|
26
|
+
const {
|
|
27
|
+
zAxis: zAxes,
|
|
28
|
+
zAxisIds
|
|
29
|
+
} = (0, _hooks.useZAxes)();
|
|
30
|
+
const defaultZAxisId = zAxisIds[0];
|
|
31
|
+
if (seriesData === undefined) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const {
|
|
35
|
+
series,
|
|
36
|
+
seriesOrder
|
|
37
|
+
} = seriesData;
|
|
38
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
39
|
+
children: seriesOrder.map(seriesId => {
|
|
40
|
+
const {
|
|
41
|
+
id,
|
|
42
|
+
xAxisId,
|
|
43
|
+
yAxisId,
|
|
44
|
+
zAxisId,
|
|
45
|
+
color
|
|
46
|
+
} = series[seriesId];
|
|
47
|
+
const colorGetter = _internals.scatterSeriesConfig.colorProcessor(series[seriesId], xAxes[xAxisId ?? defaultXAxisId], yAxes[yAxisId ?? defaultYAxisId], zAxes[zAxisId ?? defaultZAxisId]);
|
|
48
|
+
const xScale = xAxes[xAxisId ?? defaultXAxisId].scale;
|
|
49
|
+
const yScale = yAxes[yAxisId ?? defaultYAxisId].scale;
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ScatterPreviewItems, {
|
|
51
|
+
xScale: xScale,
|
|
52
|
+
yScale: yScale,
|
|
53
|
+
color: color,
|
|
54
|
+
colorGetter: colorGetter,
|
|
55
|
+
series: series[seriesId],
|
|
56
|
+
x: x,
|
|
57
|
+
y: y,
|
|
58
|
+
height: height,
|
|
59
|
+
width: width
|
|
60
|
+
}, id);
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function ScatterPreviewItems(props) {
|
|
65
|
+
const {
|
|
66
|
+
series,
|
|
67
|
+
xScale,
|
|
68
|
+
yScale,
|
|
69
|
+
color,
|
|
70
|
+
colorGetter,
|
|
71
|
+
x,
|
|
72
|
+
y,
|
|
73
|
+
width,
|
|
74
|
+
height
|
|
75
|
+
} = props;
|
|
76
|
+
const isPointInside = React.useCallback((px, py) => px >= x && px <= x + width && py >= y && py <= y + height, [height, width, x, y]);
|
|
77
|
+
const scatterPlotData = (0, _internals.useScatterPlotData)(series, xScale, yScale, isPointInside);
|
|
78
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
79
|
+
"data-series": series.id,
|
|
80
|
+
children: scatterPlotData.map((dataPoint, i) => {
|
|
81
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScatterChart.ScatterMarker, {
|
|
82
|
+
dataIndex: dataPoint.dataIndex,
|
|
83
|
+
color: colorGetter ? colorGetter(i) : color,
|
|
84
|
+
x: dataPoint.x,
|
|
85
|
+
y: dataPoint.y,
|
|
86
|
+
seriesId: series.id,
|
|
87
|
+
size: series.preview.markerSize,
|
|
88
|
+
isHighlighted: false,
|
|
89
|
+
isFaded: false
|
|
90
|
+
}, dataPoint.id ?? dataPoint.dataIndex);
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
}
|
|
@@ -35,7 +35,7 @@ const ChartsToolbarImageExportTrigger = exports.ChartsToolbarImageExportTrigger
|
|
|
35
35
|
slots,
|
|
36
36
|
slotProps
|
|
37
37
|
} = (0, _internals.useChartsSlots)();
|
|
38
|
-
const apiRef = (0, _context.
|
|
38
|
+
const apiRef = (0, _context.useChartProApiContext)();
|
|
39
39
|
const handleClick = event => {
|
|
40
40
|
apiRef.current.exportAsImage(options);
|
|
41
41
|
onClick?.(event);
|
|
@@ -64,7 +64,9 @@ process.env.NODE_ENV !== "production" ? ChartsToolbarImageExportTrigger.propType
|
|
|
64
64
|
* - [Export as Image](https://mui.com/x/react-charts/export/#export-as-image)
|
|
65
65
|
*/
|
|
66
66
|
options: _propTypes.default.shape({
|
|
67
|
+
copyStyles: _propTypes.default.bool,
|
|
67
68
|
fileName: _propTypes.default.string,
|
|
69
|
+
onBeforeExport: _propTypes.default.func,
|
|
68
70
|
quality: _propTypes.default.number,
|
|
69
71
|
type: _propTypes.default.string.isRequired
|
|
70
72
|
}),
|
|
@@ -35,7 +35,7 @@ const ChartsToolbarPrintExportTrigger = exports.ChartsToolbarPrintExportTrigger
|
|
|
35
35
|
slots,
|
|
36
36
|
slotProps
|
|
37
37
|
} = (0, _internals.useChartsSlots)();
|
|
38
|
-
const apiRef = (0, _context.
|
|
38
|
+
const apiRef = (0, _context.useChartProApiContext)();
|
|
39
39
|
const handleClick = event => {
|
|
40
40
|
apiRef.current.exportAsPrint(options);
|
|
41
41
|
onClick?.(event);
|
|
@@ -64,7 +64,9 @@ process.env.NODE_ENV !== "production" ? ChartsToolbarPrintExportTrigger.propType
|
|
|
64
64
|
* - [Print/Export as PDF](https://mui.com/x/react-charts/export/#print-export-as-pdf)
|
|
65
65
|
*/
|
|
66
66
|
options: _propTypes.default.shape({
|
|
67
|
-
|
|
67
|
+
copyStyles: _propTypes.default.bool,
|
|
68
|
+
fileName: _propTypes.default.string,
|
|
69
|
+
onBeforeExport: _propTypes.default.func
|
|
68
70
|
}),
|
|
69
71
|
/**
|
|
70
72
|
* A function to customize the rendering of the component.
|
|
@@ -158,7 +158,9 @@ process.env.NODE_ENV !== "production" ? ChartsToolbarPro.propTypes = {
|
|
|
158
158
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
159
159
|
// ----------------------------------------------------------------------
|
|
160
160
|
imageExportOptions: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
161
|
+
copyStyles: _propTypes.default.bool,
|
|
161
162
|
fileName: _propTypes.default.string,
|
|
163
|
+
onBeforeExport: _propTypes.default.func,
|
|
162
164
|
quality: _propTypes.default.number,
|
|
163
165
|
type: _propTypes.default.string.isRequired
|
|
164
166
|
})),
|
|
@@ -8,7 +8,7 @@ import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
|
8
8
|
import { FunnelChartSlotExtension } from "./funnelSlots.types.js";
|
|
9
9
|
import { CategoryAxis } from "./categoryAxis.types.js";
|
|
10
10
|
import { FunnelChartPluginsSignatures } from "./FunnelChart.plugins.js";
|
|
11
|
-
export interface FunnelChartProps extends Omit<ChartContainerProProps<'funnel', FunnelChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis' | 'zoom' | 'onZoomChange' | 'dataset' | 'yAxis' | 'xAxis' | 'rotationAxis' | 'radiusAxis' | 'slots' | 'slotProps'>, Omit<FunnelPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, FunnelChartSlotExtension {
|
|
11
|
+
export interface FunnelChartProps extends Omit<ChartContainerProProps<'funnel', FunnelChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis' | 'zoom' | 'onZoomChange' | 'dataset' | 'yAxis' | 'xAxis' | 'rotationAxis' | 'radiusAxis' | 'slots' | 'slotProps' | 'experimentalFeatures'>, Omit<FunnelPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, FunnelChartSlotExtension {
|
|
12
12
|
/**
|
|
13
13
|
* The series to display in the funnel chart.
|
|
14
14
|
* An array of [[FunnelSeriesType]] objects.
|
|
@@ -94,7 +94,7 @@ const useAggregatedData = () => {
|
|
|
94
94
|
seriesId,
|
|
95
95
|
value: currentSeries.data[dataIndex].value
|
|
96
96
|
}) : currentSeries.sectionLabel;
|
|
97
|
-
const isIncreasing = currentSeries.
|
|
97
|
+
const isIncreasing = currentSeries.funnelDirection === 'increasing';
|
|
98
98
|
const curve = (0, _curves.getFunnelCurve)(currentSeries.curve, {
|
|
99
99
|
isHorizontal,
|
|
100
100
|
gap,
|
|
@@ -16,7 +16,7 @@ export type FunnelValueType = {
|
|
|
16
16
|
/**
|
|
17
17
|
* The label to display on the tooltip, funnel section, or the legend. It can be a string or a function.
|
|
18
18
|
*/
|
|
19
|
-
label?: string | ((location: 'tooltip' | 'legend' | 'section') => string);
|
|
19
|
+
label?: string | ((location: 'tooltip' | 'legend' | 'section') => string | undefined);
|
|
20
20
|
/**
|
|
21
21
|
* The color of the funnel section
|
|
22
22
|
*/
|
|
@@ -78,6 +78,17 @@ export interface FunnelSeriesType extends Omit<CommonSeriesType<FunnelValueType>
|
|
|
78
78
|
* @default 'filled'
|
|
79
79
|
*/
|
|
80
80
|
variant?: 'filled' | 'outlined';
|
|
81
|
+
/**
|
|
82
|
+
* Controls how the funnel is drawn.
|
|
83
|
+
* Ignored on `step` and `linear-sharp` curves.
|
|
84
|
+
*
|
|
85
|
+
* This affects different curves in different ways:
|
|
86
|
+
* - `bump` & `linear`: Controls which section is the "starting" point of the funnel. This section has straight edges.
|
|
87
|
+
* - `pyramid` & `step-pyramid`: Fully changes the direction of the shape.
|
|
88
|
+
*
|
|
89
|
+
* @default 'auto'
|
|
90
|
+
*/
|
|
91
|
+
funnelDirection?: 'increasing' | 'decreasing' | 'auto';
|
|
81
92
|
}
|
|
82
93
|
/**
|
|
83
94
|
* An object that allows to identify a funnel item.
|
|
@@ -108,16 +119,10 @@ export type FunnelItem = {
|
|
|
108
119
|
*/
|
|
109
120
|
value: number;
|
|
110
121
|
};
|
|
111
|
-
export interface DefaultizedFunnelSeriesType extends DefaultizedProps<FunnelSeriesType, CommonDefaultizedProps | 'layout'> {
|
|
122
|
+
export interface DefaultizedFunnelSeriesType extends Omit<DefaultizedProps<FunnelSeriesType, CommonDefaultizedProps | 'layout'>, 'funnelDirection'> {
|
|
112
123
|
dataPoints: FunnelDataPoints[][];
|
|
113
124
|
data: Readonly<MakeRequired<FunnelValueType, 'id' | 'color'>[]>;
|
|
114
|
-
|
|
115
|
-
* Denotes if the data is increasing, first data point is less than the last data point.
|
|
116
|
-
* While the data is decreasing if the first data point is greater than the last data point.
|
|
117
|
-
*
|
|
118
|
-
* This is used to determine the direction of the funnel.
|
|
119
|
-
*/
|
|
120
|
-
dataDirection: 'increasing' | 'decreasing';
|
|
125
|
+
funnelDirection: 'increasing' | 'decreasing';
|
|
121
126
|
}
|
|
122
127
|
export type FunnelDataPoints = Record<'x' | 'y', number> & {
|
|
123
128
|
useBandWidth: boolean;
|
|
@@ -52,39 +52,51 @@ const useChartFunnelAxis = ({
|
|
|
52
52
|
}, [seriesConfig, drawingArea, xAxis, yAxis, dataset, store, gap]);
|
|
53
53
|
React.useEffect(() => {
|
|
54
54
|
const element = svgRef.current;
|
|
55
|
-
if (!isInteractionEnabled || element
|
|
55
|
+
if (!isInteractionEnabled || !element || params.disableAxisListener) {
|
|
56
56
|
return () => {};
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const target = 'targetTouches' in event ? event.targetTouches[0] : event;
|
|
63
|
-
const svgPoint = (0, _internals.getSVGPoint)(element, target);
|
|
64
|
-
if (!instance.isPointInside(svgPoint.x, svgPoint.y, event.target)) {
|
|
58
|
+
|
|
59
|
+
// Clean the interaction when the mouse leaves the chart.
|
|
60
|
+
const moveEndHandler = instance.addInteractionListener('moveEnd', event => {
|
|
61
|
+
if (!event.detail.activeGestures.pan) {
|
|
65
62
|
instance.cleanInteraction?.();
|
|
66
|
-
return;
|
|
67
63
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (!target) {
|
|
73
|
-
return;
|
|
64
|
+
});
|
|
65
|
+
const panEndHandler = instance.addInteractionListener('panEnd', event => {
|
|
66
|
+
if (!event.detail.activeGestures.move) {
|
|
67
|
+
instance.cleanInteraction?.();
|
|
74
68
|
}
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
});
|
|
70
|
+
const pressEndHandler = instance.addInteractionListener('quickPressEnd', event => {
|
|
71
|
+
if (!event.detail.activeGestures.move && !event.detail.activeGestures.pan) {
|
|
72
|
+
instance.cleanInteraction?.();
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const gestureHandler = event => {
|
|
76
|
+
const srvEvent = event.detail.srcEvent;
|
|
77
|
+
const target = event.detail.target;
|
|
78
|
+
const svgPoint = (0, _internals.getSVGPoint)(element, srvEvent);
|
|
79
|
+
// Release the pointer capture if we are panning, as this would cause the tooltip to
|
|
80
|
+
// be locked to the first "section" it touches.
|
|
81
|
+
if (event.detail.srcEvent.buttons >= 1 && target?.hasPointerCapture(event.detail.srcEvent.pointerId)) {
|
|
82
|
+
target?.releasePointerCapture(event.detail.srcEvent.pointerId);
|
|
77
83
|
}
|
|
84
|
+
if (!instance.isPointInside(svgPoint.x, svgPoint.y, target)) {
|
|
85
|
+
instance.cleanInteraction?.();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
instance.setPointerCoordinate?.(svgPoint);
|
|
78
89
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
element.addEventListener('pointerleave', handleOut);
|
|
90
|
+
const moveHandler = instance.addInteractionListener('move', gestureHandler);
|
|
91
|
+
const panHandler = instance.addInteractionListener('pan', gestureHandler);
|
|
92
|
+
const pressHandler = instance.addInteractionListener('quickPress', gestureHandler);
|
|
83
93
|
return () => {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
94
|
+
moveHandler.cleanup();
|
|
95
|
+
moveEndHandler.cleanup();
|
|
96
|
+
panHandler.cleanup();
|
|
97
|
+
panEndHandler.cleanup();
|
|
98
|
+
pressHandler.cleanup();
|
|
99
|
+
pressEndHandler.cleanup();
|
|
88
100
|
};
|
|
89
101
|
}, [svgRef, instance, params.disableAxisListener, isInteractionEnabled]);
|
|
90
102
|
React.useEffect(() => {
|
|
@@ -93,8 +105,7 @@ const useChartFunnelAxis = ({
|
|
|
93
105
|
if (element === null || !onAxisClick) {
|
|
94
106
|
return () => {};
|
|
95
107
|
}
|
|
96
|
-
const
|
|
97
|
-
event.preventDefault();
|
|
108
|
+
const axisClickHandler = instance.addInteractionListener('tap', event => {
|
|
98
109
|
const {
|
|
99
110
|
axis: xAxisWithScale,
|
|
100
111
|
axisIds: xAxisIds
|
|
@@ -108,7 +119,7 @@ const useChartFunnelAxis = ({
|
|
|
108
119
|
const usedYAxis = yAxisIds[0];
|
|
109
120
|
let dataIndex = null;
|
|
110
121
|
let isXAxis = false;
|
|
111
|
-
const svgPoint = (0, _internals.getSVGPoint)(element, event);
|
|
122
|
+
const svgPoint = (0, _internals.getSVGPoint)(element, event.detail.srcEvent);
|
|
112
123
|
const xIndex = (0, _internals.getCartesianAxisIndex)(xAxisWithScale[usedXAxis], svgPoint.x);
|
|
113
124
|
isXAxis = xIndex !== -1;
|
|
114
125
|
dataIndex = isXAxis ? xIndex : (0, _internals.getCartesianAxisIndex)(yAxisWithScale[usedYAxis], svgPoint.y);
|
|
@@ -129,17 +140,16 @@ const useChartFunnelAxis = ({
|
|
|
129
140
|
seriesValues[seriesId] = seriesItem.data[dataIndex].value;
|
|
130
141
|
}
|
|
131
142
|
});
|
|
132
|
-
onAxisClick(event, {
|
|
143
|
+
onAxisClick(event.detail.srcEvent, {
|
|
133
144
|
dataIndex,
|
|
134
145
|
axisValue,
|
|
135
146
|
seriesValues
|
|
136
147
|
});
|
|
137
|
-
};
|
|
138
|
-
element.addEventListener('click', handleMouseClick);
|
|
148
|
+
});
|
|
139
149
|
return () => {
|
|
140
|
-
|
|
150
|
+
axisClickHandler.cleanup();
|
|
141
151
|
};
|
|
142
|
-
}, [params.onAxisClick, svgRef, store]);
|
|
152
|
+
}, [params.onAxisClick, svgRef, store, instance]);
|
|
143
153
|
return {};
|
|
144
154
|
};
|
|
145
155
|
exports.useChartFunnelAxis = useChartFunnelAxis;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChartPluginSignature, UseChartCartesianAxisDefaultizedParameters, UseChartCartesianAxisParameters, UseChartCartesianAxisState, UseChartInteractionSignature, UseChartSeriesSignature, ChartsAxisData } from '@mui/x-charts/internals';
|
|
2
2
|
export type UseChartFunnelAxisSignature = ChartPluginSignature<{
|
|
3
|
-
params: Omit<UseChartCartesianAxisParameters, 'onAxisClick'> & {
|
|
3
|
+
params: Omit<UseChartCartesianAxisParameters, 'onAxisClick' | 'onHighlightedAxisChange' | 'highlightedAxis'> & {
|
|
4
4
|
/**
|
|
5
5
|
* The gap, in pixels, between funnel sections.
|
|
6
6
|
* @default 0
|
|
@@ -3,7 +3,7 @@ import { UseChartFunnelAxisSignature } from "./useChartFunnelAxis.types.js";
|
|
|
3
3
|
export declare const selectorFunnel: (state: ChartState<[], [UseChartFunnelAxisSignature]>) => {
|
|
4
4
|
gap: number;
|
|
5
5
|
} | undefined;
|
|
6
|
-
export declare const selectorFunnelGap: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<Pick<import("@mui/x-charts/internals").UseChartCartesianAxisState, "cartesianAxis"> & {
|
|
6
|
+
export declare const selectorFunnelGap: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<Pick<import("@mui/x-charts/internals").UseChartCartesianAxisState, "cartesianAxis"> & {
|
|
7
7
|
funnel: {
|
|
8
8
|
gap: number;
|
|
9
9
|
};
|
|
@@ -12,7 +12,7 @@ export declare const selectorFunnelGap: import("reselect").Selector<import("@mui
|
|
|
12
12
|
} & {
|
|
13
13
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
14
14
|
}, number, []>;
|
|
15
|
-
export declare const selectorChartXAxis: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
15
|
+
export declare const selectorChartXAxis: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
16
16
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
17
17
|
} & Partial<{}> & {
|
|
18
18
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
@@ -33,7 +33,7 @@ export declare const selectorChartXAxis: import("reselect").Selector<import("@mu
|
|
|
33
33
|
}> & {
|
|
34
34
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
35
35
|
}, import("./computeAxisValue.js").ComputeResult<import("@mui/x-charts").ChartsXAxisProps>, []>;
|
|
36
|
-
export declare const selectorChartYAxis: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
36
|
+
export declare const selectorChartYAxis: import("reselect").Selector<import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types").UseChartExperimentalFeaturesState & import("@mui/x-charts/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types").UseChartDimensionsState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeries/useChartSeries.types").UseChartSeriesState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & import("@mui/x-charts/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.types").UseChartAnimationState & import("@mui/x-charts/internals").UseChartInteractionListenerState & Partial<import("@mui/x-charts/internals").UseChartCartesianAxisState> & {
|
|
37
37
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
38
38
|
} & Partial<{}> & {
|
|
39
39
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
@@ -23,6 +23,14 @@ const createPoint = ({
|
|
|
23
23
|
useBandWidth,
|
|
24
24
|
stackOffset
|
|
25
25
|
};
|
|
26
|
+
const getFunnelDirection = (funnelDirection, curve, firstValue, lastValue) => {
|
|
27
|
+
if (curve !== 'step' && curve !== 'linear-sharp' && (funnelDirection === 'increasing' || funnelDirection === 'decreasing')) {
|
|
28
|
+
return funnelDirection;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Implicit check for null or undefined values
|
|
32
|
+
return firstValue != null && lastValue != null && firstValue < lastValue ? 'increasing' : 'decreasing';
|
|
33
|
+
};
|
|
26
34
|
const seriesProcessor = params => {
|
|
27
35
|
const {
|
|
28
36
|
seriesOrder,
|
|
@@ -34,7 +42,7 @@ const seriesProcessor = params => {
|
|
|
34
42
|
const currentSeries = series[seriesId];
|
|
35
43
|
const firstDataPoint = currentSeries.data.at(0);
|
|
36
44
|
const lastDataPoint = currentSeries.data.at(-1);
|
|
37
|
-
const
|
|
45
|
+
const funnelDirection = getFunnelDirection(currentSeries.funnelDirection, currentSeries.curve, firstDataPoint?.value, lastDataPoint?.value);
|
|
38
46
|
completedSeries[seriesId] = (0, _extends2.default)({
|
|
39
47
|
labelMarkType: 'square',
|
|
40
48
|
layout: isHorizontal ? 'horizontal' : 'vertical',
|
|
@@ -43,7 +51,7 @@ const seriesProcessor = params => {
|
|
|
43
51
|
data: currentSeries.data.map((v, i) => (0, _extends2.default)({
|
|
44
52
|
id: `${seriesId}-funnel-item-${v.id ?? i}`
|
|
45
53
|
}, v)),
|
|
46
|
-
|
|
54
|
+
funnelDirection,
|
|
47
55
|
dataPoints: []
|
|
48
56
|
});
|
|
49
57
|
const stackOffsets = completedSeries[seriesId].data.toReversed().map((_, i, array) => array.slice(0, i).reduce((acc, item) => acc + item.value, 0)).toReversed();
|
|
@@ -51,54 +59,22 @@ const seriesProcessor = params => {
|
|
|
51
59
|
// Main = main axis, Other = other axis
|
|
52
60
|
// For horizontal layout, main is y, other is x
|
|
53
61
|
// For vertical layout, main is x, other is y
|
|
54
|
-
const isIncreasing = completedSeries[seriesId].
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return dataIndex === 0 ? dataIndex : dataIndex - 1;
|
|
59
|
-
}
|
|
60
|
-
return dataIndex === array.length - 1 ? dataIndex : dataIndex + 1;
|
|
61
|
-
};
|
|
62
|
-
const nextDataIndex = getNextDataIndex();
|
|
63
|
-
const nextMaxMain = array[nextDataIndex].value ?? 0;
|
|
64
|
-
const nextMaxOther = 0;
|
|
65
|
-
const currentMaxOther = completedSeries[seriesId].data[dataIndex].value;
|
|
66
|
-
const stackOffset = stackOffsets[dataIndex];
|
|
62
|
+
const isIncreasing = completedSeries[seriesId].funnelDirection === 'increasing';
|
|
63
|
+
let currentMaxMain = 0;
|
|
64
|
+
let nextMaxMain = 0;
|
|
65
|
+
let nextDataIndex = 0;
|
|
67
66
|
if (isIncreasing) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
stackOffset
|
|
76
|
-
}),
|
|
77
|
-
// Bottom right (vertical) or Top right (horizontal)
|
|
78
|
-
createPoint({
|
|
79
|
-
main: currentMaxMain,
|
|
80
|
-
other: currentMaxOther,
|
|
81
|
-
inverse: isHorizontal,
|
|
82
|
-
useBandWidth: true,
|
|
83
|
-
stackOffset
|
|
84
|
-
}),
|
|
85
|
-
// Bottom left (vertical) or Bottom right (horizontal)
|
|
86
|
-
createPoint({
|
|
87
|
-
main: -currentMaxMain,
|
|
88
|
-
other: currentMaxOther,
|
|
89
|
-
inverse: isHorizontal,
|
|
90
|
-
useBandWidth: true,
|
|
91
|
-
stackOffset
|
|
92
|
-
}),
|
|
93
|
-
// Top left (vertical) or Bottom left (horizontal)
|
|
94
|
-
createPoint({
|
|
95
|
-
main: -nextMaxMain,
|
|
96
|
-
other: nextMaxOther,
|
|
97
|
-
inverse: isHorizontal,
|
|
98
|
-
useBandWidth: false,
|
|
99
|
-
stackOffset
|
|
100
|
-
})];
|
|
67
|
+
nextDataIndex = dataIndex === 0 ? dataIndex : dataIndex - 1;
|
|
68
|
+
currentMaxMain = array[nextDataIndex].value ?? 0;
|
|
69
|
+
nextMaxMain = item.value;
|
|
70
|
+
} else {
|
|
71
|
+
nextDataIndex = dataIndex === array.length - 1 ? dataIndex : dataIndex + 1;
|
|
72
|
+
currentMaxMain = item.value;
|
|
73
|
+
nextMaxMain = array[nextDataIndex].value ?? 0;
|
|
101
74
|
}
|
|
75
|
+
const stackOffset = stackOffsets[dataIndex];
|
|
76
|
+
const nextMaxOther = 0;
|
|
77
|
+
const currentMaxOther = completedSeries[seriesId].data[dataIndex].value;
|
|
102
78
|
return [
|
|
103
79
|
// Top right (vertical) or Top left (horizontal)
|
|
104
80
|
createPoint({
|
package/Heatmap/Heatmap.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export interface HeatmapSlots extends ChartsAxisSlots, ChartsOverlaySlots, Heatm
|
|
|
27
27
|
export interface HeatmapSlotProps extends ChartsAxisSlotProps, ChartsOverlaySlotProps, HeatmapItemSlotProps, ChartsLegendSlotProps, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {
|
|
28
28
|
tooltip?: Partial<HeatmapTooltipProps>;
|
|
29
29
|
}
|
|
30
|
-
export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', HeatmapPluginsSignatures>, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'skipAnimation' | 'slots' | 'slotProps'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
30
|
+
export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', HeatmapPluginsSignatures>, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'skipAnimation' | 'slots' | 'slotProps' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
31
31
|
/**
|
|
32
32
|
* The configuration of the x-axes.
|
|
33
33
|
* If not provided, a default axis config is used.
|
|
@@ -138,6 +138,12 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
138
138
|
* If `true`, render the line highlight item.
|
|
139
139
|
*/
|
|
140
140
|
disableLineItemHighlight: _propTypes.default.bool,
|
|
141
|
+
/**
|
|
142
|
+
* Options to enable features planned for the next major.
|
|
143
|
+
*/
|
|
144
|
+
experimentalFeatures: _propTypes.default.shape({
|
|
145
|
+
preferStrictDomainInLineCharts: _propTypes.default.bool
|
|
146
|
+
}),
|
|
141
147
|
/**
|
|
142
148
|
* Option to display a cartesian grid in the background.
|
|
143
149
|
*/
|
|
@@ -153,6 +159,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
153
159
|
* If `true`, the legend is not rendered.
|
|
154
160
|
*/
|
|
155
161
|
hideLegend: _propTypes.default.bool,
|
|
162
|
+
/**
|
|
163
|
+
* The controlled axis highlight.
|
|
164
|
+
* Identified by the axis id, and data index.
|
|
165
|
+
*/
|
|
166
|
+
highlightedAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
167
|
+
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
168
|
+
dataIndex: _propTypes.default.number.isRequired
|
|
169
|
+
})),
|
|
156
170
|
/**
|
|
157
171
|
* The highlighted item.
|
|
158
172
|
* Used when the highlight is controlled.
|
|
@@ -213,6 +227,14 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
213
227
|
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
214
228
|
*/
|
|
215
229
|
onHighlightChange: _propTypes.default.func,
|
|
230
|
+
/**
|
|
231
|
+
* The function called when the pointer position corresponds to a new axis data item.
|
|
232
|
+
* This update can either be caused by a pointer movement, or an axis update.
|
|
233
|
+
* In case of multiple axes, the function is called if at least one axis is updated.
|
|
234
|
+
* The argument contains the identifier for all axes with a `data` property.
|
|
235
|
+
* @param {AxisItemIdentifier[]} axisItems The array of axes item identifiers.
|
|
236
|
+
*/
|
|
237
|
+
onHighlightedAxisChange: _propTypes.default.func,
|
|
216
238
|
/**
|
|
217
239
|
* Callback fired when a line element is clicked.
|
|
218
240
|
*/
|
|
@@ -326,6 +348,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
326
348
|
panning: _propTypes.default.bool,
|
|
327
349
|
slider: _propTypes.default.shape({
|
|
328
350
|
enabled: _propTypes.default.bool,
|
|
351
|
+
preview: _propTypes.default.bool,
|
|
329
352
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
330
353
|
size: _propTypes.default.number
|
|
331
354
|
}),
|
|
@@ -391,6 +414,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
391
414
|
panning: _propTypes.default.bool,
|
|
392
415
|
slider: _propTypes.default.shape({
|
|
393
416
|
enabled: _propTypes.default.bool,
|
|
417
|
+
preview: _propTypes.default.bool,
|
|
394
418
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
395
419
|
size: _propTypes.default.number
|
|
396
420
|
}),
|
|
@@ -451,6 +475,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
451
475
|
panning: _propTypes.default.bool,
|
|
452
476
|
slider: _propTypes.default.shape({
|
|
453
477
|
enabled: _propTypes.default.bool,
|
|
478
|
+
preview: _propTypes.default.bool,
|
|
454
479
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
455
480
|
size: _propTypes.default.number
|
|
456
481
|
}),
|
|
@@ -511,6 +536,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
511
536
|
panning: _propTypes.default.bool,
|
|
512
537
|
slider: _propTypes.default.shape({
|
|
513
538
|
enabled: _propTypes.default.bool,
|
|
539
|
+
preview: _propTypes.default.bool,
|
|
514
540
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
515
541
|
size: _propTypes.default.number
|
|
516
542
|
}),
|
|
@@ -571,6 +597,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
571
597
|
panning: _propTypes.default.bool,
|
|
572
598
|
slider: _propTypes.default.shape({
|
|
573
599
|
enabled: _propTypes.default.bool,
|
|
600
|
+
preview: _propTypes.default.bool,
|
|
574
601
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
575
602
|
size: _propTypes.default.number
|
|
576
603
|
}),
|
|
@@ -631,6 +658,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
631
658
|
panning: _propTypes.default.bool,
|
|
632
659
|
slider: _propTypes.default.shape({
|
|
633
660
|
enabled: _propTypes.default.bool,
|
|
661
|
+
preview: _propTypes.default.bool,
|
|
634
662
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
635
663
|
size: _propTypes.default.number
|
|
636
664
|
}),
|
|
@@ -691,6 +719,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
691
719
|
panning: _propTypes.default.bool,
|
|
692
720
|
slider: _propTypes.default.shape({
|
|
693
721
|
enabled: _propTypes.default.bool,
|
|
722
|
+
preview: _propTypes.default.bool,
|
|
694
723
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
695
724
|
size: _propTypes.default.number
|
|
696
725
|
}),
|
|
@@ -751,6 +780,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
751
780
|
panning: _propTypes.default.bool,
|
|
752
781
|
slider: _propTypes.default.shape({
|
|
753
782
|
enabled: _propTypes.default.bool,
|
|
783
|
+
preview: _propTypes.default.bool,
|
|
754
784
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
755
785
|
size: _propTypes.default.number
|
|
756
786
|
}),
|
|
@@ -823,6 +853,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
823
853
|
panning: _propTypes.default.bool,
|
|
824
854
|
slider: _propTypes.default.shape({
|
|
825
855
|
enabled: _propTypes.default.bool,
|
|
856
|
+
preview: _propTypes.default.bool,
|
|
826
857
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
827
858
|
size: _propTypes.default.number
|
|
828
859
|
}),
|
|
@@ -887,6 +918,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
887
918
|
panning: _propTypes.default.bool,
|
|
888
919
|
slider: _propTypes.default.shape({
|
|
889
920
|
enabled: _propTypes.default.bool,
|
|
921
|
+
preview: _propTypes.default.bool,
|
|
890
922
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
891
923
|
size: _propTypes.default.number
|
|
892
924
|
}),
|
|
@@ -946,6 +978,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
946
978
|
panning: _propTypes.default.bool,
|
|
947
979
|
slider: _propTypes.default.shape({
|
|
948
980
|
enabled: _propTypes.default.bool,
|
|
981
|
+
preview: _propTypes.default.bool,
|
|
949
982
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
950
983
|
size: _propTypes.default.number
|
|
951
984
|
}),
|
|
@@ -1005,6 +1038,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1005
1038
|
panning: _propTypes.default.bool,
|
|
1006
1039
|
slider: _propTypes.default.shape({
|
|
1007
1040
|
enabled: _propTypes.default.bool,
|
|
1041
|
+
preview: _propTypes.default.bool,
|
|
1008
1042
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
1009
1043
|
size: _propTypes.default.number
|
|
1010
1044
|
}),
|
|
@@ -1064,6 +1098,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1064
1098
|
panning: _propTypes.default.bool,
|
|
1065
1099
|
slider: _propTypes.default.shape({
|
|
1066
1100
|
enabled: _propTypes.default.bool,
|
|
1101
|
+
preview: _propTypes.default.bool,
|
|
1067
1102
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
1068
1103
|
size: _propTypes.default.number
|
|
1069
1104
|
}),
|
|
@@ -1123,6 +1158,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1123
1158
|
panning: _propTypes.default.bool,
|
|
1124
1159
|
slider: _propTypes.default.shape({
|
|
1125
1160
|
enabled: _propTypes.default.bool,
|
|
1161
|
+
preview: _propTypes.default.bool,
|
|
1126
1162
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
1127
1163
|
size: _propTypes.default.number
|
|
1128
1164
|
}),
|
|
@@ -1182,6 +1218,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1182
1218
|
panning: _propTypes.default.bool,
|
|
1183
1219
|
slider: _propTypes.default.shape({
|
|
1184
1220
|
enabled: _propTypes.default.bool,
|
|
1221
|
+
preview: _propTypes.default.bool,
|
|
1185
1222
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
1186
1223
|
size: _propTypes.default.number
|
|
1187
1224
|
}),
|
|
@@ -1241,6 +1278,7 @@ process.env.NODE_ENV !== "production" ? LineChartPro.propTypes = {
|
|
|
1241
1278
|
panning: _propTypes.default.bool,
|
|
1242
1279
|
slider: _propTypes.default.shape({
|
|
1243
1280
|
enabled: _propTypes.default.bool,
|
|
1281
|
+
preview: _propTypes.default.bool,
|
|
1244
1282
|
showTooltip: _propTypes.default.oneOf(['always', 'hover', 'never']),
|
|
1245
1283
|
size: _propTypes.default.number
|
|
1246
1284
|
}),
|