@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/ChartContainer/index.js
CHANGED
|
@@ -10,13 +10,14 @@ var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
|
|
|
10
10
|
var _DrawingProvider = require("../context/DrawingProvider");
|
|
11
11
|
var _SeriesContextProvider = require("../context/SeriesContextProvider");
|
|
12
12
|
var _InteractionProvider = require("../context/InteractionProvider");
|
|
13
|
+
var _useReducedMotion = require("../hooks/useReducedMotion");
|
|
13
14
|
var _ChartsSurface = require("../ChartsSurface");
|
|
14
15
|
var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
15
16
|
var _HighlightProvider = require("../context/HighlightProvider");
|
|
16
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
function _getRequireWildcardCache(
|
|
18
|
-
function _interopRequireWildcard(
|
|
19
|
-
const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
|
|
18
|
+
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); }
|
|
19
|
+
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; }
|
|
20
|
+
const ChartContainer = exports.ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(props, ref) {
|
|
20
21
|
const {
|
|
21
22
|
width,
|
|
22
23
|
height,
|
|
@@ -34,6 +35,8 @@ const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(pro
|
|
|
34
35
|
} = props;
|
|
35
36
|
const svgRef = React.useRef(null);
|
|
36
37
|
const handleRef = (0, _useForkRef.default)(ref, svgRef);
|
|
38
|
+
(0, _useReducedMotion.useReducedMotion)(); // a11y reduce motion (see: https://react-spring.dev/docs/utilities/use-reduced-motion)
|
|
39
|
+
|
|
37
40
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DrawingProvider.DrawingProvider, {
|
|
38
41
|
width: width,
|
|
39
42
|
height: height,
|
|
@@ -64,5 +67,4 @@ const ChartContainer = /*#__PURE__*/React.forwardRef(function ChartContainer(pro
|
|
|
64
67
|
})
|
|
65
68
|
})
|
|
66
69
|
});
|
|
67
|
-
});
|
|
68
|
-
exports.ChartContainer = ChartContainer;
|
|
70
|
+
});
|
|
@@ -36,6 +36,15 @@ export interface ChartsAxisProps {
|
|
|
36
36
|
*/
|
|
37
37
|
slotProps?: ChartsAxisSlotComponentProps;
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Demos:
|
|
41
|
+
*
|
|
42
|
+
* - [Axis](https://mui.com/x/react-charts/axis/)
|
|
43
|
+
*
|
|
44
|
+
* API:
|
|
45
|
+
*
|
|
46
|
+
* - [ChartsAxis API](https://mui.com/x/api/charts/charts-axis/)
|
|
47
|
+
*/
|
|
39
48
|
declare function ChartsAxis(props: ChartsAxisProps): React.JSX.Element;
|
|
40
49
|
declare namespace ChartsAxis {
|
|
41
50
|
var propTypes: any;
|
package/ChartsAxis/ChartsAxis.js
CHANGED
|
@@ -12,14 +12,14 @@ var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
|
12
12
|
var _ChartsXAxis = require("../ChartsXAxis");
|
|
13
13
|
var _ChartsYAxis = require("../ChartsYAxis");
|
|
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
17
|
const getAxisId = propsValue => {
|
|
18
18
|
if (propsValue == null) {
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
21
21
|
if (typeof propsValue === 'object') {
|
|
22
|
-
return propsValue.axisId;
|
|
22
|
+
return propsValue.axisId ?? null;
|
|
23
23
|
}
|
|
24
24
|
return propsValue;
|
|
25
25
|
};
|
|
@@ -32,6 +32,16 @@ const mergeProps = (axisConfig, slots, slotProps) => {
|
|
|
32
32
|
slotProps
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Demos:
|
|
38
|
+
*
|
|
39
|
+
* - [Axis](https://mui.com/x/react-charts/axis/)
|
|
40
|
+
*
|
|
41
|
+
* API:
|
|
42
|
+
*
|
|
43
|
+
* - [ChartsAxis API](https://mui.com/x/api/charts/charts-axis/)
|
|
44
|
+
*/
|
|
35
45
|
function ChartsAxis(props) {
|
|
36
46
|
const {
|
|
37
47
|
topAxis,
|
|
@@ -98,18 +108,22 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
98
108
|
* @default xAxisIds[0] The id of the first provided axis
|
|
99
109
|
*/
|
|
100
110
|
bottomAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
101
|
-
axisId: _propTypes.default.string
|
|
111
|
+
axisId: _propTypes.default.string,
|
|
102
112
|
classes: _propTypes.default.object,
|
|
103
113
|
disableLine: _propTypes.default.bool,
|
|
104
114
|
disableTicks: _propTypes.default.bool,
|
|
105
115
|
fill: _propTypes.default.string,
|
|
106
116
|
label: _propTypes.default.string,
|
|
107
117
|
labelFontSize: _propTypes.default.number,
|
|
118
|
+
labelStyle: _propTypes.default.object,
|
|
108
119
|
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
109
120
|
slotProps: _propTypes.default.object,
|
|
110
121
|
slots: _propTypes.default.object,
|
|
111
122
|
stroke: _propTypes.default.string,
|
|
112
123
|
tickFontSize: _propTypes.default.number,
|
|
124
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
125
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
126
|
+
tickLabelStyle: _propTypes.default.object,
|
|
113
127
|
tickMaxStep: _propTypes.default.number,
|
|
114
128
|
tickMinStep: _propTypes.default.number,
|
|
115
129
|
tickNumber: _propTypes.default.number,
|
|
@@ -121,18 +135,22 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
121
135
|
* @default yAxisIds[0] The id of the first provided axis
|
|
122
136
|
*/
|
|
123
137
|
leftAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
124
|
-
axisId: _propTypes.default.string
|
|
138
|
+
axisId: _propTypes.default.string,
|
|
125
139
|
classes: _propTypes.default.object,
|
|
126
140
|
disableLine: _propTypes.default.bool,
|
|
127
141
|
disableTicks: _propTypes.default.bool,
|
|
128
142
|
fill: _propTypes.default.string,
|
|
129
143
|
label: _propTypes.default.string,
|
|
130
144
|
labelFontSize: _propTypes.default.number,
|
|
145
|
+
labelStyle: _propTypes.default.object,
|
|
131
146
|
position: _propTypes.default.oneOf(['left', 'right']),
|
|
132
147
|
slotProps: _propTypes.default.object,
|
|
133
148
|
slots: _propTypes.default.object,
|
|
134
149
|
stroke: _propTypes.default.string,
|
|
135
150
|
tickFontSize: _propTypes.default.number,
|
|
151
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
152
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
153
|
+
tickLabelStyle: _propTypes.default.object,
|
|
136
154
|
tickMaxStep: _propTypes.default.number,
|
|
137
155
|
tickMinStep: _propTypes.default.number,
|
|
138
156
|
tickNumber: _propTypes.default.number,
|
|
@@ -144,18 +162,22 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
144
162
|
* @default null
|
|
145
163
|
*/
|
|
146
164
|
rightAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
147
|
-
axisId: _propTypes.default.string
|
|
165
|
+
axisId: _propTypes.default.string,
|
|
148
166
|
classes: _propTypes.default.object,
|
|
149
167
|
disableLine: _propTypes.default.bool,
|
|
150
168
|
disableTicks: _propTypes.default.bool,
|
|
151
169
|
fill: _propTypes.default.string,
|
|
152
170
|
label: _propTypes.default.string,
|
|
153
171
|
labelFontSize: _propTypes.default.number,
|
|
172
|
+
labelStyle: _propTypes.default.object,
|
|
154
173
|
position: _propTypes.default.oneOf(['left', 'right']),
|
|
155
174
|
slotProps: _propTypes.default.object,
|
|
156
175
|
slots: _propTypes.default.object,
|
|
157
176
|
stroke: _propTypes.default.string,
|
|
158
177
|
tickFontSize: _propTypes.default.number,
|
|
178
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
179
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
180
|
+
tickLabelStyle: _propTypes.default.object,
|
|
159
181
|
tickMaxStep: _propTypes.default.number,
|
|
160
182
|
tickMinStep: _propTypes.default.number,
|
|
161
183
|
tickNumber: _propTypes.default.number,
|
|
@@ -177,18 +199,22 @@ process.env.NODE_ENV !== "production" ? ChartsAxis.propTypes = {
|
|
|
177
199
|
* @default null
|
|
178
200
|
*/
|
|
179
201
|
topAxis: _propTypes.default.oneOfType([_propTypes.default.shape({
|
|
180
|
-
axisId: _propTypes.default.string
|
|
202
|
+
axisId: _propTypes.default.string,
|
|
181
203
|
classes: _propTypes.default.object,
|
|
182
204
|
disableLine: _propTypes.default.bool,
|
|
183
205
|
disableTicks: _propTypes.default.bool,
|
|
184
206
|
fill: _propTypes.default.string,
|
|
185
207
|
label: _propTypes.default.string,
|
|
186
208
|
labelFontSize: _propTypes.default.number,
|
|
209
|
+
labelStyle: _propTypes.default.object,
|
|
187
210
|
position: _propTypes.default.oneOf(['bottom', 'top']),
|
|
188
211
|
slotProps: _propTypes.default.object,
|
|
189
212
|
slots: _propTypes.default.object,
|
|
190
213
|
stroke: _propTypes.default.string,
|
|
191
214
|
tickFontSize: _propTypes.default.number,
|
|
215
|
+
tickInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.array, _propTypes.default.func]),
|
|
216
|
+
tickLabelInterval: _propTypes.default.oneOfType([_propTypes.default.oneOf(['auto']), _propTypes.default.func]),
|
|
217
|
+
tickLabelStyle: _propTypes.default.object,
|
|
192
218
|
tickMaxStep: _propTypes.default.number,
|
|
193
219
|
tickMinStep: _propTypes.default.number,
|
|
194
220
|
tickNumber: _propTypes.default.number,
|
|
@@ -9,11 +9,11 @@ export interface ChartsAxisClasses {
|
|
|
9
9
|
tick: string;
|
|
10
10
|
/** Styles applied to ticks label. */
|
|
11
11
|
tickLabel: string;
|
|
12
|
-
/** Styles applied to the axis label. */
|
|
12
|
+
/** Styles applied to the group containing the axis label. */
|
|
13
13
|
label: string;
|
|
14
|
-
/** Styles applied to x
|
|
14
|
+
/** Styles applied to x-axes. */
|
|
15
15
|
directionX: string;
|
|
16
|
-
/** Styles applied to y
|
|
16
|
+
/** Styles applied to y-axes. */
|
|
17
17
|
directionY: string;
|
|
18
18
|
/** Styles applied to the top axis. */
|
|
19
19
|
top: string;
|
|
@@ -9,5 +9,4 @@ var _utils = require("@mui/utils");
|
|
|
9
9
|
function getAxisUtilityClass(slot) {
|
|
10
10
|
return (0, _utils.unstable_generateUtilityClass)('MuiChartsAxis', slot);
|
|
11
11
|
}
|
|
12
|
-
const axisClasses = (0, _utils.unstable_generateUtilityClasses)('MuiChartsAxis', ['root', 'line', 'tickContainer', 'tick', 'tickLabel', 'label', 'directionX', 'directionY', 'top', 'bottom', 'left', 'right']);
|
|
13
|
-
exports.axisClasses = axisClasses;
|
|
12
|
+
const axisClasses = exports.axisClasses = (0, _utils.unstable_generateUtilityClasses)('MuiChartsAxis', ['root', 'line', 'tickContainer', 'tick', 'tickLabel', 'label', 'directionX', 'directionY', 'top', 'bottom', 'left', 'right']);
|
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
export interface ChartsAxisHighlightClasses {
|
|
3
|
+
/** Styles applied to the root element. */
|
|
4
|
+
root: string;
|
|
5
|
+
}
|
|
6
|
+
export type ChartsAxisHighlightClassKey = keyof ChartsAxisHighlightClasses;
|
|
7
|
+
export declare function getAxisHighlightUtilityClass(slot: string): string;
|
|
8
|
+
export declare const chartsAxisHighlightClasses: ChartsAxisHighlightClasses;
|
|
9
|
+
export declare const ChartsAxisHighlightPath: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
10
|
+
ownerState: {
|
|
11
|
+
axisHighlight: AxisHighlight;
|
|
12
|
+
};
|
|
13
|
+
}, Pick<React.SVGProps<SVGPathElement>, keyof React.SVGProps<SVGPathElement>>, {}>;
|
|
2
14
|
type AxisHighlight = 'none' | 'line' | 'band';
|
|
3
15
|
export type ChartsAxisHighlightProps = {
|
|
4
16
|
x?: AxisHighlight;
|
|
5
17
|
y?: AxisHighlight;
|
|
6
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* Demos:
|
|
21
|
+
*
|
|
22
|
+
* - [Custom components](https://mui.com/x/react-charts/components/)
|
|
23
|
+
*
|
|
24
|
+
* API:
|
|
25
|
+
*
|
|
26
|
+
* - [ChartsAxisHighlight API](https://mui.com/x/api/charts/charts-axis-highlight/)
|
|
27
|
+
*/
|
|
7
28
|
declare function ChartsAxisHighlight(props: ChartsAxisHighlightProps): React.JSX.Element;
|
|
8
29
|
declare namespace ChartsAxisHighlight {
|
|
9
30
|
var propTypes: any;
|
|
@@ -5,15 +5,57 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.ChartsAxisHighlight = ChartsAxisHighlight;
|
|
8
|
+
exports.chartsAxisHighlightClasses = exports.ChartsAxisHighlightPath = void 0;
|
|
9
|
+
exports.getAxisHighlightUtilityClass = getAxisHighlightUtilityClass;
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
8
11
|
var React = _interopRequireWildcard(require("react"));
|
|
9
12
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _composeClasses = _interopRequireDefault(require("@mui/utils/composeClasses"));
|
|
14
|
+
var _generateUtilityClass = _interopRequireDefault(require("@mui/utils/generateUtilityClass"));
|
|
15
|
+
var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generateUtilityClasses"));
|
|
16
|
+
var _styles = require("@mui/material/styles");
|
|
10
17
|
var _InteractionProvider = require("../context/InteractionProvider");
|
|
11
18
|
var _CartesianContextProvider = require("../context/CartesianContextProvider");
|
|
12
19
|
var _useScale = require("../hooks/useScale");
|
|
13
20
|
var _isBandScale = require("../internals/isBandScale");
|
|
14
21
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
22
|
+
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); }
|
|
23
|
+
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; }
|
|
24
|
+
function getAxisHighlightUtilityClass(slot) {
|
|
25
|
+
return (0, _generateUtilityClass.default)('MuiChartsAxisHighlight', slot);
|
|
26
|
+
}
|
|
27
|
+
const chartsAxisHighlightClasses = exports.chartsAxisHighlightClasses = (0, _generateUtilityClasses.default)('MuiChartsAxisHighlight', ['root']);
|
|
28
|
+
const useUtilityClasses = () => {
|
|
29
|
+
const slots = {
|
|
30
|
+
root: ['root']
|
|
31
|
+
};
|
|
32
|
+
return (0, _composeClasses.default)(slots, getAxisHighlightUtilityClass);
|
|
33
|
+
};
|
|
34
|
+
const ChartsAxisHighlightPath = exports.ChartsAxisHighlightPath = (0, _styles.styled)('path', {
|
|
35
|
+
name: 'MuiChartsAxisHighlight',
|
|
36
|
+
slot: 'Root',
|
|
37
|
+
overridesResolver: (_, styles) => styles.root
|
|
38
|
+
})(({
|
|
39
|
+
ownerState,
|
|
40
|
+
theme
|
|
41
|
+
}) => (0, _extends2.default)({
|
|
42
|
+
pointerEvents: 'none'
|
|
43
|
+
}, ownerState.axisHighlight === 'band' && {
|
|
44
|
+
fill: theme.palette.mode === 'light' ? 'gray' : 'white',
|
|
45
|
+
fillOpacity: 0.1
|
|
46
|
+
}, ownerState.axisHighlight === 'line' && {
|
|
47
|
+
strokeDasharray: '5 2',
|
|
48
|
+
stroke: theme.palette.mode === 'light' ? '#000000' : '#ffffff'
|
|
49
|
+
}));
|
|
50
|
+
/**
|
|
51
|
+
* Demos:
|
|
52
|
+
*
|
|
53
|
+
* - [Custom components](https://mui.com/x/react-charts/components/)
|
|
54
|
+
*
|
|
55
|
+
* API:
|
|
56
|
+
*
|
|
57
|
+
* - [ChartsAxisHighlight API](https://mui.com/x/api/charts/charts-axis-highlight/)
|
|
58
|
+
*/
|
|
17
59
|
function ChartsAxisHighlight(props) {
|
|
18
60
|
const {
|
|
19
61
|
x: xAxisHighlight,
|
|
@@ -25,6 +67,7 @@ function ChartsAxisHighlight(props) {
|
|
|
25
67
|
yAxisIds,
|
|
26
68
|
yAxis
|
|
27
69
|
} = React.useContext(_CartesianContextProvider.CartesianContext);
|
|
70
|
+
const classes = useUtilityClasses();
|
|
28
71
|
const USED_X_AXIS_ID = xAxisIds[0];
|
|
29
72
|
const USED_Y_AXIS_ID = yAxisIds[0];
|
|
30
73
|
const xScale = xAxis[USED_X_AXIS_ID].scale;
|
|
@@ -35,33 +78,29 @@ function ChartsAxisHighlight(props) {
|
|
|
35
78
|
const getXPosition = (0, _useScale.getValueToPositionMapper)(xScale);
|
|
36
79
|
const getYPosition = (0, _useScale.getValueToPositionMapper)(yScale);
|
|
37
80
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
38
|
-
children: [xAxisHighlight === 'band' && axis.x !== null && (0, _isBandScale.isBandScale)(xScale) && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
81
|
+
children: [xAxisHighlight === 'band' && axis.x !== null && (0, _isBandScale.isBandScale)(xScale) && /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsAxisHighlightPath, {
|
|
39
82
|
d: `M ${xScale(axis.x.value) - (xScale.step() - xScale.bandwidth()) / 2} ${yScale.range()[0]} l ${xScale.step()} 0 l 0 ${yScale.range()[1] - yScale.range()[0]} l ${-xScale.step()} 0 Z`,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
pointerEvents: 'none'
|
|
83
|
+
className: classes.root,
|
|
84
|
+
ownerState: {
|
|
85
|
+
axisHighlight: 'band'
|
|
44
86
|
}
|
|
45
|
-
}), yAxisHighlight === 'band' && axis.y !== null && (0, _isBandScale.isBandScale)(yScale) && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
87
|
+
}), yAxisHighlight === 'band' && axis.y !== null && (0, _isBandScale.isBandScale)(yScale) && /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsAxisHighlightPath, {
|
|
46
88
|
d: `M ${xScale.range()[0]} ${yScale(axis.y.value) - (yScale.step() - yScale.bandwidth()) / 2} l 0 ${yScale.step()} l ${xScale.range()[1] - xScale.range()[0]} 0 l 0 ${-yScale.step()} Z`,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
pointerEvents: 'none'
|
|
89
|
+
className: classes.root,
|
|
90
|
+
ownerState: {
|
|
91
|
+
axisHighlight: 'band'
|
|
51
92
|
}
|
|
52
|
-
}), xAxisHighlight === 'line' && axis.x !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
93
|
+
}), xAxisHighlight === 'line' && axis.x !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsAxisHighlightPath, {
|
|
53
94
|
d: `M ${getXPosition(axis.x.value)} ${yScale.range()[0]} L ${getXPosition(axis.x.value)} ${yScale.range()[1]}`,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
pointerEvents: 'none'
|
|
95
|
+
className: classes.root,
|
|
96
|
+
ownerState: {
|
|
97
|
+
axisHighlight: 'line'
|
|
58
98
|
}
|
|
59
|
-
}), yAxisHighlight === 'line' && axis.y !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
99
|
+
}), yAxisHighlight === 'line' && axis.y !== null && /*#__PURE__*/(0, _jsxRuntime.jsx)(ChartsAxisHighlightPath, {
|
|
60
100
|
d: `M ${xScale.range()[0]} ${getYPosition(axis.y.value)} L ${xScale.range()[1]} ${getYPosition(axis.y.value)}`,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
pointerEvents: 'none'
|
|
101
|
+
className: classes.root,
|
|
102
|
+
ownerState: {
|
|
103
|
+
axisHighlight: 'line'
|
|
65
104
|
}
|
|
66
105
|
})]
|
|
67
106
|
});
|
|
@@ -8,6 +8,11 @@ export type ChartsClipPathProps = {
|
|
|
8
8
|
left?: number;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* API:
|
|
13
|
+
*
|
|
14
|
+
* - [ChartsClipPath API](https://mui.com/x/api/charts/charts-clip-path/)
|
|
15
|
+
*/
|
|
11
16
|
declare function ChartsClipPath(props: ChartsClipPathProps): React.JSX.Element;
|
|
12
17
|
declare namespace ChartsClipPath {
|
|
13
18
|
var propTypes: any;
|
|
@@ -10,8 +10,13 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _DrawingProvider = require("../context/DrawingProvider");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _getRequireWildcardCache(
|
|
14
|
-
function _interopRequireWildcard(
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
/**
|
|
16
|
+
* API:
|
|
17
|
+
*
|
|
18
|
+
* - [ChartsClipPath API](https://mui.com/x/api/charts/charts-clip-path/)
|
|
19
|
+
*/
|
|
15
20
|
function ChartsClipPath(props) {
|
|
16
21
|
const {
|
|
17
22
|
id,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Theme } from '@mui/material/styles';
|
|
3
3
|
import { DrawingArea } from '../context/DrawingProvider';
|
|
4
|
-
import { AnchorPosition,
|
|
4
|
+
import { AnchorPosition, Direction } from './utils';
|
|
5
5
|
import { FormattedSeries } from '../context/SeriesContextProvider';
|
|
6
6
|
import { ChartsLegendClasses } from './chartsLegendClasses';
|
|
7
7
|
import { DefaultizedProps } from '../models/helpers';
|
|
8
|
-
import {
|
|
8
|
+
import { LegendParams } from '../models/seriesType/config';
|
|
9
|
+
import { ChartsTextStyle } from '../internals/components/ChartsText';
|
|
10
|
+
import { CardinalDirections } from '../models/layout';
|
|
9
11
|
export interface ChartsLegendSlotsComponent {
|
|
10
12
|
legend?: React.JSXElementConstructor<LegendRendererProps>;
|
|
11
13
|
}
|
|
@@ -14,18 +16,20 @@ export interface ChartsLegendSlotComponentProps {
|
|
|
14
16
|
}
|
|
15
17
|
export type ChartsLegendProps = {
|
|
16
18
|
position?: AnchorPosition;
|
|
17
|
-
offset?: Partial<{
|
|
18
|
-
x: number;
|
|
19
|
-
y: number;
|
|
20
|
-
}>;
|
|
21
19
|
/**
|
|
22
20
|
* Override or extend the styles applied to the component.
|
|
23
21
|
*/
|
|
24
22
|
classes?: Partial<ChartsLegendClasses>;
|
|
25
23
|
/**
|
|
26
24
|
* Set to true to hide the legend.
|
|
25
|
+
* @default false
|
|
27
26
|
*/
|
|
28
27
|
hidden?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The direction of the legend layout.
|
|
30
|
+
* The default depends on the chart.
|
|
31
|
+
*/
|
|
32
|
+
direction?: Direction;
|
|
29
33
|
/**
|
|
30
34
|
* Overridable component slots.
|
|
31
35
|
* @default {}
|
|
@@ -36,36 +40,53 @@ export type ChartsLegendProps = {
|
|
|
36
40
|
* @default {}
|
|
37
41
|
*/
|
|
38
42
|
slotProps?: ChartsLegendSlotComponentProps;
|
|
39
|
-
} & SizingParams;
|
|
40
|
-
type DefaultizedChartsLegendProps = DefaultizedProps<ChartsLegendProps, 'direction' | 'position'>;
|
|
41
|
-
type SeriesLegendOwnerState = ChartSeriesDefaultized<any> & Pick<DefaultizedChartsLegendProps, 'direction'> & {
|
|
42
|
-
seriesIndex: number;
|
|
43
43
|
};
|
|
44
|
+
type DefaultizedChartsLegendProps = DefaultizedProps<ChartsLegendProps, 'direction' | 'position'>;
|
|
44
45
|
export type ChartsLegendRootOwnerState = {
|
|
45
46
|
position: AnchorPosition;
|
|
46
|
-
direction:
|
|
47
|
+
direction: Direction;
|
|
47
48
|
drawingArea: DrawingArea;
|
|
48
49
|
offsetX?: number;
|
|
49
50
|
offsetY?: number;
|
|
50
51
|
seriesNumber: number;
|
|
51
52
|
};
|
|
52
|
-
export declare const ChartsLegendRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme
|
|
53
|
-
ownerState: ChartsLegendRootOwnerState;
|
|
54
|
-
}, Pick<React.SVGProps<SVGGElement>, keyof React.SVGProps<SVGGElement>>, {}>;
|
|
55
|
-
export declare const ChartsSeriesLegendGroup: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
56
|
-
ownerState: SeriesLegendOwnerState;
|
|
57
|
-
}, Pick<React.SVGProps<SVGGElement>, keyof React.SVGProps<SVGGElement>>, {}>;
|
|
58
|
-
export declare const ChartsLegendMark: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
59
|
-
ownerState: {
|
|
60
|
-
color: string;
|
|
61
|
-
};
|
|
62
|
-
}, Pick<React.SVGProps<SVGRectElement>, keyof React.SVGProps<SVGRectElement>>, {}>;
|
|
63
|
-
export declare const ChartsLegendLabel: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, Pick<React.SVGTextElementAttributes<SVGTextElement>, keyof React.SVGTextElementAttributes<SVGTextElement>>, {}>;
|
|
53
|
+
export declare const ChartsLegendRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme>, Pick<React.SVGProps<SVGGElement>, keyof React.SVGProps<SVGGElement>>, {}>;
|
|
64
54
|
export interface LegendRendererProps extends Omit<DefaultizedChartsLegendProps, 'slots' | 'slotProps'> {
|
|
65
55
|
series: FormattedSeries;
|
|
66
56
|
seriesToDisplay: LegendParams[];
|
|
67
57
|
drawingArea: DrawingArea;
|
|
68
|
-
classes: Record<'
|
|
58
|
+
classes: Record<'mark' | 'series' | 'root', string>;
|
|
59
|
+
/**
|
|
60
|
+
* Style applied to legend labels.
|
|
61
|
+
* @default theme.typography.subtitle1
|
|
62
|
+
*/
|
|
63
|
+
labelStyle?: ChartsTextStyle;
|
|
64
|
+
/**
|
|
65
|
+
* Width of the item mark (in px).
|
|
66
|
+
* @default 20
|
|
67
|
+
*/
|
|
68
|
+
itemMarkWidth?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Height of the item mark (in px).
|
|
71
|
+
* @default 20
|
|
72
|
+
*/
|
|
73
|
+
itemMarkHeight?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Space between the mark and the label (in px).
|
|
76
|
+
* @default 5
|
|
77
|
+
*/
|
|
78
|
+
markGap?: number;
|
|
79
|
+
/**
|
|
80
|
+
* Space between two legend items (in px).
|
|
81
|
+
* @default 10
|
|
82
|
+
*/
|
|
83
|
+
itemGap?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Legend padding (in px).
|
|
86
|
+
* Can either be a single number, or an object with top, left, bottom, right properties.
|
|
87
|
+
* @default 0
|
|
88
|
+
*/
|
|
89
|
+
padding?: number | Partial<CardinalDirections<number>>;
|
|
69
90
|
}
|
|
70
91
|
export declare function ChartsLegend(inProps: ChartsLegendProps): React.JSX.Element;
|
|
71
92
|
export {};
|