@mui/x-charts-pro 8.1.0 → 8.3.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 +7 -1
- package/BarChartPro/BarChartPro.js +62 -5
- package/CHANGELOG.md +233 -7
- package/ChartContainerPro/useChartContainerProProps.d.ts +1 -1
- package/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/ChartDataProviderPro/useChartDataProviderProProps.d.ts +2 -2
- package/ChartZoomSlider/ChartZoomSlider.d.ts +5 -0
- package/ChartZoomSlider/ChartZoomSlider.js +47 -0
- package/ChartZoomSlider/index.d.ts +2 -0
- package/ChartZoomSlider/index.js +27 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts +23 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSlider.js +348 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.d.ts +12 -0
- package/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.js +92 -0
- package/ChartZoomSlider/internals/chartAxisZoomSliderHandleClasses.d.ts +17 -0
- package/ChartZoomSlider/internals/chartAxisZoomSliderHandleClasses.js +27 -0
- package/ChartsToolbarPro/ChartsToolbarPro.d.ts +2 -0
- package/ChartsToolbarPro/ChartsToolbarPro.js +31 -0
- package/ChartsToolbarPro/index.d.ts +1 -0
- package/ChartsToolbarPro/index.js +16 -0
- package/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.d.ts +13 -0
- package/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.js +36 -0
- package/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.d.ts +13 -0
- package/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.js +36 -0
- package/FunnelChart/FunnelChart.js +9 -8
- package/FunnelChart/FunnelPlot.d.ts +5 -0
- package/FunnelChart/FunnelPlot.js +36 -18
- package/FunnelChart/FunnelSection.d.ts +1 -0
- package/FunnelChart/FunnelSection.js +12 -7
- package/FunnelChart/curves/borderRadiusPolygon.d.ts +8 -0
- package/FunnelChart/curves/borderRadiusPolygon.js +42 -0
- package/FunnelChart/curves/bump.d.ts +27 -0
- package/FunnelChart/curves/bump.js +81 -0
- package/FunnelChart/curves/curve.types.d.ts +38 -0
- package/FunnelChart/curves/curve.types.js +5 -0
- package/FunnelChart/curves/getFunnelCurve.d.ts +3 -0
- package/FunnelChart/curves/getFunnelCurve.js +30 -0
- package/FunnelChart/curves/index.d.ts +2 -0
- package/FunnelChart/curves/index.js +27 -0
- package/FunnelChart/curves/linear.d.ts +32 -0
- package/FunnelChart/curves/linear.js +88 -0
- package/FunnelChart/curves/pyramid.d.ts +34 -0
- package/FunnelChart/curves/pyramid.js +127 -0
- package/FunnelChart/curves/step-pyramid.d.ts +31 -0
- package/FunnelChart/curves/step-pyramid.js +107 -0
- package/FunnelChart/curves/step.d.ts +32 -0
- package/FunnelChart/curves/step.js +88 -0
- package/FunnelChart/curves/utils.d.ts +4 -0
- package/FunnelChart/curves/utils.js +29 -0
- package/FunnelChart/funnel.types.d.ts +25 -4
- package/FunnelChart/funnelPlotSlots.types.d.ts +1 -1
- package/FunnelChart/funnelSectionClasses.d.ts +6 -2
- package/FunnelChart/funnelSectionClasses.js +5 -2
- package/FunnelChart/index.d.ts +3 -2
- package/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +1 -0
- package/FunnelChart/useFunnelChartProps.d.ts +1 -6
- package/FunnelChart/useFunnelChartProps.js +7 -15
- package/Heatmap/Heatmap.d.ts +3 -3
- package/Heatmap/Heatmap.js +3 -21
- package/LineChartPro/LineChartPro.d.ts +7 -1
- package/LineChartPro/LineChartPro.js +62 -5
- package/ScatterChartPro/ScatterChartPro.d.ts +7 -1
- package/ScatterChartPro/ScatterChartPro.js +62 -5
- package/esm/BarChartPro/BarChartPro.d.ts +7 -1
- package/esm/BarChartPro/BarChartPro.js +62 -5
- package/esm/ChartContainerPro/useChartContainerProProps.d.ts +1 -1
- package/esm/ChartDataProviderPro/ChartDataProviderPro.js +1 -1
- package/esm/ChartDataProviderPro/useChartDataProviderProProps.d.ts +2 -2
- package/esm/ChartZoomSlider/ChartZoomSlider.d.ts +5 -0
- package/esm/ChartZoomSlider/ChartZoomSlider.js +41 -0
- package/esm/ChartZoomSlider/index.d.ts +2 -0
- package/esm/ChartZoomSlider/index.js +2 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.d.ts +23 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSlider.js +339 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.d.ts +12 -0
- package/esm/ChartZoomSlider/internals/ChartAxisZoomSliderHandle.js +85 -0
- package/esm/ChartZoomSlider/internals/chartAxisZoomSliderHandleClasses.d.ts +17 -0
- package/esm/ChartZoomSlider/internals/chartAxisZoomSliderHandleClasses.js +17 -0
- package/esm/ChartsToolbarPro/ChartsToolbarPro.d.ts +2 -0
- package/esm/ChartsToolbarPro/ChartsToolbarPro.js +24 -0
- package/esm/ChartsToolbarPro/index.d.ts +1 -0
- package/esm/ChartsToolbarPro/index.js +1 -0
- package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.d.ts +13 -0
- package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomInButton.js +29 -0
- package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.d.ts +13 -0
- package/esm/ChartsToolbarPro/internal/ChartsToolbarZoomOutButton.js +29 -0
- package/esm/FunnelChart/FunnelChart.js +9 -8
- package/esm/FunnelChart/FunnelPlot.d.ts +5 -0
- package/esm/FunnelChart/FunnelPlot.js +37 -19
- package/esm/FunnelChart/FunnelSection.d.ts +1 -0
- package/esm/FunnelChart/FunnelSection.js +12 -7
- package/esm/FunnelChart/curves/borderRadiusPolygon.d.ts +8 -0
- package/esm/FunnelChart/curves/borderRadiusPolygon.js +36 -0
- package/esm/FunnelChart/curves/bump.d.ts +27 -0
- package/esm/FunnelChart/curves/bump.js +74 -0
- package/esm/FunnelChart/curves/curve.types.d.ts +38 -0
- package/esm/FunnelChart/curves/curve.types.js +1 -0
- package/esm/FunnelChart/curves/getFunnelCurve.d.ts +3 -0
- package/esm/FunnelChart/curves/getFunnelCurve.js +23 -0
- package/esm/FunnelChart/curves/index.d.ts +2 -0
- package/esm/FunnelChart/curves/index.js +2 -0
- package/esm/FunnelChart/curves/linear.d.ts +32 -0
- package/esm/FunnelChart/curves/linear.js +82 -0
- package/esm/FunnelChart/curves/pyramid.d.ts +34 -0
- package/esm/FunnelChart/curves/pyramid.js +121 -0
- package/esm/FunnelChart/curves/step-pyramid.d.ts +31 -0
- package/esm/FunnelChart/curves/step-pyramid.js +101 -0
- package/esm/FunnelChart/curves/step.d.ts +32 -0
- package/esm/FunnelChart/curves/step.js +82 -0
- package/esm/FunnelChart/curves/utils.d.ts +4 -0
- package/esm/FunnelChart/curves/utils.js +19 -0
- package/esm/FunnelChart/funnel.types.d.ts +25 -4
- package/esm/FunnelChart/funnelPlotSlots.types.d.ts +1 -1
- package/esm/FunnelChart/funnelSectionClasses.d.ts +6 -2
- package/esm/FunnelChart/funnelSectionClasses.js +5 -2
- package/esm/FunnelChart/index.d.ts +3 -2
- package/esm/FunnelChart/seriesConfig/getSeriesWithDefaultValues.js +1 -0
- package/esm/FunnelChart/useFunnelChartProps.d.ts +1 -6
- package/esm/FunnelChart/useFunnelChartProps.js +7 -15
- package/esm/Heatmap/Heatmap.d.ts +3 -3
- package/esm/Heatmap/Heatmap.js +3 -21
- package/esm/LineChartPro/LineChartPro.d.ts +7 -1
- package/esm/LineChartPro/LineChartPro.js +62 -5
- package/esm/ScatterChartPro/ScatterChartPro.d.ts +7 -1
- package/esm/ScatterChartPro/ScatterChartPro.js +62 -5
- package/esm/index.d.ts +4 -1
- package/esm/index.js +5 -2
- package/esm/internals/material/icons.d.ts +3 -0
- package/esm/internals/material/icons.js +13 -0
- package/esm/internals/material/index.d.ts +4 -0
- package/esm/internals/material/index.js +12 -0
- package/esm/internals/plugins/useChartProExport/common.d.ts +1 -0
- package/esm/internals/plugins/useChartProExport/common.js +8 -0
- package/esm/internals/plugins/useChartProExport/exportImage.d.ts +3 -0
- package/esm/internals/plugins/useChartProExport/exportImage.js +85 -0
- package/esm/internals/plugins/useChartProExport/print.js +6 -50
- package/esm/internals/plugins/useChartProExport/useChartProExport.js +22 -2
- package/esm/internals/plugins/useChartProExport/useChartProExport.types.d.ts +32 -0
- package/esm/internals/plugins/useChartProZoom/calculateZoom.d.ts +23 -0
- package/esm/internals/plugins/useChartProZoom/calculateZoom.js +32 -0
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.d.ts +1 -1
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.js +46 -4
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +84 -32
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +3 -2
- package/esm/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +17 -2
- package/esm/internals/slots/chartBaseSlotProps.d.ts +10 -0
- package/esm/internals/slots/chartBaseSlotProps.js +1 -0
- package/esm/internals/slots/chartsBaseSlots.d.ts +6 -0
- package/esm/internals/slots/chartsBaseSlots.js +1 -0
- package/esm/internals/slots/chartsIconSlots.d.ts +14 -0
- package/esm/internals/slots/chartsIconSlots.js +1 -0
- package/esm/themeAugmentation/components.d.ts +0 -4
- package/esm/themeAugmentation/components.js +1 -0
- package/esm/themeAugmentation/index.d.ts +3 -3
- package/esm/themeAugmentation/overrides.d.ts +0 -3
- package/esm/themeAugmentation/overrides.js +2 -0
- package/esm/themeAugmentation/props.d.ts +0 -6
- package/esm/themeAugmentation/props.js +2 -0
- package/esm/typeOverloads/modules.d.ts +1 -1
- package/index.d.ts +4 -1
- package/index.js +90 -1
- package/internals/material/icons.d.ts +3 -0
- package/internals/material/icons.js +20 -0
- package/internals/material/index.d.ts +4 -0
- package/internals/material/index.js +19 -0
- package/internals/plugins/useChartProExport/common.d.ts +1 -0
- package/internals/plugins/useChartProExport/common.js +14 -0
- package/internals/plugins/useChartProExport/exportImage.d.ts +3 -0
- package/internals/plugins/useChartProExport/exportImage.js +95 -0
- package/internals/plugins/useChartProExport/print.js +6 -50
- package/internals/plugins/useChartProExport/useChartProExport.js +22 -2
- package/internals/plugins/useChartProExport/useChartProExport.types.d.ts +32 -0
- package/internals/plugins/useChartProZoom/calculateZoom.d.ts +23 -0
- package/internals/plugins/useChartProZoom/calculateZoom.js +39 -0
- package/internals/plugins/useChartProZoom/useChartProZoom.d.ts +1 -1
- package/internals/plugins/useChartProZoom/useChartProZoom.js +45 -3
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.d.ts +84 -32
- package/internals/plugins/useChartProZoom/useChartProZoom.selectors.js +3 -2
- package/internals/plugins/useChartProZoom/useChartProZoom.types.d.ts +17 -2
- package/internals/slots/chartBaseSlotProps.d.ts +10 -0
- package/internals/slots/chartBaseSlotProps.js +5 -0
- package/internals/slots/chartsBaseSlots.d.ts +6 -0
- package/internals/slots/chartsBaseSlots.js +5 -0
- package/internals/slots/chartsIconSlots.d.ts +14 -0
- package/internals/slots/chartsIconSlots.js +5 -0
- package/package.json +10 -7
- package/themeAugmentation/components.d.ts +0 -4
- package/themeAugmentation/components.js +5 -0
- package/themeAugmentation/index.d.ts +3 -3
- package/themeAugmentation/overrides.d.ts +0 -3
- package/themeAugmentation/overrides.js +5 -0
- package/themeAugmentation/props.d.ts +0 -6
- package/themeAugmentation/props.js +5 -0
- package/typeOverloads/modules.d.ts +1 -1
- package/FunnelChart/funnelStepCurve.d.ts +0 -4
- package/FunnelChart/funnelStepCurve.js +0 -74
- package/esm/FunnelChart/funnelStepCurve.d.ts +0 -4
- package/esm/FunnelChart/funnelStepCurve.js +0 -67
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Linear = void 0;
|
|
7
|
+
var _borderRadiusPolygon = require("./borderRadiusPolygon");
|
|
8
|
+
var _utils = require("./utils");
|
|
9
|
+
/* eslint-disable class-methods-use-this */
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This is a custom "linear" curve generator.
|
|
13
|
+
* It draws straight lines for the 4 provided points,
|
|
14
|
+
* with the option to add a gap between sections while also properly handling the border radius.
|
|
15
|
+
*
|
|
16
|
+
* The implementation is based on the d3-shape linear curve generator.
|
|
17
|
+
* https://github.com/d3/d3-shape/blob/a82254af78f08799c71d7ab25df557c4872a3c51/src/curve/linear.js
|
|
18
|
+
*/
|
|
19
|
+
class Linear {
|
|
20
|
+
constructor(context, {
|
|
21
|
+
isHorizontal,
|
|
22
|
+
gap,
|
|
23
|
+
position,
|
|
24
|
+
sections,
|
|
25
|
+
borderRadius
|
|
26
|
+
}) {
|
|
27
|
+
this.context = void 0;
|
|
28
|
+
this.position = 0;
|
|
29
|
+
this.sections = 0;
|
|
30
|
+
this.isHorizontal = false;
|
|
31
|
+
this.gap = 0;
|
|
32
|
+
this.borderRadius = 0;
|
|
33
|
+
this.points = [];
|
|
34
|
+
this.context = context;
|
|
35
|
+
this.isHorizontal = isHorizontal ?? false;
|
|
36
|
+
this.gap = (gap ?? 0) / 2;
|
|
37
|
+
this.position = position ?? 0;
|
|
38
|
+
this.sections = sections ?? 1;
|
|
39
|
+
this.borderRadius = borderRadius ?? 0;
|
|
40
|
+
}
|
|
41
|
+
areaStart() {}
|
|
42
|
+
areaEnd() {}
|
|
43
|
+
lineStart() {}
|
|
44
|
+
lineEnd() {}
|
|
45
|
+
getBorderRadius() {
|
|
46
|
+
if (this.gap > 0) {
|
|
47
|
+
return this.borderRadius;
|
|
48
|
+
}
|
|
49
|
+
if (this.position === 0) {
|
|
50
|
+
return [0, 0, this.borderRadius, this.borderRadius];
|
|
51
|
+
}
|
|
52
|
+
if (this.position === this.sections - 1) {
|
|
53
|
+
return [this.borderRadius, this.borderRadius];
|
|
54
|
+
}
|
|
55
|
+
return 0;
|
|
56
|
+
}
|
|
57
|
+
point(xIn, yIn) {
|
|
58
|
+
this.points.push({
|
|
59
|
+
x: xIn,
|
|
60
|
+
y: yIn
|
|
61
|
+
});
|
|
62
|
+
if (this.points.length < 4) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Add gaps where they are needed.
|
|
67
|
+
this.points = this.points.map((point, index) => {
|
|
68
|
+
const slopeStart = this.points.at(index <= 1 ? 0 : 2);
|
|
69
|
+
const slopeEnd = this.points.at(index <= 1 ? 1 : 3);
|
|
70
|
+
if (this.isHorizontal) {
|
|
71
|
+
const yGetter = (0, _utils.lerpY)(slopeStart.x - this.gap, slopeStart.y, slopeEnd.x - this.gap, slopeEnd.y);
|
|
72
|
+
const xGap = point.x + (index === 0 || index === 3 ? this.gap : -this.gap);
|
|
73
|
+
return {
|
|
74
|
+
x: xGap,
|
|
75
|
+
y: yGetter(xGap)
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const xGetter = (0, _utils.lerpX)(slopeStart.x, slopeStart.y - this.gap, slopeEnd.x, slopeEnd.y - this.gap);
|
|
79
|
+
const yGap = point.y + (index === 0 || index === 3 ? this.gap : -this.gap);
|
|
80
|
+
return {
|
|
81
|
+
x: xGetter(yGap),
|
|
82
|
+
y: yGap
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
(0, _borderRadiusPolygon.borderRadiusPolygon)(this.context, this.points, this.getBorderRadius());
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.Linear = Linear;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CurveGenerator } from '@mui/x-charts-vendor/d3-shape';
|
|
2
|
+
import { CurveOptions } from "./curve.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* This is a custom "pyramid" curve generator.
|
|
5
|
+
* It draws straight lines for the 4 provided points. The slopes are calculated
|
|
6
|
+
* based on the min and max values of the x and y axes.
|
|
7
|
+
* with the option to add a gap between sections while also properly handling the border radius.
|
|
8
|
+
*/
|
|
9
|
+
export declare class Pyramid implements CurveGenerator {
|
|
10
|
+
private context;
|
|
11
|
+
private position;
|
|
12
|
+
private sections;
|
|
13
|
+
private isHorizontal;
|
|
14
|
+
private gap;
|
|
15
|
+
private borderRadius;
|
|
16
|
+
private min;
|
|
17
|
+
private max;
|
|
18
|
+
private points;
|
|
19
|
+
constructor(context: CanvasRenderingContext2D, {
|
|
20
|
+
isHorizontal,
|
|
21
|
+
gap,
|
|
22
|
+
position,
|
|
23
|
+
sections,
|
|
24
|
+
borderRadius,
|
|
25
|
+
min,
|
|
26
|
+
max
|
|
27
|
+
}: CurveOptions);
|
|
28
|
+
areaStart(): void;
|
|
29
|
+
areaEnd(): void;
|
|
30
|
+
lineStart(): void;
|
|
31
|
+
lineEnd(): void;
|
|
32
|
+
protected getBorderRadius(): number | number[];
|
|
33
|
+
point(xIn: number, yIn: number): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Pyramid = void 0;
|
|
7
|
+
var _borderRadiusPolygon = require("./borderRadiusPolygon");
|
|
8
|
+
var _utils = require("./utils");
|
|
9
|
+
/* eslint-disable class-methods-use-this */
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This is a custom "pyramid" curve generator.
|
|
13
|
+
* It draws straight lines for the 4 provided points. The slopes are calculated
|
|
14
|
+
* based on the min and max values of the x and y axes.
|
|
15
|
+
* with the option to add a gap between sections while also properly handling the border radius.
|
|
16
|
+
*/
|
|
17
|
+
class Pyramid {
|
|
18
|
+
constructor(context, {
|
|
19
|
+
isHorizontal,
|
|
20
|
+
gap,
|
|
21
|
+
position,
|
|
22
|
+
sections,
|
|
23
|
+
borderRadius,
|
|
24
|
+
min,
|
|
25
|
+
max
|
|
26
|
+
}) {
|
|
27
|
+
this.context = void 0;
|
|
28
|
+
this.position = 0;
|
|
29
|
+
this.sections = 0;
|
|
30
|
+
this.isHorizontal = false;
|
|
31
|
+
this.gap = 0;
|
|
32
|
+
this.borderRadius = 0;
|
|
33
|
+
this.min = {
|
|
34
|
+
x: 0,
|
|
35
|
+
y: 0
|
|
36
|
+
};
|
|
37
|
+
this.max = {
|
|
38
|
+
x: 0,
|
|
39
|
+
y: 0
|
|
40
|
+
};
|
|
41
|
+
this.points = [];
|
|
42
|
+
this.context = context;
|
|
43
|
+
this.isHorizontal = isHorizontal ?? false;
|
|
44
|
+
this.gap = (gap ?? 0) / 2;
|
|
45
|
+
this.position = position ?? 0;
|
|
46
|
+
this.sections = sections ?? 1;
|
|
47
|
+
this.borderRadius = borderRadius ?? 0;
|
|
48
|
+
this.min = min ?? {
|
|
49
|
+
x: 0,
|
|
50
|
+
y: 0
|
|
51
|
+
};
|
|
52
|
+
this.max = max ?? {
|
|
53
|
+
x: 0,
|
|
54
|
+
y: 0
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
areaStart() {}
|
|
58
|
+
areaEnd() {}
|
|
59
|
+
lineStart() {}
|
|
60
|
+
lineEnd() {}
|
|
61
|
+
getBorderRadius() {
|
|
62
|
+
if (this.gap > 0) {
|
|
63
|
+
return this.borderRadius;
|
|
64
|
+
}
|
|
65
|
+
if (this.position === 0) {
|
|
66
|
+
return [0, 0, this.borderRadius, this.borderRadius];
|
|
67
|
+
}
|
|
68
|
+
if (this.position === this.sections - 1 && this.gap <= 0) {
|
|
69
|
+
return [this.borderRadius];
|
|
70
|
+
}
|
|
71
|
+
if (this.position === this.sections - 1) {
|
|
72
|
+
return [this.borderRadius, this.borderRadius];
|
|
73
|
+
}
|
|
74
|
+
return 0;
|
|
75
|
+
}
|
|
76
|
+
point(xIn, yIn) {
|
|
77
|
+
this.points.push({
|
|
78
|
+
x: xIn,
|
|
79
|
+
y: yIn
|
|
80
|
+
});
|
|
81
|
+
if (this.points.length < 4) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Add gaps where they are needed.
|
|
86
|
+
this.points = this.points.map((point, index) => {
|
|
87
|
+
if (this.isHorizontal) {
|
|
88
|
+
const slopeEnd = {
|
|
89
|
+
x: this.max.x,
|
|
90
|
+
y: (this.max.y + this.min.y) / 2
|
|
91
|
+
};
|
|
92
|
+
const slopeStart = index <= 1 ? this.min : {
|
|
93
|
+
x: this.min.x,
|
|
94
|
+
y: this.max.y
|
|
95
|
+
};
|
|
96
|
+
const yGetter = (0, _utils.lerpY)(slopeStart.x, slopeStart.y, slopeEnd.x, slopeEnd.y);
|
|
97
|
+
const xGap = point.x + (index === 0 || index === 3 ? this.gap : -this.gap);
|
|
98
|
+
return {
|
|
99
|
+
x: xGap,
|
|
100
|
+
y: yGetter(xGap)
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const slopeEnd = {
|
|
104
|
+
x: (this.max.x + this.min.x) / 2,
|
|
105
|
+
y: this.max.y
|
|
106
|
+
};
|
|
107
|
+
const slopeStart = index <= 1 ? {
|
|
108
|
+
x: this.max.x,
|
|
109
|
+
y: this.min.y
|
|
110
|
+
} : this.min;
|
|
111
|
+
const xGetter = (0, _utils.lerpX)(slopeStart.x, slopeStart.y, slopeEnd.x, slopeEnd.y);
|
|
112
|
+
const yGap = point.y + (index === 0 || index === 3 ? this.gap : -this.gap);
|
|
113
|
+
return {
|
|
114
|
+
x: xGetter(yGap),
|
|
115
|
+
y: yGap
|
|
116
|
+
};
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
// In the last section, to form a triangle we need 3 points instead of 4
|
|
120
|
+
// Else the algorithm will break.
|
|
121
|
+
if (this.position === this.sections - 1 && this.gap <= 0) {
|
|
122
|
+
this.points = [this.points[0], this.points[1], this.points[3]];
|
|
123
|
+
}
|
|
124
|
+
(0, _borderRadiusPolygon.borderRadiusPolygon)(this.context, this.points, this.getBorderRadius());
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.Pyramid = Pyramid;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CurveGenerator } from '@mui/x-charts-vendor/d3-shape';
|
|
2
|
+
import { CurveOptions } from "./curve.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* This is a custom "step-pyramid" curve generator.
|
|
5
|
+
* It creates a step pyramid, which is a step-like shape with static lengths.
|
|
6
|
+
* It has the option to add a gap between sections while also properly handling the border radius.
|
|
7
|
+
*/
|
|
8
|
+
export declare class StepPyramid implements CurveGenerator {
|
|
9
|
+
private context;
|
|
10
|
+
private position;
|
|
11
|
+
private isHorizontal;
|
|
12
|
+
private gap;
|
|
13
|
+
private borderRadius;
|
|
14
|
+
private min;
|
|
15
|
+
private max;
|
|
16
|
+
private points;
|
|
17
|
+
constructor(context: CanvasRenderingContext2D, {
|
|
18
|
+
isHorizontal,
|
|
19
|
+
gap,
|
|
20
|
+
position,
|
|
21
|
+
borderRadius,
|
|
22
|
+
min,
|
|
23
|
+
max
|
|
24
|
+
}: CurveOptions);
|
|
25
|
+
areaStart(): void;
|
|
26
|
+
areaEnd(): void;
|
|
27
|
+
lineStart(): void;
|
|
28
|
+
lineEnd(): void;
|
|
29
|
+
protected getBorderRadius(): number | number[];
|
|
30
|
+
point(xIn: number, yIn: number): void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.StepPyramid = void 0;
|
|
7
|
+
var _borderRadiusPolygon = require("./borderRadiusPolygon");
|
|
8
|
+
var _utils = require("./utils");
|
|
9
|
+
/* eslint-disable class-methods-use-this */
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This is a custom "step-pyramid" curve generator.
|
|
13
|
+
* It creates a step pyramid, which is a step-like shape with static lengths.
|
|
14
|
+
* It has the option to add a gap between sections while also properly handling the border radius.
|
|
15
|
+
*/
|
|
16
|
+
class StepPyramid {
|
|
17
|
+
constructor(context, {
|
|
18
|
+
isHorizontal,
|
|
19
|
+
gap,
|
|
20
|
+
position,
|
|
21
|
+
borderRadius,
|
|
22
|
+
min,
|
|
23
|
+
max
|
|
24
|
+
}) {
|
|
25
|
+
this.context = void 0;
|
|
26
|
+
this.position = 0;
|
|
27
|
+
this.isHorizontal = false;
|
|
28
|
+
this.gap = 0;
|
|
29
|
+
this.borderRadius = 0;
|
|
30
|
+
this.min = {
|
|
31
|
+
x: 0,
|
|
32
|
+
y: 0
|
|
33
|
+
};
|
|
34
|
+
this.max = {
|
|
35
|
+
x: 0,
|
|
36
|
+
y: 0
|
|
37
|
+
};
|
|
38
|
+
this.points = [];
|
|
39
|
+
this.context = context;
|
|
40
|
+
this.isHorizontal = isHorizontal ?? false;
|
|
41
|
+
this.gap = (gap ?? 0) / 2;
|
|
42
|
+
this.position = position ?? 0;
|
|
43
|
+
this.borderRadius = borderRadius ?? 0;
|
|
44
|
+
this.min = min ?? {
|
|
45
|
+
x: 0,
|
|
46
|
+
y: 0
|
|
47
|
+
};
|
|
48
|
+
this.max = max ?? {
|
|
49
|
+
x: 0,
|
|
50
|
+
y: 0
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
areaStart() {}
|
|
54
|
+
areaEnd() {}
|
|
55
|
+
lineStart() {}
|
|
56
|
+
lineEnd() {}
|
|
57
|
+
getBorderRadius() {
|
|
58
|
+
return this.gap > 0 || this.position === 0 ? this.borderRadius : [this.borderRadius, this.borderRadius];
|
|
59
|
+
}
|
|
60
|
+
point(xIn, yIn) {
|
|
61
|
+
this.points.push({
|
|
62
|
+
x: xIn,
|
|
63
|
+
y: yIn
|
|
64
|
+
});
|
|
65
|
+
if (this.points.length < 4) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Add gaps where they are needed.
|
|
70
|
+
this.points = this.points.map((point, index) => {
|
|
71
|
+
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
|
+
const yGetter = (0, _utils.lerpY)(slopeStart.x, slopeStart.y, slopeEnd.x, slopeEnd.y);
|
|
81
|
+
const xGap = point.x + (index === 0 || index === 3 ? this.gap : -this.gap);
|
|
82
|
+
const xInitial = index === 0 || index === 1 ? this.points.at(0).x : this.points.at(3).x;
|
|
83
|
+
return {
|
|
84
|
+
x: xGap,
|
|
85
|
+
y: yGetter(xInitial)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
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
|
+
const xGetter = (0, _utils.lerpX)(slopeStart.x, slopeStart.y, slopeEnd.x, slopeEnd.y);
|
|
97
|
+
const yGap = point.y + (index === 0 || index === 3 ? this.gap : -this.gap);
|
|
98
|
+
const yInitial = index === 0 || index === 1 ? this.points.at(0).y : this.points.at(3).y;
|
|
99
|
+
return {
|
|
100
|
+
x: xGetter(yInitial),
|
|
101
|
+
y: yGap
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
(0, _borderRadiusPolygon.borderRadiusPolygon)(this.context, this.points, this.getBorderRadius());
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.StepPyramid = StepPyramid;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CurveGenerator } from '@mui/x-charts-vendor/d3-shape';
|
|
2
|
+
import { CurveOptions } from "./curve.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* This is a custom "step" curve generator.
|
|
5
|
+
* It is used to draw "rectangles" from 4 points without having to rework the rendering logic,
|
|
6
|
+
* with the option to add a gap between sections while also properly handling the border radius.
|
|
7
|
+
*
|
|
8
|
+
* It takes the min and max of the x and y coordinates of the points to create a rectangle.
|
|
9
|
+
*
|
|
10
|
+
* The implementation is based on the d3-shape step curve generator.
|
|
11
|
+
* https://github.com/d3/d3-shape/blob/a82254af78f08799c71d7ab25df557c4872a3c51/src/curve/step.js
|
|
12
|
+
*/
|
|
13
|
+
export declare class Step implements CurveGenerator {
|
|
14
|
+
private context;
|
|
15
|
+
private isHorizontal;
|
|
16
|
+
private gap;
|
|
17
|
+
private borderRadius;
|
|
18
|
+
private position;
|
|
19
|
+
private points;
|
|
20
|
+
constructor(context: CanvasRenderingContext2D, {
|
|
21
|
+
isHorizontal,
|
|
22
|
+
gap,
|
|
23
|
+
position,
|
|
24
|
+
borderRadius
|
|
25
|
+
}: CurveOptions);
|
|
26
|
+
areaStart(): void;
|
|
27
|
+
areaEnd(): void;
|
|
28
|
+
lineStart(): void;
|
|
29
|
+
lineEnd(): void;
|
|
30
|
+
protected getBorderRadius(): number | number[];
|
|
31
|
+
point(xIn: number, yIn: number): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Step = void 0;
|
|
7
|
+
var _borderRadiusPolygon = require("./borderRadiusPolygon");
|
|
8
|
+
var _utils = require("./utils");
|
|
9
|
+
/* eslint-disable class-methods-use-this */
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This is a custom "step" curve generator.
|
|
13
|
+
* It is used to draw "rectangles" from 4 points without having to rework the rendering logic,
|
|
14
|
+
* with the option to add a gap between sections while also properly handling the border radius.
|
|
15
|
+
*
|
|
16
|
+
* It takes the min and max of the x and y coordinates of the points to create a rectangle.
|
|
17
|
+
*
|
|
18
|
+
* The implementation is based on the d3-shape step curve generator.
|
|
19
|
+
* https://github.com/d3/d3-shape/blob/a82254af78f08799c71d7ab25df557c4872a3c51/src/curve/step.js
|
|
20
|
+
*/
|
|
21
|
+
class Step {
|
|
22
|
+
constructor(context, {
|
|
23
|
+
isHorizontal,
|
|
24
|
+
gap,
|
|
25
|
+
position,
|
|
26
|
+
borderRadius
|
|
27
|
+
}) {
|
|
28
|
+
this.context = void 0;
|
|
29
|
+
this.isHorizontal = false;
|
|
30
|
+
this.gap = 0;
|
|
31
|
+
this.borderRadius = 0;
|
|
32
|
+
this.position = 0;
|
|
33
|
+
this.points = [];
|
|
34
|
+
this.context = context;
|
|
35
|
+
this.isHorizontal = isHorizontal ?? false;
|
|
36
|
+
this.gap = (gap ?? 0) / 2;
|
|
37
|
+
this.position = position ?? 0;
|
|
38
|
+
this.borderRadius = borderRadius ?? 0;
|
|
39
|
+
}
|
|
40
|
+
areaStart() {}
|
|
41
|
+
areaEnd() {}
|
|
42
|
+
lineStart() {}
|
|
43
|
+
lineEnd() {}
|
|
44
|
+
getBorderRadius() {
|
|
45
|
+
return this.gap > 0 || this.position === 0 ? this.borderRadius : [this.borderRadius, this.borderRadius];
|
|
46
|
+
}
|
|
47
|
+
point(xIn, yIn) {
|
|
48
|
+
this.points.push({
|
|
49
|
+
x: xIn,
|
|
50
|
+
y: yIn
|
|
51
|
+
});
|
|
52
|
+
if (this.points.length < 4) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Ensure we have rectangles instead of trapezoids.
|
|
57
|
+
this.points = this.points.map((_, index) => {
|
|
58
|
+
const allX = this.points.map(p => p.x);
|
|
59
|
+
const allY = this.points.map(p => p.y);
|
|
60
|
+
if (this.isHorizontal) {
|
|
61
|
+
return {
|
|
62
|
+
x: index === 1 || index === 2 ? (0, _utils.max)(allX) : (0, _utils.min)(allX),
|
|
63
|
+
y: index <= 1 ? (0, _utils.max)(allY) : (0, _utils.min)(allY)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
x: index <= 1 ? (0, _utils.min)(allX) : (0, _utils.max)(allX),
|
|
68
|
+
y: index === 1 || index === 2 ? (0, _utils.max)(allY) : (0, _utils.min)(allY)
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// Add gaps where they are needed.
|
|
73
|
+
this.points = this.points.map((point, index) => {
|
|
74
|
+
if (this.isHorizontal) {
|
|
75
|
+
return {
|
|
76
|
+
x: point.x + (index === 0 || index === 3 ? this.gap : -this.gap),
|
|
77
|
+
y: point.y
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
x: point.x,
|
|
82
|
+
y: point.y + (index === 0 || index === 3 ? this.gap : -this.gap)
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
(0, _borderRadiusPolygon.borderRadiusPolygon)(this.context, this.points, this.getBorderRadius());
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.Step = Step;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const max: (numbers: number[]) => number;
|
|
2
|
+
export declare const min: (numbers: number[]) => number;
|
|
3
|
+
export declare const lerpX: (x1: number, y1: number, x2: number, y2: number) => (y: number) => number;
|
|
4
|
+
export declare const lerpY: (x1: number, y1: number, x2: number, y2: number) => (x: number) => number;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.min = exports.max = exports.lerpY = exports.lerpX = void 0;
|
|
7
|
+
const max = numbers => Math.max(...numbers, -Infinity);
|
|
8
|
+
exports.max = max;
|
|
9
|
+
const min = numbers => Math.min(...numbers, Infinity);
|
|
10
|
+
// From point1 to point2, get the x value from y
|
|
11
|
+
exports.min = min;
|
|
12
|
+
const lerpX = (x1, y1, x2, y2) => y => {
|
|
13
|
+
if (y1 === y2) {
|
|
14
|
+
return x1;
|
|
15
|
+
}
|
|
16
|
+
const result = (x2 - x1) * (y - y1) / (y2 - y1) + x1;
|
|
17
|
+
return Number.isNaN(result) ? 0 : result;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// From point1 to point2, get the y value from x
|
|
21
|
+
exports.lerpX = lerpX;
|
|
22
|
+
const lerpY = (x1, y1, x2, y2) => x => {
|
|
23
|
+
if (x1 === x2) {
|
|
24
|
+
return y1;
|
|
25
|
+
}
|
|
26
|
+
const result = (y2 - y1) * (x - x1) / (x2 - x1) + y1;
|
|
27
|
+
return Number.isNaN(result) ? 0 : result;
|
|
28
|
+
};
|
|
29
|
+
exports.lerpY = lerpY;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ChartsLabelMarkProps } from '@mui/x-charts/ChartsLabel';
|
|
2
2
|
import { CommonSeriesType, CartesianSeriesType, CommonDefaultizedProps, SeriesId } from '@mui/x-charts/internals';
|
|
3
|
-
import {
|
|
3
|
+
import { Position } from '@mui/x-charts/models';
|
|
4
4
|
import { DefaultizedProps, MakeRequired } from '@mui/x-internals/types';
|
|
5
|
+
import { FunnelCurveType } from "./curves/index.js";
|
|
5
6
|
export type FunnelItemId = string | number;
|
|
6
|
-
export type FunnelCurveType = Extract<CurveType, 'linear' | 'step'> | 'bump';
|
|
7
7
|
export type FunnelValueType = {
|
|
8
8
|
/**
|
|
9
9
|
* A unique identifier of the funnel section.
|
|
@@ -43,11 +43,23 @@ export interface FunnelSeriesType extends Omit<CommonSeriesType<FunnelValueType>
|
|
|
43
43
|
*/
|
|
44
44
|
layout?: 'horizontal' | 'vertical';
|
|
45
45
|
/**
|
|
46
|
-
* The type of curve to use for the line.
|
|
47
|
-
*
|
|
46
|
+
* The type of curve to use for the line.
|
|
47
|
+
*
|
|
48
|
+
* - `bump`: A curve that creates a smooth transition between points, with a bump in the middle.
|
|
49
|
+
* - `linear`: A straight line between points.
|
|
50
|
+
* - `step`: A step line that creates a staircase effect.
|
|
51
|
+
* - `pyramid`: A pyramid shape that connects the points.
|
|
52
|
+
* - `step-pyramid`: A step line that creates a staircase effect, with a pyramid shape.
|
|
53
|
+
*
|
|
54
|
+
* Read more about curves at [curve interpolation](https://mui.com/x/react-charts/funnel/#curve-interpolation).
|
|
48
55
|
* @default 'linear'
|
|
49
56
|
*/
|
|
50
57
|
curve?: FunnelCurveType;
|
|
58
|
+
/**
|
|
59
|
+
* The radius, in pixels, of the corners of the funnel sections.
|
|
60
|
+
* @default 8
|
|
61
|
+
*/
|
|
62
|
+
borderRadius?: number;
|
|
51
63
|
/**
|
|
52
64
|
* The label configuration for the funnel plot.
|
|
53
65
|
* Allows to customize the position and margin of the label that is displayed on the funnel sections.
|
|
@@ -56,6 +68,15 @@ export interface FunnelSeriesType extends Omit<CommonSeriesType<FunnelValueType>
|
|
|
56
68
|
* @default { vertical: 'middle', horizontal: 'center' }
|
|
57
69
|
*/
|
|
58
70
|
sectionLabel?: FunnelLabelOptions | ((item: FunnelItem) => FunnelLabelOptions | false) | false;
|
|
71
|
+
/**
|
|
72
|
+
* Defines if the funnel sections are filled or outlined.
|
|
73
|
+
*
|
|
74
|
+
* An `outlined` funnel will have a stroke around the sections and a translucent fill.
|
|
75
|
+
* A `filled` funnel will have a solid fill and no stroke.
|
|
76
|
+
*
|
|
77
|
+
* @default 'filled'
|
|
78
|
+
*/
|
|
79
|
+
variant?: 'filled' | 'outlined';
|
|
59
80
|
}
|
|
60
81
|
/**
|
|
61
82
|
* An object that allows to identify a funnel item.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FunnelSectionProps } from
|
|
1
|
+
import type { FunnelSectionProps } from "./FunnelSection.js";
|
|
2
2
|
export interface FunnelSectionClasses {
|
|
3
3
|
/** Styles applied to the root element. */
|
|
4
4
|
root: string;
|
|
@@ -6,6 +6,10 @@ export interface FunnelSectionClasses {
|
|
|
6
6
|
highlighted: string;
|
|
7
7
|
/** Styles applied to the root element if `faded={true}`. */
|
|
8
8
|
faded: string;
|
|
9
|
+
/** Styles applied to the root element if `variant="filled"`. */
|
|
10
|
+
filled: string;
|
|
11
|
+
/** Styles applied to the root element if `variant="outlined"`. */
|
|
12
|
+
outlined: string;
|
|
9
13
|
/** Styles applied to the label element. */
|
|
10
14
|
label: string;
|
|
11
15
|
/**
|
|
@@ -14,5 +18,5 @@ export interface FunnelSectionClasses {
|
|
|
14
18
|
*/
|
|
15
19
|
series: string;
|
|
16
20
|
}
|
|
17
|
-
export declare const useUtilityClasses: (props: FunnelSectionProps) => Record<"label" | "highlighted" | "faded" | "root", string>;
|
|
21
|
+
export declare const useUtilityClasses: (props: FunnelSectionProps) => Record<"label" | "filled" | "outlined" | "highlighted" | "faded" | "root", string>;
|
|
18
22
|
export declare const funnelSectionClasses: FunnelSectionClasses;
|
|
@@ -14,15 +14,18 @@ function getFunnelSectionUtilityClass(slot) {
|
|
|
14
14
|
const useUtilityClasses = props => {
|
|
15
15
|
const {
|
|
16
16
|
classes,
|
|
17
|
-
seriesId
|
|
17
|
+
seriesId,
|
|
18
|
+
variant
|
|
18
19
|
} = props;
|
|
19
20
|
const slots = {
|
|
20
21
|
root: ['root', `series-${seriesId}`],
|
|
21
22
|
highlighted: ['highlighted'],
|
|
22
23
|
faded: ['faded'],
|
|
24
|
+
outlined: variant === 'outlined' ? ['outlined'] : [],
|
|
25
|
+
filled: variant === 'filled' ? ['filled'] : [],
|
|
23
26
|
label: ['label']
|
|
24
27
|
};
|
|
25
28
|
return (0, _composeClasses.default)(slots, getFunnelSectionUtilityClass, classes);
|
|
26
29
|
};
|
|
27
30
|
exports.useUtilityClasses = useUtilityClasses;
|
|
28
|
-
const funnelSectionClasses = exports.funnelSectionClasses = (0, _generateUtilityClasses.default)('MuiFunnelSection', ['root', 'highlighted', 'faded', 'label', 'series']);
|
|
31
|
+
const funnelSectionClasses = exports.funnelSectionClasses = (0, _generateUtilityClasses.default)('MuiFunnelSection', ['root', 'highlighted', 'faded', 'filled', 'outlined', 'label', 'series']);
|
package/FunnelChart/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { FunnelChart as Unstable_FunnelChart } from "./FunnelChart.js";
|
|
2
|
-
export type { FunnelChartProps } from
|
|
2
|
+
export type { FunnelChartProps } from "./FunnelChart.js";
|
|
3
3
|
export * from "./FunnelPlot.js";
|
|
4
4
|
export * from "./funnel.types.js";
|
|
5
5
|
export * from "./categoryAxis.types.js";
|
|
6
6
|
export * from "./funnelSlots.types.js";
|
|
7
|
+
export type { FunnelCurveType } from "./curves/index.js";
|
|
7
8
|
export { funnelSectionClasses } from "./funnelSectionClasses.js";
|
|
8
|
-
export type { FunnelSectionClasses } from
|
|
9
|
+
export type { FunnelSectionClasses } from "./funnelSectionClasses.js";
|
|
@@ -10,6 +10,7 @@ const getSeriesWithDefaultValues = (seriesData, seriesIndex, colors) => {
|
|
|
10
10
|
return (0, _extends2.default)({
|
|
11
11
|
id: seriesData.id ?? `auto-generated-id-${seriesIndex}`
|
|
12
12
|
}, seriesData, {
|
|
13
|
+
borderRadius: seriesData.borderRadius ?? 8,
|
|
13
14
|
data: seriesData.data.map((d, index) => (0, _extends2.default)({
|
|
14
15
|
color: colors[index % colors.length]
|
|
15
16
|
}, d))
|