@mui/x-charts 6.0.0-alpha.9 → 6.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarChart.d.ts +26 -5
- package/BarChart/BarChart.js +93 -17
- package/BarChart/BarElement.d.ts +1319 -4
- package/BarChart/BarElement.js +10 -10
- package/BarChart/BarPlot.d.ts +17 -1
- package/BarChart/BarPlot.js +152 -66
- package/BarChart/formatter.js +2 -3
- package/BarChart/legend.js +1 -2
- package/CHANGELOG.md +797 -59
- package/ChartContainer/index.js +7 -5
- package/ChartsAxis/ChartsAxis.d.ts +9 -0
- package/ChartsAxis/ChartsAxis.js +33 -7
- package/ChartsAxis/axisClasses.d.ts +3 -3
- package/ChartsAxis/axisClasses.js +1 -2
- package/ChartsAxisHighlight/ChartsAxisHighlight.d.ts +21 -0
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +61 -22
- package/ChartsClipPath/ChartsClipPath.d.ts +5 -0
- package/ChartsClipPath/ChartsClipPath.js +7 -2
- package/ChartsLegend/ChartsLegend.d.ts +45 -24
- package/ChartsLegend/ChartsLegend.js +193 -151
- package/ChartsLegend/chartsLegendClasses.d.ts +1 -1
- package/ChartsLegend/chartsLegendClasses.js +3 -4
- package/ChartsLegend/utils.d.ts +1 -6
- package/ChartsReferenceLine/ChartsReferenceLine.d.ts +10 -0
- package/ChartsReferenceLine/ChartsReferenceLine.js +78 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +13 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.js +112 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +13 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.js +112 -0
- package/ChartsReferenceLine/chartsReferenceLineClasses.d.ts +15 -0
- package/ChartsReferenceLine/chartsReferenceLineClasses.js +14 -0
- package/ChartsReferenceLine/common.d.ts +41 -0
- package/ChartsReferenceLine/common.js +27 -0
- package/ChartsReferenceLine/index.d.ts +2 -0
- package/ChartsReferenceLine/index.js +27 -0
- package/ChartsReferenceLine/package.json +6 -0
- package/ChartsSurface.d.ts +12 -1
- package/ChartsSurface.js +9 -18
- package/ChartsTooltip/ChartsAxisTooltipContent.d.ts +1 -0
- package/ChartsTooltip/ChartsAxisTooltipContent.js +46 -32
- package/ChartsTooltip/ChartsItemTooltipContent.d.ts +3 -2
- package/ChartsTooltip/ChartsItemTooltipContent.js +18 -9
- package/ChartsTooltip/ChartsTooltip.d.ts +32 -0
- package/ChartsTooltip/ChartsTooltip.js +62 -18
- package/ChartsTooltip/ChartsTooltipTable.d.ts +3 -10
- package/ChartsTooltip/ChartsTooltipTable.js +22 -20
- package/ChartsTooltip/tooltipClasses.js +1 -2
- package/ChartsTooltip/utils.js +2 -2
- package/ChartsXAxis/ChartsXAxis.d.ts +9 -0
- package/ChartsXAxis/ChartsXAxis.js +170 -45
- package/ChartsYAxis/ChartsYAxis.d.ts +9 -0
- package/ChartsYAxis/ChartsYAxis.js +95 -38
- package/LineChart/AreaElement.d.ts +11 -1
- package/LineChart/AreaElement.js +14 -6
- package/LineChart/AreaPlot.d.ts +11 -0
- package/LineChart/AreaPlot.js +27 -8
- package/LineChart/LineChart.d.ts +23 -3
- package/LineChart/LineChart.js +89 -17
- package/LineChart/LineElement.d.ts +11 -1
- package/LineChart/LineElement.js +14 -6
- package/LineChart/LineHighlightElement.d.ts +10 -0
- package/LineChart/LineHighlightElement.js +13 -4
- package/LineChart/LineHighlightPlot.d.ts +10 -0
- package/LineChart/LineHighlightPlot.js +15 -4
- package/LineChart/LinePlot.d.ts +10 -0
- package/LineChart/LinePlot.js +25 -12
- package/LineChart/MarkElement.d.ts +10 -0
- package/LineChart/MarkElement.js +14 -5
- package/LineChart/MarkPlot.d.ts +10 -0
- package/LineChart/MarkPlot.js +42 -10
- package/LineChart/formatter.js +5 -5
- package/LineChart/legend.js +1 -2
- package/PieChart/PieArc.d.ts +11 -13
- package/PieChart/PieArc.js +28 -60
- package/PieChart/PieArcLabel.d.ts +8 -9
- package/PieChart/PieArcLabel.js +46 -38
- package/PieChart/PieArcLabelPlot.d.ts +28 -0
- package/PieChart/PieArcLabelPlot.js +99 -0
- package/PieChart/PieArcPlot.d.ts +35 -0
- package/PieChart/PieArcPlot.js +92 -0
- package/PieChart/PieChart.d.ts +19 -5
- package/PieChart/PieChart.js +95 -18
- package/PieChart/PiePlot.d.ts +15 -9
- package/PieChart/PiePlot.js +77 -55
- package/PieChart/dataTransform/transition.d.ts +4 -0
- package/PieChart/dataTransform/transition.js +136 -0
- package/PieChart/dataTransform/useTransformData.d.ts +15 -0
- package/PieChart/dataTransform/useTransformData.js +67 -0
- package/PieChart/formatter.js +1 -2
- package/PieChart/legend.js +1 -2
- package/README.md +8 -14
- package/ResponsiveChartContainer/index.d.ts +13 -3
- package/ResponsiveChartContainer/index.js +7 -8
- package/ScatterChart/Scatter.d.ts +10 -0
- package/ScatterChart/Scatter.js +12 -2
- package/ScatterChart/ScatterChart.d.ts +16 -3
- package/ScatterChart/ScatterChart.js +77 -16
- package/ScatterChart/ScatterPlot.d.ts +10 -0
- package/ScatterChart/ScatterPlot.js +12 -2
- package/ScatterChart/formatter.js +1 -2
- package/ScatterChart/legend.js +1 -2
- package/SparkLineChart/SparkLineChart.d.ts +12 -3
- package/SparkLineChart/SparkLineChart.js +50 -7
- package/colorPalettes/colorPalettes.js +6 -12
- package/constants.js +5 -8
- package/context/CartesianContextProvider.d.ts +26 -1
- package/context/CartesianContextProvider.js +42 -16
- package/context/DrawingProvider.d.ts +25 -0
- package/context/DrawingProvider.js +18 -6
- package/context/HighlightProvider.d.ts +17 -0
- package/context/HighlightProvider.js +3 -4
- package/context/InteractionProvider.d.ts +6 -0
- package/context/InteractionProvider.js +3 -4
- package/context/SeriesContextProvider.d.ts +5 -0
- package/context/SeriesContextProvider.js +3 -4
- package/esm/BarChart/BarChart.js +90 -13
- package/esm/BarChart/BarElement.js +7 -4
- package/esm/BarChart/BarPlot.js +152 -67
- package/esm/BarChart/formatter.js +1 -1
- package/esm/ChartContainer/index.js +3 -0
- package/esm/ChartsAxis/ChartsAxis.js +32 -5
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +57 -20
- package/esm/ChartsClipPath/ChartsClipPath.js +5 -0
- package/esm/ChartsLegend/ChartsLegend.js +190 -144
- package/esm/ChartsLegend/chartsLegendClasses.js +1 -1
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +105 -0
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +105 -0
- package/esm/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
- package/esm/ChartsReferenceLine/common.js +20 -0
- package/esm/ChartsReferenceLine/index.js +2 -0
- package/esm/ChartsSurface.js +4 -12
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +44 -30
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
- package/esm/ChartsTooltip/ChartsTooltip.js +59 -14
- package/esm/ChartsTooltip/ChartsTooltipTable.js +17 -10
- package/esm/ChartsXAxis/ChartsXAxis.js +168 -43
- package/esm/ChartsYAxis/ChartsYAxis.js +93 -36
- package/esm/LineChart/AreaElement.js +10 -0
- package/esm/LineChart/AreaPlot.js +26 -6
- package/esm/LineChart/LineChart.js +86 -13
- package/esm/LineChart/LineElement.js +10 -0
- package/esm/LineChart/LineHighlightElement.js +10 -0
- package/esm/LineChart/LineHighlightPlot.js +13 -2
- package/esm/LineChart/LinePlot.js +25 -14
- package/esm/LineChart/MarkElement.js +11 -1
- package/esm/LineChart/MarkPlot.js +40 -8
- package/esm/LineChart/formatter.js +7 -3
- package/esm/PieChart/PieArc.js +26 -58
- package/esm/PieChart/PieArcLabel.js +43 -34
- package/esm/PieChart/PieArcLabelPlot.js +92 -0
- package/esm/PieChart/PieArcPlot.js +84 -0
- package/esm/PieChart/PieChart.js +93 -16
- package/esm/PieChart/PiePlot.js +76 -57
- package/esm/PieChart/dataTransform/transition.js +130 -0
- package/esm/PieChart/dataTransform/useTransformData.js +59 -0
- package/esm/ResponsiveChartContainer/index.js +3 -3
- package/esm/ScatterChart/Scatter.js +10 -0
- package/esm/ScatterChart/ScatterChart.js +74 -12
- package/esm/ScatterChart/ScatterPlot.js +10 -0
- package/esm/SparkLineChart/SparkLineChart.js +47 -3
- package/esm/constants.js +1 -1
- package/esm/context/CartesianContextProvider.js +41 -14
- package/esm/context/DrawingProvider.js +14 -0
- package/esm/hooks/useChartDimensions.js +2 -0
- package/esm/hooks/useMounted.js +16 -0
- package/esm/hooks/useReducedMotion.js +27 -0
- package/esm/hooks/useTicks.js +15 -9
- package/esm/index.js +1 -0
- package/esm/internals/components/AxisSharedComponents.js +15 -70
- package/esm/internals/components/ChartsText.js +77 -0
- package/esm/internals/domUtils.js +113 -0
- package/esm/internals/geometry.js +36 -0
- package/hooks/useAxisEvents.js +2 -2
- package/hooks/useChartDimensions.d.ts +2 -0
- package/hooks/useChartDimensions.js +5 -4
- package/hooks/useDrawingArea.js +2 -2
- package/hooks/useInteractionItemProps.js +2 -2
- package/hooks/useMounted.d.ts +1 -0
- package/hooks/useMounted.js +25 -0
- package/hooks/useReducedMotion.d.ts +8 -0
- package/hooks/useReducedMotion.js +33 -0
- package/hooks/useScale.d.ts +2 -2
- package/hooks/useScale.js +2 -2
- package/hooks/useTicks.d.ts +19 -11
- package/hooks/useTicks.js +19 -14
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/internals/components/AxisSharedComponents.d.ts +0 -4
- package/internals/components/AxisSharedComponents.js +18 -78
- package/internals/components/ChartsText.d.ts +35 -0
- package/internals/components/ChartsText.js +87 -0
- package/internals/defaultizeColor.d.ts +7 -2
- package/internals/defaultizeValueFormatter.js +1 -2
- package/internals/domUtils.d.ts +13 -0
- package/internals/domUtils.js +122 -0
- package/internals/geometry.d.ts +9 -0
- package/internals/geometry.js +42 -0
- package/internals/isBandScale.d.ts +3 -1
- package/internals/stackSeries.js +2 -4
- package/internals/utils.d.ts +5 -0
- package/legacy/BarChart/BarChart.js +90 -13
- package/legacy/BarChart/BarElement.js +6 -3
- package/legacy/BarChart/BarPlot.js +151 -63
- package/legacy/BarChart/formatter.js +1 -1
- package/legacy/ChartContainer/index.js +3 -0
- package/legacy/ChartsAxis/ChartsAxis.js +32 -5
- package/legacy/ChartsAxisHighlight/ChartsAxisHighlight.js +60 -20
- package/legacy/ChartsClipPath/ChartsClipPath.js +5 -0
- package/legacy/ChartsLegend/ChartsLegend.js +205 -142
- package/legacy/ChartsLegend/chartsLegendClasses.js +1 -1
- package/legacy/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
- package/legacy/ChartsReferenceLine/ChartsXReferenceLine.js +105 -0
- package/legacy/ChartsReferenceLine/ChartsYReferenceLine.js +105 -0
- package/legacy/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
- package/legacy/ChartsReferenceLine/common.js +20 -0
- package/legacy/ChartsReferenceLine/index.js +2 -0
- package/legacy/ChartsSurface.js +3 -12
- package/legacy/ChartsTooltip/ChartsAxisTooltipContent.js +22 -10
- package/legacy/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
- package/legacy/ChartsTooltip/ChartsTooltip.js +62 -14
- package/legacy/ChartsTooltip/ChartsTooltipTable.js +34 -26
- package/legacy/ChartsXAxis/ChartsXAxis.js +176 -50
- package/legacy/ChartsYAxis/ChartsYAxis.js +97 -41
- package/legacy/LineChart/AreaElement.js +10 -0
- package/legacy/LineChart/AreaPlot.js +31 -7
- package/legacy/LineChart/LineChart.js +86 -13
- package/legacy/LineChart/LineElement.js +10 -0
- package/legacy/LineChart/LineHighlightElement.js +10 -0
- package/legacy/LineChart/LineHighlightPlot.js +13 -2
- package/legacy/LineChart/LinePlot.js +29 -12
- package/legacy/LineChart/MarkElement.js +11 -1
- package/legacy/LineChart/MarkPlot.js +39 -8
- package/legacy/LineChart/formatter.js +7 -3
- package/legacy/PieChart/PieArc.js +30 -62
- package/legacy/PieChart/PieArcLabel.js +48 -34
- package/legacy/PieChart/PieArcLabelPlot.js +93 -0
- package/legacy/PieChart/PieArcPlot.js +84 -0
- package/legacy/PieChart/PieChart.js +93 -16
- package/legacy/PieChart/PiePlot.js +76 -59
- package/legacy/PieChart/dataTransform/transition.js +142 -0
- package/legacy/PieChart/dataTransform/useTransformData.js +60 -0
- package/legacy/ResponsiveChartContainer/index.js +3 -3
- package/legacy/ScatterChart/Scatter.js +10 -0
- package/legacy/ScatterChart/ScatterChart.js +74 -12
- package/legacy/ScatterChart/ScatterPlot.js +10 -0
- package/legacy/SparkLineChart/SparkLineChart.js +47 -3
- package/legacy/constants.js +1 -1
- package/legacy/context/CartesianContextProvider.js +41 -14
- package/legacy/context/DrawingProvider.js +14 -0
- package/legacy/hooks/useChartDimensions.js +2 -0
- package/legacy/hooks/useMounted.js +21 -0
- package/legacy/hooks/useReducedMotion.js +27 -0
- package/legacy/hooks/useTicks.js +16 -9
- package/legacy/index.js +2 -1
- package/legacy/internals/components/AxisSharedComponents.js +11 -65
- package/legacy/internals/components/ChartsText.js +79 -0
- package/legacy/internals/domUtils.js +121 -0
- package/legacy/internals/geometry.js +37 -0
- package/models/axis.d.ts +58 -20
- package/models/layout.d.ts +13 -6
- package/models/seriesType/common.d.ts +16 -0
- package/models/seriesType/line.d.ts +8 -3
- package/models/seriesType/pie.d.ts +5 -1
- package/modern/BarChart/BarChart.js +90 -13
- package/modern/BarChart/BarElement.js +7 -4
- package/modern/BarChart/BarPlot.js +149 -65
- package/modern/BarChart/formatter.js +1 -1
- package/modern/ChartContainer/index.js +3 -0
- package/modern/ChartsAxis/ChartsAxis.js +31 -5
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +57 -20
- package/modern/ChartsClipPath/ChartsClipPath.js +5 -0
- package/modern/ChartsLegend/ChartsLegend.js +190 -144
- package/modern/ChartsLegend/chartsLegendClasses.js +1 -1
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +70 -0
- package/modern/ChartsReferenceLine/ChartsXReferenceLine.js +104 -0
- package/modern/ChartsReferenceLine/ChartsYReferenceLine.js +104 -0
- package/modern/ChartsReferenceLine/chartsReferenceLineClasses.js +6 -0
- package/modern/ChartsReferenceLine/common.js +20 -0
- package/modern/ChartsReferenceLine/index.js +2 -0
- package/modern/ChartsSurface.js +4 -12
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +44 -30
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +15 -7
- package/modern/ChartsTooltip/ChartsTooltip.js +58 -14
- package/modern/ChartsTooltip/ChartsTooltipTable.js +17 -10
- package/modern/ChartsXAxis/ChartsXAxis.js +167 -42
- package/modern/ChartsYAxis/ChartsYAxis.js +92 -35
- package/modern/LineChart/AreaElement.js +10 -0
- package/modern/LineChart/AreaPlot.js +25 -6
- package/modern/LineChart/LineChart.js +86 -13
- package/modern/LineChart/LineElement.js +10 -0
- package/modern/LineChart/LineHighlightElement.js +10 -0
- package/modern/LineChart/LineHighlightPlot.js +13 -2
- package/modern/LineChart/LinePlot.js +23 -10
- package/modern/LineChart/MarkElement.js +11 -1
- package/modern/LineChart/MarkPlot.js +40 -8
- package/modern/LineChart/formatter.js +4 -3
- package/modern/PieChart/PieArc.js +26 -57
- package/modern/PieChart/PieArcLabel.js +43 -34
- package/modern/PieChart/PieArcLabelPlot.js +90 -0
- package/modern/PieChart/PieArcPlot.js +83 -0
- package/modern/PieChart/PieChart.js +93 -16
- package/modern/PieChart/PiePlot.js +76 -55
- package/modern/PieChart/dataTransform/transition.js +130 -0
- package/modern/PieChart/dataTransform/useTransformData.js +58 -0
- package/modern/ResponsiveChartContainer/index.js +3 -3
- package/modern/ScatterChart/Scatter.js +10 -0
- package/modern/ScatterChart/ScatterChart.js +74 -12
- package/modern/ScatterChart/ScatterPlot.js +10 -0
- package/modern/SparkLineChart/SparkLineChart.js +47 -3
- package/modern/constants.js +1 -1
- package/modern/context/CartesianContextProvider.js +40 -13
- package/modern/context/DrawingProvider.js +14 -0
- package/modern/hooks/useChartDimensions.js +2 -0
- package/modern/hooks/useMounted.js +16 -0
- package/modern/hooks/useReducedMotion.js +27 -0
- package/modern/hooks/useTicks.js +15 -9
- package/modern/index.js +2 -1
- package/modern/internals/components/AxisSharedComponents.js +15 -70
- package/modern/internals/components/ChartsText.js +77 -0
- package/modern/internals/domUtils.js +113 -0
- package/modern/internals/geometry.js +36 -0
- package/package.json +9 -6
- package/themeAugmentation/components.d.ts +1 -0
- package/themeAugmentation/overrides.d.ts +2 -0
package/PieChart/PiePlot.js
CHANGED
|
@@ -5,34 +5,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.PiePlot = PiePlot;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
8
|
var React = _interopRequireWildcard(require("react"));
|
|
10
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
10
|
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
12
|
-
var _PieArc = _interopRequireDefault(require("./PieArc"));
|
|
13
|
-
var _PieArcLabel = _interopRequireDefault(require("./PieArcLabel"));
|
|
14
11
|
var _DrawingProvider = require("../context/DrawingProvider");
|
|
12
|
+
var _PieArcPlot = require("./PieArcPlot");
|
|
13
|
+
var _PieArcLabelPlot = require("./PieArcLabelPlot");
|
|
15
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
function _getRequireWildcardCache(
|
|
17
|
-
function _interopRequireWildcard(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return item[arcLabel]?.toString();
|
|
29
|
-
}
|
|
30
|
-
return arcLabel(item);
|
|
31
|
-
}
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
/**
|
|
18
|
+
* Demos:
|
|
19
|
+
*
|
|
20
|
+
* - [Pie](https://mui.com/x/react-charts/pie/)
|
|
21
|
+
* - [Pie demonstration](https://mui.com/x/react-charts/pie-demo/)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [PiePlot API](https://mui.com/x/api/charts/pie-plot/)
|
|
26
|
+
*/
|
|
32
27
|
function PiePlot(props) {
|
|
33
28
|
const {
|
|
29
|
+
skipAnimation,
|
|
34
30
|
slots,
|
|
35
|
-
slotProps
|
|
31
|
+
slotProps,
|
|
32
|
+
onClick
|
|
36
33
|
} = props;
|
|
37
34
|
const seriesData = React.useContext(_SeriesContextProvider.SeriesContext).pie;
|
|
38
35
|
const {
|
|
@@ -53,54 +50,67 @@ function PiePlot(props) {
|
|
|
53
50
|
series,
|
|
54
51
|
seriesOrder
|
|
55
52
|
} = seriesData;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
59
|
-
children: seriesOrder.map(seriesId => {
|
|
53
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("g", {
|
|
54
|
+
children: [seriesOrder.map(seriesId => {
|
|
60
55
|
const {
|
|
61
56
|
innerRadius,
|
|
62
57
|
outerRadius,
|
|
63
58
|
cornerRadius,
|
|
64
|
-
|
|
65
|
-
arcLabelMinAngle = 0,
|
|
59
|
+
paddingAngle,
|
|
66
60
|
data,
|
|
67
61
|
cx,
|
|
68
62
|
cy,
|
|
69
63
|
highlighted,
|
|
70
|
-
faded
|
|
64
|
+
faded,
|
|
65
|
+
highlightScope
|
|
66
|
+
} = series[seriesId];
|
|
67
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
68
|
+
transform: `translate(${cx === undefined ? center.x : left + cx}, ${cy === undefined ? center.y : top + cy})`,
|
|
69
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PieArcPlot.PieArcPlot, {
|
|
70
|
+
innerRadius: innerRadius,
|
|
71
|
+
outerRadius: outerRadius ?? availableRadius,
|
|
72
|
+
cornerRadius: cornerRadius,
|
|
73
|
+
paddingAngle: paddingAngle,
|
|
74
|
+
id: seriesId,
|
|
75
|
+
data: data,
|
|
76
|
+
skipAnimation: skipAnimation,
|
|
77
|
+
highlightScope: highlightScope,
|
|
78
|
+
highlighted: highlighted,
|
|
79
|
+
faded: faded,
|
|
80
|
+
onClick: onClick,
|
|
81
|
+
slots: slots,
|
|
82
|
+
slotProps: slotProps
|
|
83
|
+
})
|
|
84
|
+
}, seriesId);
|
|
85
|
+
}), seriesOrder.map(seriesId => {
|
|
86
|
+
const {
|
|
87
|
+
innerRadius,
|
|
88
|
+
outerRadius,
|
|
89
|
+
cornerRadius,
|
|
90
|
+
paddingAngle,
|
|
91
|
+
arcLabel,
|
|
92
|
+
arcLabelMinAngle,
|
|
93
|
+
data,
|
|
94
|
+
cx,
|
|
95
|
+
cy,
|
|
96
|
+
highlightScope
|
|
71
97
|
} = series[seriesId];
|
|
72
98
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
73
99
|
transform: `translate(${cx === undefined ? center.x : left + cx}, ${cy === undefined ? center.y : top + cy})`,
|
|
74
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
highlighted: highlighted,
|
|
86
|
-
faded: faded
|
|
87
|
-
}, slotProps?.pieArc));
|
|
88
|
-
}), data.map((item, index) => {
|
|
89
|
-
return /*#__PURE__*/(0, React.createElement)(ArcLabel, (0, _extends2.default)({}, item, {
|
|
90
|
-
key: item.id,
|
|
91
|
-
innerRadius: innerRadius,
|
|
92
|
-
outerRadius: outerRadius ?? availableRadius,
|
|
93
|
-
cornerRadius: cornerRadius,
|
|
94
|
-
id: seriesId,
|
|
95
|
-
color: item.color,
|
|
96
|
-
dataIndex: index,
|
|
97
|
-
highlightScope: series[seriesId].highlightScope,
|
|
98
|
-
formattedArcLabel: getItemLabel(arcLabel, arcLabelMinAngle, item)
|
|
99
|
-
}, slotProps?.pieArcLabel));
|
|
100
|
-
})]
|
|
100
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PieArcLabelPlot.PieArcLabelPlot, {
|
|
101
|
+
innerRadius: innerRadius,
|
|
102
|
+
outerRadius: outerRadius ?? availableRadius,
|
|
103
|
+
cornerRadius: cornerRadius,
|
|
104
|
+
paddingAngle: paddingAngle,
|
|
105
|
+
id: seriesId,
|
|
106
|
+
data: data,
|
|
107
|
+
skipAnimation: skipAnimation,
|
|
108
|
+
arcLabel: arcLabel,
|
|
109
|
+
arcLabelMinAngle: arcLabelMinAngle,
|
|
110
|
+
highlightScope: highlightScope
|
|
101
111
|
})
|
|
102
112
|
}, seriesId);
|
|
103
|
-
})
|
|
113
|
+
})]
|
|
104
114
|
});
|
|
105
115
|
}
|
|
106
116
|
process.env.NODE_ENV !== "production" ? PiePlot.propTypes = {
|
|
@@ -108,6 +118,18 @@ process.env.NODE_ENV !== "production" ? PiePlot.propTypes = {
|
|
|
108
118
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
109
119
|
// | To update them edit the TypeScript types and run "yarn proptypes" |
|
|
110
120
|
// ----------------------------------------------------------------------
|
|
121
|
+
/**
|
|
122
|
+
* Callback fired when a pie item is clicked.
|
|
123
|
+
* @param {React.MouseEvent<SVGPathElement, MouseEvent>} event The event source of the callback.
|
|
124
|
+
* @param {PieItemIdentifier} pieItemIdentifier The pie item identifier.
|
|
125
|
+
* @param {DefaultizedPieValueType} item The pie item.
|
|
126
|
+
*/
|
|
127
|
+
onClick: _propTypes.default.func,
|
|
128
|
+
/**
|
|
129
|
+
* If `true`, animations are skiped.
|
|
130
|
+
* @default false
|
|
131
|
+
*/
|
|
132
|
+
skipAnimation: _propTypes.default.bool,
|
|
111
133
|
/**
|
|
112
134
|
* The props used for each component slot.
|
|
113
135
|
* @default {}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { UseTransitionProps } from '@react-spring/web';
|
|
2
|
+
import { ValueWithHighlight } from './useTransformData';
|
|
3
|
+
export declare const defaultTransitionConfig: UseTransitionProps<ValueWithHighlight>;
|
|
4
|
+
export declare const defaultLabelTransitionConfig: UseTransitionProps<ValueWithHighlight>;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultTransitionConfig = exports.defaultLabelTransitionConfig = void 0;
|
|
7
|
+
const defaultTransitionConfig = exports.defaultTransitionConfig = {
|
|
8
|
+
keys: item => item.id,
|
|
9
|
+
from: ({
|
|
10
|
+
innerRadius,
|
|
11
|
+
outerRadius,
|
|
12
|
+
cornerRadius,
|
|
13
|
+
startAngle,
|
|
14
|
+
endAngle,
|
|
15
|
+
paddingAngle,
|
|
16
|
+
color,
|
|
17
|
+
isFaded
|
|
18
|
+
}) => ({
|
|
19
|
+
innerRadius,
|
|
20
|
+
outerRadius: (innerRadius + outerRadius) / 2,
|
|
21
|
+
cornerRadius,
|
|
22
|
+
startAngle: (startAngle + endAngle) / 2,
|
|
23
|
+
endAngle: (startAngle + endAngle) / 2,
|
|
24
|
+
paddingAngle,
|
|
25
|
+
fill: color,
|
|
26
|
+
opacity: isFaded ? 0.3 : 1
|
|
27
|
+
}),
|
|
28
|
+
leave: ({
|
|
29
|
+
innerRadius,
|
|
30
|
+
startAngle,
|
|
31
|
+
endAngle
|
|
32
|
+
}) => ({
|
|
33
|
+
innerRadius,
|
|
34
|
+
outerRadius: innerRadius,
|
|
35
|
+
startAngle: (startAngle + endAngle) / 2,
|
|
36
|
+
endAngle: (startAngle + endAngle) / 2
|
|
37
|
+
}),
|
|
38
|
+
enter: ({
|
|
39
|
+
innerRadius,
|
|
40
|
+
outerRadius,
|
|
41
|
+
startAngle,
|
|
42
|
+
endAngle
|
|
43
|
+
}) => ({
|
|
44
|
+
innerRadius,
|
|
45
|
+
outerRadius,
|
|
46
|
+
startAngle,
|
|
47
|
+
endAngle
|
|
48
|
+
}),
|
|
49
|
+
update: ({
|
|
50
|
+
innerRadius,
|
|
51
|
+
outerRadius,
|
|
52
|
+
cornerRadius,
|
|
53
|
+
startAngle,
|
|
54
|
+
endAngle,
|
|
55
|
+
paddingAngle,
|
|
56
|
+
color,
|
|
57
|
+
isFaded
|
|
58
|
+
}) => ({
|
|
59
|
+
innerRadius,
|
|
60
|
+
outerRadius,
|
|
61
|
+
cornerRadius,
|
|
62
|
+
startAngle,
|
|
63
|
+
endAngle,
|
|
64
|
+
paddingAngle,
|
|
65
|
+
fill: color,
|
|
66
|
+
opacity: isFaded ? 0.3 : 1
|
|
67
|
+
}),
|
|
68
|
+
config: {
|
|
69
|
+
tension: 120,
|
|
70
|
+
friction: 14,
|
|
71
|
+
clamp: true
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const defaultLabelTransitionConfig = exports.defaultLabelTransitionConfig = {
|
|
75
|
+
keys: item => item.id,
|
|
76
|
+
from: ({
|
|
77
|
+
innerRadius,
|
|
78
|
+
outerRadius,
|
|
79
|
+
cornerRadius,
|
|
80
|
+
startAngle,
|
|
81
|
+
endAngle,
|
|
82
|
+
paddingAngle
|
|
83
|
+
}) => ({
|
|
84
|
+
innerRadius,
|
|
85
|
+
outerRadius: (innerRadius + outerRadius) / 2,
|
|
86
|
+
cornerRadius,
|
|
87
|
+
startAngle: (startAngle + endAngle) / 2,
|
|
88
|
+
endAngle: (startAngle + endAngle) / 2,
|
|
89
|
+
paddingAngle,
|
|
90
|
+
opacity: 0
|
|
91
|
+
}),
|
|
92
|
+
leave: ({
|
|
93
|
+
innerRadius,
|
|
94
|
+
startAngle,
|
|
95
|
+
endAngle
|
|
96
|
+
}) => ({
|
|
97
|
+
innerRadius,
|
|
98
|
+
outerRadius: innerRadius,
|
|
99
|
+
startAngle: (startAngle + endAngle) / 2,
|
|
100
|
+
endAngle: (startAngle + endAngle) / 2,
|
|
101
|
+
opacity: 0
|
|
102
|
+
}),
|
|
103
|
+
enter: ({
|
|
104
|
+
innerRadius,
|
|
105
|
+
outerRadius,
|
|
106
|
+
startAngle,
|
|
107
|
+
endAngle
|
|
108
|
+
}) => ({
|
|
109
|
+
innerRadius,
|
|
110
|
+
outerRadius,
|
|
111
|
+
startAngle,
|
|
112
|
+
endAngle,
|
|
113
|
+
opacity: 1
|
|
114
|
+
}),
|
|
115
|
+
update: ({
|
|
116
|
+
innerRadius,
|
|
117
|
+
outerRadius,
|
|
118
|
+
cornerRadius,
|
|
119
|
+
startAngle,
|
|
120
|
+
endAngle,
|
|
121
|
+
paddingAngle
|
|
122
|
+
}) => ({
|
|
123
|
+
innerRadius,
|
|
124
|
+
outerRadius,
|
|
125
|
+
cornerRadius,
|
|
126
|
+
startAngle,
|
|
127
|
+
endAngle,
|
|
128
|
+
paddingAngle,
|
|
129
|
+
opacity: 1
|
|
130
|
+
}),
|
|
131
|
+
config: {
|
|
132
|
+
tension: 120,
|
|
133
|
+
friction: 14,
|
|
134
|
+
clamp: true
|
|
135
|
+
}
|
|
136
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DefaultizedPieSeriesType, DefaultizedPieValueType } from '../../models/seriesType/pie';
|
|
2
|
+
import { DefaultizedProps } from '../../models/helpers';
|
|
3
|
+
export interface AnimatedObject {
|
|
4
|
+
innerRadius: number;
|
|
5
|
+
outerRadius: number;
|
|
6
|
+
cornerRadius: number;
|
|
7
|
+
startAngle: number;
|
|
8
|
+
endAngle: number;
|
|
9
|
+
paddingAngle: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ValueWithHighlight extends DefaultizedPieValueType, AnimatedObject {
|
|
12
|
+
isFaded: boolean;
|
|
13
|
+
isHighlighted: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function useTransformData(series: DefaultizedProps<Pick<DefaultizedPieSeriesType, 'innerRadius' | 'outerRadius' | 'cornerRadius' | 'paddingAngle' | 'id' | 'highlightScope' | 'highlighted' | 'faded' | 'data'>, 'outerRadius'>): ValueWithHighlight[];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.useTransformData = useTransformData;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _InteractionProvider = require("../../context/InteractionProvider");
|
|
11
|
+
var _useInteractionItemProps = require("../../hooks/useInteractionItemProps");
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
function useTransformData(series) {
|
|
15
|
+
const {
|
|
16
|
+
id: seriesId,
|
|
17
|
+
highlightScope,
|
|
18
|
+
data,
|
|
19
|
+
faded,
|
|
20
|
+
highlighted,
|
|
21
|
+
paddingAngle: basePaddingAngle = 0,
|
|
22
|
+
innerRadius: baseInnerRadius = 0,
|
|
23
|
+
outerRadius: baseOuterRadius,
|
|
24
|
+
cornerRadius: baseCornerRadius = 0
|
|
25
|
+
} = series;
|
|
26
|
+
const {
|
|
27
|
+
item: highlightedItem
|
|
28
|
+
} = React.useContext(_InteractionProvider.InteractionContext);
|
|
29
|
+
const getHighlightStatus = React.useCallback(dataIndex => {
|
|
30
|
+
const isHighlighted = (0, _useInteractionItemProps.getIsHighlighted)(highlightedItem, {
|
|
31
|
+
type: 'pie',
|
|
32
|
+
seriesId,
|
|
33
|
+
dataIndex
|
|
34
|
+
}, highlightScope);
|
|
35
|
+
const isFaded = !isHighlighted && (0, _useInteractionItemProps.getIsFaded)(highlightedItem, {
|
|
36
|
+
type: 'pie',
|
|
37
|
+
seriesId,
|
|
38
|
+
dataIndex
|
|
39
|
+
}, highlightScope);
|
|
40
|
+
return {
|
|
41
|
+
isHighlighted,
|
|
42
|
+
isFaded
|
|
43
|
+
};
|
|
44
|
+
}, [highlightScope, highlightedItem, seriesId]);
|
|
45
|
+
const dataWithHighlight = React.useMemo(() => data.map((item, itemIndex) => {
|
|
46
|
+
const {
|
|
47
|
+
isHighlighted,
|
|
48
|
+
isFaded
|
|
49
|
+
} = getHighlightStatus(itemIndex);
|
|
50
|
+
const attibuesOverride = (0, _extends2.default)({
|
|
51
|
+
additionalRadius: 0
|
|
52
|
+
}, isFaded && faded || isHighlighted && highlighted || {});
|
|
53
|
+
const paddingAngle = Math.max(0, Math.PI * (attibuesOverride.paddingAngle ?? basePaddingAngle) / 180);
|
|
54
|
+
const innerRadius = Math.max(0, attibuesOverride.innerRadius ?? baseInnerRadius);
|
|
55
|
+
const outerRadius = Math.max(0, attibuesOverride.outerRadius ?? baseOuterRadius + attibuesOverride.additionalRadius);
|
|
56
|
+
const cornerRadius = attibuesOverride.cornerRadius ?? baseCornerRadius;
|
|
57
|
+
return (0, _extends2.default)({}, item, attibuesOverride, {
|
|
58
|
+
isFaded,
|
|
59
|
+
isHighlighted,
|
|
60
|
+
paddingAngle,
|
|
61
|
+
innerRadius,
|
|
62
|
+
outerRadius,
|
|
63
|
+
cornerRadius
|
|
64
|
+
});
|
|
65
|
+
}), [baseCornerRadius, baseInnerRadius, baseOuterRadius, basePaddingAngle, data, faded, getHighlightStatus, highlighted]);
|
|
66
|
+
return dataWithHighlight;
|
|
67
|
+
}
|
package/PieChart/formatter.js
CHANGED
package/PieChart/legend.js
CHANGED
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# MUI X Charts
|
|
2
2
|
|
|
3
|
-
This package is the community edition of the
|
|
4
|
-
It's part of MUI X, an open-core extension of MUI, with advanced components.
|
|
3
|
+
This package is the community edition of the chart components.
|
|
4
|
+
It's part of [MUI X](https://mui.com/x/), an open-core extension of MUI Core, with advanced components.
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
7
7
|
|
|
@@ -11,23 +11,17 @@ Install the package in your project directory with:
|
|
|
11
11
|
npm install @mui/x-charts
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
or
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
yarn add @mui/x-charts
|
|
18
|
-
```
|
|
19
|
-
|
|
20
14
|
This component has the following peer dependencies that you will need to install as well.
|
|
21
15
|
|
|
22
16
|
```json
|
|
23
17
|
"peerDependencies": {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
"@mui/material": "^5.4.1",
|
|
19
|
+
"@mui/system": "^5.4.1",
|
|
20
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
21
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
|
28
22
|
},
|
|
29
23
|
```
|
|
30
24
|
|
|
31
25
|
## Documentation
|
|
32
26
|
|
|
33
|
-
[
|
|
27
|
+
Visit [https://mui.com/x/react-charts/](https://mui.com/x/react-charts/) to view the full documentation.
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ChartContainerProps } from '../ChartContainer';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export interface ResponsiveChartContainerProps extends Omit<ChartContainerProps, 'width' | 'height'> {
|
|
4
|
+
/**
|
|
5
|
+
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
6
|
+
* @default undefined
|
|
7
|
+
*/
|
|
8
|
+
width?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
11
|
+
* @default undefined
|
|
12
|
+
*/
|
|
13
|
+
height?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const ResponsiveChartContainer: React.ForwardRefExoticComponent<ResponsiveChartContainerProps & React.RefAttributes<unknown>>;
|
|
@@ -14,8 +14,8 @@ var _styles = require("@mui/material/styles");
|
|
|
14
14
|
var _ChartContainer = require("../ChartContainer");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
const _excluded = ["width", "height"];
|
|
17
|
-
function _getRequireWildcardCache(
|
|
18
|
-
function _interopRequireWildcard(
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
19
|
const useChartDimensions = (inWidth, inHeight) => {
|
|
20
20
|
const rootRef = React.useRef(null);
|
|
21
21
|
const displayError = React.useRef(false);
|
|
@@ -51,7 +51,7 @@ const useChartDimensions = (inWidth, inHeight) => {
|
|
|
51
51
|
let animationFrame;
|
|
52
52
|
const observer = new ResizeObserver(() => {
|
|
53
53
|
// See https://github.com/mui/mui-x/issues/8733
|
|
54
|
-
animationFrame =
|
|
54
|
+
animationFrame = requestAnimationFrame(() => {
|
|
55
55
|
computeSize();
|
|
56
56
|
});
|
|
57
57
|
});
|
|
@@ -99,7 +99,7 @@ const ResizableContainer = (0, _styles.styled)('div', {
|
|
|
99
99
|
height: '100%'
|
|
100
100
|
}
|
|
101
101
|
}));
|
|
102
|
-
const ResponsiveChartContainer = /*#__PURE__*/React.forwardRef(function ResponsiveChartContainer(props, ref) {
|
|
102
|
+
const ResponsiveChartContainer = exports.ResponsiveChartContainer = /*#__PURE__*/React.forwardRef(function ResponsiveChartContainer(props, ref) {
|
|
103
103
|
const {
|
|
104
104
|
width: inWidth,
|
|
105
105
|
height: inHeight
|
|
@@ -112,11 +112,10 @@ const ResponsiveChartContainer = /*#__PURE__*/React.forwardRef(function Responsi
|
|
|
112
112
|
width: inWidth,
|
|
113
113
|
height: inHeight
|
|
114
114
|
},
|
|
115
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartContainer.ChartContainer, (0, _extends2.default)({}, other, {
|
|
115
|
+
children: width && height ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartContainer.ChartContainer, (0, _extends2.default)({}, other, {
|
|
116
116
|
width: width,
|
|
117
117
|
height: height,
|
|
118
118
|
ref: ref
|
|
119
|
-
}))
|
|
119
|
+
})) : null
|
|
120
120
|
});
|
|
121
|
-
});
|
|
122
|
-
exports.ResponsiveChartContainer = ResponsiveChartContainer;
|
|
121
|
+
});
|
|
@@ -8,6 +8,16 @@ export interface ScatterProps {
|
|
|
8
8
|
markerSize: number;
|
|
9
9
|
color: string;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Demos:
|
|
13
|
+
*
|
|
14
|
+
* - [Scatter](https://mui.com/x/react-charts/scatter/)
|
|
15
|
+
* - [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/)
|
|
16
|
+
*
|
|
17
|
+
* API:
|
|
18
|
+
*
|
|
19
|
+
* - [Scatter API](https://mui.com/x/api/charts/scatter/)
|
|
20
|
+
*/
|
|
11
21
|
declare function Scatter(props: ScatterProps): React.JSX.Element;
|
|
12
22
|
declare namespace Scatter {
|
|
13
23
|
var propTypes: any;
|
package/ScatterChart/Scatter.js
CHANGED
|
@@ -12,8 +12,18 @@ var _useScale = require("../hooks/useScale");
|
|
|
12
12
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
13
13
|
var _InteractionProvider = require("../context/InteractionProvider");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
/**
|
|
18
|
+
* Demos:
|
|
19
|
+
*
|
|
20
|
+
* - [Scatter](https://mui.com/x/react-charts/scatter/)
|
|
21
|
+
* - [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/)
|
|
22
|
+
*
|
|
23
|
+
* API:
|
|
24
|
+
*
|
|
25
|
+
* - [Scatter API](https://mui.com/x/api/charts/scatter/)
|
|
26
|
+
*/
|
|
17
27
|
function Scatter(props) {
|
|
18
28
|
const {
|
|
19
29
|
series,
|
|
@@ -4,18 +4,21 @@ import { ResponsiveChartContainerProps } from '../ResponsiveChartContainer';
|
|
|
4
4
|
import { ChartsAxisProps } from '../ChartsAxis';
|
|
5
5
|
import { ScatterSeriesType } from '../models/seriesType/scatter';
|
|
6
6
|
import { MakeOptional } from '../models/helpers';
|
|
7
|
-
import { ChartsTooltipProps } from '../ChartsTooltip';
|
|
7
|
+
import { ChartsTooltipProps, ChartsTooltipSlotComponentProps, ChartsTooltipSlotsComponent } from '../ChartsTooltip';
|
|
8
8
|
import { ChartsLegendProps, ChartsLegendSlotComponentProps, ChartsLegendSlotsComponent } from '../ChartsLegend';
|
|
9
9
|
import { ChartsAxisHighlightProps } from '../ChartsAxisHighlight';
|
|
10
10
|
import { ChartsAxisSlotsComponent, ChartsAxisSlotComponentProps } from '../models/axis';
|
|
11
|
-
export interface ScatterChartSlotsComponent extends ChartsAxisSlotsComponent, ScatterPlotSlotsComponent, ChartsLegendSlotsComponent {
|
|
11
|
+
export interface ScatterChartSlotsComponent extends ChartsAxisSlotsComponent, ScatterPlotSlotsComponent, ChartsLegendSlotsComponent, ChartsTooltipSlotsComponent {
|
|
12
12
|
}
|
|
13
|
-
export interface ScatterChartSlotComponentProps extends ChartsAxisSlotComponentProps, ScatterPlotSlotComponentProps, ChartsLegendSlotComponentProps {
|
|
13
|
+
export interface ScatterChartSlotComponentProps extends ChartsAxisSlotComponentProps, ScatterPlotSlotComponentProps, ChartsLegendSlotComponentProps, ChartsTooltipSlotComponentProps {
|
|
14
14
|
}
|
|
15
15
|
export interface ScatterChartProps extends Omit<ResponsiveChartContainerProps, 'series'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'> {
|
|
16
16
|
series: MakeOptional<ScatterSeriesType, 'type'>[];
|
|
17
17
|
tooltip?: ChartsTooltipProps;
|
|
18
18
|
axisHighlight?: ChartsAxisHighlightProps;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Consider using `slotProps.legend` instead.
|
|
21
|
+
*/
|
|
19
22
|
legend?: ChartsLegendProps;
|
|
20
23
|
/**
|
|
21
24
|
* Overridable component slots.
|
|
@@ -28,5 +31,15 @@ export interface ScatterChartProps extends Omit<ResponsiveChartContainerProps, '
|
|
|
28
31
|
*/
|
|
29
32
|
slotProps?: ScatterChartSlotComponentProps;
|
|
30
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Demos:
|
|
36
|
+
*
|
|
37
|
+
* - [Scatter](https://mui.com/x/react-charts/scatter/)
|
|
38
|
+
* - [Scatter demonstration](https://mui.com/x/react-charts/scatter-demo/)
|
|
39
|
+
*
|
|
40
|
+
* API:
|
|
41
|
+
*
|
|
42
|
+
* - [ScatterChart API](https://mui.com/x/api/charts/scatter-chart/)
|
|
43
|
+
*/
|
|
31
44
|
declare const ScatterChart: React.ForwardRefExoticComponent<ScatterChartProps & React.RefAttributes<unknown>>;
|
|
32
45
|
export { ScatterChart };
|