@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,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _ChartsContainer = require("@mui/x-charts/ChartsContainer");
|
|
7
|
+
Object.keys(_ChartsContainer).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _ChartsContainer[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _ChartsContainer[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -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,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.ChartsContainerPro = void 0;
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _ChartsSurface = require("@mui/x-charts/ChartsSurface");
|
|
14
|
+
var _useChartsContainerProProps = require("./useChartsContainerProProps");
|
|
15
|
+
var _ChartDataProviderPro = require("../ChartDataProviderPro");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
/**
|
|
18
|
+
* It sets up the data providers as well as the `<svg>` for the chart.
|
|
19
|
+
*
|
|
20
|
+
* This is a combination of both the `ChartDataProviderPro` and `ChartsSurface` components.
|
|
21
|
+
*
|
|
22
|
+
* Demos:
|
|
23
|
+
*
|
|
24
|
+
* - [Composition](https://mui.com/x/api/charts/composition/)
|
|
25
|
+
*
|
|
26
|
+
* API:
|
|
27
|
+
*
|
|
28
|
+
* - [ChartsContainerPro API](https://mui.com/x/api/charts/charts-container-pro/)
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```jsx
|
|
32
|
+
* <ChartsContainerPro
|
|
33
|
+
* series={[{ label: "Label", type: "bar", data: [10, 20] }]}
|
|
34
|
+
* xAxis={[{ data: ["A", "B"], scaleType: "band", id: "x-axis" }]}
|
|
35
|
+
* >
|
|
36
|
+
* <BarPlot />
|
|
37
|
+
* <ChartsXAxis axisId="x-axis" />
|
|
38
|
+
* </ChartsContainerPro>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
const ChartsContainerPro = exports.ChartsContainerPro = /*#__PURE__*/React.forwardRef(function ChartsContainerProInner(props, ref) {
|
|
42
|
+
const {
|
|
43
|
+
chartDataProviderProProps,
|
|
44
|
+
children,
|
|
45
|
+
chartsSurfaceProps
|
|
46
|
+
} = (0, _useChartsContainerProProps.useChartsContainerProProps)(props);
|
|
47
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProviderPro.ChartDataProviderPro, (0, _extends2.default)({}, chartDataProviderProProps, {
|
|
48
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
49
|
+
ref: ref,
|
|
50
|
+
children: children
|
|
51
|
+
}))
|
|
52
|
+
}));
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// @ts-expect-error the type coercion breaks the prop types
|
|
56
|
+
if (process.env.NODE_ENV !== "production") ChartsContainerPro.displayName = "ChartsContainerPro";
|
|
57
|
+
process.env.NODE_ENV !== "production" ? ChartsContainerPro.propTypes = {
|
|
58
|
+
// ----------------------------- Warning --------------------------------
|
|
59
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
60
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
61
|
+
// ----------------------------------------------------------------------
|
|
62
|
+
apiRef: _propTypes.default.shape({
|
|
63
|
+
current: _propTypes.default.shape({
|
|
64
|
+
setZoomData: _propTypes.default.func.isRequired
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
children: _propTypes.default.node,
|
|
68
|
+
className: _propTypes.default.string,
|
|
69
|
+
/**
|
|
70
|
+
* Color palette used to colorize multiple series.
|
|
71
|
+
* @default blueberryTwilightPalette
|
|
72
|
+
*/
|
|
73
|
+
colors: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string), _propTypes.default.func]),
|
|
74
|
+
/**
|
|
75
|
+
* An array of objects that can be used to populate series and axes data using their `dataKey` property.
|
|
76
|
+
*/
|
|
77
|
+
dataset: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
78
|
+
desc: _propTypes.default.string,
|
|
79
|
+
/**
|
|
80
|
+
* If `true`, the charts will not listen to the mouse move event.
|
|
81
|
+
* It might break interactive features, but will improve performance.
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
disableAxisListener: _propTypes.default.bool,
|
|
85
|
+
/**
|
|
86
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
87
|
+
*/
|
|
88
|
+
height: _propTypes.default.number,
|
|
89
|
+
/**
|
|
90
|
+
* The highlighted item.
|
|
91
|
+
* Used when the highlight is controlled.
|
|
92
|
+
*/
|
|
93
|
+
highlightedItem: _propTypes.default.shape({
|
|
94
|
+
dataIndex: _propTypes.default.number,
|
|
95
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired
|
|
96
|
+
}),
|
|
97
|
+
/**
|
|
98
|
+
* This prop is used to help implement the accessibility logic.
|
|
99
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
100
|
+
*/
|
|
101
|
+
id: _propTypes.default.string,
|
|
102
|
+
/**
|
|
103
|
+
* The list of zoom data related to each axis.
|
|
104
|
+
*/
|
|
105
|
+
initialZoom: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
106
|
+
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
107
|
+
end: _propTypes.default.number.isRequired,
|
|
108
|
+
start: _propTypes.default.number.isRequired
|
|
109
|
+
})),
|
|
110
|
+
/**
|
|
111
|
+
* The margin between the SVG and the drawing area.
|
|
112
|
+
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
113
|
+
* Accepts an object with the optional properties: `top`, `bottom`, `left`, and `right`.
|
|
114
|
+
*/
|
|
115
|
+
margin: _propTypes.default.shape({
|
|
116
|
+
bottom: _propTypes.default.number,
|
|
117
|
+
left: _propTypes.default.number,
|
|
118
|
+
right: _propTypes.default.number,
|
|
119
|
+
top: _propTypes.default.number
|
|
120
|
+
}),
|
|
121
|
+
/**
|
|
122
|
+
* The callback fired when the highlighted item changes.
|
|
123
|
+
*
|
|
124
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
125
|
+
*/
|
|
126
|
+
onHighlightChange: _propTypes.default.func,
|
|
127
|
+
/**
|
|
128
|
+
* Callback fired when the zoom has changed.
|
|
129
|
+
*
|
|
130
|
+
* @param {ZoomData[]} zoomData Updated zoom data.
|
|
131
|
+
*/
|
|
132
|
+
onZoomChange: _propTypes.default.func,
|
|
133
|
+
/**
|
|
134
|
+
* The array of series to display.
|
|
135
|
+
* Each type of series has its own specificity.
|
|
136
|
+
* Please refer to the appropriate docs page to learn more about it.
|
|
137
|
+
*/
|
|
138
|
+
series: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
139
|
+
/**
|
|
140
|
+
* If `true`, animations are skipped.
|
|
141
|
+
* If unset or `false`, the animations respects the user's `prefers-reduced-motion` setting.
|
|
142
|
+
*/
|
|
143
|
+
skipAnimation: _propTypes.default.bool,
|
|
144
|
+
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
145
|
+
theme: _propTypes.default.oneOf(['dark', 'light']),
|
|
146
|
+
title: _propTypes.default.string,
|
|
147
|
+
/**
|
|
148
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
149
|
+
*/
|
|
150
|
+
width: _propTypes.default.number,
|
|
151
|
+
/**
|
|
152
|
+
* The configuration of the x-axes.
|
|
153
|
+
* If not provided, a default axis config is used.
|
|
154
|
+
* An array of [[AxisConfig]] objects.
|
|
155
|
+
*/
|
|
156
|
+
xAxis: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
157
|
+
/**
|
|
158
|
+
* The configuration of the y-axes.
|
|
159
|
+
* If not provided, a default axis config is used.
|
|
160
|
+
* An array of [[AxisConfig]] objects.
|
|
161
|
+
*/
|
|
162
|
+
yAxis: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
163
|
+
/**
|
|
164
|
+
* The configuration of the z-axes.
|
|
165
|
+
*/
|
|
166
|
+
zAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
167
|
+
colorMap: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
168
|
+
colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
169
|
+
type: _propTypes.default.oneOf(['ordinal']).isRequired,
|
|
170
|
+
unknownColor: _propTypes.default.string,
|
|
171
|
+
values: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number, _propTypes.default.string]).isRequired)
|
|
172
|
+
}), _propTypes.default.shape({
|
|
173
|
+
color: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.string.isRequired), _propTypes.default.func]).isRequired,
|
|
174
|
+
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
175
|
+
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
176
|
+
type: _propTypes.default.oneOf(['continuous']).isRequired
|
|
177
|
+
}), _propTypes.default.shape({
|
|
178
|
+
colors: _propTypes.default.arrayOf(_propTypes.default.string).isRequired,
|
|
179
|
+
thresholds: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]).isRequired).isRequired,
|
|
180
|
+
type: _propTypes.default.oneOf(['piecewise']).isRequired
|
|
181
|
+
})]),
|
|
182
|
+
data: _propTypes.default.array,
|
|
183
|
+
dataKey: _propTypes.default.string,
|
|
184
|
+
id: _propTypes.default.string,
|
|
185
|
+
max: _propTypes.default.number,
|
|
186
|
+
min: _propTypes.default.number
|
|
187
|
+
}))
|
|
188
|
+
} : void 0;
|
|
@@ -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,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
require("../typeOverloads");
|
|
7
|
+
var _ChartsContainerPro = require("./ChartsContainerPro");
|
|
8
|
+
Object.keys(_ChartsContainerPro).forEach(function (key) {
|
|
9
|
+
if (key === "default" || key === "__esModule") return;
|
|
10
|
+
if (key in exports && exports[key] === _ChartsContainerPro[key]) return;
|
|
11
|
+
Object.defineProperty(exports, key, {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return _ChartsContainerPro[key];
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -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,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useChartsContainerProProps = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
+
var _internals = require("@mui/x-charts/internals");
|
|
12
|
+
var _allPlugins = require("../internals/plugins/allPlugins");
|
|
13
|
+
const _excluded = ["initialZoom", "zoomData", "onZoomChange", "zoomInteractionConfig", "plugins", "apiRef"];
|
|
14
|
+
const useChartsContainerProProps = props => {
|
|
15
|
+
const _ref = props,
|
|
16
|
+
{
|
|
17
|
+
initialZoom,
|
|
18
|
+
zoomData,
|
|
19
|
+
onZoomChange,
|
|
20
|
+
zoomInteractionConfig,
|
|
21
|
+
plugins,
|
|
22
|
+
apiRef
|
|
23
|
+
} = _ref,
|
|
24
|
+
baseProps = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
25
|
+
const {
|
|
26
|
+
chartDataProviderProps,
|
|
27
|
+
chartsSurfaceProps,
|
|
28
|
+
children
|
|
29
|
+
} = (0, _internals.useChartsContainerProps)(baseProps);
|
|
30
|
+
const chartDataProviderProProps = (0, _extends2.default)({}, chartDataProviderProps, {
|
|
31
|
+
initialZoom,
|
|
32
|
+
zoomData,
|
|
33
|
+
onZoomChange,
|
|
34
|
+
zoomInteractionConfig,
|
|
35
|
+
apiRef,
|
|
36
|
+
plugins: plugins ?? _allPlugins.DEFAULT_PLUGINS
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
chartDataProviderProProps,
|
|
40
|
+
chartsSurfaceProps,
|
|
41
|
+
children
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
exports.useChartsContainerProProps = useChartsContainerProProps;
|
|
@@ -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 };
|
|
@@ -47,13 +47,14 @@ const FunnelChart = exports.FunnelChart = /*#__PURE__*/React.forwardRef(function
|
|
|
47
47
|
const {
|
|
48
48
|
chartDataProviderProProps,
|
|
49
49
|
chartsSurfaceProps
|
|
50
|
-
} = (0, _useChartContainerProProps.useChartContainerProProps)(chartContainerProps
|
|
50
|
+
} = (0, _useChartContainerProProps.useChartContainerProProps)(chartContainerProps);
|
|
51
51
|
const Tooltip = themedProps.slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
|
|
52
52
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProviderPro.ChartDataProviderPro, (0, _extends2.default)({}, chartDataProviderProProps, {
|
|
53
53
|
gap: themedProps.gap,
|
|
54
54
|
seriesConfig: seriesConfig,
|
|
55
55
|
plugins: _FunnelChart2.FUNNEL_CHART_PLUGINS,
|
|
56
56
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
57
|
+
ref: ref,
|
|
57
58
|
children: [!themedProps.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
58
59
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FunnelPlot.FunnelPlot, (0, _extends2.default)({}, funnelPlotProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxisHighlight.ChartsAxisHighlight, (0, _extends2.default)({}, axisHighlightProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FocusedFunnelSection.FocusedFunnelSection, {}), children]
|
|
59
60
|
})), !themedProps.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({
|
|
@@ -215,8 +216,8 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
215
216
|
*/
|
|
216
217
|
hiddenItems: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
217
218
|
dataIndex: _propTypes.default.number,
|
|
218
|
-
seriesId: _propTypes.default.
|
|
219
|
-
type: _propTypes.default.oneOf(['funnel'])
|
|
219
|
+
seriesId: _propTypes.default.string.isRequired,
|
|
220
|
+
type: _propTypes.default.oneOf(['funnel'])
|
|
220
221
|
})),
|
|
221
222
|
/**
|
|
222
223
|
* If `true`, the legend is not rendered.
|
|
@@ -229,7 +230,7 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
229
230
|
*/
|
|
230
231
|
highlightedItem: _propTypes.default.shape({
|
|
231
232
|
dataIndex: _propTypes.default.number,
|
|
232
|
-
seriesId: _propTypes.default.
|
|
233
|
+
seriesId: _propTypes.default.string.isRequired
|
|
233
234
|
}),
|
|
234
235
|
/**
|
|
235
236
|
* This prop is used to help implement the accessibility logic.
|
|
@@ -259,8 +260,8 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
259
260
|
*/
|
|
260
261
|
initialHiddenItems: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
261
262
|
dataIndex: _propTypes.default.number,
|
|
262
|
-
seriesId: _propTypes.default.
|
|
263
|
-
type: _propTypes.default.oneOf(['funnel'])
|
|
263
|
+
seriesId: _propTypes.default.string.isRequired,
|
|
264
|
+
type: _propTypes.default.oneOf(['funnel'])
|
|
264
265
|
})),
|
|
265
266
|
/**
|
|
266
267
|
* If `true`, a loading overlay is displayed.
|
|
@@ -342,8 +343,8 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
342
343
|
*/
|
|
343
344
|
tooltipItem: _propTypes.default.shape({
|
|
344
345
|
dataIndex: _propTypes.default.number.isRequired,
|
|
345
|
-
seriesId: _propTypes.default.
|
|
346
|
-
type: _propTypes.default.oneOf(['funnel'])
|
|
346
|
+
seriesId: _propTypes.default.string.isRequired,
|
|
347
|
+
type: _propTypes.default.oneOf(['funnel'])
|
|
347
348
|
}),
|
|
348
349
|
/**
|
|
349
350
|
* 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.
|
|
@@ -15,10 +15,11 @@ var _useChartFunnelAxisRendering = require("./useChartFunnelAxisRendering.select
|
|
|
15
15
|
const useChartFunnelAxis = ({
|
|
16
16
|
params,
|
|
17
17
|
store,
|
|
18
|
-
seriesConfig,
|
|
19
|
-
svgRef,
|
|
20
18
|
instance
|
|
21
19
|
}) => {
|
|
20
|
+
const {
|
|
21
|
+
svgRef
|
|
22
|
+
} = instance;
|
|
22
23
|
const {
|
|
23
24
|
xAxis,
|
|
24
25
|
yAxis,
|
|
@@ -45,11 +46,12 @@ const useChartFunnelAxis = ({
|
|
|
45
46
|
gap: gap ?? 0
|
|
46
47
|
},
|
|
47
48
|
cartesianAxis: {
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
axesGap: 0,
|
|
50
|
+
x: (0, _internals.defaultizeXAxis)(xAxis, dataset, 0),
|
|
51
|
+
y: (0, _internals.defaultizeYAxis)(yAxis, dataset, 0)
|
|
50
52
|
}
|
|
51
53
|
});
|
|
52
|
-
}, [
|
|
54
|
+
}, [drawingArea, xAxis, yAxis, dataset, store, gap]);
|
|
53
55
|
React.useEffect(() => {
|
|
54
56
|
const element = svgRef.current;
|
|
55
57
|
if (!isInteractionEnabled || !element || params.disableAxisListener) {
|
|
@@ -75,7 +77,7 @@ const useChartFunnelAxis = ({
|
|
|
75
77
|
const gestureHandler = event => {
|
|
76
78
|
const srvEvent = event.detail.srcEvent;
|
|
77
79
|
const target = event.detail.target;
|
|
78
|
-
const svgPoint = (0, _internals.
|
|
80
|
+
const svgPoint = (0, _internals.getChartPoint)(element, srvEvent);
|
|
79
81
|
// Release the pointer capture if we are panning, as this would cause the tooltip to
|
|
80
82
|
// be locked to the first "section" it touches.
|
|
81
83
|
if (event.detail.srcEvent.buttons >= 1 && target?.hasPointerCapture(event.detail.srcEvent.pointerId)) {
|
|
@@ -119,7 +121,7 @@ const useChartFunnelAxis = ({
|
|
|
119
121
|
const usedYAxis = yAxisIds[0];
|
|
120
122
|
let dataIndex = null;
|
|
121
123
|
let isXAxis = false;
|
|
122
|
-
const svgPoint = (0, _internals.
|
|
124
|
+
const svgPoint = (0, _internals.getChartPoint)(element, event.detail.srcEvent);
|
|
123
125
|
const xIndex = (0, _internals.getCartesianAxisIndex)(xAxisWithScale[usedXAxis], svgPoint.x);
|
|
124
126
|
isXAxis = xIndex !== -1;
|
|
125
127
|
dataIndex = isXAxis ? xIndex : (0, _internals.getCartesianAxisIndex)(yAxisWithScale[usedYAxis], svgPoint.y);
|
|
@@ -166,8 +168,8 @@ useChartFunnelAxis.getDefaultizedParams = ({
|
|
|
166
168
|
}) => {
|
|
167
169
|
return (0, _extends2.default)({}, params, {
|
|
168
170
|
gap: params.gap ?? 0,
|
|
169
|
-
defaultizedXAxis: (0, _internals.defaultizeXAxis)(params.xAxis, params.dataset),
|
|
170
|
-
defaultizedYAxis: (0, _internals.defaultizeYAxis)(params.yAxis, params.dataset)
|
|
171
|
+
defaultizedXAxis: (0, _internals.defaultizeXAxis)(params.xAxis, params.dataset, 0),
|
|
172
|
+
defaultizedYAxis: (0, _internals.defaultizeYAxis)(params.yAxis, params.dataset, 0)
|
|
171
173
|
});
|
|
172
174
|
};
|
|
173
175
|
useChartFunnelAxis.getInitialState = params => {
|
|
@@ -176,6 +178,7 @@ useChartFunnelAxis.getInitialState = params => {
|
|
|
176
178
|
gap: params.gap ?? 0
|
|
177
179
|
},
|
|
178
180
|
cartesianAxis: {
|
|
181
|
+
axesGap: 0,
|
|
179
182
|
x: params.defaultizedXAxis,
|
|
180
183
|
y: params.defaultizedYAxis
|
|
181
184
|
}
|
|
@@ -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.
|
package/FunnelChart/index.d.ts
CHANGED
|
@@ -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/FunnelChart/index.js
CHANGED
|
@@ -48,6 +48,18 @@ Object.keys(_FunnelPlot).forEach(function (key) {
|
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
|
+
var _funnelPlotSlots = require("./funnelPlotSlots.types");
|
|
52
|
+
Object.keys(_funnelPlotSlots).forEach(function (key) {
|
|
53
|
+
if (key === "default" || key === "__esModule") return;
|
|
54
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
55
|
+
if (key in exports && exports[key] === _funnelPlotSlots[key]) return;
|
|
56
|
+
Object.defineProperty(exports, key, {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () {
|
|
59
|
+
return _funnelPlotSlots[key];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
51
63
|
var _FocusedFunnelSection = require("./FocusedFunnelSection");
|
|
52
64
|
Object.keys(_FocusedFunnelSection).forEach(function (key) {
|
|
53
65
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -24,5 +24,6 @@ const funnelSeriesConfig = exports.funnelSeriesConfig = {
|
|
|
24
24
|
yExtremumGetter: _extremums.getExtremumY,
|
|
25
25
|
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
|
|
26
26
|
keyboardFocusHandler: _keyboardFocusHandler.default,
|
|
27
|
-
identifierSerializer: _internals.identifierSerializerSeriesIdDataIndex
|
|
27
|
+
identifierSerializer: _internals.identifierSerializerSeriesIdDataIndex,
|
|
28
|
+
identifierCleaner: _internals.identifierCleanerSeriesIdDataIndex
|
|
28
29
|
};
|
|
@@ -6,18 +6,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _internals = require("@mui/x-charts/internals");
|
|
8
8
|
const outSeriesTypes = new Set(['funnel']);
|
|
9
|
-
const keyboardFocusHandler =
|
|
10
|
-
switch (event.key) {
|
|
11
|
-
case 'ArrowRight':
|
|
12
|
-
return (0, _internals.createGetNextIndexFocusedItem)(outSeriesTypes);
|
|
13
|
-
case 'ArrowLeft':
|
|
14
|
-
return (0, _internals.createGetPreviousIndexFocusedItem)(outSeriesTypes);
|
|
15
|
-
case 'ArrowDown':
|
|
16
|
-
return (0, _internals.createGetPreviousSeriesFocusedItem)(outSeriesTypes);
|
|
17
|
-
case 'ArrowUp':
|
|
18
|
-
return (0, _internals.createGetNextSeriesFocusedItem)(outSeriesTypes);
|
|
19
|
-
default:
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
9
|
+
const keyboardFocusHandler = (0, _internals.createCommonKeyboardFocusHandler)(outSeriesTypes);
|
|
23
10
|
var _default = exports.default = keyboardFocusHandler;
|