@mui/x-charts-pro 8.3.1 → 8.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChartPro/BarChartPro.d.ts +13 -5
- package/BarChartPro/BarChartPro.js +56 -21
- package/CHANGELOG.md +213 -0
- package/ChartContainerPro/ChartContainerPro.d.ts +0 -1
- package/ChartContainerPro/ChartContainerPro.js +1 -0
- package/ChartContainerPro/ChartProApi.d.ts +26 -0
- package/ChartContainerPro/ChartProApi.js +5 -0
- package/ChartContainerPro/index.d.ts +2 -1
- package/ChartContainerPro/index.js +11 -0
- package/ChartDataProviderPro/ChartDataProviderPro.d.ts +11 -1
- package/ChartDataProviderPro/ChartDataProviderPro.js +19 -3
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +2 -0
- package/ChartDataProviderPro/useChartDataProviderProProps.js +5 -1
- package/ChartZoomSlider/index.d.ts +1 -1
- package/ChartZoomSlider/index.js +4 -4
- package/ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts +1 -3
- package/ChartZoomSlider/internals/ChartAxisZoomSlider.js +31 -287
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +24 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +251 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.d.ts +12 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.js +92 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.d.ts +18 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +160 -0
- package/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.d.ts +11 -0
- package/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.js +58 -0
- package/ChartZoomSlider/internals/chartAxisZoomSliderThumbClasses.d.ts +17 -0
- package/ChartZoomSlider/internals/{chartAxisZoomSliderHandleClasses.js → chartAxisZoomSliderThumbClasses.js} +6 -6
- package/ChartZoomSlider/internals/constants.d.ts +5 -0
- package/ChartZoomSlider/internals/constants.js +11 -0
- package/ChartZoomSlider/internals/zoom-utils.d.ts +4 -0
- package/ChartZoomSlider/internals/zoom-utils.js +48 -0
- package/ChartsToolbarPro/ChartsToolbarPro.d.ts +8 -1
- package/ChartsToolbarPro/ChartsToolbarPro.js +42 -8
- package/ChartsToolbarPro/ChartsToolbarZoomInButton.d.ts +16 -0
- package/ChartsToolbarPro/ChartsToolbarZoomInButton.js +56 -0
- package/ChartsToolbarPro/ChartsToolbarZoomOutButton.d.ts +16 -0
- package/ChartsToolbarPro/ChartsToolbarZoomOutButton.js +56 -0
- package/ChartsToolbarPro/index.d.ts +3 -1
- package/ChartsToolbarPro/index.js +22 -0
- package/FunnelChart/FunnelChart.d.ts +2 -1
- package/FunnelChart/FunnelChart.js +6 -23
- package/FunnelChart/FunnelChart.plugins.d.ts +4 -0
- package/FunnelChart/FunnelChart.plugins.js +9 -0
- package/FunnelChart/FunnelPlot.js +2 -0
- package/FunnelChart/FunnelSection.js +2 -1
- package/FunnelChart/curves/curve.types.d.ts +4 -0
- package/FunnelChart/curves/pyramid.d.ts +3 -1
- package/FunnelChart/curves/pyramid.js +37 -10
- package/FunnelChart/curves/step-pyramid.d.ts +10 -2
- package/FunnelChart/curves/step-pyramid.js +96 -20
- package/FunnelChart/curves/step.d.ts +5 -1
- package/FunnelChart/curves/step.js +20 -2
- package/FunnelChart/funnel.types.d.ts +7 -0
- package/FunnelChart/funnelSlots.types.d.ts +4 -3
- package/FunnelChart/seriesConfig/seriesProcessor.js +47 -1
- package/FunnelChart/useFunnelChartProps.d.ts +2 -1
- package/FunnelChart/useFunnelChartProps.js +3 -1
- package/Heatmap/Heatmap.d.ts +18 -5
- package/Heatmap/Heatmap.js +64 -26
- package/Heatmap/Heatmap.plugins.d.ts +2 -1
- package/Heatmap/Heatmap.plugins.js +2 -1
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.d.ts +2 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.js +27 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.d.ts +1 -10
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.js +4 -102
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +10 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltip.types.js +5 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.d.ts +7 -0
- package/Heatmap/HeatmapTooltip/HeatmapTooltipContent.js +96 -0
- package/Heatmap/HeatmapTooltip/index.d.ts +3 -1
- package/Heatmap/HeatmapTooltip/index.js +11 -0
- package/LineChartPro/LineChartPro.d.ts +13 -5
- package/LineChartPro/LineChartPro.js +56 -21
- package/RadarChartPro/RadarChartPro.d.ts +15 -0
- package/RadarChartPro/RadarChartPro.js +202 -0
- package/RadarChartPro/RadarChartPro.plugins.d.ts +4 -0
- package/RadarChartPro/RadarChartPro.plugins.js +9 -0
- package/RadarChartPro/index.d.ts +1 -0
- package/RadarChartPro/index.js +16 -0
- package/ScatterChartPro/ScatterChartPro.d.ts +13 -5
- package/ScatterChartPro/ScatterChartPro.js +57 -22
- package/context/index.d.ts +1 -0
- package/context/index.js +16 -0
- package/context/useChartApiContext.d.ts +9 -0
- package/context/useChartApiContext.js +17 -0
- package/esm/BarChartPro/BarChartPro.d.ts +13 -5
- package/esm/BarChartPro/BarChartPro.js +54 -19
- package/esm/ChartContainerPro/ChartContainerPro.d.ts +0 -1
- package/esm/ChartContainerPro/ChartContainerPro.js +1 -0
- package/esm/ChartContainerPro/ChartProApi.d.ts +26 -0
- package/esm/ChartContainerPro/ChartProApi.js +1 -0
- package/esm/ChartContainerPro/index.d.ts +2 -1
- package/esm/ChartContainerPro/index.js +2 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.d.ts +11 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +20 -4
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +2 -0
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.js +5 -1
- package/esm/ChartZoomSlider/index.d.ts +1 -1
- package/esm/ChartZoomSlider/index.js +1 -1
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts +1 -3
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.js +30 -283
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.d.ts +24 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderActiveTrack.js +243 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.d.ts +12 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderThumb.js +85 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.d.ts +18 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderTrack.js +152 -0
- package/esm/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.d.ts +11 -0
- package/esm/ChartZoomSlider/internals/ChartsTooltipZoomSliderValue.js +52 -0
- package/esm/ChartZoomSlider/internals/chartAxisZoomSliderThumbClasses.d.ts +17 -0
- package/esm/ChartZoomSlider/internals/{chartAxisZoomSliderHandleClasses.js → chartAxisZoomSliderThumbClasses.js} +4 -4
- package/esm/ChartZoomSlider/internals/constants.d.ts +5 -0
- package/esm/ChartZoomSlider/internals/constants.js +5 -0
- package/esm/ChartZoomSlider/internals/zoom-utils.d.ts +4 -0
- package/esm/ChartZoomSlider/internals/zoom-utils.js +40 -0
- package/esm/ChartsToolbarPro/ChartsToolbarPro.d.ts +8 -1
- package/esm/ChartsToolbarPro/ChartsToolbarPro.js +42 -9
- package/esm/ChartsToolbarPro/ChartsToolbarZoomInButton.d.ts +16 -0
- package/esm/ChartsToolbarPro/ChartsToolbarZoomInButton.js +50 -0
- package/esm/ChartsToolbarPro/ChartsToolbarZoomOutButton.d.ts +16 -0
- package/esm/ChartsToolbarPro/ChartsToolbarZoomOutButton.js +50 -0
- package/esm/ChartsToolbarPro/index.d.ts +3 -1
- package/esm/ChartsToolbarPro/index.js +3 -1
- package/esm/FunnelChart/FunnelChart.d.ts +2 -1
- package/esm/FunnelChart/FunnelChart.js +6 -23
- package/esm/FunnelChart/FunnelChart.plugins.d.ts +4 -0
- package/esm/FunnelChart/FunnelChart.plugins.js +3 -0
- package/esm/FunnelChart/FunnelPlot.js +2 -0
- package/esm/FunnelChart/FunnelSection.js +1 -0
- package/esm/FunnelChart/curves/curve.types.d.ts +4 -0
- package/esm/FunnelChart/curves/pyramid.d.ts +3 -1
- package/esm/FunnelChart/curves/pyramid.js +37 -10
- package/esm/FunnelChart/curves/step-pyramid.d.ts +10 -2
- package/esm/FunnelChart/curves/step-pyramid.js +96 -20
- package/esm/FunnelChart/curves/step.d.ts +5 -1
- package/esm/FunnelChart/curves/step.js +20 -2
- package/esm/FunnelChart/funnel.types.d.ts +7 -0
- package/esm/FunnelChart/funnelSlots.types.d.ts +4 -3
- package/esm/FunnelChart/seriesConfig/seriesProcessor.js +47 -1
- package/esm/FunnelChart/useFunnelChartProps.d.ts +2 -1
- package/esm/FunnelChart/useFunnelChartProps.js +3 -1
- package/esm/Heatmap/Heatmap.d.ts +18 -5
- package/esm/Heatmap/Heatmap.js +62 -24
- package/esm/Heatmap/Heatmap.plugins.d.ts +2 -1
- package/esm/Heatmap/Heatmap.plugins.js +2 -1
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.d.ts +2 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.classes.js +19 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.d.ts +1 -10
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.js +5 -103
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.types.d.ts +10 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltip.types.js +1 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipContent.d.ts +7 -0
- package/esm/Heatmap/HeatmapTooltip/HeatmapTooltipContent.js +89 -0
- package/esm/Heatmap/HeatmapTooltip/index.d.ts +3 -1
- package/esm/Heatmap/HeatmapTooltip/index.js +3 -1
- package/esm/LineChartPro/LineChartPro.d.ts +13 -5
- package/esm/LineChartPro/LineChartPro.js +54 -19
- package/esm/RadarChartPro/RadarChartPro.d.ts +15 -0
- package/esm/RadarChartPro/RadarChartPro.js +195 -0
- package/esm/RadarChartPro/RadarChartPro.plugins.d.ts +4 -0
- package/esm/RadarChartPro/RadarChartPro.plugins.js +3 -0
- package/esm/RadarChartPro/index.d.ts +1 -0
- package/esm/RadarChartPro/index.js +1 -0
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +13 -5
- package/esm/ScatterChartPro/ScatterChartPro.js +55 -20
- package/esm/context/index.d.ts +1 -0
- package/esm/context/index.js +1 -0
- package/esm/context/useChartApiContext.d.ts +9 -0
- package/esm/context/useChartApiContext.js +11 -0
- package/esm/hooks/index.d.ts +2 -1
- package/esm/hooks/index.js +2 -1
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/internals/material/index.d.ts +1 -0
- package/esm/internals/plugins/useChartProExport/exportImage.js +1 -1
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +12 -2
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +358 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +15 -1
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +7 -0
- package/esm/models/index.d.ts +1 -1
- package/hooks/index.d.ts +2 -1
- package/hooks/index.js +21 -10
- package/index.d.ts +2 -1
- package/index.js +12 -1
- package/internals/material/index.d.ts +1 -0
- package/internals/plugins/useChartProExport/exportImage.js +1 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.js +12 -2
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +358 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +16 -2
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +7 -0
- package/models/index.d.ts +1 -1
- package/package.json +5 -5
- package/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.d.ts +0 -12
- package/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.js +0 -92
- package/ChartZoomSlider/internals/chartAxisZoomSliderHandleClasses.d.ts +0 -17
- package/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.d.ts +0 -13
- package/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.js +0 -36
- package/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.d.ts +0 -13
- package/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.js +0 -36
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.d.ts +0 -12
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.js +0 -85
- package/esm/ChartZoomSlider/internals/chartAxisZoomSliderHandleClasses.d.ts +0 -17
- package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.d.ts +0 -13
- package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.js +0 -29
- package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.d.ts +0 -13
- package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.js +0 -29
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.ChartsToolbarZoomOutButton = void 0;
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
|
+
var React = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
+
var _internals = require("@mui/x-charts/internals");
|
|
15
|
+
var _useComponentRenderer = require("@mui/x-internals/useComponentRenderer");
|
|
16
|
+
var _useChartProZoom = require("../internals/plugins/useChartProZoom");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
const _excluded = ["render"];
|
|
19
|
+
/**
|
|
20
|
+
* The zoom-out button for the chart toolbar.
|
|
21
|
+
*/
|
|
22
|
+
const ChartsToolbarZoomOutButton = exports.ChartsToolbarZoomOutButton = /*#__PURE__*/React.forwardRef(function ChartsToolbarZoomOutButton(_ref, ref) {
|
|
23
|
+
let {
|
|
24
|
+
render
|
|
25
|
+
} = _ref,
|
|
26
|
+
other = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
27
|
+
const {
|
|
28
|
+
slots,
|
|
29
|
+
slotProps
|
|
30
|
+
} = (0, _internals.useChartsSlots)();
|
|
31
|
+
const {
|
|
32
|
+
instance,
|
|
33
|
+
store
|
|
34
|
+
} = (0, _internals.useChartContext)();
|
|
35
|
+
const disabled = (0, _internals.useSelector)(store, _useChartProZoom.selectorChartCanZoomOut);
|
|
36
|
+
const element = (0, _useComponentRenderer.useComponentRenderer)(slots.baseIconButton, render, (0, _extends2.default)({}, slotProps?.baseIconButton, {
|
|
37
|
+
onClick: () => instance.zoomOut(),
|
|
38
|
+
disabled
|
|
39
|
+
}, other, {
|
|
40
|
+
ref
|
|
41
|
+
}));
|
|
42
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
43
|
+
children: element
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
if (process.env.NODE_ENV !== "production") ChartsToolbarZoomOutButton.displayName = "ChartsToolbarZoomOutButton";
|
|
47
|
+
process.env.NODE_ENV !== "production" ? ChartsToolbarZoomOutButton.propTypes = {
|
|
48
|
+
// ----------------------------- Warning --------------------------------
|
|
49
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
50
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
51
|
+
// ----------------------------------------------------------------------
|
|
52
|
+
/**
|
|
53
|
+
* A function to customize the rendering of the component.
|
|
54
|
+
*/
|
|
55
|
+
render: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.func])
|
|
56
|
+
} : void 0;
|
|
@@ -13,4 +13,26 @@ Object.keys(_ChartsToolbarPro).forEach(function (key) {
|
|
|
13
13
|
return _ChartsToolbarPro[key];
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
+
});
|
|
17
|
+
var _ChartsToolbarZoomInButton = require("./ChartsToolbarZoomInButton");
|
|
18
|
+
Object.keys(_ChartsToolbarZoomInButton).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _ChartsToolbarZoomInButton[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _ChartsToolbarZoomInButton[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _ChartsToolbarZoomOutButton = require("./ChartsToolbarZoomOutButton");
|
|
29
|
+
Object.keys(_ChartsToolbarZoomOutButton).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _ChartsToolbarZoomOutButton[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _ChartsToolbarZoomOutButton[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
16
38
|
});
|
|
@@ -7,7 +7,8 @@ import { FunnelSeriesType } from "./funnel.types.js";
|
|
|
7
7
|
import { ChartContainerProProps } from "../ChartContainerPro/index.js";
|
|
8
8
|
import { FunnelChartSlotExtension } from "./funnelSlots.types.js";
|
|
9
9
|
import { CategoryAxis } from "./categoryAxis.types.js";
|
|
10
|
-
|
|
10
|
+
import { FunnelChartPluginsSignatures } from "./FunnelChart.plugins.js";
|
|
11
|
+
export interface FunnelChartProps extends Omit<ChartContainerProProps<'funnel', FunnelChartPluginsSignatures>, 'series' | 'plugins' | 'zAxis' | 'zoom' | 'onZoomChange' | 'dataset' | 'yAxis' | 'xAxis' | 'rotationAxis' | 'radiusAxis' | 'slots' | 'slotProps'>, Omit<FunnelPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, FunnelChartSlotExtension {
|
|
11
12
|
/**
|
|
12
13
|
* The series to display in the funnel chart.
|
|
13
14
|
* An array of [[FunnelSeriesType]] objects.
|
|
@@ -51,13 +51,14 @@ const FunnelChart = exports.FunnelChart = /*#__PURE__*/React.forwardRef(function
|
|
|
51
51
|
seriesConfig: seriesConfig,
|
|
52
52
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_internals.ChartsWrapper, (0, _extends2.default)({}, chartsWrapperProps, {
|
|
53
53
|
children: [!themedProps.hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, (0, _extends2.default)({}, legendProps)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
54
|
-
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)),
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
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)), children]
|
|
55
|
+
})), !themedProps.loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(Tooltip, (0, _extends2.default)({}, themedProps.slotProps?.tooltip, {
|
|
56
|
+
trigger: "item"
|
|
57
57
|
}))]
|
|
58
58
|
}))
|
|
59
59
|
}));
|
|
60
60
|
});
|
|
61
|
+
if (process.env.NODE_ENV !== "production") FunnelChart.displayName = "FunnelChart";
|
|
61
62
|
process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
62
63
|
// ----------------------------- Warning --------------------------------
|
|
63
64
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -66,8 +67,7 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
66
67
|
apiRef: _propTypes.default.shape({
|
|
67
68
|
current: _propTypes.default.shape({
|
|
68
69
|
exportAsImage: _propTypes.default.func.isRequired,
|
|
69
|
-
exportAsPrint: _propTypes.default.func.isRequired
|
|
70
|
-
setZoomData: _propTypes.default.func.isRequired
|
|
70
|
+
exportAsPrint: _propTypes.default.func.isRequired
|
|
71
71
|
})
|
|
72
72
|
}),
|
|
73
73
|
/**
|
|
@@ -206,15 +206,6 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
206
206
|
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
207
207
|
*/
|
|
208
208
|
id: _propTypes.default.string,
|
|
209
|
-
/**
|
|
210
|
-
* The list of zoom data related to each axis.
|
|
211
|
-
* Used to initialize the zoom in a specific configuration without controlling it.
|
|
212
|
-
*/
|
|
213
|
-
initialZoom: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
214
|
-
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
215
|
-
end: _propTypes.default.number.isRequired,
|
|
216
|
-
start: _propTypes.default.number.isRequired
|
|
217
|
-
})),
|
|
218
209
|
/**
|
|
219
210
|
* If `true`, a loading overlay is displayed.
|
|
220
211
|
* @default false
|
|
@@ -281,13 +272,5 @@ process.env.NODE_ENV !== "production" ? FunnelChart.propTypes = {
|
|
|
281
272
|
/**
|
|
282
273
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
283
274
|
*/
|
|
284
|
-
width: _propTypes.default.number
|
|
285
|
-
/**
|
|
286
|
-
* The list of zoom data related to each axis.
|
|
287
|
-
*/
|
|
288
|
-
zoomData: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
289
|
-
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
290
|
-
end: _propTypes.default.number.isRequired,
|
|
291
|
-
start: _propTypes.default.number.isRequired
|
|
292
|
-
}))
|
|
275
|
+
width: _propTypes.default.number
|
|
293
276
|
} : void 0;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ConvertSignaturesIntoPlugins, UseChartCartesianAxisSignature, UseChartHighlightSignature, UseChartInteractionSignature } from '@mui/x-charts/internals';
|
|
2
|
+
import { UseChartProExportSignature } from "../internals/plugins/useChartProExport/index.js";
|
|
3
|
+
export type FunnelChartPluginsSignatures = [UseChartCartesianAxisSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartProExportSignature];
|
|
4
|
+
export declare const FUNNEL_CHART_PLUGINS: ConvertSignaturesIntoPlugins<FunnelChartPluginsSignatures>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FUNNEL_CHART_PLUGINS = void 0;
|
|
7
|
+
var _internals = require("@mui/x-charts/internals");
|
|
8
|
+
var _useChartProExport = require("../internals/plugins/useChartProExport");
|
|
9
|
+
const FUNNEL_CHART_PLUGINS = exports.FUNNEL_CHART_PLUGINS = [_internals.useChartCartesianAxis, _internals.useChartInteraction, _internals.useChartHighlight, _useChartProExport.useChartProExport];
|
|
@@ -86,12 +86,14 @@ const useAggregatedData = gap => {
|
|
|
86
86
|
seriesId,
|
|
87
87
|
value: currentSeries.data[dataIndex].value
|
|
88
88
|
}) : currentSeries.sectionLabel;
|
|
89
|
+
const isIncreasing = currentSeries.dataDirection === 'increasing';
|
|
89
90
|
const curve = (0, _curves.getFunnelCurve)(currentSeries.curve, {
|
|
90
91
|
isHorizontal,
|
|
91
92
|
gap,
|
|
92
93
|
position: dataIndex,
|
|
93
94
|
sections: currentSeries.dataPoints.length,
|
|
94
95
|
borderRadius: currentSeries.borderRadius,
|
|
96
|
+
isIncreasing,
|
|
95
97
|
min: minPoint,
|
|
96
98
|
max: maxPoint
|
|
97
99
|
});
|
|
@@ -8,6 +8,10 @@ export type CurveOptions = {
|
|
|
8
8
|
* Indicates if the main axis of the visualization.
|
|
9
9
|
*/
|
|
10
10
|
isHorizontal?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Indicates if the segments values are increasing or decreasing.
|
|
13
|
+
*/
|
|
14
|
+
isIncreasing?: boolean;
|
|
11
15
|
/**
|
|
12
16
|
* The order position of the segment.
|
|
13
17
|
*/
|
|
@@ -11,6 +11,7 @@ export declare class Pyramid implements CurveGenerator {
|
|
|
11
11
|
private position;
|
|
12
12
|
private sections;
|
|
13
13
|
private isHorizontal;
|
|
14
|
+
private isIncreasing;
|
|
14
15
|
private gap;
|
|
15
16
|
private borderRadius;
|
|
16
17
|
private min;
|
|
@@ -23,7 +24,8 @@ export declare class Pyramid implements CurveGenerator {
|
|
|
23
24
|
sections,
|
|
24
25
|
borderRadius,
|
|
25
26
|
min,
|
|
26
|
-
max
|
|
27
|
+
max,
|
|
28
|
+
isIncreasing
|
|
27
29
|
}: CurveOptions);
|
|
28
30
|
areaStart(): void;
|
|
29
31
|
areaEnd(): void;
|
|
@@ -22,12 +22,14 @@ class Pyramid {
|
|
|
22
22
|
sections,
|
|
23
23
|
borderRadius,
|
|
24
24
|
min,
|
|
25
|
-
max
|
|
25
|
+
max,
|
|
26
|
+
isIncreasing
|
|
26
27
|
}) {
|
|
27
28
|
this.context = void 0;
|
|
28
29
|
this.position = 0;
|
|
29
30
|
this.sections = 0;
|
|
30
31
|
this.isHorizontal = false;
|
|
32
|
+
this.isIncreasing = false;
|
|
31
33
|
this.gap = 0;
|
|
32
34
|
this.borderRadius = 0;
|
|
33
35
|
this.min = {
|
|
@@ -45,6 +47,7 @@ class Pyramid {
|
|
|
45
47
|
this.position = position ?? 0;
|
|
46
48
|
this.sections = sections ?? 1;
|
|
47
49
|
this.borderRadius = borderRadius ?? 0;
|
|
50
|
+
this.isIncreasing = isIncreasing ?? false;
|
|
48
51
|
this.min = min ?? {
|
|
49
52
|
x: 0,
|
|
50
53
|
y: 0
|
|
@@ -53,6 +56,12 @@ class Pyramid {
|
|
|
53
56
|
x: 0,
|
|
54
57
|
y: 0
|
|
55
58
|
};
|
|
59
|
+
if (isIncreasing) {
|
|
60
|
+
const currentMin = this.min;
|
|
61
|
+
const currentMax = this.max;
|
|
62
|
+
this.min = currentMax;
|
|
63
|
+
this.max = currentMin;
|
|
64
|
+
}
|
|
56
65
|
}
|
|
57
66
|
areaStart() {}
|
|
58
67
|
areaEnd() {}
|
|
@@ -62,14 +71,25 @@ class Pyramid {
|
|
|
62
71
|
if (this.gap > 0) {
|
|
63
72
|
return this.borderRadius;
|
|
64
73
|
}
|
|
65
|
-
if (this.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
if (this.isIncreasing) {
|
|
75
|
+
// Is largest section
|
|
76
|
+
if (this.position === this.sections - 1) {
|
|
77
|
+
return [this.borderRadius, this.borderRadius];
|
|
78
|
+
}
|
|
79
|
+
// Is smallest section and shaped like a triangle
|
|
80
|
+
if (this.position === 0) {
|
|
81
|
+
return [0, 0, this.borderRadius];
|
|
82
|
+
}
|
|
70
83
|
}
|
|
71
|
-
if (this.
|
|
72
|
-
|
|
84
|
+
if (!this.isIncreasing) {
|
|
85
|
+
// Is largest section
|
|
86
|
+
if (this.position === 0) {
|
|
87
|
+
return [0, 0, this.borderRadius, this.borderRadius];
|
|
88
|
+
}
|
|
89
|
+
// Is smallest section and shaped like a triangle
|
|
90
|
+
if (this.position === this.sections - 1) {
|
|
91
|
+
return [this.borderRadius];
|
|
92
|
+
}
|
|
73
93
|
}
|
|
74
94
|
return 0;
|
|
75
95
|
}
|
|
@@ -118,8 +138,15 @@ class Pyramid {
|
|
|
118
138
|
|
|
119
139
|
// In the last section, to form a triangle we need 3 points instead of 4
|
|
120
140
|
// Else the algorithm will break.
|
|
121
|
-
|
|
122
|
-
|
|
141
|
+
const isLastSection = this.position === this.sections - 1;
|
|
142
|
+
const isFirstSection = this.position === 0;
|
|
143
|
+
if (this.gap <= 0) {
|
|
144
|
+
if (isFirstSection && this.isIncreasing) {
|
|
145
|
+
this.points = [this.points[0], this.points[1], this.points[2]];
|
|
146
|
+
}
|
|
147
|
+
if (isLastSection && !this.isIncreasing) {
|
|
148
|
+
this.points = [this.points[0], this.points[1], this.points[3]];
|
|
149
|
+
}
|
|
123
150
|
}
|
|
124
151
|
(0, _borderRadiusPolygon.borderRadiusPolygon)(this.context, this.points, this.getBorderRadius());
|
|
125
152
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CurveGenerator } from '@mui/x-charts-vendor/d3-shape';
|
|
2
|
-
import { CurveOptions } from "./curve.types.js";
|
|
2
|
+
import { CurveOptions, Point } from "./curve.types.js";
|
|
3
3
|
/**
|
|
4
4
|
* This is a custom "step-pyramid" curve generator.
|
|
5
5
|
* It creates a step pyramid, which is a step-like shape with static lengths.
|
|
@@ -8,7 +8,9 @@ import { CurveOptions } from "./curve.types.js";
|
|
|
8
8
|
export declare class StepPyramid implements CurveGenerator {
|
|
9
9
|
private context;
|
|
10
10
|
private position;
|
|
11
|
+
private sections;
|
|
11
12
|
private isHorizontal;
|
|
13
|
+
private isIncreasing;
|
|
12
14
|
private gap;
|
|
13
15
|
private borderRadius;
|
|
14
16
|
private min;
|
|
@@ -18,14 +20,20 @@ export declare class StepPyramid implements CurveGenerator {
|
|
|
18
20
|
isHorizontal,
|
|
19
21
|
gap,
|
|
20
22
|
position,
|
|
23
|
+
sections,
|
|
21
24
|
borderRadius,
|
|
22
25
|
min,
|
|
23
|
-
max
|
|
26
|
+
max,
|
|
27
|
+
isIncreasing
|
|
24
28
|
}: CurveOptions);
|
|
25
29
|
areaStart(): void;
|
|
26
30
|
areaEnd(): void;
|
|
27
31
|
lineStart(): void;
|
|
28
32
|
lineEnd(): void;
|
|
29
33
|
protected getBorderRadius(): number | number[];
|
|
34
|
+
slopeStart(index: number): Point;
|
|
35
|
+
slopeEnd(index: number): Point;
|
|
36
|
+
initialX(index: number): number;
|
|
37
|
+
initialY(index: number): number;
|
|
30
38
|
point(xIn: number, yIn: number): void;
|
|
31
39
|
}
|
|
@@ -18,13 +18,17 @@ class StepPyramid {
|
|
|
18
18
|
isHorizontal,
|
|
19
19
|
gap,
|
|
20
20
|
position,
|
|
21
|
+
sections,
|
|
21
22
|
borderRadius,
|
|
22
23
|
min,
|
|
23
|
-
max
|
|
24
|
+
max,
|
|
25
|
+
isIncreasing
|
|
24
26
|
}) {
|
|
25
27
|
this.context = void 0;
|
|
26
28
|
this.position = 0;
|
|
29
|
+
this.sections = 0;
|
|
27
30
|
this.isHorizontal = false;
|
|
31
|
+
this.isIncreasing = false;
|
|
28
32
|
this.gap = 0;
|
|
29
33
|
this.borderRadius = 0;
|
|
30
34
|
this.min = {
|
|
@@ -40,7 +44,9 @@ class StepPyramid {
|
|
|
40
44
|
this.isHorizontal = isHorizontal ?? false;
|
|
41
45
|
this.gap = (gap ?? 0) / 2;
|
|
42
46
|
this.position = position ?? 0;
|
|
47
|
+
this.sections = sections ?? 1;
|
|
43
48
|
this.borderRadius = borderRadius ?? 0;
|
|
49
|
+
this.isIncreasing = isIncreasing ?? false;
|
|
44
50
|
this.min = min ?? {
|
|
45
51
|
x: 0,
|
|
46
52
|
y: 0
|
|
@@ -55,7 +61,91 @@ class StepPyramid {
|
|
|
55
61
|
lineStart() {}
|
|
56
62
|
lineEnd() {}
|
|
57
63
|
getBorderRadius() {
|
|
58
|
-
|
|
64
|
+
if (this.gap > 0) {
|
|
65
|
+
return this.borderRadius;
|
|
66
|
+
}
|
|
67
|
+
if (this.isIncreasing) {
|
|
68
|
+
if (this.position === this.sections - 1) {
|
|
69
|
+
return this.borderRadius;
|
|
70
|
+
}
|
|
71
|
+
return [0, 0, this.borderRadius, this.borderRadius];
|
|
72
|
+
}
|
|
73
|
+
if (this.position === 0) {
|
|
74
|
+
return this.borderRadius;
|
|
75
|
+
}
|
|
76
|
+
return [this.borderRadius, this.borderRadius];
|
|
77
|
+
}
|
|
78
|
+
slopeStart(index) {
|
|
79
|
+
if (this.isIncreasing) {
|
|
80
|
+
if (this.isHorizontal) {
|
|
81
|
+
return {
|
|
82
|
+
x: this.min.x,
|
|
83
|
+
y: (this.min.y + this.max.y) / 2
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
x: (this.min.x + this.max.x) / 2,
|
|
88
|
+
y: this.min.y
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
if (this.isHorizontal) {
|
|
92
|
+
if (index <= 1) {
|
|
93
|
+
return this.min;
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
x: this.min.x,
|
|
97
|
+
y: this.max.y
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (index <= 1) {
|
|
101
|
+
return {
|
|
102
|
+
x: this.max.x,
|
|
103
|
+
y: this.min.y
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return this.min;
|
|
107
|
+
}
|
|
108
|
+
slopeEnd(index) {
|
|
109
|
+
if (this.isIncreasing) {
|
|
110
|
+
if (this.isHorizontal) {
|
|
111
|
+
if (index <= 1) {
|
|
112
|
+
return {
|
|
113
|
+
x: this.max.x,
|
|
114
|
+
y: this.min.y
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
return this.max;
|
|
118
|
+
}
|
|
119
|
+
if (index <= 1) {
|
|
120
|
+
return this.max;
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
x: this.min.x,
|
|
124
|
+
y: this.max.y
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
if (this.isHorizontal) {
|
|
128
|
+
return {
|
|
129
|
+
x: this.max.x,
|
|
130
|
+
y: (this.max.y + this.min.y) / 2
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
x: (this.max.x + this.min.x) / 2,
|
|
135
|
+
y: this.max.y
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
initialX(index) {
|
|
139
|
+
if (this.isIncreasing) {
|
|
140
|
+
return index === 0 || index === 1 ? this.points.at(1).x : this.points.at(2).x;
|
|
141
|
+
}
|
|
142
|
+
return index === 0 || index === 1 ? this.points.at(0).x : this.points.at(3).x;
|
|
143
|
+
}
|
|
144
|
+
initialY(index) {
|
|
145
|
+
if (this.isIncreasing) {
|
|
146
|
+
return index === 0 || index === 1 ? this.points.at(1).y : this.points.at(2).y;
|
|
147
|
+
}
|
|
148
|
+
return index === 0 || index === 1 ? this.points.at(0).y : this.points.at(3).y;
|
|
59
149
|
}
|
|
60
150
|
point(xIn, yIn) {
|
|
61
151
|
this.points.push({
|
|
@@ -68,34 +158,20 @@ class StepPyramid {
|
|
|
68
158
|
|
|
69
159
|
// Add gaps where they are needed.
|
|
70
160
|
this.points = this.points.map((point, index) => {
|
|
161
|
+
const slopeStart = this.slopeStart(index);
|
|
162
|
+
const slopeEnd = this.slopeEnd(index);
|
|
71
163
|
if (this.isHorizontal) {
|
|
72
|
-
const slopeEnd = {
|
|
73
|
-
x: this.max.x,
|
|
74
|
-
y: (this.max.y + this.min.y) / 2
|
|
75
|
-
};
|
|
76
|
-
const slopeStart = index <= 1 ? this.min : {
|
|
77
|
-
x: this.min.x,
|
|
78
|
-
y: this.max.y
|
|
79
|
-
};
|
|
80
164
|
const yGetter = (0, _utils.lerpY)(slopeStart.x, slopeStart.y, slopeEnd.x, slopeEnd.y);
|
|
81
165
|
const xGap = point.x + (index === 0 || index === 3 ? this.gap : -this.gap);
|
|
82
|
-
const xInitial =
|
|
166
|
+
const xInitial = this.initialX(index);
|
|
83
167
|
return {
|
|
84
168
|
x: xGap,
|
|
85
169
|
y: yGetter(xInitial)
|
|
86
170
|
};
|
|
87
171
|
}
|
|
88
|
-
const slopeEnd = {
|
|
89
|
-
x: (this.max.x + this.min.x) / 2,
|
|
90
|
-
y: this.max.y
|
|
91
|
-
};
|
|
92
|
-
const slopeStart = index <= 1 ? {
|
|
93
|
-
x: this.max.x,
|
|
94
|
-
y: this.min.y
|
|
95
|
-
} : this.min;
|
|
96
172
|
const xGetter = (0, _utils.lerpX)(slopeStart.x, slopeStart.y, slopeEnd.x, slopeEnd.y);
|
|
97
173
|
const yGap = point.y + (index === 0 || index === 3 ? this.gap : -this.gap);
|
|
98
|
-
const yInitial =
|
|
174
|
+
const yInitial = this.initialY(index);
|
|
99
175
|
return {
|
|
100
176
|
x: xGetter(yInitial),
|
|
101
177
|
y: yGap
|
|
@@ -13,15 +13,19 @@ import { CurveOptions } from "./curve.types.js";
|
|
|
13
13
|
export declare class Step implements CurveGenerator {
|
|
14
14
|
private context;
|
|
15
15
|
private isHorizontal;
|
|
16
|
+
private isIncreasing;
|
|
16
17
|
private gap;
|
|
17
18
|
private borderRadius;
|
|
18
19
|
private position;
|
|
20
|
+
private sections;
|
|
19
21
|
private points;
|
|
20
22
|
constructor(context: CanvasRenderingContext2D, {
|
|
21
23
|
isHorizontal,
|
|
22
24
|
gap,
|
|
23
25
|
position,
|
|
24
|
-
borderRadius
|
|
26
|
+
borderRadius,
|
|
27
|
+
isIncreasing,
|
|
28
|
+
sections
|
|
25
29
|
}: CurveOptions);
|
|
26
30
|
areaStart(): void;
|
|
27
31
|
areaEnd(): void;
|
|
@@ -23,26 +23,44 @@ class Step {
|
|
|
23
23
|
isHorizontal,
|
|
24
24
|
gap,
|
|
25
25
|
position,
|
|
26
|
-
borderRadius
|
|
26
|
+
borderRadius,
|
|
27
|
+
isIncreasing,
|
|
28
|
+
sections
|
|
27
29
|
}) {
|
|
28
30
|
this.context = void 0;
|
|
29
31
|
this.isHorizontal = false;
|
|
32
|
+
this.isIncreasing = false;
|
|
30
33
|
this.gap = 0;
|
|
31
34
|
this.borderRadius = 0;
|
|
32
35
|
this.position = 0;
|
|
36
|
+
this.sections = 0;
|
|
33
37
|
this.points = [];
|
|
34
38
|
this.context = context;
|
|
35
39
|
this.isHorizontal = isHorizontal ?? false;
|
|
36
40
|
this.gap = (gap ?? 0) / 2;
|
|
37
41
|
this.position = position ?? 0;
|
|
42
|
+
this.sections = sections ?? 1;
|
|
38
43
|
this.borderRadius = borderRadius ?? 0;
|
|
44
|
+
this.isIncreasing = isIncreasing ?? false;
|
|
39
45
|
}
|
|
40
46
|
areaStart() {}
|
|
41
47
|
areaEnd() {}
|
|
42
48
|
lineStart() {}
|
|
43
49
|
lineEnd() {}
|
|
44
50
|
getBorderRadius() {
|
|
45
|
-
|
|
51
|
+
if (this.gap > 0) {
|
|
52
|
+
return this.borderRadius;
|
|
53
|
+
}
|
|
54
|
+
if (this.isIncreasing) {
|
|
55
|
+
if (this.position === this.sections - 1) {
|
|
56
|
+
return this.borderRadius;
|
|
57
|
+
}
|
|
58
|
+
return [0, 0, this.borderRadius, this.borderRadius];
|
|
59
|
+
}
|
|
60
|
+
if (this.position === 0) {
|
|
61
|
+
return this.borderRadius;
|
|
62
|
+
}
|
|
63
|
+
return [this.borderRadius, this.borderRadius];
|
|
46
64
|
}
|
|
47
65
|
point(xIn, yIn) {
|
|
48
66
|
this.points.push({
|
|
@@ -110,6 +110,13 @@ export type FunnelItem = {
|
|
|
110
110
|
export interface DefaultizedFunnelSeriesType extends DefaultizedProps<FunnelSeriesType, CommonDefaultizedProps | 'layout'> {
|
|
111
111
|
dataPoints: FunnelDataPoints[][];
|
|
112
112
|
data: Readonly<MakeRequired<FunnelValueType, 'id' | 'color'>[]>;
|
|
113
|
+
/**
|
|
114
|
+
* Denotes if the data is increasing, first data point is less than the last data point.
|
|
115
|
+
* While the data is decreasing if the first data point is greater than the last data point.
|
|
116
|
+
*
|
|
117
|
+
* This is used to determine the direction of the funnel.
|
|
118
|
+
*/
|
|
119
|
+
dataDirection: 'increasing' | 'decreasing';
|
|
113
120
|
}
|
|
114
121
|
export type FunnelDataPoints = Record<'x' | 'y', number> & {
|
|
115
122
|
useBandWidth: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ChartsOverlaySlotProps, ChartsOverlaySlots } from '@mui/x-charts/ChartsOverlay';
|
|
2
2
|
import { ChartsTooltipSlotProps, ChartsTooltipSlots } from '@mui/x-charts/ChartsTooltip';
|
|
3
|
-
import { ChartsAxisSlotProps, ChartsAxisSlots } from '@mui/x-charts/internals';
|
|
3
|
+
import { ChartsAxisSlotProps, ChartsAxisSlots, ChartsSlotProps, ChartsSlots } from '@mui/x-charts/internals';
|
|
4
4
|
import { ChartsLegendSlotProps, ChartsLegendSlots } from '@mui/x-charts/ChartsLegend';
|
|
5
|
+
import { ChartsToolbarSlotProps, ChartsToolbarSlots } from '@mui/x-charts/Toolbar';
|
|
5
6
|
import { FunnelPlotSlotProps, FunnelPlotSlots } from "./funnelPlotSlots.types.js";
|
|
6
|
-
export interface FunnelChartSlots extends ChartsAxisSlots, FunnelPlotSlots, ChartsLegendSlots, ChartsTooltipSlots, ChartsOverlaySlots, ChartsAxisSlots {}
|
|
7
|
-
export interface FunnelChartSlotProps extends ChartsAxisSlotProps, FunnelPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps, ChartsOverlaySlotProps, ChartsAxisSlotProps {}
|
|
7
|
+
export interface FunnelChartSlots extends ChartsAxisSlots, FunnelPlotSlots, ChartsLegendSlots, ChartsTooltipSlots, ChartsOverlaySlots, ChartsAxisSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
8
|
+
export interface FunnelChartSlotProps extends ChartsAxisSlotProps, FunnelPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps, ChartsOverlaySlotProps, ChartsAxisSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
8
9
|
export interface FunnelChartSlotExtension {
|
|
9
10
|
/**
|
|
10
11
|
* Overridable component slots.
|