@mui/x-charts-pro 8.5.0 → 8.5.2
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 +3 -2
- package/BarChartPro/BarChartPro.js +1 -1
- package/CHANGELOG.md +204 -0
- package/ChartContainerPro/ChartProApi.d.ts +2 -0
- package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +0 -2
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +42 -9
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +0 -22
- package/ChartsToolbarPro/ChartsToolbarPro.d.ts +2 -4
- package/ChartsToolbarPro/ChartsToolbarPro.js +7 -13
- package/ChartsToolbarPro/{ChartsToolbarZoomInButton.d.ts → ChartsToolbarZoomInTrigger.d.ts} +6 -5
- package/ChartsToolbarPro/{ChartsToolbarZoomInButton.js → ChartsToolbarZoomInTrigger.js} +7 -6
- package/ChartsToolbarPro/{ChartsToolbarZoomOutButton.d.ts → ChartsToolbarZoomOutTrigger.d.ts} +6 -5
- package/ChartsToolbarPro/{ChartsToolbarZoomOutButton.js → ChartsToolbarZoomOutTrigger.js} +7 -6
- package/ChartsToolbarPro/Toolbar.types.d.ts +15 -0
- package/ChartsToolbarPro/Toolbar.types.js +5 -0
- package/ChartsToolbarPro/index.d.ts +2 -2
- package/ChartsToolbarPro/index.js +8 -8
- package/FunnelChart/FunnelChart.js +4 -11
- package/FunnelChart/FunnelChart.plugins.d.ts +3 -2
- package/FunnelChart/FunnelChart.plugins.js +2 -1
- package/FunnelChart/FunnelPlot.d.ts +0 -5
- package/FunnelChart/FunnelPlot.js +40 -50
- package/FunnelChart/FunnelSection.d.ts +1 -1
- package/FunnelChart/FunnelSectionLabel.d.ts +21 -0
- package/FunnelChart/FunnelSectionLabel.js +52 -0
- package/FunnelChart/categoryAxis.types.d.ts +2 -1
- package/FunnelChart/curves/bump.d.ts +9 -5
- package/FunnelChart/curves/bump.js +72 -43
- package/FunnelChart/curves/curve.types.d.ts +6 -1
- package/FunnelChart/curves/getFunnelCurve.js +3 -0
- package/FunnelChart/curves/linear.d.ts +10 -2
- package/FunnelChart/curves/linear.js +97 -17
- package/FunnelChart/curves/pyramid.js +10 -14
- package/FunnelChart/curves/step-pyramid.js +4 -6
- package/FunnelChart/curves/step.js +1 -15
- package/FunnelChart/funnel.types.d.ts +1 -0
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.d.ts +25 -0
- package/FunnelChart/funnelAxisPlugin/computeAxisValue.js +124 -0
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.d.ts +3 -0
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +173 -0
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +27 -0
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.js +5 -0
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +1482 -0
- package/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.js +27 -0
- package/FunnelChart/funnelPlotSlots.types.d.ts +11 -0
- package/FunnelChart/funnelSectionClasses.d.ts +2 -0
- package/FunnelChart/funnelSectionClasses.js +17 -4
- package/FunnelChart/index.d.ts +3 -1
- package/FunnelChart/index.js +18 -2
- package/FunnelChart/labelUtils.d.ts +3 -2
- package/FunnelChart/labelUtils.js +15 -15
- package/FunnelChart/positionGetter.d.ts +1 -0
- package/FunnelChart/positionGetter.js +5 -0
- package/FunnelChart/useFunnelChartProps.js +1 -3
- package/Heatmap/Heatmap.d.ts +8 -3
- package/Heatmap/Heatmap.js +10 -2
- package/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +1 -1
- package/LineChartPro/LineChartPro.d.ts +3 -2
- package/LineChartPro/LineChartPro.js +1 -1
- package/PieChartPro/PieChartPro.d.ts +22 -0
- package/PieChartPro/PieChartPro.js +204 -0
- package/PieChartPro/PieChartPro.plugins.d.ts +4 -0
- package/PieChartPro/PieChartPro.plugins.js +9 -0
- package/PieChartPro/index.d.ts +1 -0
- package/PieChartPro/index.js +16 -0
- package/RadarChartPro/RadarChartPro.d.ts +17 -2
- package/RadarChartPro/RadarChartPro.js +1 -1
- package/ScatterChartPro/ScatterChartPro.d.ts +3 -2
- package/ScatterChartPro/ScatterChartPro.js +1 -1
- package/esm/BarChartPro/BarChartPro.d.ts +3 -2
- package/esm/BarChartPro/BarChartPro.js +1 -1
- package/esm/ChartContainerPro/ChartProApi.d.ts +2 -0
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +0 -2
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +43 -10
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +0 -22
- package/esm/ChartsToolbarPro/ChartsToolbarPro.d.ts +2 -4
- package/esm/ChartsToolbarPro/ChartsToolbarPro.js +8 -14
- package/esm/ChartsToolbarPro/{ChartsToolbarZoomInButton.d.ts → ChartsToolbarZoomInTrigger.d.ts} +6 -5
- package/esm/ChartsToolbarPro/{ChartsToolbarZoomInButton.js → ChartsToolbarZoomInTrigger.js} +8 -7
- package/esm/ChartsToolbarPro/{ChartsToolbarZoomOutButton.d.ts → ChartsToolbarZoomOutTrigger.d.ts} +6 -5
- package/esm/ChartsToolbarPro/{ChartsToolbarZoomOutButton.js → ChartsToolbarZoomOutTrigger.js} +8 -7
- package/esm/ChartsToolbarPro/Toolbar.types.d.ts +15 -0
- package/esm/ChartsToolbarPro/Toolbar.types.js +1 -0
- package/esm/ChartsToolbarPro/index.d.ts +2 -2
- package/esm/ChartsToolbarPro/index.js +2 -2
- package/esm/FunnelChart/FunnelChart.js +4 -11
- package/esm/FunnelChart/FunnelChart.plugins.d.ts +3 -2
- package/esm/FunnelChart/FunnelChart.plugins.js +3 -2
- package/esm/FunnelChart/FunnelPlot.d.ts +0 -5
- package/esm/FunnelChart/FunnelPlot.js +41 -51
- package/esm/FunnelChart/FunnelSection.d.ts +1 -1
- package/esm/FunnelChart/FunnelSectionLabel.d.ts +21 -0
- package/esm/FunnelChart/FunnelSectionLabel.js +46 -0
- package/esm/FunnelChart/categoryAxis.types.d.ts +2 -1
- package/esm/FunnelChart/curves/bump.d.ts +9 -5
- package/esm/FunnelChart/curves/bump.js +72 -43
- package/esm/FunnelChart/curves/curve.types.d.ts +6 -1
- package/esm/FunnelChart/curves/getFunnelCurve.js +3 -0
- package/esm/FunnelChart/curves/linear.d.ts +10 -2
- package/esm/FunnelChart/curves/linear.js +97 -17
- package/esm/FunnelChart/curves/pyramid.js +10 -14
- package/esm/FunnelChart/curves/step-pyramid.js +4 -6
- package/esm/FunnelChart/curves/step.js +1 -15
- package/esm/FunnelChart/funnel.types.d.ts +1 -0
- package/esm/FunnelChart/funnelAxisPlugin/computeAxisValue.d.ts +25 -0
- package/esm/FunnelChart/funnelAxisPlugin/computeAxisValue.js +114 -0
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.d.ts +3 -0
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.js +165 -0
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.d.ts +27 -0
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxis.types.js +1 -0
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.d.ts +1482 -0
- package/esm/FunnelChart/funnelAxisPlugin/useChartFunnelAxisRendering.selectors.js +20 -0
- package/esm/FunnelChart/funnelPlotSlots.types.d.ts +11 -0
- package/esm/FunnelChart/funnelSectionClasses.d.ts +2 -0
- package/esm/FunnelChart/funnelSectionClasses.js +15 -3
- package/esm/FunnelChart/index.d.ts +3 -1
- package/esm/FunnelChart/index.js +3 -1
- package/esm/FunnelChart/labelUtils.d.ts +3 -2
- package/esm/FunnelChart/labelUtils.js +15 -15
- package/esm/FunnelChart/positionGetter.d.ts +1 -0
- package/esm/FunnelChart/positionGetter.js +1 -0
- package/esm/FunnelChart/useFunnelChartProps.js +1 -3
- package/esm/Heatmap/Heatmap.d.ts +8 -3
- package/esm/Heatmap/Heatmap.js +10 -2
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipAxesValue.d.ts +1 -1
- package/esm/LineChartPro/LineChartPro.d.ts +3 -2
- package/esm/LineChartPro/LineChartPro.js +1 -1
- package/esm/PieChartPro/PieChartPro.d.ts +22 -0
- package/esm/PieChartPro/PieChartPro.js +197 -0
- package/esm/PieChartPro/PieChartPro.plugins.d.ts +4 -0
- package/esm/PieChartPro/PieChartPro.plugins.js +3 -0
- package/esm/PieChartPro/index.d.ts +1 -0
- package/esm/PieChartPro/index.js +1 -0
- package/esm/RadarChartPro/RadarChartPro.d.ts +17 -2
- package/esm/RadarChartPro/RadarChartPro.js +1 -1
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +3 -2
- package/esm/ScatterChartPro/ScatterChartPro.js +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/package.json +7 -7
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { RadarChartProps, RadarDataProviderProps } from '@mui/x-charts/RadarChart';
|
|
2
|
+
import { RadarChartProps, RadarDataProviderProps, RadarChartSlotProps, RadarChartSlots } from '@mui/x-charts/RadarChart';
|
|
3
3
|
import { RadarChartProPluginsSignatures } from "./RadarChartPro.plugins.js";
|
|
4
|
-
|
|
4
|
+
import { ChartsToolbarProSlotProps, ChartsToolbarProSlots } from "../ChartsToolbarPro/Toolbar.types.js";
|
|
5
|
+
import { ChartsSlotPropsPro, ChartsSlotsPro } from "../internals/material/index.js";
|
|
6
|
+
export interface RadarChartProSlots extends Omit<RadarChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
7
|
+
export interface RadarChartProSlotProps extends Omit<RadarChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
8
|
+
export interface RadarChartProProps extends Omit<RadarChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<RadarDataProviderProps<RadarChartProPluginsSignatures>, 'plugins' | 'seriesConfig' | 'slots' | 'slotProps'> {
|
|
9
|
+
/**
|
|
10
|
+
* Overridable component slots.
|
|
11
|
+
* @default {}
|
|
12
|
+
*/
|
|
13
|
+
slots?: RadarChartProSlots;
|
|
14
|
+
/**
|
|
15
|
+
* The props used for each component slot.
|
|
16
|
+
* @default {}
|
|
17
|
+
*/
|
|
18
|
+
slotProps?: RadarChartProSlotProps;
|
|
19
|
+
}
|
|
5
20
|
/**
|
|
6
21
|
* Demos:
|
|
7
22
|
*
|
|
@@ -51,7 +51,7 @@ const RadarChartPro = exports.RadarChartPro = /*#__PURE__*/React.forwardRef(func
|
|
|
51
51
|
});
|
|
52
52
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarChart.RadarDataProvider, (0, _extends2.default)({}, radarDataProviderProProps, {
|
|
53
53
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_internals.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
54
|
-
children: [props.showToolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, {}) : null, !props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
54
|
+
children: [props.showToolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
55
55
|
ref: ref,
|
|
56
56
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarChart.RadarGrid, (0, _extends2.default)({}, radarGrid)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarChart.RadarMetricLabels, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarChart.RadarSeriesArea, {}), highlight === 'axis' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarChart.RadarAxisHighlight, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RadarChart.RadarSeriesMarks, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOverlay.ChartsOverlay, (0, _extends2.default)({}, overlayProps)), children]
|
|
57
57
|
})), !props.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, props.slotProps?.tooltip))]
|
|
@@ -3,8 +3,9 @@ import { ScatterChartProps, ScatterChartSlotProps, ScatterChartSlots } from '@mu
|
|
|
3
3
|
import { ChartsSlotPropsPro, ChartsSlotsPro } from "../internals/material/index.js";
|
|
4
4
|
import { ChartContainerProProps } from "../ChartContainerPro/ChartContainerPro.js";
|
|
5
5
|
import { ScatterChartProPluginsSignatures } from "./ScatterChartPro.plugins.js";
|
|
6
|
-
|
|
7
|
-
export interface
|
|
6
|
+
import { ChartsToolbarProSlots, ChartsToolbarProSlotProps } from "../ChartsToolbarPro/Toolbar.types.js";
|
|
7
|
+
export interface ScatterChartProSlots extends Omit<ScatterChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
8
|
+
export interface ScatterChartProSlotProps extends Omit<ScatterChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
8
9
|
export interface ScatterChartProProps extends Omit<ScatterChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'scatter', ScatterChartProPluginsSignatures>, 'series' | 'plugins' | 'seriesConfig' | 'onItemClick' | 'slots' | 'slotProps'> {
|
|
9
10
|
/**
|
|
10
11
|
* Overridable component slots.
|
|
@@ -76,7 +76,7 @@ const ScatterChartPro = exports.ScatterChartPro = /*#__PURE__*/React.forwardRef(
|
|
|
76
76
|
const Toolbar = props.slots?.toolbar ?? _ChartsToolbarPro.ChartsToolbarPro;
|
|
77
77
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProviderPro.ChartDataProviderPro, (0, _extends2.default)({}, chartDataProviderProProps, {
|
|
78
78
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_internals.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
79
|
-
children: [showToolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, {}) : null, !props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
79
|
+
children: [showToolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
80
80
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsAxis.ChartsAxis, (0, _extends2.default)({}, chartsAxisProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartZoomSlider.ChartZoomSlider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, (0, _extends2.default)({}, gridProps)), /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
81
81
|
"data-drawing-container": true,
|
|
82
82
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScatterChart.ScatterPlot, (0, _extends2.default)({}, scatterPlotProps))
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BarChartProps, BarChartSlotProps, BarChartSlots } from '@mui/x-charts/BarChart';
|
|
3
|
+
import { ChartsToolbarProSlotProps, ChartsToolbarProSlots } from "../ChartsToolbarPro/Toolbar.types.js";
|
|
3
4
|
import { ChartsSlotPropsPro, ChartsSlotsPro } from "../internals/material/index.js";
|
|
4
5
|
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
5
6
|
import { BarChartProPluginsSignatures } from "./BarChartPro.plugins.js";
|
|
6
|
-
export interface BarChartProSlots extends BarChartSlots, Partial<ChartsSlotsPro> {}
|
|
7
|
-
export interface BarChartProSlotProps extends BarChartSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
7
|
+
export interface BarChartProSlots extends Omit<BarChartSlots, 'toolbar'>, ChartsToolbarProSlots, Partial<ChartsSlotsPro> {}
|
|
8
|
+
export interface BarChartProSlotProps extends Omit<BarChartSlotProps, 'toolbar'>, ChartsToolbarProSlotProps, Partial<ChartsSlotPropsPro> {}
|
|
8
9
|
export interface BarChartProProps extends Omit<BarChartProps, 'apiRef' | 'slots' | 'slotProps'>, Omit<ChartContainerProProps<'bar', BarChartProPluginsSignatures>, 'series' | 'plugins' | 'seriesConfig' | 'slots' | 'slotProps'> {
|
|
9
10
|
/**
|
|
10
11
|
* Overridable component slots.
|
|
@@ -73,7 +73,7 @@ const BarChartPro = /*#__PURE__*/React.forwardRef(function BarChartPro(inProps,
|
|
|
73
73
|
const Toolbar = props.slots?.toolbar ?? ChartsToolbarPro;
|
|
74
74
|
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
75
75
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
76
|
-
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, {}) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
76
|
+
children: [showToolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, props.slotProps?.toolbar)) : null, !props.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
77
77
|
children: [/*#__PURE__*/_jsx(ChartsGrid, _extends({}, gridProps)), /*#__PURE__*/_jsxs("g", _extends({}, clipPathGroupProps, {
|
|
78
78
|
children: [/*#__PURE__*/_jsx(BarPlot, _extends({}, barPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps))]
|
|
79
79
|
})), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), /*#__PURE__*/_jsx(ChartZoomSlider, {}), /*#__PURE__*/_jsx(ChartsClipPath, _extends({}, clipPathProps)), children]
|
|
@@ -6,6 +6,7 @@ import { BarChartProPluginsSignatures } from "../BarChartPro/BarChartPro.plugins
|
|
|
6
6
|
import { AllPluginSignatures, DefaultPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
7
7
|
import { FunnelChartPluginsSignatures } from "../FunnelChart/FunnelChart.plugins.js";
|
|
8
8
|
import { RadarChartProPluginsSignatures } from "../RadarChartPro/RadarChartPro.plugins.js";
|
|
9
|
+
import { PieChartProPluginSignatures } from "../PieChartPro/PieChartPro.plugins.js";
|
|
9
10
|
type PluginsPerSeriesType = {
|
|
10
11
|
heatmap: HeatmapPluginsSignatures;
|
|
11
12
|
line: LineChartProPluginsSignatures;
|
|
@@ -13,6 +14,7 @@ type PluginsPerSeriesType = {
|
|
|
13
14
|
bar: BarChartProPluginsSignatures;
|
|
14
15
|
funnel: FunnelChartPluginsSignatures;
|
|
15
16
|
radar: RadarChartProPluginsSignatures;
|
|
17
|
+
pie: PieChartProPluginSignatures;
|
|
16
18
|
composition: DefaultPluginSignatures;
|
|
17
19
|
};
|
|
18
20
|
/**
|
|
@@ -11,7 +11,7 @@ import { defaultSlotsMaterial } from "../internals/material/index.js";
|
|
|
11
11
|
import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
12
12
|
import { useChartDataProviderProProps } from "./useChartDataProviderProProps.js";
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
const releaseInfo = "
|
|
14
|
+
const releaseInfo = "MTc0OTY3OTIwMDAwMA==";
|
|
15
15
|
const packageIdentifier = 'x-charts-pro';
|
|
16
16
|
/**
|
|
17
17
|
* Orchestrates the data providers for the chart components and hooks.
|
|
@@ -6,7 +6,6 @@ export interface ChartAxisZoomSliderActiveTrackProps {
|
|
|
6
6
|
axisPosition: 'top' | 'bottom' | 'left' | 'right';
|
|
7
7
|
zoomData: ZoomData;
|
|
8
8
|
reverse?: boolean;
|
|
9
|
-
valueFormatter?: (value: number) => string;
|
|
10
9
|
showTooltip: boolean;
|
|
11
10
|
onPointerEnter?: () => void;
|
|
12
11
|
onPointerLeave?: () => void;
|
|
@@ -17,7 +16,6 @@ export declare function ChartAxisZoomSliderActiveTrack({
|
|
|
17
16
|
axisPosition,
|
|
18
17
|
zoomData,
|
|
19
18
|
reverse,
|
|
20
|
-
valueFormatter,
|
|
21
19
|
showTooltip,
|
|
22
20
|
onPointerEnter,
|
|
23
21
|
onPointerLeave
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
|
-
import { getSVGPoint, selectorChartAxisZoomOptionsLookup, selectorChartDrawingArea, useChartContext, useDrawingArea, useStore } from '@mui/x-charts/internals';
|
|
3
|
+
import { getSVGPoint, invertScale, selectorChartAxis, selectorChartAxisZoomOptionsLookup, selectorChartDrawingArea, useChartContext, useDrawingArea, useSelector, useStore } from '@mui/x-charts/internals';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { rafThrottle } from '@mui/x-internals/rafThrottle';
|
|
6
6
|
import { selectorChartAxisZoomData } from "../../internals/plugins/useChartProZoom/index.js";
|
|
@@ -17,17 +17,12 @@ const ZoomSliderActiveTrackRect = styled('rect')(({
|
|
|
17
17
|
cursor: 'grab'
|
|
18
18
|
}
|
|
19
19
|
}));
|
|
20
|
-
const formatter = Intl.NumberFormat(undefined, {
|
|
21
|
-
maximumFractionDigits: 0
|
|
22
|
-
});
|
|
23
|
-
const zoomValueFormatter = value => formatter.format(value);
|
|
24
20
|
export function ChartAxisZoomSliderActiveTrack({
|
|
25
21
|
axisId,
|
|
26
22
|
axisDirection,
|
|
27
23
|
axisPosition,
|
|
28
24
|
zoomData,
|
|
29
25
|
reverse,
|
|
30
|
-
valueFormatter = zoomValueFormatter,
|
|
31
26
|
showTooltip,
|
|
32
27
|
onPointerEnter,
|
|
33
28
|
onPointerLeave
|
|
@@ -37,10 +32,15 @@ export function ChartAxisZoomSliderActiveTrack({
|
|
|
37
32
|
svgRef
|
|
38
33
|
} = useChartContext();
|
|
39
34
|
const store = useStore();
|
|
35
|
+
const axis = useSelector(store, selectorChartAxis, axisId);
|
|
40
36
|
const drawingArea = useDrawingArea();
|
|
41
37
|
const activePreviewRectRef = React.useRef(null);
|
|
42
38
|
const [startThumbEl, setStartThumbEl] = React.useState(null);
|
|
43
39
|
const [endThumbEl, setEndThumbEl] = React.useState(null);
|
|
40
|
+
const {
|
|
41
|
+
tooltipStart,
|
|
42
|
+
tooltipEnd
|
|
43
|
+
} = getZoomSliderTooltipsText(axis, drawingArea);
|
|
44
44
|
const previewThumbWidth = axisDirection === 'x' ? ZOOM_SLIDER_THUMB_WIDTH : ZOOM_SLIDER_THUMB_HEIGHT;
|
|
45
45
|
const previewThumbHeight = axisDirection === 'x' ? ZOOM_SLIDER_THUMB_HEIGHT : ZOOM_SLIDER_THUMB_WIDTH;
|
|
46
46
|
React.useEffect(() => {
|
|
@@ -230,14 +230,47 @@ export function ChartAxisZoomSliderActiveTrack({
|
|
|
230
230
|
placement: "end"
|
|
231
231
|
}), /*#__PURE__*/_jsx(ChartsTooltipZoomSliderValue, {
|
|
232
232
|
anchorEl: startThumbEl,
|
|
233
|
-
open: showTooltip,
|
|
233
|
+
open: showTooltip && tooltipStart !== '',
|
|
234
234
|
placement: axisPosition,
|
|
235
|
-
children:
|
|
235
|
+
children: tooltipStart
|
|
236
236
|
}), /*#__PURE__*/_jsx(ChartsTooltipZoomSliderValue, {
|
|
237
237
|
anchorEl: endThumbEl,
|
|
238
|
-
open: showTooltip,
|
|
238
|
+
open: showTooltip && tooltipEnd !== '',
|
|
239
239
|
placement: axisPosition,
|
|
240
|
-
children:
|
|
240
|
+
children: tooltipEnd
|
|
241
241
|
})]
|
|
242
242
|
});
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Returns the text for the tooltips on the thumbs of the zoom slider.
|
|
247
|
+
*/
|
|
248
|
+
function getZoomSliderTooltipsText(axis, drawingArea) {
|
|
249
|
+
const formatValue = value => {
|
|
250
|
+
if (axis.valueFormatter) {
|
|
251
|
+
return axis.valueFormatter(value, {
|
|
252
|
+
location: 'zoom-slider-tooltip',
|
|
253
|
+
scale: axis.scale
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
return `${value}`;
|
|
257
|
+
};
|
|
258
|
+
const axisDirection = axis.position === 'top' || axis.position === 'bottom' ? 'x' : 'y';
|
|
259
|
+
let start = axisDirection === 'x' ? drawingArea.left : drawingArea.top;
|
|
260
|
+
const size = axisDirection === 'x' ? drawingArea.width : drawingArea.height;
|
|
261
|
+
let end = start + size;
|
|
262
|
+
if (axisDirection === 'y') {
|
|
263
|
+
[start, end] = [end, start]; // Invert for y-axis
|
|
264
|
+
}
|
|
265
|
+
if (axis.reverse) {
|
|
266
|
+
[start, end] = [end, start]; // Reverse the start and end if the axis is reversed
|
|
267
|
+
}
|
|
268
|
+
const startValue = invertScale(axis.scale, axis.data ?? [], start) ?? axis.data?.at(0);
|
|
269
|
+
const endValue = invertScale(axis.scale, axis.data ?? [], end) ?? axis.data?.at(-1);
|
|
270
|
+
const tooltipStart = formatValue(startValue);
|
|
271
|
+
const tooltipEnd = formatValue(endValue);
|
|
272
|
+
return {
|
|
273
|
+
tooltipStart,
|
|
274
|
+
tooltipEnd
|
|
275
|
+
};
|
|
243
276
|
}
|
|
@@ -66,14 +66,12 @@ export function ChartAxisZoomSliderTrack(_ref) {
|
|
|
66
66
|
|
|
67
67
|
// Ensure the zoomFromPointerDown is within the min and max range
|
|
68
68
|
zoomFromPointerDown = Math.max(Math.min(zoomFromPointerDown, maxEnd), minStart);
|
|
69
|
-
let pointerMoved = false;
|
|
70
69
|
const onPointerMove = rafThrottle(function onPointerMove(pointerMoveEvent) {
|
|
71
70
|
const pointerMovePoint = getSVGPoint(element, pointerMoveEvent);
|
|
72
71
|
const zoomFromPointerMove = calculateZoomFromPoint(store.getSnapshot(), axisId, pointerMovePoint);
|
|
73
72
|
if (zoomFromPointerMove === null) {
|
|
74
73
|
return;
|
|
75
74
|
}
|
|
76
|
-
pointerMoved = true;
|
|
77
75
|
const zoomOptions = selectorChartAxisZoomOptionsLookup(store.getSnapshot(), axisId);
|
|
78
76
|
instance.setAxisZoomData(axisId, prevZoomData => {
|
|
79
77
|
if (zoomFromPointerMove > zoomFromPointerDown) {
|
|
@@ -114,22 +112,6 @@ export function ChartAxisZoomSliderTrack(_ref) {
|
|
|
114
112
|
document.removeEventListener('pointerup', onPointerUp);
|
|
115
113
|
setIsSelecting(false);
|
|
116
114
|
onSelectEnd?.();
|
|
117
|
-
if (pointerMoved) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// If the pointer didn't move, we still need to respect the zoom constraints (minSpan, etc.)
|
|
122
|
-
// In that case, we assume the start to be the pointerZoom and calculate the end.
|
|
123
|
-
const pointerUpPoint = getSVGPoint(element, pointerUpEvent);
|
|
124
|
-
const zoomFromPointerUp = calculateZoomFromPoint(store.getSnapshot(), axisId, pointerUpPoint);
|
|
125
|
-
if (zoomFromPointerUp === null) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const zoomOptions = selectorChartAxisZoomOptionsLookup(store.getSnapshot(), axisId);
|
|
129
|
-
instance.setAxisZoomData(axisId, prev => _extends({}, prev, {
|
|
130
|
-
start: zoomFromPointerUp,
|
|
131
|
-
end: calculateZoomEnd(zoomFromPointerUp, prev, zoomOptions)
|
|
132
|
-
}));
|
|
133
115
|
};
|
|
134
116
|
event.preventDefault();
|
|
135
117
|
event.stopPropagation();
|
|
@@ -138,10 +120,6 @@ export function ChartAxisZoomSliderTrack(_ref) {
|
|
|
138
120
|
rect.addEventListener('pointermove', onPointerMove);
|
|
139
121
|
onSelectStart?.();
|
|
140
122
|
setIsSelecting(true);
|
|
141
|
-
instance.setAxisZoomData(axisId, prev => _extends({}, prev, {
|
|
142
|
-
start: zoomFromPointerDown,
|
|
143
|
-
end: zoomFromPointerDown
|
|
144
|
-
}));
|
|
145
123
|
};
|
|
146
124
|
return /*#__PURE__*/_jsx(ZoomSliderTrack, _extends({
|
|
147
125
|
ref: ref,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ChartsToolbarProps } from '@mui/x-charts/Toolbar';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
export interface ChartsToolbarProProps extends ChartsToolbarProps {}
|
|
3
4
|
/**
|
|
4
5
|
* The chart toolbar component for the pro package.
|
|
5
6
|
*/
|
|
6
|
-
export declare function ChartsToolbarPro(props:
|
|
7
|
-
export declare namespace ChartsToolbarPro {
|
|
8
|
-
var propTypes: any;
|
|
9
|
-
}
|
|
7
|
+
export declare function ChartsToolbarPro(props: ChartsToolbarProProps): React.JSX.Element | null;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { Toolbar } from '@mui/x-charts/Toolbar';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
2
|
+
import { Toolbar, ToolbarButton } from '@mui/x-charts/Toolbar';
|
|
4
3
|
import * as React from 'react';
|
|
5
4
|
import { useChartContext, useSelector, useChartsSlots } from '@mui/x-charts/internals';
|
|
6
5
|
import { useChartsLocalization } from '@mui/x-charts/hooks';
|
|
7
6
|
import { selectorChartZoomIsEnabled } from "../internals/plugins/useChartProZoom/index.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { ChartsToolbarZoomInTrigger } from "./ChartsToolbarZoomInTrigger.js";
|
|
8
|
+
import { ChartsToolbarZoomOutTrigger } from "./ChartsToolbarZoomOutTrigger.js";
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
/**
|
|
12
11
|
* The chart toolbar component for the pro package.
|
|
@@ -30,13 +29,15 @@ export function ChartsToolbarPro(props) {
|
|
|
30
29
|
const ZoomInIcon = slots.zoomInIcon;
|
|
31
30
|
children.push(/*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps.baseTooltip, {
|
|
32
31
|
title: localeText.zoomIn,
|
|
33
|
-
children: /*#__PURE__*/_jsx(
|
|
32
|
+
children: /*#__PURE__*/_jsx(ChartsToolbarZoomInTrigger, {
|
|
33
|
+
render: /*#__PURE__*/_jsx(ToolbarButton, {}),
|
|
34
34
|
children: /*#__PURE__*/_jsx(ZoomInIcon, _extends({}, slotProps.zoomInIcon))
|
|
35
35
|
})
|
|
36
36
|
}), "zoom-in"));
|
|
37
37
|
children.push(/*#__PURE__*/_jsx(Tooltip, _extends({}, slotProps.baseTooltip, {
|
|
38
38
|
title: localeText.zoomOut,
|
|
39
|
-
children: /*#__PURE__*/_jsx(
|
|
39
|
+
children: /*#__PURE__*/_jsx(ChartsToolbarZoomOutTrigger, {
|
|
40
|
+
render: /*#__PURE__*/_jsx(ToolbarButton, {}),
|
|
40
41
|
children: /*#__PURE__*/_jsx(ZoomOutIcon, _extends({}, slotProps.zoomOutIcon))
|
|
41
42
|
})
|
|
42
43
|
}), "zoom-out"));
|
|
@@ -47,11 +48,4 @@ export function ChartsToolbarPro(props) {
|
|
|
47
48
|
return /*#__PURE__*/_jsx(Toolbar, _extends({}, props, {
|
|
48
49
|
children: children
|
|
49
50
|
}));
|
|
50
|
-
}
|
|
51
|
-
process.env.NODE_ENV !== "production" ? ChartsToolbarPro.propTypes = {
|
|
52
|
-
// ----------------------------- Warning --------------------------------
|
|
53
|
-
// | These PropTypes are generated from the TypeScript type definitions |
|
|
54
|
-
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
55
|
-
// ----------------------------------------------------------------------
|
|
56
|
-
className: PropTypes.string
|
|
57
|
-
} : void 0;
|
|
51
|
+
}
|
package/esm/ChartsToolbarPro/{ChartsToolbarZoomInButton.d.ts → ChartsToolbarZoomInTrigger.d.ts}
RENAMED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ChartsSlotProps } from '@mui/x-charts/internals';
|
|
3
3
|
import { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
|
4
|
-
interface
|
|
4
|
+
interface ChartsToolbarZoomInTriggerProps {
|
|
5
5
|
/**
|
|
6
6
|
* A function to customize the rendering of the component.
|
|
7
7
|
*/
|
|
8
|
-
render?: RenderProp<ChartsSlotProps['
|
|
8
|
+
render?: RenderProp<ChartsSlotProps['baseButton']>;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* A button that zooms the chart in.
|
|
12
|
+
* It renders the `baseButton` slot.
|
|
12
13
|
*/
|
|
13
|
-
declare const
|
|
14
|
+
declare const ChartsToolbarZoomInTrigger: React.ForwardRefExoticComponent<ChartsToolbarZoomInTriggerProps & {
|
|
14
15
|
children?: React.ReactNode | undefined;
|
|
15
16
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
-
export {
|
|
17
|
+
export { ChartsToolbarZoomInTrigger };
|
|
@@ -5,14 +5,15 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["render"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { useChartContext,
|
|
8
|
+
import { useChartContext, useSelector, useChartsSlots } from '@mui/x-charts/internals';
|
|
9
9
|
import { useComponentRenderer } from '@mui/x-internals/useComponentRenderer';
|
|
10
10
|
import { selectorChartCanZoomIn } from "../internals/plugins/useChartProZoom/index.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* A button that zooms the chart in.
|
|
14
|
+
* It renders the `baseButton` slot.
|
|
14
15
|
*/
|
|
15
|
-
const
|
|
16
|
+
const ChartsToolbarZoomInTrigger = /*#__PURE__*/React.forwardRef(function ChartsToolbarZoomInTrigger(_ref, ref) {
|
|
16
17
|
let {
|
|
17
18
|
render
|
|
18
19
|
} = _ref,
|
|
@@ -26,7 +27,7 @@ const ChartsToolbarZoomInButton = /*#__PURE__*/React.forwardRef(function ChartsT
|
|
|
26
27
|
store
|
|
27
28
|
} = useChartContext();
|
|
28
29
|
const disabled = useSelector(store, selectorChartCanZoomIn);
|
|
29
|
-
const element = useComponentRenderer(slots.
|
|
30
|
+
const element = useComponentRenderer(slots.baseButton, render, _extends({}, slotProps.baseButton, {
|
|
30
31
|
onClick: () => instance.zoomIn(),
|
|
31
32
|
disabled
|
|
32
33
|
}, other, {
|
|
@@ -36,8 +37,8 @@ const ChartsToolbarZoomInButton = /*#__PURE__*/React.forwardRef(function ChartsT
|
|
|
36
37
|
children: element
|
|
37
38
|
});
|
|
38
39
|
});
|
|
39
|
-
if (process.env.NODE_ENV !== "production")
|
|
40
|
-
process.env.NODE_ENV !== "production" ?
|
|
40
|
+
if (process.env.NODE_ENV !== "production") ChartsToolbarZoomInTrigger.displayName = "ChartsToolbarZoomInTrigger";
|
|
41
|
+
process.env.NODE_ENV !== "production" ? ChartsToolbarZoomInTrigger.propTypes = {
|
|
41
42
|
// ----------------------------- Warning --------------------------------
|
|
42
43
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
43
44
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -47,4 +48,4 @@ process.env.NODE_ENV !== "production" ? ChartsToolbarZoomInButton.propTypes = {
|
|
|
47
48
|
*/
|
|
48
49
|
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
|
|
49
50
|
} : void 0;
|
|
50
|
-
export {
|
|
51
|
+
export { ChartsToolbarZoomInTrigger };
|
package/esm/ChartsToolbarPro/{ChartsToolbarZoomOutButton.d.ts → ChartsToolbarZoomOutTrigger.d.ts}
RENAMED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ChartsSlotProps } from '@mui/x-charts/internals';
|
|
3
3
|
import { RenderProp } from '@mui/x-internals/useComponentRenderer';
|
|
4
|
-
interface
|
|
4
|
+
interface ChartsToolbarZoomOutTriggerProps {
|
|
5
5
|
/**
|
|
6
6
|
* A function to customize the rendering of the component.
|
|
7
7
|
*/
|
|
8
|
-
render?: RenderProp<ChartsSlotProps['
|
|
8
|
+
render?: RenderProp<ChartsSlotProps['baseButton']>;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* A button that zooms the chart out.
|
|
12
|
+
* It renders the `baseButton` slot.
|
|
12
13
|
*/
|
|
13
|
-
declare const
|
|
14
|
+
declare const ChartsToolbarZoomOutTrigger: React.ForwardRefExoticComponent<ChartsToolbarZoomOutTriggerProps & {
|
|
14
15
|
children?: React.ReactNode | undefined;
|
|
15
16
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
-
export {
|
|
17
|
+
export { ChartsToolbarZoomOutTrigger };
|
package/esm/ChartsToolbarPro/{ChartsToolbarZoomOutButton.js → ChartsToolbarZoomOutTrigger.js}
RENAMED
|
@@ -5,14 +5,15 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["render"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { useChartContext,
|
|
8
|
+
import { useChartContext, useSelector, useChartsSlots } from '@mui/x-charts/internals';
|
|
9
9
|
import { useComponentRenderer } from '@mui/x-internals/useComponentRenderer';
|
|
10
10
|
import { selectorChartCanZoomOut } from "../internals/plugins/useChartProZoom/index.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* A button that zooms the chart out.
|
|
14
|
+
* It renders the `baseButton` slot.
|
|
14
15
|
*/
|
|
15
|
-
const
|
|
16
|
+
const ChartsToolbarZoomOutTrigger = /*#__PURE__*/React.forwardRef(function ChartsToolbarZoomOutTrigger(_ref, ref) {
|
|
16
17
|
let {
|
|
17
18
|
render
|
|
18
19
|
} = _ref,
|
|
@@ -26,7 +27,7 @@ const ChartsToolbarZoomOutButton = /*#__PURE__*/React.forwardRef(function Charts
|
|
|
26
27
|
store
|
|
27
28
|
} = useChartContext();
|
|
28
29
|
const disabled = useSelector(store, selectorChartCanZoomOut);
|
|
29
|
-
const element = useComponentRenderer(slots.
|
|
30
|
+
const element = useComponentRenderer(slots.baseButton, render, _extends({}, slotProps.baseButton, {
|
|
30
31
|
onClick: () => instance.zoomOut(),
|
|
31
32
|
disabled
|
|
32
33
|
}, other, {
|
|
@@ -36,8 +37,8 @@ const ChartsToolbarZoomOutButton = /*#__PURE__*/React.forwardRef(function Charts
|
|
|
36
37
|
children: element
|
|
37
38
|
});
|
|
38
39
|
});
|
|
39
|
-
if (process.env.NODE_ENV !== "production")
|
|
40
|
-
process.env.NODE_ENV !== "production" ?
|
|
40
|
+
if (process.env.NODE_ENV !== "production") ChartsToolbarZoomOutTrigger.displayName = "ChartsToolbarZoomOutTrigger";
|
|
41
|
+
process.env.NODE_ENV !== "production" ? ChartsToolbarZoomOutTrigger.propTypes = {
|
|
41
42
|
// ----------------------------- Warning --------------------------------
|
|
42
43
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
43
44
|
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
@@ -47,4 +48,4 @@ process.env.NODE_ENV !== "production" ? ChartsToolbarZoomOutButton.propTypes = {
|
|
|
47
48
|
*/
|
|
48
49
|
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
|
|
49
50
|
} : void 0;
|
|
50
|
-
export {
|
|
51
|
+
export { ChartsToolbarZoomOutTrigger };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ChartsToolbarProProps } from "./ChartsToolbarPro.js";
|
|
3
|
+
export interface ChartsToolbarProSlots {
|
|
4
|
+
/**
|
|
5
|
+
* Custom component for the toolbar.
|
|
6
|
+
* @default ChartsToolbar
|
|
7
|
+
*/
|
|
8
|
+
toolbar?: React.ElementType<ChartsToolbarProProps>;
|
|
9
|
+
}
|
|
10
|
+
export interface ChartsToolbarProSlotProps {
|
|
11
|
+
/**
|
|
12
|
+
* Props for the toolbar component.
|
|
13
|
+
*/
|
|
14
|
+
toolbar?: Partial<ChartsToolbarProProps>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from "./ChartsToolbarPro.js";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
2
|
+
export * from "./ChartsToolbarZoomInTrigger.js";
|
|
3
|
+
export * from "./ChartsToolbarZoomOutTrigger.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from "./ChartsToolbarPro.js";
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
2
|
+
export * from "./ChartsToolbarZoomInTrigger.js";
|
|
3
|
+
export * from "./ChartsToolbarZoomOutTrigger.js";
|
|
@@ -16,6 +16,7 @@ import { useFunnelChartProps } from "./useFunnelChartProps.js";
|
|
|
16
16
|
import { seriesConfig as funnelSeriesConfig } from "./seriesConfig/index.js";
|
|
17
17
|
import { useChartContainerProProps } from "../ChartContainerPro/useChartContainerProProps.js";
|
|
18
18
|
import { ChartDataProviderPro } from "../ChartDataProviderPro/index.js";
|
|
19
|
+
import { FUNNEL_CHART_PLUGINS } from "./FunnelChart.plugins.js";
|
|
19
20
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
21
|
const seriesConfig = {
|
|
21
22
|
funnel: funnelSeriesConfig
|
|
@@ -41,7 +42,9 @@ const FunnelChart = /*#__PURE__*/React.forwardRef(function FunnelChart(props, re
|
|
|
41
42
|
} = useChartContainerProProps(chartContainerProps, ref);
|
|
42
43
|
const Tooltip = themedProps.slots?.tooltip ?? ChartsTooltip;
|
|
43
44
|
return /*#__PURE__*/_jsx(ChartDataProviderPro, _extends({}, chartDataProviderProProps, {
|
|
45
|
+
gap: themedProps.gap,
|
|
44
46
|
seriesConfig: seriesConfig,
|
|
47
|
+
plugins: FUNNEL_CHART_PLUGINS,
|
|
45
48
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, _extends({}, chartsWrapperProps, {
|
|
46
49
|
children: [!themedProps.hideLegend && /*#__PURE__*/_jsx(ChartsLegend, _extends({}, legendProps)), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
47
50
|
children: [/*#__PURE__*/_jsx(FunnelPlot, _extends({}, funnelPlotProps)), /*#__PURE__*/_jsx(ChartsOverlay, _extends({}, overlayProps)), /*#__PURE__*/_jsx(ChartsAxisHighlight, _extends({}, axisHighlightProps)), /*#__PURE__*/_jsx(ChartsAxis, _extends({}, chartsAxisProps)), children]
|
|
@@ -88,16 +91,6 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
88
91
|
size: PropTypes.number,
|
|
89
92
|
tickLabelStyle: PropTypes.object,
|
|
90
93
|
tickSize: PropTypes.number
|
|
91
|
-
}), PropTypes.shape({
|
|
92
|
-
categories: PropTypes.arrayOf(PropTypes.string),
|
|
93
|
-
disableLine: PropTypes.bool,
|
|
94
|
-
disableTicks: PropTypes.bool,
|
|
95
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
96
|
-
position: PropTypes.oneOf(['bottom', 'left', 'none', 'right', 'top']),
|
|
97
|
-
scaleType: PropTypes.oneOf(['point']),
|
|
98
|
-
size: PropTypes.number,
|
|
99
|
-
tickLabelStyle: PropTypes.object,
|
|
100
|
-
tickSize: PropTypes.number
|
|
101
94
|
}), PropTypes.shape({
|
|
102
95
|
categories: PropTypes.arrayOf(PropTypes.string),
|
|
103
96
|
disableLine: PropTypes.bool,
|
|
@@ -222,7 +215,7 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
222
215
|
})]),
|
|
223
216
|
/**
|
|
224
217
|
* The function called for onClick events.
|
|
225
|
-
* The second argument contains information about all
|
|
218
|
+
* The second argument contains information about all funnel elements at the current position.
|
|
226
219
|
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element.
|
|
227
220
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
228
221
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ConvertSignaturesIntoPlugins,
|
|
1
|
+
import { ConvertSignaturesIntoPlugins, UseChartHighlightSignature, UseChartInteractionSignature } from '@mui/x-charts/internals';
|
|
2
2
|
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
|
|
3
|
+
import { UseChartFunnelAxisSignature } from "./funnelAxisPlugin/useChartFunnelAxis.types.js";
|
|
4
|
+
export type FunnelChartPluginsSignatures = [UseChartFunnelAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProExportSignature];
|
|
4
5
|
export declare const FUNNEL_CHART_PLUGINS: ConvertSignaturesIntoPlugins<FunnelChartPluginsSignatures>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useChartHighlight, useChartInteraction } from '@mui/x-charts/internals';
|
|
2
2
|
import { useChartProExport } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
-
|
|
3
|
+
import { useChartFunnelAxis } from "./funnelAxisPlugin/useChartFunnelAxis.js";
|
|
4
|
+
export const FUNNEL_CHART_PLUGINS = [useChartFunnelAxis, useChartInteraction, useChartHighlight, useChartProExport];
|
|
@@ -2,11 +2,6 @@ import * as React from 'react';
|
|
|
2
2
|
import { FunnelItemIdentifier } from "./funnel.types.js";
|
|
3
3
|
import { FunnelPlotSlotExtension } from "./funnelPlotSlots.types.js";
|
|
4
4
|
export interface FunnelPlotProps extends FunnelPlotSlotExtension {
|
|
5
|
-
/**
|
|
6
|
-
* The gap, in pixels, between funnel sections.
|
|
7
|
-
* @default 0
|
|
8
|
-
*/
|
|
9
|
-
gap?: number;
|
|
10
5
|
/**
|
|
11
6
|
* Callback fired when a funnel item is clicked.
|
|
12
7
|
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|