@mui/x-charts-pro 8.26.0 → 9.0.0-alpha.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 +9 -4
- package/CHANGELOG.md +355 -3
- package/ChartContainerPro/ChartContainerPro.d.ts +17 -31
- package/ChartContainerPro/ChartContainerPro.js +14 -287
- package/ChartContainerPro/useChartContainerProProps.d.ts +9 -5
- package/ChartContainerPro/useChartContainerProProps.js +9 -34
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +5 -3
- package/ChartDataProviderPro/ChartDataProviderPro.js +2 -2
- package/ChartDataProviderPro/index.d.ts +1 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +3 -3
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +8 -6
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +6 -4
- package/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +1 -1
- package/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +4 -4
- package/ChartZoomSlider/internals/previews/BarPreviewPlot.js +1 -1
- package/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +1 -1
- package/ChartZoomSlider/internals/previews/LinePreviewPlot.js +4 -4
- package/ChartsContainer/index.d.ts +1 -0
- package/ChartsContainer/index.js +16 -0
- package/ChartsContainerPro/ChartsContainerPro.d.ts +37 -0
- package/ChartsContainerPro/ChartsContainerPro.js +187 -0
- package/ChartsContainerPro/index.d.ts +9 -0
- package/ChartsContainerPro/index.js +17 -0
- package/ChartsContainerPro/useChartsContainerProProps.d.ts +9 -0
- package/ChartsContainerPro/useChartsContainerProProps.js +44 -0
- package/FunnelChart/FunnelChart.js +4 -4
- package/FunnelChart/FunnelSection.d.ts +1 -1
- package/FunnelChart/funnel.types.d.ts +1 -1
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +12 -9
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +3 -2
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +3 -3
- package/FunnelChart/index.d.ts +1 -0
- package/FunnelChart/index.js +12 -0
- package/FunnelChart/seriesConfig/index.js +2 -1
- package/FunnelChart/seriesConfig/legend.js +0 -1
- package/Heatmap/Heatmap.d.ts +14 -2
- package/Heatmap/Heatmap.js +36 -130
- package/Heatmap/Heatmap.plugins.d.ts +2 -2
- package/Heatmap/Heatmap.plugins.js +1 -1
- package/Heatmap/Heatmap.types.d.ts +19 -0
- package/Heatmap/Heatmap.types.js +5 -0
- package/Heatmap/HeatmapItem.d.ts +6 -0
- package/Heatmap/HeatmapItem.js +11 -3
- package/Heatmap/HeatmapPlot.d.ts +7 -3
- package/Heatmap/HeatmapPlot.js +16 -54
- package/Heatmap/HeatmapSVGPlot.d.ts +2 -0
- package/Heatmap/HeatmapSVGPlot.js +70 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +5 -1
- package/Heatmap/HeatmapTooltip/index.d.ts +1 -1
- package/Heatmap/index.d.ts +3 -2
- package/Heatmap/seriesConfig/getItemAtPosition.d.ts +6 -0
- package/Heatmap/seriesConfig/getItemAtPosition.js +45 -0
- package/Heatmap/seriesConfig/index.js +3 -0
- package/Heatmap/useHeatmapProps.d.ts +24 -0
- package/Heatmap/useHeatmapProps.js +159 -0
- package/LineChartPro/LineChartPro.d.ts +1 -1
- package/LineChartPro/LineChartPro.js +9 -4
- package/PieChartPro/PieChartPro.d.ts +1 -1
- package/PieChartPro/PieChartPro.js +4 -4
- package/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/RadarChartPro/RadarChartPro.js +4 -4
- package/RadarChartPro/RadarChartPro.plugins.d.ts +2 -2
- package/RadarChartPro/RadarChartPro.plugins.js +1 -1
- package/SankeyChart/SankeyChart.js +4 -4
- package/SankeyChart/SankeyTooltip/SankeyTooltip.types.d.ts +5 -1
- package/SankeyChart/SankeyTooltip/index.d.ts +1 -1
- package/SankeyChart/index.d.ts +1 -1
- package/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +7 -7
- package/SankeyChart/sankey.highlight.types.d.ts +4 -0
- package/SankeyChart/sankey.types.d.ts +6 -3
- package/SankeyChart/seriesConfig/getSeriesWithDefaultValues.js +13 -1
- package/SankeyChart/seriesConfig/identifierCleaner.d.ts +3 -0
- package/SankeyChart/seriesConfig/identifierCleaner.js +24 -0
- package/SankeyChart/seriesConfig/index.js +3 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +1 -1
- package/ScatterChartPro/ScatterChartPro.js +9 -4
- package/esm/BarChartPro/BarChartPro.d.ts +1 -1
- package/esm/BarChartPro/BarChartPro.js +9 -4
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +17 -31
- package/esm/ChartContainerPro/ChartContainerPro.js +15 -286
- package/esm/ChartContainerPro/useChartContainerProProps.d.ts +9 -5
- package/esm/ChartContainerPro/useChartContainerProProps.js +10 -33
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +5 -3
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +2 -2
- package/esm/ChartDataProviderPro/index.d.ts +1 -1
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +3 -3
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +9 -7
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +7 -5
- package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/previews/AreaPreviewPlot.js +4 -4
- package/esm/ChartZoomSlider/internals/previews/BarPreviewPlot.js +1 -1
- package/esm/ChartZoomSlider/internals/previews/LinePreviewPlot.d.ts +1 -1
- package/esm/ChartZoomSlider/internals/previews/LinePreviewPlot.js +4 -4
- package/esm/ChartsContainer/index.d.ts +1 -0
- package/esm/ChartsContainer/index.js +2 -0
- package/esm/ChartsContainerPro/ChartsContainerPro.d.ts +37 -0
- package/esm/ChartsContainerPro/ChartsContainerPro.js +181 -0
- package/esm/ChartsContainerPro/index.d.ts +9 -0
- package/esm/ChartsContainerPro/index.js +6 -0
- package/esm/ChartsContainerPro/useChartsContainerProProps.d.ts +9 -0
- package/esm/ChartsContainerPro/useChartsContainerProProps.js +37 -0
- package/esm/FunnelChart/FunnelChart.js +4 -4
- package/esm/FunnelChart/FunnelSection.d.ts +1 -1
- package/esm/FunnelChart/funnel.types.d.ts +1 -1
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +13 -10
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +3 -2
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +3 -3
- package/esm/FunnelChart/index.d.ts +1 -0
- package/esm/FunnelChart/index.js +1 -0
- package/esm/FunnelChart/seriesConfig/index.js +3 -2
- package/esm/FunnelChart/seriesConfig/legend.js +0 -1
- package/esm/Heatmap/Heatmap.d.ts +14 -2
- package/esm/Heatmap/Heatmap.js +37 -131
- package/esm/Heatmap/Heatmap.plugins.d.ts +2 -2
- package/esm/Heatmap/Heatmap.plugins.js +2 -2
- package/esm/Heatmap/Heatmap.types.d.ts +19 -0
- package/esm/Heatmap/Heatmap.types.js +1 -0
- package/esm/Heatmap/HeatmapItem.d.ts +6 -0
- package/esm/Heatmap/HeatmapItem.js +11 -3
- package/esm/Heatmap/HeatmapPlot.d.ts +7 -3
- package/esm/Heatmap/HeatmapPlot.js +17 -56
- package/esm/Heatmap/HeatmapSVGPlot.d.ts +2 -0
- package/esm/Heatmap/HeatmapSVGPlot.js +64 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +5 -1
- package/esm/Heatmap/HeatmapTooltip/index.d.ts +1 -1
- package/esm/Heatmap/index.d.ts +3 -2
- package/esm/Heatmap/seriesConfig/getItemAtPosition.d.ts +6 -0
- package/esm/Heatmap/seriesConfig/getItemAtPosition.js +39 -0
- package/esm/Heatmap/seriesConfig/index.js +4 -1
- package/esm/Heatmap/useHeatmapProps.d.ts +24 -0
- package/esm/Heatmap/useHeatmapProps.js +151 -0
- package/esm/LineChartPro/LineChartPro.d.ts +1 -1
- package/esm/LineChartPro/LineChartPro.js +9 -4
- package/esm/PieChartPro/PieChartPro.d.ts +1 -1
- package/esm/PieChartPro/PieChartPro.js +4 -4
- package/esm/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/esm/RadarChartPro/RadarChartPro.js +4 -4
- package/esm/RadarChartPro/RadarChartPro.plugins.d.ts +2 -2
- package/esm/RadarChartPro/RadarChartPro.plugins.js +2 -2
- package/esm/SankeyChart/SankeyChart.js +4 -4
- package/esm/SankeyChart/SankeyTooltip/SankeyTooltip.types.d.ts +5 -1
- package/esm/SankeyChart/SankeyTooltip/index.d.ts +1 -1
- package/esm/SankeyChart/index.d.ts +1 -1
- package/esm/SankeyChart/plugins/useSankeyHighlight.selectors.d.ts +7 -7
- package/esm/SankeyChart/sankey.highlight.types.d.ts +4 -0
- package/esm/SankeyChart/sankey.types.d.ts +6 -3
- package/esm/SankeyChart/seriesConfig/getSeriesWithDefaultValues.js +13 -1
- package/esm/SankeyChart/seriesConfig/identifierCleaner.d.ts +3 -0
- package/esm/SankeyChart/seriesConfig/identifierCleaner.js +18 -0
- package/esm/SankeyChart/seriesConfig/index.js +3 -1
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +1 -1
- package/esm/ScatterChartPro/ScatterChartPro.js +9 -4
- package/esm/index.d.ts +3 -1
- package/esm/index.js +2 -1
- package/esm/internals/index.d.ts +8 -1
- package/esm/internals/index.js +6 -1
- package/esm/internals/plugins/useChartProExport/common.d.ts +5 -1
- package/esm/internals/plugins/useChartProExport/common.js +36 -0
- package/esm/internals/plugins/useChartProExport/exportImage.d.ts +1 -1
- package/esm/internals/plugins/useChartProExport/exportImage.js +10 -1
- package/esm/internals/plugins/useChartProExport/print.d.ts +1 -1
- package/esm/internals/plugins/useChartProExport/print.js +2 -1
- package/esm/internals/plugins/useChartProExport/useChartProExport.js +4 -2
- package/esm/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +2 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +4 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +4 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.js +6 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +7 -5
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +4 -2
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +6 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +6 -4
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +2 -3
- package/esm/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +6 -4
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +5 -5
- package/esm/models/seriesType/heatmap.d.ts +3 -3
- package/esm/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +1 -1
- package/esm/plugins/selectors/useChartHeatmapPosition.selectors.js +3 -1
- package/esm/typeOverloads/modules.d.ts +9 -5
- package/index.d.ts +3 -1
- package/index.js +9 -1
- package/internals/index.d.ts +8 -1
- package/internals/index.js +50 -1
- package/internals/plugins/useChartProExport/common.d.ts +5 -1
- package/internals/plugins/useChartProExport/common.js +37 -0
- package/internals/plugins/useChartProExport/exportImage.d.ts +1 -1
- package/internals/plugins/useChartProExport/exportImage.js +9 -0
- package/internals/plugins/useChartProExport/print.d.ts +1 -1
- package/internals/plugins/useChartProExport/print.js +1 -0
- package/internals/plugins/useChartProExport/useChartProExport.js +4 -2
- package/internals/plugins/useChartProZoom/ZoomInteractionConfig.selectors.d.ts +2 -2
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnDrag.js +4 -2
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnPressAndDrag.js +4 -2
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/usePanOnWheel.js +5 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnBrush.js +6 -4
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnDoubleTapReset.js +4 -2
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnPinch.js +5 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnTapAndDrag.js +5 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.d.ts +2 -3
- package/internals/plugins/useChartProZoom/gestureHooks/useZoomOnWheel.js +5 -3
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +5 -5
- package/models/seriesType/heatmap.d.ts +3 -3
- package/package.json +8 -8
- package/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +1 -1
- package/plugins/selectors/useChartHeatmapPosition.selectors.js +3 -1
- package/typeOverloads/modules.d.ts +9 -5
|
@@ -4,7 +4,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
5
|
const _excluded = ["axisId", "axisDirection", "reverse", "onSelectStart", "onSelectEnd"];
|
|
6
6
|
import * as React from 'react';
|
|
7
|
-
import { useChartContext,
|
|
7
|
+
import { useChartContext, getChartPoint, selectorChartAxisZoomOptionsLookup, useStore } from '@mui/x-charts/internals';
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
9
9
|
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
10
10
|
import { shouldForwardProp } from '@mui/system';
|
|
@@ -51,9 +51,11 @@ export function ChartAxisZoomSliderTrack(_ref) {
|
|
|
51
51
|
other = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
52
52
|
const ref = React.useRef(null);
|
|
53
53
|
const {
|
|
54
|
-
instance
|
|
55
|
-
svgRef
|
|
54
|
+
instance
|
|
56
55
|
} = useChartContext();
|
|
56
|
+
const {
|
|
57
|
+
svgRef
|
|
58
|
+
} = instance;
|
|
57
59
|
const store = useStore();
|
|
58
60
|
const [isSelecting, setIsSelecting] = React.useState(false);
|
|
59
61
|
const classes = useUtilityClasses({
|
|
@@ -65,13 +67,13 @@ export function ChartAxisZoomSliderTrack(_ref) {
|
|
|
65
67
|
if (!rect || !element) {
|
|
66
68
|
return;
|
|
67
69
|
}
|
|
68
|
-
const pointerDownPoint =
|
|
70
|
+
const pointerDownPoint = getChartPoint(element, event);
|
|
69
71
|
const zoomFromPointerDown = calculateZoomFromPoint(store.state, axisId, pointerDownPoint);
|
|
70
72
|
if (zoomFromPointerDown === null) {
|
|
71
73
|
return;
|
|
72
74
|
}
|
|
73
75
|
const onPointerMove = rafThrottle(function onPointerMove(pointerMoveEvent) {
|
|
74
|
-
const pointerMovePoint =
|
|
76
|
+
const pointerMovePoint = getChartPoint(element, pointerMoveEvent);
|
|
75
77
|
const zoomFromPointerMove = calculateZoomFromPoint(store.state, axisId, pointerMovePoint);
|
|
76
78
|
if (zoomFromPointerMove === null) {
|
|
77
79
|
return;
|
|
@@ -6,7 +6,7 @@ export declare function AreaPreviewPlot({
|
|
|
6
6
|
axisId
|
|
7
7
|
}: AreaPreviewPlotProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export interface PreviewAreaElementProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'color' | 'id'> {
|
|
9
|
-
|
|
9
|
+
seriesId: SeriesId;
|
|
10
10
|
gradientId?: string;
|
|
11
11
|
color: string;
|
|
12
12
|
d: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["
|
|
3
|
+
const _excluded = ["seriesId", "color", "gradientId", "onClick"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { styled } from '@mui/material/styles';
|
|
6
6
|
import { useStore, useAreaPlotData, selectorChartPreviewComputedXAxis, selectorChartPreviewComputedYAxis } from '@mui/x-charts/internals';
|
|
@@ -21,7 +21,7 @@ export function AreaPreviewPlot({
|
|
|
21
21
|
area,
|
|
22
22
|
gradientId
|
|
23
23
|
}) => !!area && /*#__PURE__*/_jsx(PreviewAreaElement, {
|
|
24
|
-
|
|
24
|
+
seriesId: seriesId,
|
|
25
25
|
d: d,
|
|
26
26
|
color: color,
|
|
27
27
|
gradientId: gradientId
|
|
@@ -34,7 +34,7 @@ export function AreaPreviewPlot({
|
|
|
34
34
|
*/
|
|
35
35
|
function PreviewAreaElement(_ref) {
|
|
36
36
|
let {
|
|
37
|
-
|
|
37
|
+
seriesId,
|
|
38
38
|
color,
|
|
39
39
|
gradientId
|
|
40
40
|
} = _ref,
|
|
@@ -42,7 +42,7 @@ function PreviewAreaElement(_ref) {
|
|
|
42
42
|
return /*#__PURE__*/_jsx("path", _extends({
|
|
43
43
|
fill: gradientId ? `url(#${gradientId})` : color,
|
|
44
44
|
stroke: "none",
|
|
45
|
-
"data-series":
|
|
45
|
+
"data-series": seriesId
|
|
46
46
|
}, other));
|
|
47
47
|
}
|
|
48
48
|
function useAreaPreviewData(axisId) {
|
|
@@ -6,7 +6,7 @@ export declare function LinePreviewPlot({
|
|
|
6
6
|
axisId
|
|
7
7
|
}: LinePreviewPlotProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export interface PreviewLineElementProps extends Omit<React.SVGProps<SVGPathElement>, 'ref' | 'color' | 'id'> {
|
|
9
|
-
|
|
9
|
+
seriesId: SeriesId;
|
|
10
10
|
gradientId?: string;
|
|
11
11
|
color: string;
|
|
12
12
|
d: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["
|
|
3
|
+
const _excluded = ["seriesId", "color", "gradientId", "onClick"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { useStore, useLinePlotData, selectorChartPreviewComputedXAxis, selectorChartPreviewComputedYAxis } from '@mui/x-charts/internals';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -16,7 +16,7 @@ export function LinePreviewPlot({
|
|
|
16
16
|
gradientId
|
|
17
17
|
}) => {
|
|
18
18
|
return /*#__PURE__*/_jsx(PreviewLineElement, {
|
|
19
|
-
|
|
19
|
+
seriesId: seriesId,
|
|
20
20
|
d: d,
|
|
21
21
|
color: color,
|
|
22
22
|
gradientId: gradientId
|
|
@@ -30,7 +30,7 @@ export function LinePreviewPlot({
|
|
|
30
30
|
*/
|
|
31
31
|
function PreviewLineElement(_ref) {
|
|
32
32
|
let {
|
|
33
|
-
|
|
33
|
+
seriesId,
|
|
34
34
|
color,
|
|
35
35
|
gradientId
|
|
36
36
|
} = _ref,
|
|
@@ -40,7 +40,7 @@ function PreviewLineElement(_ref) {
|
|
|
40
40
|
strokeWidth: 2,
|
|
41
41
|
strokeLinejoin: "round",
|
|
42
42
|
fill: "none",
|
|
43
|
-
"data-series":
|
|
43
|
+
"data-series": seriesId
|
|
44
44
|
}, other));
|
|
45
45
|
}
|
|
46
46
|
function useLinePreviewData(axisId) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@mui/x-charts/ChartsContainer';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ChartsSurfaceProps } from '@mui/x-charts/ChartsSurface';
|
|
3
|
+
import { type ChartAnyPluginSignature, type ChartSeriesType } from '@mui/x-charts/internals';
|
|
4
|
+
import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
5
|
+
import { type ChartDataProviderProProps } from "../ChartDataProviderPro/index.js";
|
|
6
|
+
export interface ChartsContainerProSlots {}
|
|
7
|
+
export interface ChartsContainerProSlotProps {}
|
|
8
|
+
export type ChartsContainerProProps<TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>> = ChartDataProviderProProps<TSeries, TSignatures> & ChartsSurfaceProps;
|
|
9
|
+
type ChartsContainerProComponent = <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartsContainerProProps<TSeries, TSignatures> & {
|
|
10
|
+
ref?: React.ForwardedRef<SVGSVGElement>;
|
|
11
|
+
}) => React.JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* It sets up the data providers as well as the `<svg>` for the chart.
|
|
14
|
+
*
|
|
15
|
+
* This is a combination of both the `ChartDataProviderPro` and `ChartsSurface` components.
|
|
16
|
+
*
|
|
17
|
+
* Demos:
|
|
18
|
+
*
|
|
19
|
+
* - [Composition](https://mui.com/x/api/charts/composition/)
|
|
20
|
+
*
|
|
21
|
+
* API:
|
|
22
|
+
*
|
|
23
|
+
* - [ChartsContainerPro API](https://mui.com/x/api/charts/charts-container-pro/)
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```jsx
|
|
27
|
+
* <ChartsContainerPro
|
|
28
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
29
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
30
|
+
* >
|
|
31
|
+
* <BarPlot />
|
|
32
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
33
|
+
* </ChartsContainerPro>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare const ChartsContainerPro: ChartsContainerProComponent;
|
|
37
|
+
export { ChartsContainerPro };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { ChartsSurface } from '@mui/x-charts/ChartsSurface';
|
|
7
|
+
import { useChartsContainerProProps } from "./useChartsContainerProProps.js";
|
|
8
|
+
import { ChartDataProviderPro } from "../ChartDataProviderPro/index.js";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
/**
|
|
11
|
+
* It sets up the data providers as well as the `<svg>` for the chart.
|
|
12
|
+
*
|
|
13
|
+
* This is a combination of both the `ChartDataProviderPro` and `ChartsSurface` components.
|
|
14
|
+
*
|
|
15
|
+
* Demos:
|
|
16
|
+
*
|
|
17
|
+
* - [Composition](https://mui.com/x/api/charts/composition/)
|
|
18
|
+
*
|
|
19
|
+
* API:
|
|
20
|
+
*
|
|
21
|
+
* - [ChartsContainerPro API](https://mui.com/x/api/charts/charts-container-pro/)
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```jsx
|
|
25
|
+
* <ChartsContainerPro
|
|
26
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
27
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
28
|
+
* >
|
|
29
|
+
* <BarPlot />
|
|
30
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
31
|
+
* </ChartsContainerPro>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
const ChartsContainerPro = /*#__PURE__*/React.forwardRef(function ChartsContainerProInner(props, ref) {
|
|
35
|
+
const {
|
|
36
|
+
chartDataProviderProProps,
|
|
37
|
+
children,
|
|
38
|
+
chartsSurfaceProps
|
|
39
|
+
} = useChartsContainerProProps(props, ref);
|
|
40
|
+
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
41
|
+
children: /*#__PURE__*/_jsx(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
42
|
+
children: children
|
|
43
|
+
}))
|
|
44
|
+
}));
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// @ts-expect-error the type coercion breaks the prop types
|
|
48
|
+
if (process.env.NODE_ENV !== "production") ChartsContainerPro.displayName = "ChartsContainerPro";
|
|
49
|
+
process.env.NODE_ENV !== "production" ? ChartsContainerPro.propTypes = {
|
|
50
|
+
// ----------------------------- Warning --------------------------------
|
|
51
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
52
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
53
|
+
// ----------------------------------------------------------------------
|
|
54
|
+
apiRef: PropTypes.shape({
|
|
55
|
+
current: PropTypes.shape({
|
|
56
|
+
setZoomData: PropTypes.func.isRequired
|
|
57
|
+
})
|
|
58
|
+
}),
|
|
59
|
+
children: PropTypes.node,
|
|
60
|
+
className: PropTypes.string,
|
|
61
|
+
/**
|
|
62
|
+
* Color palette used to colorize multiple series.
|
|
63
|
+
* @default blueberryTwilightPalette
|
|
64
|
+
*/
|
|
65
|
+
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
66
|
+
/**
|
|
67
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
68
|
+
*/
|
|
69
|
+
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
70
|
+
desc: PropTypes.string,
|
|
71
|
+
/**
|
|
72
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
73
|
+
* It might break interactive features, but will improve performance.
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
disableAxisListener: PropTypes.bool,
|
|
77
|
+
/**
|
|
78
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
79
|
+
*/
|
|
80
|
+
height: PropTypes.number,
|
|
81
|
+
/**
|
|
82
|
+
* The highlighted item.
|
|
83
|
+
* Used when the highlight is controlled.
|
|
84
|
+
*/
|
|
85
|
+
highlightedItem: PropTypes.shape({
|
|
86
|
+
dataIndex: PropTypes.number,
|
|
87
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
88
|
+
}),
|
|
89
|
+
/**
|
|
90
|
+
* This prop is used to help implement the accessibility logic.
|
|
91
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
92
|
+
*/
|
|
93
|
+
id: PropTypes.string,
|
|
94
|
+
/**
|
|
95
|
+
* The list of zoom data related to each axis.
|
|
96
|
+
*/
|
|
97
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
98
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
99
|
+
end: PropTypes.number.isRequired,
|
|
100
|
+
start: PropTypes.number.isRequired
|
|
101
|
+
})),
|
|
102
|
+
/**
|
|
103
|
+
* The margin between the SVG and the drawing area.
|
|
104
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
105
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
106
|
+
*/
|
|
107
|
+
margin: PropTypes.shape({
|
|
108
|
+
bottom: PropTypes.number,
|
|
109
|
+
left: PropTypes.number,
|
|
110
|
+
right: PropTypes.number,
|
|
111
|
+
top: PropTypes.number
|
|
112
|
+
}),
|
|
113
|
+
/**
|
|
114
|
+
* The callback fired when the highlighted item changes.
|
|
115
|
+
*
|
|
116
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
117
|
+
*/
|
|
118
|
+
onHighlightChange: PropTypes.func,
|
|
119
|
+
/**
|
|
120
|
+
* Callback fired when the zoom has changed.
|
|
121
|
+
*
|
|
122
|
+
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
123
|
+
*/
|
|
124
|
+
onZoomChange: PropTypes.func,
|
|
125
|
+
/**
|
|
126
|
+
* The array of series to display.
|
|
127
|
+
* Each type of series has its own specificity.
|
|
128
|
+
* Please refer to the appropriate docs page to learn more about it.
|
|
129
|
+
*/
|
|
130
|
+
series: PropTypes.arrayOf(PropTypes.object),
|
|
131
|
+
/**
|
|
132
|
+
* If `true`, animations are skipped.
|
|
133
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
134
|
+
*/
|
|
135
|
+
skipAnimation: PropTypes.bool,
|
|
136
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
137
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
138
|
+
title: PropTypes.string,
|
|
139
|
+
/**
|
|
140
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
141
|
+
*/
|
|
142
|
+
width: PropTypes.number,
|
|
143
|
+
/**
|
|
144
|
+
* The configuration of the x-axes.
|
|
145
|
+
* If not provided, a default axis config is used.
|
|
146
|
+
* An array of [[AxisConfig]] objects.
|
|
147
|
+
*/
|
|
148
|
+
xAxis: PropTypes.arrayOf(PropTypes.object),
|
|
149
|
+
/**
|
|
150
|
+
* The configuration of the y-axes.
|
|
151
|
+
* If not provided, a default axis config is used.
|
|
152
|
+
* An array of [[AxisConfig]] objects.
|
|
153
|
+
*/
|
|
154
|
+
yAxis: PropTypes.arrayOf(PropTypes.object),
|
|
155
|
+
/**
|
|
156
|
+
* The configuration of the z-axes.
|
|
157
|
+
*/
|
|
158
|
+
zAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
159
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
160
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
161
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
162
|
+
unknownColor: PropTypes.string,
|
|
163
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
164
|
+
}), PropTypes.shape({
|
|
165
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
166
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
167
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
168
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
169
|
+
}), PropTypes.shape({
|
|
170
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
171
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
172
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
173
|
+
})]),
|
|
174
|
+
data: PropTypes.array,
|
|
175
|
+
dataKey: PropTypes.string,
|
|
176
|
+
id: PropTypes.string,
|
|
177
|
+
max: PropTypes.number,
|
|
178
|
+
min: PropTypes.number
|
|
179
|
+
}))
|
|
180
|
+
} : void 0;
|
|
181
|
+
export { ChartsContainerPro };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "../typeOverloads/index.js";
|
|
2
|
+
import type { ChartAnyPluginSignature } from '@mui/x-charts/internals';
|
|
3
|
+
import type { ChartProApi as ChartProApiOriginal, ProPluginsPerSeriesType } from "../context/ChartProApi.js";
|
|
4
|
+
import type { AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
5
|
+
export * from "./ChartsContainerPro.js";
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use `ChartProApi` from `@mui/x-charts/context` instead.
|
|
8
|
+
*/
|
|
9
|
+
export type ChartProApi<ChartType extends keyof ProPluginsPerSeriesType | undefined = undefined, Signatures extends readonly ChartAnyPluginSignature[] = (ChartType extends keyof ProPluginsPerSeriesType ? ProPluginsPerSeriesType[ChartType] : AllPluginSignatures)> = ChartProApiOriginal<ChartType, Signatures>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ChartAnyPluginSignature, type ChartSeriesType, type UseChartsContainerPropsReturnValue } from '@mui/x-charts/internals';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
import type { ChartDataProviderProProps } from "../ChartDataProviderPro/index.js";
|
|
4
|
+
import type { ChartsContainerProProps } from "./ChartsContainerPro.js";
|
|
5
|
+
import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
6
|
+
export type UseChartsContainerProPropsReturnValue<TSeries extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]> = Pick<UseChartsContainerPropsReturnValue<TSeries, TSignatures>, 'chartsSurfaceProps' | 'children'> & {
|
|
7
|
+
chartDataProviderProProps: ChartDataProviderProProps<TSeries, TSignatures>;
|
|
8
|
+
};
|
|
9
|
+
export declare const useChartsContainerProProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartsContainerProProps<TSeries, TSignatures>, ref: React.Ref<SVGSVGElement>) => UseChartsContainerProPropsReturnValue<TSeries, TSignatures>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
+
const _excluded = ["initialZoom", "zoomData", "onZoomChange", "zoomInteractionConfig", "plugins", "apiRef"];
|
|
6
|
+
import { useChartsContainerProps } from '@mui/x-charts/internals';
|
|
7
|
+
import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
8
|
+
export const useChartsContainerProProps = (props, ref) => {
|
|
9
|
+
const _ref = props,
|
|
10
|
+
{
|
|
11
|
+
initialZoom,
|
|
12
|
+
zoomData,
|
|
13
|
+
onZoomChange,
|
|
14
|
+
zoomInteractionConfig,
|
|
15
|
+
plugins,
|
|
16
|
+
apiRef
|
|
17
|
+
} = _ref,
|
|
18
|
+
baseProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
19
|
+
const {
|
|
20
|
+
chartDataProviderProps,
|
|
21
|
+
chartsSurfaceProps,
|
|
22
|
+
children
|
|
23
|
+
} = useChartsContainerProps(baseProps, ref);
|
|
24
|
+
const chartDataProviderProProps = _extends({}, chartDataProviderProps, {
|
|
25
|
+
initialZoom,
|
|
26
|
+
zoomData,
|
|
27
|
+
onZoomChange,
|
|
28
|
+
zoomInteractionConfig,
|
|
29
|
+
apiRef,
|
|
30
|
+
plugins: plugins ?? DEFAULT_PLUGINS
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
chartDataProviderProProps,
|
|
34
|
+
chartsSurfaceProps,
|
|
35
|
+
children
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -208,7 +208,7 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
208
208
|
*/
|
|
209
209
|
hiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
210
210
|
dataIndex: PropTypes.number,
|
|
211
|
-
seriesId: PropTypes.
|
|
211
|
+
seriesId: PropTypes.string,
|
|
212
212
|
type: PropTypes.oneOf(['funnel']).isRequired
|
|
213
213
|
})),
|
|
214
214
|
/**
|
|
@@ -222,7 +222,7 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
222
222
|
*/
|
|
223
223
|
highlightedItem: PropTypes.shape({
|
|
224
224
|
dataIndex: PropTypes.number,
|
|
225
|
-
seriesId: PropTypes.
|
|
225
|
+
seriesId: PropTypes.string.isRequired
|
|
226
226
|
}),
|
|
227
227
|
/**
|
|
228
228
|
* This prop is used to help implement the accessibility logic.
|
|
@@ -252,7 +252,7 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
252
252
|
*/
|
|
253
253
|
initialHiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
254
254
|
dataIndex: PropTypes.number,
|
|
255
|
-
seriesId: PropTypes.
|
|
255
|
+
seriesId: PropTypes.string,
|
|
256
256
|
type: PropTypes.oneOf(['funnel']).isRequired
|
|
257
257
|
})),
|
|
258
258
|
/**
|
|
@@ -335,7 +335,7 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
335
335
|
*/
|
|
336
336
|
tooltipItem: PropTypes.shape({
|
|
337
337
|
dataIndex: PropTypes.number.isRequired,
|
|
338
|
-
seriesId: PropTypes.
|
|
338
|
+
seriesId: PropTypes.string.isRequired,
|
|
339
339
|
type: PropTypes.oneOf(['funnel']).isRequired
|
|
340
340
|
}),
|
|
341
341
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type SeriesId } from '@mui/x-charts/internals';
|
|
3
3
|
import { type FunnelSectionClasses } from "./funnelSectionClasses.js";
|
|
4
|
-
export interface FunnelSectionProps extends Omit<React.SVGProps<SVGPathElement>, 'ref'
|
|
4
|
+
export interface FunnelSectionProps extends Omit<React.SVGProps<SVGPathElement>, 'ref'> {
|
|
5
5
|
seriesId: SeriesId;
|
|
6
6
|
dataIndex: number;
|
|
7
7
|
color: string;
|
|
@@ -27,7 +27,7 @@ export type FunnelValueType = {
|
|
|
27
27
|
*/
|
|
28
28
|
labelMarkType?: ChartsLabelMarkProps['type'];
|
|
29
29
|
};
|
|
30
|
-
export interface FunnelSeriesType extends Omit<CommonSeriesType<FunnelValueType>, 'color' | 'colorGetter'>, CartesianSeriesType {
|
|
30
|
+
export interface FunnelSeriesType extends Omit<CommonSeriesType<FunnelValueType, 'funnel'>, 'color' | 'colorGetter'>, CartesianSeriesType {
|
|
31
31
|
type: 'funnel';
|
|
32
32
|
/**
|
|
33
33
|
* Data associated to the funnel section.
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
6
|
-
import {
|
|
6
|
+
import { getChartPoint, getCartesianAxisIndex, selectorChartDrawingArea, selectorChartSeriesProcessed, selectorChartsInteractionIsInitialized, defaultizeXAxis, defaultizeYAxis } from '@mui/x-charts/internals';
|
|
7
7
|
import { selectorChartXAxis, selectorChartYAxis } from "./useChartFunnelAxisRendering.selectors.js";
|
|
8
8
|
export const useChartFunnelAxis = ({
|
|
9
9
|
params,
|
|
10
10
|
store,
|
|
11
|
-
seriesConfig,
|
|
12
|
-
svgRef,
|
|
13
11
|
instance
|
|
14
12
|
}) => {
|
|
13
|
+
const {
|
|
14
|
+
svgRef
|
|
15
|
+
} = instance;
|
|
15
16
|
const {
|
|
16
17
|
xAxis,
|
|
17
18
|
yAxis,
|
|
@@ -38,11 +39,12 @@ export const useChartFunnelAxis = ({
|
|
|
38
39
|
gap: gap ?? 0
|
|
39
40
|
},
|
|
40
41
|
cartesianAxis: {
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
axesGap: 0,
|
|
43
|
+
x: defaultizeXAxis(xAxis, dataset, 0),
|
|
44
|
+
y: defaultizeYAxis(yAxis, dataset, 0)
|
|
43
45
|
}
|
|
44
46
|
});
|
|
45
|
-
}, [
|
|
47
|
+
}, [drawingArea, xAxis, yAxis, dataset, store, gap]);
|
|
46
48
|
React.useEffect(() => {
|
|
47
49
|
const element = svgRef.current;
|
|
48
50
|
if (!isInteractionEnabled || !element || params.disableAxisListener) {
|
|
@@ -68,7 +70,7 @@ export const useChartFunnelAxis = ({
|
|
|
68
70
|
const gestureHandler = event => {
|
|
69
71
|
const srvEvent = event.detail.srcEvent;
|
|
70
72
|
const target = event.detail.target;
|
|
71
|
-
const svgPoint =
|
|
73
|
+
const svgPoint = getChartPoint(element, srvEvent);
|
|
72
74
|
// Release the pointer capture if we are panning, as this would cause the tooltip to
|
|
73
75
|
// be locked to the first "section" it touches.
|
|
74
76
|
if (event.detail.srcEvent.buttons >= 1 && target?.hasPointerCapture(event.detail.srcEvent.pointerId)) {
|
|
@@ -112,7 +114,7 @@ export const useChartFunnelAxis = ({
|
|
|
112
114
|
const usedYAxis = yAxisIds[0];
|
|
113
115
|
let dataIndex = null;
|
|
114
116
|
let isXAxis = false;
|
|
115
|
-
const svgPoint =
|
|
117
|
+
const svgPoint = getChartPoint(element, event.detail.srcEvent);
|
|
116
118
|
const xIndex = getCartesianAxisIndex(xAxisWithScale[usedXAxis], svgPoint.x);
|
|
117
119
|
isXAxis = xIndex !== -1;
|
|
118
120
|
dataIndex = isXAxis ? xIndex : getCartesianAxisIndex(yAxisWithScale[usedYAxis], svgPoint.y);
|
|
@@ -158,8 +160,8 @@ useChartFunnelAxis.getDefaultizedParams = ({
|
|
|
158
160
|
}) => {
|
|
159
161
|
return _extends({}, params, {
|
|
160
162
|
gap: params.gap ?? 0,
|
|
161
|
-
defaultizedXAxis: defaultizeXAxis(params.xAxis, params.dataset),
|
|
162
|
-
defaultizedYAxis: defaultizeYAxis(params.yAxis, params.dataset)
|
|
163
|
+
defaultizedXAxis: defaultizeXAxis(params.xAxis, params.dataset, 0),
|
|
164
|
+
defaultizedYAxis: defaultizeYAxis(params.yAxis, params.dataset, 0)
|
|
163
165
|
});
|
|
164
166
|
};
|
|
165
167
|
useChartFunnelAxis.getInitialState = params => {
|
|
@@ -168,6 +170,7 @@ useChartFunnelAxis.getInitialState = params => {
|
|
|
168
170
|
gap: params.gap ?? 0
|
|
169
171
|
},
|
|
170
172
|
cartesianAxis: {
|
|
173
|
+
axesGap: 0,
|
|
171
174
|
x: params.defaultizedXAxis,
|
|
172
175
|
y: params.defaultizedYAxis
|
|
173
176
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ChartPluginSignature, type UseChartCartesianAxisDefaultizedParameters, type UseChartCartesianAxisParameters, type UseChartCartesianAxisState, type UseChartInteractionSignature, type UseChartSeriesSignature, type ChartsAxisData } from '@mui/x-charts/internals';
|
|
2
2
|
export type UseChartFunnelAxisSignature = ChartPluginSignature<{
|
|
3
|
-
params: Omit<UseChartCartesianAxisParameters, 'onAxisClick' | 'onHighlightedAxisChange' | 'highlightedAxis'> & {
|
|
3
|
+
params: Omit<UseChartCartesianAxisParameters, 'onAxisClick' | 'onHighlightedAxisChange' | 'highlightedAxis' | 'axesGap'> & {
|
|
4
4
|
/**
|
|
5
5
|
* The gap, in pixels, between funnel sections.
|
|
6
6
|
* @default 0
|
|
@@ -14,8 +14,9 @@ export type UseChartFunnelAxisSignature = ChartPluginSignature<{
|
|
|
14
14
|
*/
|
|
15
15
|
onAxisClick?: (event: MouseEvent, data: null | ChartsAxisData) => void;
|
|
16
16
|
};
|
|
17
|
-
defaultizedParams: UseChartCartesianAxisDefaultizedParameters & {
|
|
17
|
+
defaultizedParams: Omit<UseChartCartesianAxisDefaultizedParameters, 'onAxisClick' | 'onHighlightedAxisChange' | 'highlightedAxis' | 'axesGap'> & {
|
|
18
18
|
gap: number;
|
|
19
|
+
onAxisClick?: (event: MouseEvent, data: null | ChartsAxisData) => void;
|
|
19
20
|
};
|
|
20
21
|
state: Pick<UseChartCartesianAxisState, 'cartesianAxis'> & {
|
|
21
22
|
funnel: {
|
|
@@ -3,16 +3,16 @@ import { type 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: (args_0: 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"> & {
|
|
6
|
+
export declare const selectorFunnelGap: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & 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
|
};
|
|
10
10
|
}> & {
|
|
11
11
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
12
12
|
}) => number;
|
|
13
|
-
export declare const selectorChartXAxis: (args_0: 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> & {
|
|
13
|
+
export declare const selectorChartXAxis: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & 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> & {
|
|
14
14
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
15
15
|
}) => import("./computeAxisValue.js").ComputeResult<import("@mui/x-charts").ChartsXAxisProps>;
|
|
16
|
-
export declare const selectorChartYAxis: (args_0: 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
|
+
export declare const selectorChartYAxis: (args_0: import("@mui/x-charts/internals/plugins/corePlugins/useChartId/useChartId.types").UseChartIdState & import("@mui/x-charts/internals/plugins/corePlugins/useChartSeriesConfig/useChartSeriesConfig.types").UseChartSeriesConfigState<keyof import("@mui/x-charts/internals").ChartsSeriesConfig> & 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> & {
|
|
17
17
|
cacheKey: import("@mui/x-charts/internals").ChartStateCacheKey;
|
|
18
18
|
}) => import("./computeAxisValue.js").ComputeResult<import("@mui/x-charts").ChartsYAxisProps>;
|
|
@@ -5,6 +5,7 @@ export { FunnelChart } from "./FunnelChart.js";
|
|
|
5
5
|
export declare const Unstable_FunnelChart: import("react").ForwardRefExoticComponent<import("./FunnelChart.js").FunnelChartProps & import("react").RefAttributes<SVGSVGElement>>;
|
|
6
6
|
export type { FunnelChartProps, FunnelSeries } from "./FunnelChart.js";
|
|
7
7
|
export * from "./FunnelPlot.js";
|
|
8
|
+
export * from "./funnelPlotSlots.types.js";
|
|
8
9
|
export * from "./FocusedFunnelSection.js";
|
|
9
10
|
export * from "./funnel.types.js";
|
|
10
11
|
export * from "./categoryAxis.types.js";
|
package/esm/FunnelChart/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { FunnelChart } from "./FunnelChart.js";
|
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
7
|
export const Unstable_FunnelChart = FunnelChart;
|
|
8
8
|
export * from "./FunnelPlot.js";
|
|
9
|
+
export * from "./funnelPlotSlots.types.js";
|
|
9
10
|
export * from "./FocusedFunnelSection.js";
|
|
10
11
|
export * from "./funnel.types.js";
|
|
11
12
|
export * from "./categoryAxis.types.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { identifierSerializerSeriesIdDataIndex } from '@mui/x-charts/internals';
|
|
1
|
+
import { identifierSerializerSeriesIdDataIndex, identifierCleanerSeriesIdDataIndex } from '@mui/x-charts/internals';
|
|
2
2
|
import { getExtremumX, getExtremumY } from "./extremums.js";
|
|
3
3
|
import seriesProcessor from "./seriesProcessor.js";
|
|
4
4
|
import getColor from "./getColor.js";
|
|
@@ -17,5 +17,6 @@ export const funnelSeriesConfig = {
|
|
|
17
17
|
yExtremumGetter: getExtremumY,
|
|
18
18
|
getSeriesWithDefaultValues,
|
|
19
19
|
keyboardFocusHandler,
|
|
20
|
-
identifierSerializer: identifierSerializerSeriesIdDataIndex
|
|
20
|
+
identifierSerializer: identifierSerializerSeriesIdDataIndex,
|
|
21
|
+
identifierCleaner: identifierCleanerSeriesIdDataIndex
|
|
21
22
|
};
|