@mui/x-charts 7.0.0-beta.1 → 7.0.0-beta.3
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/BarChart/BarChart.d.ts +21 -5
- package/BarChart/BarChart.js +37 -13
- package/BarChart/BarElement.d.ts +20 -13
- package/BarChart/BarElement.js +1 -0
- package/BarChart/BarPlot.d.ts +3 -5
- package/BarChart/BarPlot.js +9 -10
- package/CHANGELOG.md +223 -1
- package/ChartContainer/ChartContainer.js +6 -4
- package/ChartsAxis/ChartsAxis.js +4 -4
- package/ChartsGrid/ChartsGrid.d.ts +30 -0
- package/ChartsGrid/ChartsGrid.js +128 -0
- package/ChartsGrid/chartsGridClasses.d.ts +13 -0
- package/ChartsGrid/chartsGridClasses.js +14 -0
- package/ChartsGrid/index.d.ts +2 -0
- package/ChartsGrid/index.js +27 -0
- package/ChartsGrid/package.json +6 -0
- package/ChartsLegend/ChartsLegend.d.ts +5 -54
- package/ChartsLegend/ChartsLegend.js +2 -307
- package/ChartsLegend/DefaultChartsLegend.d.ts +60 -0
- package/ChartsLegend/DefaultChartsLegend.js +294 -0
- package/ChartsLegend/index.d.ts +1 -0
- package/ChartsLegend/index.js +11 -0
- package/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/ChartsReferenceLine/common.d.ts +2 -1
- package/ChartsSurface.js +6 -4
- package/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/ChartsTooltip/utils.d.ts +1 -0
- package/ChartsTooltip/utils.js +7 -0
- package/ChartsXAxis/ChartsXAxis.js +15 -11
- package/ChartsYAxis/ChartsYAxis.js +3 -3
- package/Gauge/Gauge.d.ts +13 -0
- package/Gauge/Gauge.js +156 -0
- package/Gauge/GaugeContainer.d.ts +19 -0
- package/Gauge/GaugeContainer.js +216 -0
- package/Gauge/GaugeProvider.d.ts +117 -0
- package/Gauge/GaugeProvider.js +96 -0
- package/Gauge/GaugeReferenceArc.d.ts +2 -0
- package/Gauge/GaugeReferenceArc.js +44 -0
- package/Gauge/GaugeValueArc.d.ts +2 -0
- package/Gauge/GaugeValueArc.js +51 -0
- package/Gauge/GaugeValueText.d.ts +15 -0
- package/Gauge/GaugeValueText.js +77 -0
- package/Gauge/gaugeClasses.d.ts +14 -0
- package/Gauge/gaugeClasses.js +15 -0
- package/Gauge/index.d.ts +7 -0
- package/Gauge/index.js +87 -0
- package/Gauge/package.json +6 -0
- package/Gauge/utils.d.ts +19 -0
- package/Gauge/utils.js +75 -0
- package/LineChart/AnimatedArea.js +1 -1
- package/LineChart/AnimatedLine.js +1 -1
- package/LineChart/AreaElement.d.ts +2 -1
- package/LineChart/AreaElement.js +1 -1
- package/LineChart/LineChart.d.ts +24 -5
- package/LineChart/LineChart.js +41 -13
- package/LineChart/LineElement.d.ts +2 -1
- package/LineChart/LineElement.js +1 -1
- package/LineChart/LineHighlightElement.d.ts +3 -2
- package/LineChart/LineHighlightElement.js +2 -1
- package/LineChart/MarkElement.d.ts +3 -2
- package/LineChart/MarkElement.js +1 -0
- package/PieChart/PieArc.d.ts +7 -6
- package/PieChart/PieArc.js +10 -9
- package/PieChart/PieArcLabel.d.ts +3 -2
- package/PieChart/PieArcLabel.js +1 -0
- package/PieChart/PieArcLabelPlot.js +14 -14
- package/PieChart/PieArcPlot.js +1 -1
- package/PieChart/PieChart.d.ts +22 -0
- package/PieChart/PieChart.js +32 -8
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -70
- package/ResponsiveChartContainer/useChartContainerDimensions.d.ts +2 -0
- package/ResponsiveChartContainer/useChartContainerDimensions.js +76 -0
- package/ScatterChart/ScatterChart.d.ts +18 -0
- package/ScatterChart/ScatterChart.js +35 -8
- package/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.js +5 -4
- package/context/CartesianContextProvider.js +8 -6
- package/esm/BarChart/BarChart.js +37 -13
- package/esm/BarChart/BarElement.js +1 -0
- package/esm/BarChart/BarPlot.js +8 -10
- package/esm/ChartContainer/ChartContainer.js +6 -4
- package/esm/ChartsAxis/ChartsAxis.js +4 -4
- package/esm/ChartsGrid/ChartsGrid.js +121 -0
- package/esm/ChartsGrid/chartsGridClasses.js +6 -0
- package/esm/ChartsGrid/index.js +2 -0
- package/esm/ChartsLegend/ChartsLegend.js +2 -307
- package/esm/ChartsLegend/DefaultChartsLegend.js +286 -0
- package/esm/ChartsLegend/index.js +1 -0
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/esm/ChartsSurface.js +6 -4
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/esm/ChartsTooltip/utils.js +6 -0
- package/esm/ChartsXAxis/ChartsXAxis.js +14 -10
- package/esm/ChartsYAxis/ChartsYAxis.js +2 -2
- package/esm/Gauge/Gauge.js +149 -0
- package/esm/Gauge/GaugeContainer.js +211 -0
- package/esm/Gauge/GaugeProvider.js +85 -0
- package/esm/Gauge/GaugeReferenceArc.js +35 -0
- package/esm/Gauge/GaugeValueArc.js +42 -0
- package/esm/Gauge/GaugeValueText.js +69 -0
- package/esm/Gauge/gaugeClasses.js +7 -0
- package/esm/Gauge/index.js +7 -0
- package/esm/Gauge/utils.js +68 -0
- package/esm/LineChart/AnimatedArea.js +1 -1
- package/esm/LineChart/AnimatedLine.js +1 -1
- package/esm/LineChart/AreaElement.js +1 -1
- package/esm/LineChart/LineChart.js +41 -13
- package/esm/LineChart/LineElement.js +1 -1
- package/esm/LineChart/LineHighlightElement.js +2 -1
- package/esm/LineChart/MarkElement.js +1 -0
- package/esm/PieChart/PieArc.js +10 -9
- package/esm/PieChart/PieArcLabel.js +1 -0
- package/esm/PieChart/PieArcLabelPlot.js +14 -14
- package/esm/PieChart/PieArcPlot.js +1 -1
- package/esm/PieChart/PieChart.js +32 -8
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -70
- package/esm/ResponsiveChartContainer/useChartContainerDimensions.js +66 -0
- package/esm/ScatterChart/ScatterChart.js +35 -8
- package/esm/SparkLineChart/SparkLineChart.js +5 -4
- package/esm/context/CartesianContextProvider.js +8 -6
- package/esm/hooks/useTicks.js +2 -3
- package/esm/index.js +2 -0
- package/hooks/useTicks.d.ts +1 -2
- package/hooks/useTicks.js +2 -3
- package/index.d.ts +2 -0
- package/index.js +23 -1
- package/internals/defaultizeColor.d.ts +16 -16
- package/internals/defaultizeValueFormatter.d.ts +4 -7
- package/internals/stackSeries.d.ts +4 -7
- package/legacy/BarChart/BarChart.js +37 -13
- package/legacy/BarChart/BarElement.js +1 -0
- package/legacy/BarChart/BarPlot.js +10 -10
- package/legacy/ChartContainer/ChartContainer.js +6 -4
- package/legacy/ChartsAxis/ChartsAxis.js +4 -4
- package/legacy/ChartsGrid/ChartsGrid.js +119 -0
- package/legacy/ChartsGrid/chartsGridClasses.js +6 -0
- package/legacy/ChartsGrid/index.js +2 -0
- package/legacy/ChartsLegend/ChartsLegend.js +2 -323
- package/legacy/ChartsLegend/DefaultChartsLegend.js +302 -0
- package/legacy/ChartsLegend/index.js +1 -0
- package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/legacy/ChartsSurface.js +5 -3
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
- package/legacy/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
- package/legacy/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/legacy/ChartsTooltip/utils.js +6 -0
- package/legacy/ChartsXAxis/ChartsXAxis.js +13 -9
- package/legacy/ChartsYAxis/ChartsYAxis.js +2 -2
- package/legacy/Gauge/Gauge.js +146 -0
- package/legacy/Gauge/GaugeContainer.js +215 -0
- package/legacy/Gauge/GaugeProvider.js +87 -0
- package/legacy/Gauge/GaugeReferenceArc.js +37 -0
- package/legacy/Gauge/GaugeValueArc.js +44 -0
- package/legacy/Gauge/GaugeValueText.js +66 -0
- package/legacy/Gauge/gaugeClasses.js +7 -0
- package/legacy/Gauge/index.js +7 -0
- package/legacy/Gauge/utils.js +84 -0
- package/legacy/LineChart/AnimatedArea.js +1 -1
- package/legacy/LineChart/AnimatedLine.js +1 -1
- package/legacy/LineChart/AreaElement.js +1 -1
- package/legacy/LineChart/LineChart.js +41 -13
- package/legacy/LineChart/LineElement.js +1 -1
- package/legacy/LineChart/LineHighlightElement.js +2 -1
- package/legacy/LineChart/MarkElement.js +1 -0
- package/legacy/PieChart/PieArc.js +11 -10
- package/legacy/PieChart/PieArcLabel.js +1 -0
- package/legacy/PieChart/PieArcLabelPlot.js +15 -15
- package/legacy/PieChart/PieArcPlot.js +1 -1
- package/legacy/PieChart/PieChart.js +32 -8
- package/legacy/ResponsiveChartContainer/ResponsiveChartContainer.js +13 -81
- package/legacy/ResponsiveChartContainer/useChartContainerDimensions.js +73 -0
- package/legacy/ScatterChart/ScatterChart.js +35 -8
- package/legacy/SparkLineChart/SparkLineChart.js +6 -5
- package/legacy/context/CartesianContextProvider.js +8 -6
- package/legacy/hooks/useTicks.js +2 -3
- package/legacy/index.js +3 -1
- package/models/axis.d.ts +7 -2
- package/models/seriesType/common.d.ts +2 -1
- package/models/seriesType/config.d.ts +7 -12
- package/models/seriesType/line.d.ts +2 -2
- package/models/seriesType/pie.d.ts +7 -3
- package/models/seriesType/scatter.d.ts +5 -2
- package/modern/BarChart/BarChart.js +37 -13
- package/modern/BarChart/BarElement.js +1 -0
- package/modern/BarChart/BarPlot.js +8 -10
- package/modern/ChartContainer/ChartContainer.js +6 -4
- package/modern/ChartsAxis/ChartsAxis.js +4 -4
- package/modern/ChartsGrid/ChartsGrid.js +121 -0
- package/modern/ChartsGrid/chartsGridClasses.js +6 -0
- package/modern/ChartsGrid/index.js +2 -0
- package/modern/ChartsLegend/ChartsLegend.js +2 -307
- package/modern/ChartsLegend/DefaultChartsLegend.js +286 -0
- package/modern/ChartsLegend/index.js +1 -0
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +2 -2
- package/modern/ChartsSurface.js +6 -4
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +2 -2
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +2 -2
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/modern/ChartsTooltip/utils.js +6 -0
- package/modern/ChartsXAxis/ChartsXAxis.js +14 -10
- package/modern/ChartsYAxis/ChartsYAxis.js +2 -2
- package/modern/Gauge/Gauge.js +149 -0
- package/modern/Gauge/GaugeContainer.js +208 -0
- package/modern/Gauge/GaugeProvider.js +85 -0
- package/modern/Gauge/GaugeReferenceArc.js +35 -0
- package/modern/Gauge/GaugeValueArc.js +42 -0
- package/modern/Gauge/GaugeValueText.js +69 -0
- package/modern/Gauge/gaugeClasses.js +7 -0
- package/modern/Gauge/index.js +7 -0
- package/modern/Gauge/utils.js +68 -0
- package/modern/LineChart/AnimatedArea.js +1 -1
- package/modern/LineChart/AnimatedLine.js +1 -1
- package/modern/LineChart/AreaElement.js +1 -1
- package/modern/LineChart/LineChart.js +41 -13
- package/modern/LineChart/LineElement.js +1 -1
- package/modern/LineChart/LineHighlightElement.js +2 -1
- package/modern/LineChart/MarkElement.js +1 -0
- package/modern/PieChart/PieArc.js +10 -9
- package/modern/PieChart/PieArcLabel.js +1 -0
- package/modern/PieChart/PieArcLabelPlot.js +14 -14
- package/modern/PieChart/PieArcPlot.js +1 -1
- package/modern/PieChart/PieChart.js +32 -8
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +8 -70
- package/modern/ResponsiveChartContainer/useChartContainerDimensions.js +66 -0
- package/modern/ScatterChart/ScatterChart.js +35 -8
- package/modern/SparkLineChart/SparkLineChart.js +5 -4
- package/modern/context/CartesianContextProvider.js +8 -6
- package/modern/hooks/useTicks.js +2 -3
- package/modern/index.js +3 -1
- package/package.json +4 -4
package/Gauge/index.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
useGaugeState: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "useGaugeState", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _GaugeProvider.useGaugeState;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var _Gauge = require("./Gauge");
|
|
16
|
+
Object.keys(_Gauge).forEach(function (key) {
|
|
17
|
+
if (key === "default" || key === "__esModule") return;
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
19
|
+
if (key in exports && exports[key] === _Gauge[key]) return;
|
|
20
|
+
Object.defineProperty(exports, key, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () {
|
|
23
|
+
return _Gauge[key];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
var _GaugeContainer = require("./GaugeContainer");
|
|
28
|
+
Object.keys(_GaugeContainer).forEach(function (key) {
|
|
29
|
+
if (key === "default" || key === "__esModule") return;
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
31
|
+
if (key in exports && exports[key] === _GaugeContainer[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _GaugeContainer[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _GaugeValueText = require("./GaugeValueText");
|
|
40
|
+
Object.keys(_GaugeValueText).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
43
|
+
if (key in exports && exports[key] === _GaugeValueText[key]) return;
|
|
44
|
+
Object.defineProperty(exports, key, {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function () {
|
|
47
|
+
return _GaugeValueText[key];
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
var _GaugeValueArc = require("./GaugeValueArc");
|
|
52
|
+
Object.keys(_GaugeValueArc).forEach(function (key) {
|
|
53
|
+
if (key === "default" || key === "__esModule") return;
|
|
54
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
55
|
+
if (key in exports && exports[key] === _GaugeValueArc[key]) return;
|
|
56
|
+
Object.defineProperty(exports, key, {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () {
|
|
59
|
+
return _GaugeValueArc[key];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
var _GaugeReferenceArc = require("./GaugeReferenceArc");
|
|
64
|
+
Object.keys(_GaugeReferenceArc).forEach(function (key) {
|
|
65
|
+
if (key === "default" || key === "__esModule") return;
|
|
66
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
67
|
+
if (key in exports && exports[key] === _GaugeReferenceArc[key]) return;
|
|
68
|
+
Object.defineProperty(exports, key, {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () {
|
|
71
|
+
return _GaugeReferenceArc[key];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
var _gaugeClasses = require("./gaugeClasses");
|
|
76
|
+
Object.keys(_gaugeClasses).forEach(function (key) {
|
|
77
|
+
if (key === "default" || key === "__esModule") return;
|
|
78
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
79
|
+
if (key in exports && exports[key] === _gaugeClasses[key]) return;
|
|
80
|
+
Object.defineProperty(exports, key, {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function () {
|
|
83
|
+
return _gaugeClasses[key];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
var _GaugeProvider = require("./GaugeProvider");
|
package/Gauge/utils.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Retruns the ratio of the arc bounding box and its center.
|
|
3
|
+
* @param startAngle The start angle (in deg)
|
|
4
|
+
* @param endAngle The end angle (in deg)
|
|
5
|
+
*/
|
|
6
|
+
export declare function getArcRatios(startAngle: number, endAngle: number): {
|
|
7
|
+
cx: number;
|
|
8
|
+
cy: number;
|
|
9
|
+
minX: number;
|
|
10
|
+
maxX: number;
|
|
11
|
+
minY: number;
|
|
12
|
+
maxY: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function getAvailableRadius(cx: number, cy: number, width: number, height: number, { minX, maxX, minY, maxY, }: {
|
|
15
|
+
minX: number;
|
|
16
|
+
maxX: number;
|
|
17
|
+
minY: number;
|
|
18
|
+
maxY: number;
|
|
19
|
+
}): number;
|
package/Gauge/utils.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getArcRatios = getArcRatios;
|
|
7
|
+
exports.getAvailableRadius = getAvailableRadius;
|
|
8
|
+
function deg2rad(angle) {
|
|
9
|
+
return Math.PI * angle / 180;
|
|
10
|
+
}
|
|
11
|
+
function getPoint(angle) {
|
|
12
|
+
const radAngle = deg2rad(angle);
|
|
13
|
+
return [Math.sin(radAngle), -Math.cos(radAngle)];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Retruns the ratio of the arc bounding box and its center.
|
|
18
|
+
* @param startAngle The start angle (in deg)
|
|
19
|
+
* @param endAngle The end angle (in deg)
|
|
20
|
+
*/
|
|
21
|
+
function getArcRatios(startAngle, endAngle) {
|
|
22
|
+
// Set the start, end and center point.
|
|
23
|
+
const points = [[0, 0], getPoint(startAngle), getPoint(endAngle)];
|
|
24
|
+
|
|
25
|
+
// Add cardinal points included in the arc
|
|
26
|
+
const minAngle = Math.min(startAngle, endAngle);
|
|
27
|
+
const maxAngle = Math.max(startAngle, endAngle);
|
|
28
|
+
const initialAngle = Math.floor(minAngle / 90) * 90;
|
|
29
|
+
for (let step = 1; step <= 4; step += 1) {
|
|
30
|
+
const cartinalAngle = initialAngle + step * 90;
|
|
31
|
+
if (cartinalAngle < maxAngle) {
|
|
32
|
+
points.push(getPoint(cartinalAngle));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const minX = Math.min(...points.map(([x]) => x));
|
|
36
|
+
const maxX = Math.max(...points.map(([x]) => x));
|
|
37
|
+
const minY = Math.min(...points.map(([, y]) => y));
|
|
38
|
+
const maxY = Math.max(...points.map(([, y]) => y));
|
|
39
|
+
return {
|
|
40
|
+
cx: -minX / (maxX - minX),
|
|
41
|
+
cy: -minY / (maxY - minY),
|
|
42
|
+
minX,
|
|
43
|
+
maxX,
|
|
44
|
+
minY,
|
|
45
|
+
maxY
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function getAvailableRadius(cx, cy, width, height, {
|
|
49
|
+
minX,
|
|
50
|
+
maxX,
|
|
51
|
+
minY,
|
|
52
|
+
maxY
|
|
53
|
+
}) {
|
|
54
|
+
return Math.min(...[{
|
|
55
|
+
ratio: Math.abs(minX),
|
|
56
|
+
space: cx
|
|
57
|
+
}, {
|
|
58
|
+
ratio: Math.abs(maxX),
|
|
59
|
+
space: width - cx
|
|
60
|
+
}, {
|
|
61
|
+
ratio: Math.abs(minY),
|
|
62
|
+
space: cy
|
|
63
|
+
}, {
|
|
64
|
+
ratio: Math.abs(maxY),
|
|
65
|
+
space: height - cy
|
|
66
|
+
}].map(({
|
|
67
|
+
ratio,
|
|
68
|
+
space
|
|
69
|
+
}) => {
|
|
70
|
+
if (ratio < 0.00001) {
|
|
71
|
+
return Infinity;
|
|
72
|
+
}
|
|
73
|
+
return space / ratio;
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
@@ -99,7 +99,7 @@ process.env.NODE_ENV !== "production" ? AnimatedArea.propTypes = {
|
|
|
99
99
|
ownerState: _propTypes.default.shape({
|
|
100
100
|
classes: _propTypes.default.object,
|
|
101
101
|
color: _propTypes.default.string.isRequired,
|
|
102
|
-
id: _propTypes.default.string.isRequired,
|
|
102
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
103
103
|
isFaded: _propTypes.default.bool.isRequired,
|
|
104
104
|
isHighlighted: _propTypes.default.bool.isRequired
|
|
105
105
|
}).isRequired,
|
|
@@ -101,7 +101,7 @@ process.env.NODE_ENV !== "production" ? AnimatedLine.propTypes = {
|
|
|
101
101
|
ownerState: _propTypes.default.shape({
|
|
102
102
|
classes: _propTypes.default.object,
|
|
103
103
|
color: _propTypes.default.string.isRequired,
|
|
104
|
-
id: _propTypes.default.string.isRequired,
|
|
104
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
105
105
|
isFaded: _propTypes.default.bool.isRequired,
|
|
106
106
|
isHighlighted: _propTypes.default.bool.isRequired
|
|
107
107
|
}).isRequired,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { HighlightScope } from '../context/HighlightProvider';
|
|
3
3
|
import { AnimatedAreaProps } from './AnimatedArea';
|
|
4
|
+
import { SeriesId } from '../models/seriesType/common';
|
|
4
5
|
export interface AreaElementClasses {
|
|
5
6
|
/** Styles applied to the root element. */
|
|
6
7
|
root: string;
|
|
@@ -11,7 +12,7 @@ export interface AreaElementClasses {
|
|
|
11
12
|
}
|
|
12
13
|
export type AreaElementClassKey = keyof AreaElementClasses;
|
|
13
14
|
export interface AreaElementOwnerState {
|
|
14
|
-
id:
|
|
15
|
+
id: SeriesId;
|
|
15
16
|
color: string;
|
|
16
17
|
isFaded: boolean;
|
|
17
18
|
isHighlighted: boolean;
|
package/LineChart/AreaElement.js
CHANGED
|
@@ -107,7 +107,7 @@ process.env.NODE_ENV !== "production" ? AreaElement.propTypes = {
|
|
|
107
107
|
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
108
108
|
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
109
109
|
}),
|
|
110
|
-
id: _propTypes.default.string.isRequired,
|
|
110
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
111
111
|
/**
|
|
112
112
|
* If `true`, animations are skipped.
|
|
113
113
|
* @default false
|
package/LineChart/LineChart.d.ts
CHANGED
|
@@ -11,20 +11,30 @@ import { ChartsLegendProps, ChartsLegendSlotProps, ChartsLegendSlots } from '../
|
|
|
11
11
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
12
12
|
import { ChartsAxisSlotProps, ChartsAxisSlots } from '../models/axis';
|
|
13
13
|
import { LineHighlightPlotSlots, LineHighlightPlotSlotProps } from './LineHighlightPlot';
|
|
14
|
+
import { ChartsGridProps } from '../ChartsGrid';
|
|
14
15
|
import { ChartsOnAxisClickHandlerProps } from '../ChartsOnAxisClickHandler';
|
|
15
16
|
export interface LineChartSlots extends ChartsAxisSlots, AreaPlotSlots, LinePlotSlots, MarkPlotSlots, LineHighlightPlotSlots, ChartsLegendSlots, ChartsTooltipSlots {
|
|
16
17
|
}
|
|
17
18
|
export interface LineChartSlotProps extends ChartsAxisSlotProps, AreaPlotSlotProps, LinePlotSlotProps, MarkPlotSlotProps, LineHighlightPlotSlotProps, ChartsLegendSlotProps, ChartsTooltipSlotProps {
|
|
18
19
|
}
|
|
19
20
|
export interface LineChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, ChartsOnAxisClickHandlerProps {
|
|
21
|
+
/**
|
|
22
|
+
* The series to display in the line chart.
|
|
23
|
+
*/
|
|
20
24
|
series: MakeOptional<LineSeriesType, 'type'>[];
|
|
25
|
+
/**
|
|
26
|
+
* The configuration of the tooltip.
|
|
27
|
+
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
28
|
+
* @default { trigger: 'item' }
|
|
29
|
+
*/
|
|
21
30
|
tooltip?: ChartsTooltipProps;
|
|
22
31
|
/**
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*
|
|
32
|
+
* Option to display a cartesian grid in the background.
|
|
33
|
+
*/
|
|
34
|
+
grid?: Pick<ChartsGridProps, 'vertical' | 'horizontal'>;
|
|
35
|
+
/**
|
|
36
|
+
* The configuration of axes highlight.
|
|
37
|
+
* @see See {@link https://mui.com/x/react-charts/tooltip/#highlights highlight docs} for more details.
|
|
28
38
|
* @default { x: 'line' }
|
|
29
39
|
*/
|
|
30
40
|
axisHighlight?: ChartsAxisHighlightProps;
|
|
@@ -46,8 +56,17 @@ export interface LineChartProps extends Omit<ResponsiveChartContainerProps, 'ser
|
|
|
46
56
|
* @default {}
|
|
47
57
|
*/
|
|
48
58
|
slotProps?: LineChartSlotProps;
|
|
59
|
+
/**
|
|
60
|
+
* Callback fired when an area element is clicked.
|
|
61
|
+
*/
|
|
49
62
|
onAreaClick?: AreaPlotProps['onItemClick'];
|
|
63
|
+
/**
|
|
64
|
+
* Callback fired when a line element is clicked.
|
|
65
|
+
*/
|
|
50
66
|
onLineClick?: LinePlotProps['onItemClick'];
|
|
67
|
+
/**
|
|
68
|
+
* Callback fired when a mark element is clicked.
|
|
69
|
+
*/
|
|
51
70
|
onMarkClick?: MarkPlotProps['onItemClick'];
|
|
52
71
|
/**
|
|
53
72
|
* If `true`, animations are skipped.
|
package/LineChart/LineChart.js
CHANGED
|
@@ -20,6 +20,7 @@ var _ChartsLegend = require("../ChartsLegend");
|
|
|
20
20
|
var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
|
|
21
21
|
var _ChartsClipPath = require("../ChartsClipPath");
|
|
22
22
|
var _LineHighlightPlot = require("./LineHighlightPlot");
|
|
23
|
+
var _ChartsGrid = require("../ChartsGrid");
|
|
23
24
|
var _ChartsOnAxisClickHandler = require("../ChartsOnAxisClickHandler");
|
|
24
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
26
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -55,6 +56,7 @@ const LineChart = exports.LineChart = /*#__PURE__*/React.forwardRef(function Lin
|
|
|
55
56
|
},
|
|
56
57
|
disableLineItemHighlight,
|
|
57
58
|
legend,
|
|
59
|
+
grid,
|
|
58
60
|
topAxis,
|
|
59
61
|
leftAxis,
|
|
60
62
|
rightAxis,
|
|
@@ -89,6 +91,9 @@ const LineChart = exports.LineChart = /*#__PURE__*/React.forwardRef(function Lin
|
|
|
89
91
|
disableAxisListener: tooltip?.trigger !== 'axis' && axisHighlight?.x === 'none' && axisHighlight?.y === 'none' && !onAxisClick,
|
|
90
92
|
children: [onAxisClick && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsOnAxisClickHandler.ChartsOnAxisClickHandler, {
|
|
91
93
|
onAxisClick: onAxisClick
|
|
94
|
+
}), grid && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsGrid.ChartsGrid, {
|
|
95
|
+
vertical: grid.vertical,
|
|
96
|
+
horizontal: grid.horizontal
|
|
92
97
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
|
|
93
98
|
clipPath: `url(#${clipPathId})`,
|
|
94
99
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_AreaPlot.AreaPlot, {
|
|
@@ -134,11 +139,8 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
134
139
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
135
140
|
// ----------------------------------------------------------------------
|
|
136
141
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
* - 'none': display nothing.
|
|
140
|
-
* - 'line': display a line at the current mouse position.
|
|
141
|
-
* - 'band': display a band at the current mouse position. Only available with band scale.
|
|
142
|
+
* The configuration of axes highlight.
|
|
143
|
+
* @see See {@link https://mui.com/x/react-charts/tooltip/#highlights highlight docs} for more details.
|
|
142
144
|
* @default { x: 'line' }
|
|
143
145
|
*/
|
|
144
146
|
axisHighlight: _propTypes.default.shape({
|
|
@@ -151,7 +153,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
151
153
|
* @default xAxisIds[0] The id of the first provided axis
|
|
152
154
|
*/
|
|
153
155
|
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
154
|
-
axisId: _propTypes.default.string,
|
|
156
|
+
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
155
157
|
classes: _propTypes.default.object,
|
|
156
158
|
disableLine: _propTypes.default.bool,
|
|
157
159
|
disableTicks: _propTypes.default.bool,
|
|
@@ -194,6 +196,13 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
194
196
|
* If `true`, render the line highlight item.
|
|
195
197
|
*/
|
|
196
198
|
disableLineItemHighlight: _propTypes.default.bool,
|
|
199
|
+
/**
|
|
200
|
+
* Option to display a cartesian grid in the background.
|
|
201
|
+
*/
|
|
202
|
+
grid: _propTypes.default.shape({
|
|
203
|
+
horizontal: _propTypes.default.bool,
|
|
204
|
+
vertical: _propTypes.default.bool
|
|
205
|
+
}),
|
|
197
206
|
/**
|
|
198
207
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
199
208
|
* @default undefined
|
|
@@ -205,7 +214,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
205
214
|
* @default yAxisIds[0] The id of the first provided axis
|
|
206
215
|
*/
|
|
207
216
|
leftAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
208
|
-
axisId: _propTypes.default.string,
|
|
217
|
+
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
209
218
|
classes: _propTypes.default.object,
|
|
210
219
|
disableLine: _propTypes.default.bool,
|
|
211
220
|
disableTicks: _propTypes.default.bool,
|
|
@@ -252,6 +261,9 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
252
261
|
right: _propTypes.default.number,
|
|
253
262
|
top: _propTypes.default.number
|
|
254
263
|
}),
|
|
264
|
+
/**
|
|
265
|
+
* Callback fired when an area element is clicked.
|
|
266
|
+
*/
|
|
255
267
|
onAreaClick: _propTypes.default.func,
|
|
256
268
|
/**
|
|
257
269
|
* The function called for onClick events.
|
|
@@ -260,7 +272,13 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
260
272
|
* @param {null | AxisData} data The data about the clicked axis and items associated with it.
|
|
261
273
|
*/
|
|
262
274
|
onAxisClick: _propTypes.default.func,
|
|
275
|
+
/**
|
|
276
|
+
* Callback fired when a line element is clicked.
|
|
277
|
+
*/
|
|
263
278
|
onLineClick: _propTypes.default.func,
|
|
279
|
+
/**
|
|
280
|
+
* Callback fired when a mark element is clicked.
|
|
281
|
+
*/
|
|
264
282
|
onMarkClick: _propTypes.default.func,
|
|
265
283
|
/**
|
|
266
284
|
* Indicate which axis to display the right of the charts.
|
|
@@ -268,7 +286,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
268
286
|
* @default null
|
|
269
287
|
*/
|
|
270
288
|
rightAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
271
|
-
axisId: _propTypes.default.string,
|
|
289
|
+
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
272
290
|
classes: _propTypes.default.object,
|
|
273
291
|
disableLine: _propTypes.default.bool,
|
|
274
292
|
disableTicks: _propTypes.default.bool,
|
|
@@ -289,6 +307,9 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
289
307
|
tickNumber: _propTypes.default.number,
|
|
290
308
|
tickSize: _propTypes.default.number
|
|
291
309
|
}), _propTypes.default.string]),
|
|
310
|
+
/**
|
|
311
|
+
* The series to display in the line chart.
|
|
312
|
+
*/
|
|
292
313
|
series: _propTypes.default.arrayOf(_propTypes.default.object).isRequired,
|
|
293
314
|
/**
|
|
294
315
|
* If `true`, animations are skipped.
|
|
@@ -307,6 +328,11 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
307
328
|
slots: _propTypes.default.object,
|
|
308
329
|
sx: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object, _propTypes.default.bool])), _propTypes.default.func, _propTypes.default.object]),
|
|
309
330
|
title: _propTypes.default.string,
|
|
331
|
+
/**
|
|
332
|
+
* The configuration of the tooltip.
|
|
333
|
+
* @see See {@link https://mui.com/x/react-charts/tooltip/ tooltip docs} for more details.
|
|
334
|
+
* @default { trigger: 'item' }
|
|
335
|
+
*/
|
|
310
336
|
tooltip: _propTypes.default.shape({
|
|
311
337
|
axisContent: _propTypes.default.elementType,
|
|
312
338
|
classes: _propTypes.default.object,
|
|
@@ -321,7 +347,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
321
347
|
* @default null
|
|
322
348
|
*/
|
|
323
349
|
topAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
324
|
-
axisId: _propTypes.default.string,
|
|
350
|
+
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
325
351
|
classes: _propTypes.default.object,
|
|
326
352
|
disableLine: _propTypes.default.bool,
|
|
327
353
|
disableTicks: _propTypes.default.bool,
|
|
@@ -358,7 +384,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
358
384
|
* If not provided, a default axis config is used with id set to `DEFAULT_X_AXIS_KEY`.
|
|
359
385
|
*/
|
|
360
386
|
xAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
361
|
-
axisId: _propTypes.default.string,
|
|
387
|
+
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
362
388
|
classes: _propTypes.default.object,
|
|
363
389
|
data: _propTypes.default.array,
|
|
364
390
|
dataKey: _propTypes.default.string,
|
|
@@ -366,13 +392,14 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
366
392
|
disableTicks: _propTypes.default.bool,
|
|
367
393
|
fill: _propTypes.default.string,
|
|
368
394
|
hideTooltip: _propTypes.default.bool,
|
|
369
|
-
id: _propTypes.default.string,
|
|
395
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
370
396
|
label: _propTypes.default.string,
|
|
371
397
|
labelFontSize: _propTypes.default.number,
|
|
372
398
|
labelStyle: _propTypes.default.object,
|
|
373
399
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
374
400
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
375
401
|
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
402
|
+
reverse: _propTypes.default.bool,
|
|
376
403
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
377
404
|
slotProps: _propTypes.default.object,
|
|
378
405
|
slots: _propTypes.default.object,
|
|
@@ -392,7 +419,7 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
392
419
|
* If not provided, a default axis config is used with id set to `DEFAULT_Y_AXIS_KEY`.
|
|
393
420
|
*/
|
|
394
421
|
yAxis: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
395
|
-
axisId: _propTypes.default.string,
|
|
422
|
+
axisId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
396
423
|
classes: _propTypes.default.object,
|
|
397
424
|
data: _propTypes.default.array,
|
|
398
425
|
dataKey: _propTypes.default.string,
|
|
@@ -400,13 +427,14 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
400
427
|
disableTicks: _propTypes.default.bool,
|
|
401
428
|
fill: _propTypes.default.string,
|
|
402
429
|
hideTooltip: _propTypes.default.bool,
|
|
403
|
-
id: _propTypes.default.string,
|
|
430
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
404
431
|
label: _propTypes.default.string,
|
|
405
432
|
labelFontSize: _propTypes.default.number,
|
|
406
433
|
labelStyle: _propTypes.default.object,
|
|
407
434
|
max: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
408
435
|
min: _propTypes.default.oneOfType([_propTypes.default.instanceOf(Date), _propTypes.default.number]),
|
|
409
436
|
position: _propTypes.default.oneOf(['bottom', 'left', 'right', 'top']),
|
|
437
|
+
reverse: _propTypes.default.bool,
|
|
410
438
|
scaleType: _propTypes.default.oneOf(['band', 'linear', 'log', 'point', 'pow', 'sqrt', 'time', 'utc']),
|
|
411
439
|
slotProps: _propTypes.default.object,
|
|
412
440
|
slots: _propTypes.default.object,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { HighlightScope } from '../context/HighlightProvider';
|
|
3
3
|
import { AnimatedLineProps } from './AnimatedLine';
|
|
4
|
+
import { SeriesId } from '../models/seriesType/common';
|
|
4
5
|
export interface LineElementClasses {
|
|
5
6
|
/** Styles applied to the root element. */
|
|
6
7
|
root: string;
|
|
@@ -11,7 +12,7 @@ export interface LineElementClasses {
|
|
|
11
12
|
}
|
|
12
13
|
export type LineElementClassKey = keyof LineElementClasses;
|
|
13
14
|
export interface LineElementOwnerState {
|
|
14
|
-
id:
|
|
15
|
+
id: SeriesId;
|
|
15
16
|
color: string;
|
|
16
17
|
isFaded: boolean;
|
|
17
18
|
isHighlighted: boolean;
|
package/LineChart/LineElement.js
CHANGED
|
@@ -107,7 +107,7 @@ process.env.NODE_ENV !== "production" ? LineElement.propTypes = {
|
|
|
107
107
|
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
108
108
|
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
109
109
|
}),
|
|
110
|
-
id: _propTypes.default.string.isRequired,
|
|
110
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
111
111
|
/**
|
|
112
112
|
* If `true`, animations are skipped.
|
|
113
113
|
* @default false
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { SeriesId } from '../models/seriesType/common';
|
|
2
3
|
export interface LineHighlightElementClasses {
|
|
3
4
|
/** Styles applied to the root element. */
|
|
4
5
|
root: string;
|
|
5
6
|
}
|
|
6
7
|
export type HighlightElementClassKey = keyof LineHighlightElementClasses;
|
|
7
8
|
interface LineHighlightElementOwnerState {
|
|
8
|
-
id:
|
|
9
|
+
id: SeriesId;
|
|
9
10
|
color: string;
|
|
10
11
|
x: number;
|
|
11
12
|
y: number;
|
|
@@ -13,7 +14,7 @@ interface LineHighlightElementOwnerState {
|
|
|
13
14
|
}
|
|
14
15
|
export declare function getHighlightElementUtilityClass(slot: string): string;
|
|
15
16
|
export declare const lineHighlightElementClasses: LineHighlightElementClasses;
|
|
16
|
-
export type LineHighlightElementProps = LineHighlightElementOwnerState & React.ComponentPropsWithoutRef<'circle'> & {};
|
|
17
|
+
export type LineHighlightElementProps = LineHighlightElementOwnerState & Omit<React.ComponentPropsWithoutRef<'circle'>, 'id'> & {};
|
|
17
18
|
/**
|
|
18
19
|
* Demos:
|
|
19
20
|
*
|
|
@@ -85,5 +85,6 @@ process.env.NODE_ENV !== "production" ? LineHighlightElement.propTypes = {
|
|
|
85
85
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
86
86
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
87
87
|
// ----------------------------------------------------------------------
|
|
88
|
-
classes: _propTypes.default.object
|
|
88
|
+
classes: _propTypes.default.object,
|
|
89
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired
|
|
89
90
|
} : void 0;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { HighlightScope } from '../context/HighlightProvider';
|
|
3
|
+
import { SeriesId } from '../models/seriesType/common';
|
|
3
4
|
export interface MarkElementClasses {
|
|
4
5
|
/** Styles applied to the root element. */
|
|
5
6
|
root: string;
|
|
@@ -10,7 +11,7 @@ export interface MarkElementClasses {
|
|
|
10
11
|
}
|
|
11
12
|
export type MarkElementClassKey = keyof MarkElementClasses;
|
|
12
13
|
interface MarkElementOwnerState {
|
|
13
|
-
id:
|
|
14
|
+
id: SeriesId;
|
|
14
15
|
color: string;
|
|
15
16
|
isFaded: boolean;
|
|
16
17
|
isHighlighted: boolean;
|
|
@@ -18,7 +19,7 @@ interface MarkElementOwnerState {
|
|
|
18
19
|
}
|
|
19
20
|
export declare function getMarkElementUtilityClass(slot: string): string;
|
|
20
21
|
export declare const markElementClasses: MarkElementClasses;
|
|
21
|
-
export type MarkElementProps = Omit<MarkElementOwnerState, 'isFaded' | 'isHighlighted'> & React.ComponentPropsWithoutRef<'path'> & {
|
|
22
|
+
export type MarkElementProps = Omit<MarkElementOwnerState, 'isFaded' | 'isHighlighted'> & Omit<React.ComponentPropsWithoutRef<'path'>, 'id'> & {
|
|
22
23
|
/**
|
|
23
24
|
* If `true`, animations are skipped.
|
|
24
25
|
* @default false
|
package/LineChart/MarkElement.js
CHANGED
|
@@ -147,6 +147,7 @@ process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
|
|
|
147
147
|
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
148
148
|
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
149
149
|
}),
|
|
150
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
150
151
|
/**
|
|
151
152
|
* The shape of the marker.
|
|
152
153
|
*/
|
package/PieChart/PieArc.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SpringValue } from '@react-spring/web';
|
|
3
3
|
import { HighlightScope } from '../context/HighlightProvider';
|
|
4
|
+
import { PieItemId } from '../models';
|
|
4
5
|
export interface PieArcClasses {
|
|
5
6
|
/** Styles applied to the root element. */
|
|
6
7
|
root: string;
|
|
@@ -11,7 +12,7 @@ export interface PieArcClasses {
|
|
|
11
12
|
}
|
|
12
13
|
export type PieArcClassKey = keyof PieArcClasses;
|
|
13
14
|
interface PieArcOwnerState {
|
|
14
|
-
id:
|
|
15
|
+
id: PieItemId;
|
|
15
16
|
dataIndex: number;
|
|
16
17
|
color: string;
|
|
17
18
|
isFaded: boolean;
|
|
@@ -20,15 +21,15 @@ interface PieArcOwnerState {
|
|
|
20
21
|
}
|
|
21
22
|
export declare function getPieArcUtilityClass(slot: string): string;
|
|
22
23
|
export declare const pieArcClasses: PieArcClasses;
|
|
23
|
-
export type PieArcProps =
|
|
24
|
-
|
|
24
|
+
export type PieArcProps = Omit<React.ComponentPropsWithoutRef<'path'>, 'id'> & PieArcOwnerState & {
|
|
25
|
+
cornerRadius: SpringValue<number>;
|
|
25
26
|
endAngle: SpringValue<number>;
|
|
27
|
+
highlightScope?: Partial<HighlightScope>;
|
|
26
28
|
innerRadius: SpringValue<number>;
|
|
29
|
+
onClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void;
|
|
27
30
|
outerRadius: SpringValue<number>;
|
|
28
|
-
cornerRadius: SpringValue<number>;
|
|
29
31
|
paddingAngle: SpringValue<number>;
|
|
30
|
-
|
|
31
|
-
onClick?: (event: React.MouseEvent<SVGPathElement, MouseEvent>) => void;
|
|
32
|
+
startAngle: SpringValue<number>;
|
|
32
33
|
};
|
|
33
34
|
declare function PieArc(props: PieArcProps): React.JSX.Element;
|
|
34
35
|
declare namespace PieArc {
|
package/PieChart/PieArc.js
CHANGED
|
@@ -19,7 +19,7 @@ var _styles = require("@mui/material/styles");
|
|
|
19
19
|
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
20
20
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
21
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
|
-
const _excluded = ["
|
|
22
|
+
const _excluded = ["classes", "color", "cornerRadius", "dataIndex", "endAngle", "highlightScope", "id", "innerRadius", "isFaded", "isHighlighted", "onClick", "outerRadius", "paddingAngle", "startAngle"];
|
|
23
23
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
24
24
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
25
25
|
function getPieArcUtilityClass(slot) {
|
|
@@ -51,20 +51,20 @@ const PieArcRoot = (0, _styles.styled)(_web.animated.path, {
|
|
|
51
51
|
}));
|
|
52
52
|
function PieArc(props) {
|
|
53
53
|
const {
|
|
54
|
-
id,
|
|
55
|
-
dataIndex,
|
|
56
54
|
classes: innerClasses,
|
|
57
55
|
color,
|
|
56
|
+
cornerRadius,
|
|
57
|
+
dataIndex,
|
|
58
|
+
endAngle,
|
|
58
59
|
highlightScope,
|
|
59
|
-
|
|
60
|
+
id,
|
|
61
|
+
innerRadius,
|
|
60
62
|
isFaded,
|
|
61
63
|
isHighlighted,
|
|
62
|
-
|
|
63
|
-
endAngle,
|
|
64
|
-
paddingAngle,
|
|
65
|
-
innerRadius,
|
|
64
|
+
onClick,
|
|
66
65
|
outerRadius,
|
|
67
|
-
|
|
66
|
+
paddingAngle,
|
|
67
|
+
startAngle
|
|
68
68
|
} = props,
|
|
69
69
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
70
70
|
const ownerState = {
|
|
@@ -106,6 +106,7 @@ process.env.NODE_ENV !== "production" ? PieArc.propTypes = {
|
|
|
106
106
|
faded: _propTypes.default.oneOf(['global', 'none', 'series']),
|
|
107
107
|
highlighted: _propTypes.default.oneOf(['item', 'none', 'series'])
|
|
108
108
|
}),
|
|
109
|
+
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
109
110
|
isFaded: _propTypes.default.bool.isRequired,
|
|
110
111
|
isHighlighted: _propTypes.default.bool.isRequired
|
|
111
112
|
} : void 0;
|