@mui/x-charts-pro 8.27.2 → 9.0.0-alpha.1
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 +30 -8
- package/CHANGELOG.md +279 -34
- package/ChartContainerPro/ChartContainerPro.d.ts +17 -31
- package/ChartContainerPro/ChartContainerPro.js +14 -287
- package/ChartContainerPro/useChartContainerProProps.d.ts +10 -7
- package/ChartContainerPro/useChartContainerProProps.js +10 -35
- 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 +188 -0
- package/ChartsContainerPro/index.d.ts +9 -0
- package/ChartsContainerPro/index.js +17 -0
- package/ChartsContainerPro/useChartsContainerProProps.d.ts +8 -0
- package/ChartsContainerPro/useChartsContainerProProps.js +44 -0
- package/FunnelChart/FunnelChart.d.ts +1 -1
- package/FunnelChart/FunnelChart.js +9 -8
- 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/funnelSlots.types.d.ts +3 -9
- package/FunnelChart/index.d.ts +2 -1
- package/FunnelChart/index.js +12 -0
- package/FunnelChart/seriesConfig/index.js +2 -1
- package/FunnelChart/seriesConfig/keyboardFocusHandler.js +1 -14
- package/FunnelChart/seriesConfig/legend.js +0 -1
- package/Heatmap/Heatmap.d.ts +6 -3
- package/Heatmap/Heatmap.js +46 -135
- 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 +18 -2
- package/Heatmap/HeatmapTooltip/index.d.ts +1 -1
- package/Heatmap/index.d.ts +3 -2
- package/Heatmap/seriesConfig/getItemAtPosition.d.ts +2 -2
- package/Heatmap/seriesConfig/getItemAtPosition.js +6 -2
- package/Heatmap/seriesConfig/index.js +1 -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 +30 -8
- package/PieChartPro/PieChartPro.d.ts +1 -1
- package/PieChartPro/PieChartPro.js +9 -8
- package/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/RadarChartPro/RadarChartPro.js +8 -8
- package/SankeyChart/SankeyChart.d.ts +1 -1
- package/SankeyChart/SankeyChart.js +9 -23
- 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/sankeySlots.types.d.ts +3 -9
- 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 +30 -8
- package/esm/BarChartPro/BarChartPro.d.ts +1 -1
- package/esm/BarChartPro/BarChartPro.js +30 -8
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +17 -31
- package/esm/ChartContainerPro/ChartContainerPro.js +15 -286
- package/esm/ChartContainerPro/useChartContainerProProps.d.ts +10 -7
- package/esm/ChartContainerPro/useChartContainerProProps.js +11 -34
- 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 +182 -0
- package/esm/ChartsContainerPro/index.d.ts +9 -0
- package/esm/ChartsContainerPro/index.js +6 -0
- package/esm/ChartsContainerPro/useChartsContainerProProps.d.ts +8 -0
- package/esm/ChartsContainerPro/useChartsContainerProProps.js +37 -0
- package/esm/FunnelChart/FunnelChart.d.ts +1 -1
- package/esm/FunnelChart/FunnelChart.js +9 -8
- 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/funnelSlots.types.d.ts +3 -9
- package/esm/FunnelChart/index.d.ts +2 -1
- package/esm/FunnelChart/index.js +1 -0
- package/esm/FunnelChart/seriesConfig/index.js +3 -2
- package/esm/FunnelChart/seriesConfig/keyboardFocusHandler.js +2 -15
- package/esm/FunnelChart/seriesConfig/legend.js +0 -1
- package/esm/Heatmap/Heatmap.d.ts +6 -3
- package/esm/Heatmap/Heatmap.js +47 -136
- 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 +18 -2
- package/esm/Heatmap/HeatmapTooltip/index.d.ts +1 -1
- package/esm/Heatmap/index.d.ts +3 -2
- package/esm/Heatmap/seriesConfig/getItemAtPosition.d.ts +2 -2
- package/esm/Heatmap/seriesConfig/getItemAtPosition.js +6 -2
- package/esm/Heatmap/seriesConfig/index.js +2 -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 +30 -8
- package/esm/PieChartPro/PieChartPro.d.ts +1 -1
- package/esm/PieChartPro/PieChartPro.js +9 -8
- package/esm/RadarChartPro/RadarChartPro.d.ts +1 -1
- package/esm/RadarChartPro/RadarChartPro.js +8 -8
- package/esm/SankeyChart/SankeyChart.d.ts +1 -1
- package/esm/SankeyChart/SankeyChart.js +9 -23
- 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/sankeySlots.types.d.ts +3 -9
- 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 +30 -8
- package/esm/index.d.ts +3 -1
- package/esm/index.js +2 -1
- package/esm/internals/index.d.ts +7 -1
- package/esm/internals/index.js +5 -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 +2 -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 +7 -1
- package/internals/index.js +43 -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 +1 -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 +19 -11
- package/plugins/selectors/useChartHeatmapPosition.selectors.d.ts +1 -1
- package/plugins/selectors/useChartHeatmapPosition.selectors.js +3 -1
- package/typeOverloads/modules.d.ts +9 -5
|
@@ -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,182 @@
|
|
|
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);
|
|
40
|
+
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
41
|
+
children: /*#__PURE__*/_jsx(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
42
|
+
ref: ref,
|
|
43
|
+
children: children
|
|
44
|
+
}))
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// @ts-expect-error the type coercion breaks the prop types
|
|
49
|
+
if (process.env.NODE_ENV !== "production") ChartsContainerPro.displayName = "ChartsContainerPro";
|
|
50
|
+
process.env.NODE_ENV !== "production" ? ChartsContainerPro.propTypes = {
|
|
51
|
+
// ----------------------------- Warning --------------------------------
|
|
52
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
53
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
54
|
+
// ----------------------------------------------------------------------
|
|
55
|
+
apiRef: PropTypes.shape({
|
|
56
|
+
current: PropTypes.shape({
|
|
57
|
+
setZoomData: PropTypes.func.isRequired
|
|
58
|
+
})
|
|
59
|
+
}),
|
|
60
|
+
children: PropTypes.node,
|
|
61
|
+
className: PropTypes.string,
|
|
62
|
+
/**
|
|
63
|
+
* Color palette used to colorize multiple series.
|
|
64
|
+
* @default blueberryTwilightPalette
|
|
65
|
+
*/
|
|
66
|
+
colors: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
|
|
67
|
+
/**
|
|
68
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
69
|
+
*/
|
|
70
|
+
dataset: PropTypes.arrayOf(PropTypes.object),
|
|
71
|
+
desc: PropTypes.string,
|
|
72
|
+
/**
|
|
73
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
74
|
+
* It might break interactive features, but will improve performance.
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
disableAxisListener: PropTypes.bool,
|
|
78
|
+
/**
|
|
79
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
80
|
+
*/
|
|
81
|
+
height: PropTypes.number,
|
|
82
|
+
/**
|
|
83
|
+
* The highlighted item.
|
|
84
|
+
* Used when the highlight is controlled.
|
|
85
|
+
*/
|
|
86
|
+
highlightedItem: PropTypes.shape({
|
|
87
|
+
dataIndex: PropTypes.number,
|
|
88
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired
|
|
89
|
+
}),
|
|
90
|
+
/**
|
|
91
|
+
* This prop is used to help implement the accessibility logic.
|
|
92
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
93
|
+
*/
|
|
94
|
+
id: PropTypes.string,
|
|
95
|
+
/**
|
|
96
|
+
* The list of zoom data related to each axis.
|
|
97
|
+
*/
|
|
98
|
+
initialZoom: PropTypes.arrayOf(PropTypes.shape({
|
|
99
|
+
axisId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
100
|
+
end: PropTypes.number.isRequired,
|
|
101
|
+
start: PropTypes.number.isRequired
|
|
102
|
+
})),
|
|
103
|
+
/**
|
|
104
|
+
* The margin between the SVG and the drawing area.
|
|
105
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
106
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
107
|
+
*/
|
|
108
|
+
margin: PropTypes.shape({
|
|
109
|
+
bottom: PropTypes.number,
|
|
110
|
+
left: PropTypes.number,
|
|
111
|
+
right: PropTypes.number,
|
|
112
|
+
top: PropTypes.number
|
|
113
|
+
}),
|
|
114
|
+
/**
|
|
115
|
+
* The callback fired when the highlighted item changes.
|
|
116
|
+
*
|
|
117
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
118
|
+
*/
|
|
119
|
+
onHighlightChange: PropTypes.func,
|
|
120
|
+
/**
|
|
121
|
+
* Callback fired when the zoom has changed.
|
|
122
|
+
*
|
|
123
|
+
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
124
|
+
*/
|
|
125
|
+
onZoomChange: PropTypes.func,
|
|
126
|
+
/**
|
|
127
|
+
* The array of series to display.
|
|
128
|
+
* Each type of series has its own specificity.
|
|
129
|
+
* Please refer to the appropriate docs page to learn more about it.
|
|
130
|
+
*/
|
|
131
|
+
series: PropTypes.arrayOf(PropTypes.object),
|
|
132
|
+
/**
|
|
133
|
+
* If `true`, animations are skipped.
|
|
134
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
135
|
+
*/
|
|
136
|
+
skipAnimation: PropTypes.bool,
|
|
137
|
+
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
138
|
+
theme: PropTypes.oneOf(['dark', 'light']),
|
|
139
|
+
title: PropTypes.string,
|
|
140
|
+
/**
|
|
141
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
142
|
+
*/
|
|
143
|
+
width: PropTypes.number,
|
|
144
|
+
/**
|
|
145
|
+
* The configuration of the x-axes.
|
|
146
|
+
* If not provided, a default axis config is used.
|
|
147
|
+
* An array of [[AxisConfig]] objects.
|
|
148
|
+
*/
|
|
149
|
+
xAxis: PropTypes.arrayOf(PropTypes.object),
|
|
150
|
+
/**
|
|
151
|
+
* The configuration of the y-axes.
|
|
152
|
+
* If not provided, a default axis config is used.
|
|
153
|
+
* An array of [[AxisConfig]] objects.
|
|
154
|
+
*/
|
|
155
|
+
yAxis: PropTypes.arrayOf(PropTypes.object),
|
|
156
|
+
/**
|
|
157
|
+
* The configuration of the z-axes.
|
|
158
|
+
*/
|
|
159
|
+
zAxis: PropTypes.arrayOf(PropTypes.shape({
|
|
160
|
+
colorMap: PropTypes.oneOfType([PropTypes.shape({
|
|
161
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
162
|
+
type: PropTypes.oneOf(['ordinal']).isRequired,
|
|
163
|
+
unknownColor: PropTypes.string,
|
|
164
|
+
values: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number, PropTypes.string]).isRequired)
|
|
165
|
+
}), PropTypes.shape({
|
|
166
|
+
color: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string.isRequired), PropTypes.func]).isRequired,
|
|
167
|
+
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
168
|
+
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
169
|
+
type: PropTypes.oneOf(['continuous']).isRequired
|
|
170
|
+
}), PropTypes.shape({
|
|
171
|
+
colors: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
172
|
+
thresholds: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]).isRequired).isRequired,
|
|
173
|
+
type: PropTypes.oneOf(['piecewise']).isRequired
|
|
174
|
+
})]),
|
|
175
|
+
data: PropTypes.array,
|
|
176
|
+
dataKey: PropTypes.string,
|
|
177
|
+
id: PropTypes.string,
|
|
178
|
+
max: PropTypes.number,
|
|
179
|
+
min: PropTypes.number
|
|
180
|
+
}))
|
|
181
|
+
} : void 0;
|
|
182
|
+
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,8 @@
|
|
|
1
|
+
import { type ChartAnyPluginSignature, type ChartSeriesType, type UseChartsContainerPropsReturnValue } from '@mui/x-charts/internals';
|
|
2
|
+
import type { ChartDataProviderProProps } from "../ChartDataProviderPro/index.js";
|
|
3
|
+
import type { ChartsContainerProProps } from "./ChartsContainerPro.js";
|
|
4
|
+
import { type AllPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
5
|
+
export type UseChartsContainerProPropsReturnValue<TSeries extends ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[]> = Pick<UseChartsContainerPropsReturnValue<TSeries, TSignatures>, 'chartsSurfaceProps' | 'children'> & {
|
|
6
|
+
chartDataProviderProProps: ChartDataProviderProProps<TSeries, TSignatures>;
|
|
7
|
+
};
|
|
8
|
+
export declare const useChartsContainerProProps: <TSeries extends ChartSeriesType = ChartSeriesType, TSignatures extends readonly ChartAnyPluginSignature[] = AllPluginSignatures<TSeries>>(props: ChartsContainerProProps<TSeries, TSignatures>) => 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 => {
|
|
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);
|
|
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
|
+
};
|
|
@@ -35,5 +35,5 @@ export interface FunnelChartProps extends Omit<ChartContainerProProps<'funnel',
|
|
|
35
35
|
*/
|
|
36
36
|
axisHighlight?: ChartsAxisHighlightProps;
|
|
37
37
|
}
|
|
38
|
-
declare const FunnelChart: React.ForwardRefExoticComponent<FunnelChartProps & React.RefAttributes<
|
|
38
|
+
declare const FunnelChart: React.ForwardRefExoticComponent<FunnelChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
39
39
|
export { FunnelChart };
|
|
@@ -40,13 +40,14 @@ const FunnelChart = /*#__PURE__*/React.forwardRef(function FunnelChart(props, re
|
|
|
40
40
|
const {
|
|
41
41
|
chartDataProviderProProps,
|
|
42
42
|
chartsSurfaceProps
|
|
43
|
-
} = useChartContainerProProps(chartContainerProps
|
|
43
|
+
} = useChartContainerProProps(chartContainerProps);
|
|
44
44
|
const Tooltip = themedProps.slots?.tooltip ?? ChartsTooltip;
|
|
45
45
|
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
46
46
|
gap: themedProps.gap,
|
|
47
47
|
seriesConfig: seriesConfig,
|
|
48
48
|
plugins: FUNNEL_CHART_PLUGINS,
|
|
49
49
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
50
|
+
ref: ref,
|
|
50
51
|
children: [!themedProps.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
51
52
|
children: [/*#__PURE__*/_jsx(FunnelPlot, _extends({}, funnelPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(FocusedFunnelSection, {}), children]
|
|
52
53
|
})), !themedProps.loading && /*#__PURE__*/_jsx(Tooltip, _extends({
|
|
@@ -208,8 +209,8 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
208
209
|
*/
|
|
209
210
|
hiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
210
211
|
dataIndex: PropTypes.number,
|
|
211
|
-
seriesId: PropTypes.
|
|
212
|
-
type: PropTypes.oneOf(['funnel'])
|
|
212
|
+
seriesId: PropTypes.string.isRequired,
|
|
213
|
+
type: PropTypes.oneOf(['funnel'])
|
|
213
214
|
})),
|
|
214
215
|
/**
|
|
215
216
|
* If `true`, the legend is not rendered.
|
|
@@ -222,7 +223,7 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
222
223
|
*/
|
|
223
224
|
highlightedItem: PropTypes.shape({
|
|
224
225
|
dataIndex: PropTypes.number,
|
|
225
|
-
seriesId: PropTypes.
|
|
226
|
+
seriesId: PropTypes.string.isRequired
|
|
226
227
|
}),
|
|
227
228
|
/**
|
|
228
229
|
* This prop is used to help implement the accessibility logic.
|
|
@@ -252,8 +253,8 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
252
253
|
*/
|
|
253
254
|
initialHiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
254
255
|
dataIndex: PropTypes.number,
|
|
255
|
-
seriesId: PropTypes.
|
|
256
|
-
type: PropTypes.oneOf(['funnel'])
|
|
256
|
+
seriesId: PropTypes.string.isRequired,
|
|
257
|
+
type: PropTypes.oneOf(['funnel'])
|
|
257
258
|
})),
|
|
258
259
|
/**
|
|
259
260
|
* If `true`, a loading overlay is displayed.
|
|
@@ -335,8 +336,8 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
335
336
|
*/
|
|
336
337
|
tooltipItem: PropTypes.shape({
|
|
337
338
|
dataIndex: PropTypes.number.isRequired,
|
|
338
|
-
seriesId: PropTypes.
|
|
339
|
-
type: PropTypes.oneOf(['funnel'])
|
|
339
|
+
seriesId: PropTypes.string.isRequired,
|
|
340
|
+
type: PropTypes.oneOf(['funnel'])
|
|
340
341
|
}),
|
|
341
342
|
/**
|
|
342
343
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
@@ -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' | 'onTooltipAxisChange' | 'tooltipAxis' | '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>;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { type ChartsOverlaySlotProps, type ChartsOverlaySlots } from '@mui/x-charts/ChartsOverlay';
|
|
2
|
-
import { type
|
|
2
|
+
import { type ChartsTooltipSlotProps, type ChartsTooltipSlots } from '@mui/x-charts/ChartsTooltip';
|
|
3
3
|
import { type ChartsAxisSlotProps, type ChartsAxisSlots, type ChartsSlotProps, type ChartsSlots } from '@mui/x-charts/internals';
|
|
4
4
|
import { type ChartsLegendSlotProps, type ChartsLegendSlots } from '@mui/x-charts/ChartsLegend';
|
|
5
5
|
import { type ChartsToolbarSlotProps, type ChartsToolbarSlots } from '@mui/x-charts/Toolbar';
|
|
6
6
|
import { type FunnelPlotSlotProps, type FunnelPlotSlots } from "./funnelPlotSlots.types.js";
|
|
7
|
-
export interface FunnelChartSlots extends ChartsAxisSlots, FunnelPlotSlots, ChartsLegendSlots,
|
|
8
|
-
export interface FunnelChartSlotProps extends ChartsAxisSlotProps, FunnelPlotSlotProps, ChartsLegendSlotProps,
|
|
9
|
-
/**
|
|
10
|
-
* Slot props for the tooltip component.
|
|
11
|
-
* @default {}
|
|
12
|
-
*/
|
|
13
|
-
tooltip?: Partial<ChartsTooltipProps<'item' | 'none'>>;
|
|
14
|
-
}
|
|
7
|
+
export interface FunnelChartSlots extends ChartsAxisSlots, FunnelPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsAxisSlots, ChartsToolbarSlots, ChartsTooltipSlots<'item' | 'none'>, Partial<ChartsSlots> {}
|
|
8
|
+
export interface FunnelChartSlotProps extends ChartsAxisSlotProps, FunnelPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsAxisSlotProps, ChartsToolbarSlotProps, ChartsTooltipSlotProps<'item' | 'none'>, Partial<ChartsSlotProps> {}
|
|
15
9
|
export interface FunnelChartSlotExtension {
|
|
16
10
|
/**
|
|
17
11
|
* Overridable component slots.
|
|
@@ -2,9 +2,10 @@ export { FunnelChart } from "./FunnelChart.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated funnel chart is now stable, import `FunnelChart` instead
|
|
4
4
|
*/
|
|
5
|
-
export declare const Unstable_FunnelChart: import("react").ForwardRefExoticComponent<import("./FunnelChart.js").FunnelChartProps & import("react").RefAttributes<
|
|
5
|
+
export declare const Unstable_FunnelChart: import("react").ForwardRefExoticComponent<import("./FunnelChart.js").FunnelChartProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
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
|
};
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createCommonKeyboardFocusHandler } from '@mui/x-charts/internals';
|
|
2
2
|
const outSeriesTypes = new Set(['funnel']);
|
|
3
|
-
const keyboardFocusHandler =
|
|
4
|
-
switch (event.key) {
|
|
5
|
-
case 'ArrowRight':
|
|
6
|
-
return createGetNextIndexFocusedItem(outSeriesTypes);
|
|
7
|
-
case 'ArrowLeft':
|
|
8
|
-
return createGetPreviousIndexFocusedItem(outSeriesTypes);
|
|
9
|
-
case 'ArrowDown':
|
|
10
|
-
return createGetPreviousSeriesFocusedItem(outSeriesTypes);
|
|
11
|
-
case 'ArrowUp':
|
|
12
|
-
return createGetNextSeriesFocusedItem(outSeriesTypes);
|
|
13
|
-
default:
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
3
|
+
const keyboardFocusHandler = createCommonKeyboardFocusHandler(outSeriesTypes);
|
|
17
4
|
export default keyboardFocusHandler;
|
package/esm/Heatmap/Heatmap.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export interface HeatmapSlotProps extends ChartsAxisSlotProps, ChartsOverlaySlot
|
|
|
28
28
|
tooltip?: Partial<HeatmapTooltipProps>;
|
|
29
29
|
}
|
|
30
30
|
export type HeatmapSeries = MakeOptional<HeatmapSeriesType, 'type'>;
|
|
31
|
-
export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', HeatmapPluginSignatures>, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'skipAnimation' | 'slots' | 'slotProps' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange' | 'onAxisClick'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
31
|
+
export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', HeatmapPluginSignatures>, 'series' | 'plugins' | 'xAxis' | 'yAxis' | 'axesGap' | 'skipAnimation' | 'slots' | 'slotProps' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange' | 'seriesConfig' | 'onAxisClick'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
32
32
|
/**
|
|
33
33
|
* The function called for onClick events.
|
|
34
34
|
* The second argument contains information about all line/bar elements at the current mouse position.
|
|
@@ -62,7 +62,6 @@ export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', Hea
|
|
|
62
62
|
tooltip?: ChartsTooltipProps;
|
|
63
63
|
/**
|
|
64
64
|
* If `true`, the legend is not rendered.
|
|
65
|
-
* @default true
|
|
66
65
|
*/
|
|
67
66
|
hideLegend?: boolean;
|
|
68
67
|
/**
|
|
@@ -70,6 +69,10 @@ export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', Hea
|
|
|
70
69
|
* @default false
|
|
71
70
|
*/
|
|
72
71
|
showToolbar?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* The border radius of the heatmap cells in pixels.
|
|
74
|
+
*/
|
|
75
|
+
borderRadius?: number;
|
|
73
76
|
/**
|
|
74
77
|
* Overridable component slots.
|
|
75
78
|
* @default {}
|
|
@@ -81,5 +84,5 @@ export interface HeatmapProps extends Omit<ChartContainerProProps<'heatmap', Hea
|
|
|
81
84
|
*/
|
|
82
85
|
slotProps?: HeatmapSlotProps;
|
|
83
86
|
}
|
|
84
|
-
declare const Heatmap: React.ForwardRefExoticComponent<HeatmapProps & React.RefAttributes<
|
|
87
|
+
declare const Heatmap: React.ForwardRefExoticComponent<HeatmapProps & React.RefAttributes<HTMLDivElement>>;
|
|
85
88
|
export { Heatmap };
|