@mui/x-charts 8.0.0-alpha.1 → 8.0.0-alpha.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.js +0 -4
- package/BarChart/BarLabel/BarLabel.d.ts +298 -298
- package/CHANGELOG.md +330 -7
- package/ChartContainer/ChartContainer.d.ts +24 -0
- package/ChartContainer/ChartContainer.js +26 -10
- package/ChartContainer/useChartContainerProps.d.ts +0 -1
- package/ChartContainer/useChartContainerProps.js +3 -4
- package/ChartsAxis/axisClasses.js +2 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +3 -3
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +3 -3
- package/ChartsLegend/chartsLegendClasses.js +2 -1
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/ChartsSurface/ChartsSurface.d.ts +14 -0
- package/ChartsSurface/ChartsSurface.js +38 -6
- package/ChartsTooltip/ChartsTooltip.js +2 -20
- package/ChartsTooltip/ChartsTooltipContainer.js +5 -23
- package/ChartsTooltip/ChartsTooltipTable.js +2 -2
- package/ChartsTooltip/useAxisTooltip.js +3 -3
- package/ChartsTooltip/useItemTooltip.d.ts +2 -3
- package/ChartsTooltip/useItemTooltip.js +3 -3
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -3
- package/ChartsXAxis/ChartsXAxis.js +3 -17
- package/ChartsYAxis/ChartsYAxis.js +2 -17
- package/Gauge/Gauge.d.ts +1 -1
- package/Gauge/GaugeContainer.d.ts +2 -2
- package/Gauge/GaugeContainer.js +14 -47
- package/LineChart/CircleMarkElement.js +3 -3
- package/LineChart/LineChart.js +0 -4
- package/LineChart/LineHighlightPlot.js +3 -3
- package/LineChart/MarkElement.js +3 -3
- package/PieChart/PieArc.js +11 -5
- package/PieChart/PieArcPlot.js +9 -13
- package/PieChart/PieChart.js +0 -4
- package/ScatterChart/Scatter.js +3 -3
- package/ScatterChart/ScatterChart.js +0 -4
- package/SparkLineChart/SparkLineChart.js +0 -4
- package/context/CartesianProvider/defaultizeAxis.d.ts +9 -11
- package/context/ChartDataProvider/ChartDataProvider.d.ts +27 -0
- package/context/ChartDataProvider/ChartDataProvider.js +38 -18
- package/context/ChartDataProvider/useChartDataProviderProps.d.ts +18 -22
- package/context/ChartDataProvider/useDefaultizeAxis.d.ts +9 -11
- package/context/ChartProvider/ChartContext.d.ts +6 -0
- package/context/ChartProvider/ChartContext.js +8 -0
- package/context/ChartProvider/ChartProvider.d.ts +4 -0
- package/context/ChartProvider/ChartProvider.js +19 -0
- package/context/ChartProvider/ChartProvider.types.d.ts +24 -0
- package/context/ChartProvider/index.d.ts +3 -0
- package/context/ChartProvider/index.js +3 -0
- package/context/ChartProvider/useChartContext.d.ts +3 -0
- package/context/ChartProvider/useChartContext.js +11 -0
- package/context/DrawingAreaProvider/DrawingAreaContext.d.ts +1 -6
- package/context/DrawingAreaProvider/DrawingAreaContext.js +0 -1
- package/context/InteractionSelectors.d.ts +72 -49
- package/context/SizeProvider/Size.types.d.ts +2 -2
- package/context/SizeProvider/SizeContext.js +3 -1
- package/context/SizeProvider/useChartContainerDimensions.d.ts +1 -1
- package/context/SizeProvider/useChartContainerDimensions.js +5 -1
- package/hooks/useAxisEvents.js +1 -1
- package/hooks/useChartId.js +5 -6
- package/hooks/useInteractionItemProps.js +4 -2
- package/hooks/useSvgRef.d.ts +1 -1
- package/hooks/useSvgRef.js +4 -8
- package/index.js +1 -1
- package/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +2 -5
- package/internals/defaultizeColor.d.ts +1 -1
- package/internals/index.d.ts +1 -3
- package/internals/index.js +1 -3
- package/internals/plugins/allPlugins.d.ts +1 -0
- package/internals/plugins/allPlugins.js +3 -0
- package/internals/plugins/corePlugins/corePlugins.d.ts +10 -0
- package/internals/plugins/corePlugins/corePlugins.js +7 -0
- package/internals/plugins/corePlugins/index.d.ts +2 -0
- package/internals/plugins/corePlugins/index.js +1 -0
- package/internals/plugins/corePlugins/useChartId/index.d.ts +2 -0
- package/internals/plugins/corePlugins/useChartId/index.js +1 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.js +32 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +36 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +9 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.types.d.ts +20 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.utils.d.ts +1 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.utils.js +5 -0
- package/internals/plugins/featurePlugins/useChartInteraction/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartInteraction/index.js +2 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +73 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +376 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +10 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +57 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +1 -0
- package/internals/plugins/models/chart.d.ts +14 -0
- package/internals/plugins/models/chart.js +1 -0
- package/internals/plugins/models/helpers.d.ts +7 -0
- package/internals/plugins/models/helpers.js +1 -0
- package/internals/plugins/models/index.d.ts +3 -35
- package/internals/plugins/models/index.js +3 -1
- package/internals/plugins/models/plugin.d.ts +75 -0
- package/internals/plugins/models/plugin.js +1 -0
- package/internals/plugins/utils/ChartStore.d.ts +9 -8
- package/internals/plugins/utils/ChartStore.js +0 -2
- package/internals/plugins/utils/selectors.d.ts +2 -2
- package/internals/store/useCharts.d.ts +14 -0
- package/internals/store/useCharts.js +72 -0
- package/internals/store/useCharts.types.d.ts +5 -0
- package/internals/store/useCharts.types.js +1 -0
- package/internals/store/useSelector.d.ts +4 -0
- package/internals/store/useStore.d.ts +3 -0
- package/{modern/internals → internals/store}/useStore.js +6 -6
- package/models/axis.d.ts +1 -13
- package/modern/BarChart/BarChart.js +0 -4
- package/modern/ChartContainer/ChartContainer.js +26 -10
- package/modern/ChartContainer/useChartContainerProps.js +3 -4
- package/modern/ChartsAxis/axisClasses.js +2 -1
- package/modern/ChartsAxisHighlight/ChartsXAxisHighlight.js +3 -3
- package/modern/ChartsAxisHighlight/ChartsYAxisHighlight.js +3 -3
- package/modern/ChartsLegend/chartsLegendClasses.js +2 -1
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/modern/ChartsSurface/ChartsSurface.js +38 -6
- package/modern/ChartsTooltip/ChartsTooltip.js +2 -20
- package/modern/ChartsTooltip/ChartsTooltipContainer.js +5 -23
- package/modern/ChartsTooltip/ChartsTooltipTable.js +2 -2
- package/modern/ChartsTooltip/useAxisTooltip.js +3 -3
- package/modern/ChartsTooltip/useItemTooltip.js +3 -3
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -3
- package/modern/ChartsXAxis/ChartsXAxis.js +3 -17
- package/modern/ChartsYAxis/ChartsYAxis.js +2 -17
- package/modern/Gauge/GaugeContainer.js +14 -47
- package/modern/LineChart/CircleMarkElement.js +3 -3
- package/modern/LineChart/LineChart.js +0 -4
- package/modern/LineChart/LineHighlightPlot.js +3 -3
- package/modern/LineChart/MarkElement.js +3 -3
- package/modern/PieChart/PieArc.js +11 -5
- package/modern/PieChart/PieArcPlot.js +9 -13
- package/modern/PieChart/PieChart.js +0 -4
- package/modern/ScatterChart/Scatter.js +3 -3
- package/modern/ScatterChart/ScatterChart.js +0 -4
- package/modern/SparkLineChart/SparkLineChart.js +0 -4
- package/modern/context/ChartDataProvider/ChartDataProvider.js +38 -18
- package/modern/context/ChartProvider/ChartContext.js +8 -0
- package/modern/context/ChartProvider/ChartProvider.js +19 -0
- package/modern/context/ChartProvider/ChartProvider.types.js +1 -0
- package/modern/context/ChartProvider/index.js +3 -0
- package/modern/context/ChartProvider/useChartContext.js +11 -0
- package/modern/context/DrawingAreaProvider/DrawingAreaContext.js +0 -1
- package/modern/context/SizeProvider/SizeContext.js +3 -1
- package/modern/context/SizeProvider/useChartContainerDimensions.js +5 -1
- package/modern/hooks/useAxisEvents.js +1 -1
- package/modern/hooks/useChartId.js +5 -6
- package/modern/hooks/useInteractionItemProps.js +4 -2
- package/modern/hooks/useSvgRef.js +4 -8
- package/modern/index.js +1 -1
- package/modern/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +2 -5
- package/modern/internals/index.js +1 -3
- package/modern/internals/plugins/allPlugins.js +3 -0
- package/modern/internals/plugins/corePlugins/corePlugins.js +7 -0
- package/modern/internals/plugins/corePlugins/index.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartId/index.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.js +32 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +9 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.types.js +1 -0
- package/modern/internals/plugins/corePlugins/useChartId/useChartId.utils.js +5 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/index.js +2 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +73 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +10 -0
- package/modern/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +1 -0
- package/modern/internals/plugins/models/chart.js +1 -0
- package/modern/internals/plugins/models/helpers.js +1 -0
- package/modern/internals/plugins/models/index.js +3 -1
- package/modern/internals/plugins/models/plugin.js +1 -0
- package/modern/internals/plugins/utils/ChartStore.js +0 -2
- package/modern/internals/store/useCharts.js +72 -0
- package/modern/internals/store/useCharts.types.js +1 -0
- package/{internals → modern/internals/store}/useStore.js +6 -6
- package/node/BarChart/BarChart.js +0 -4
- package/node/ChartContainer/ChartContainer.js +26 -10
- package/node/ChartContainer/useChartContainerProps.js +3 -4
- package/node/ChartsAxis/axisClasses.js +5 -3
- package/node/ChartsAxisHighlight/ChartsXAxisHighlight.js +4 -4
- package/node/ChartsAxisHighlight/ChartsYAxisHighlight.js +4 -4
- package/node/ChartsLegend/chartsLegendClasses.js +5 -3
- package/node/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/node/ChartsSurface/ChartsSurface.js +37 -5
- package/node/ChartsTooltip/ChartsTooltip.js +2 -20
- package/node/ChartsTooltip/ChartsTooltipContainer.js +6 -24
- package/node/ChartsTooltip/ChartsTooltipTable.js +3 -3
- package/node/ChartsTooltip/useAxisTooltip.js +4 -4
- package/node/ChartsTooltip/useItemTooltip.js +4 -4
- package/node/ChartsVoronoiHandler/ChartsVoronoiHandler.js +3 -3
- package/node/ChartsXAxis/ChartsXAxis.js +3 -17
- package/node/ChartsYAxis/ChartsYAxis.js +2 -17
- package/node/Gauge/GaugeContainer.js +13 -46
- package/node/LineChart/CircleMarkElement.js +4 -4
- package/node/LineChart/LineChart.js +0 -4
- package/node/LineChart/LineHighlightPlot.js +4 -4
- package/node/LineChart/MarkElement.js +4 -4
- package/node/PieChart/PieArc.js +11 -5
- package/node/PieChart/PieArcPlot.js +9 -13
- package/node/PieChart/PieChart.js +0 -4
- package/node/ScatterChart/Scatter.js +4 -4
- package/node/ScatterChart/ScatterChart.js +0 -4
- package/node/SparkLineChart/SparkLineChart.js +0 -4
- package/node/context/ChartDataProvider/ChartDataProvider.js +38 -18
- package/node/context/ChartProvider/ChartContext.js +15 -0
- package/node/context/ChartProvider/ChartProvider.js +24 -0
- package/node/context/ChartProvider/index.js +38 -0
- package/node/context/ChartProvider/useChartContext.js +18 -0
- package/node/context/DrawingAreaProvider/DrawingAreaContext.js +0 -1
- package/node/context/SizeProvider/SizeContext.js +3 -1
- package/node/context/SizeProvider/useChartContainerDimensions.js +5 -1
- package/node/hooks/useAxisEvents.js +1 -1
- package/node/hooks/useChartId.js +5 -7
- package/node/hooks/useInteractionItemProps.js +4 -2
- package/node/hooks/useSvgRef.js +4 -9
- package/node/index.js +1 -1
- package/node/internals/components/ChartsAxesGradients/ChartsAxesGradients.js +1 -4
- package/node/internals/index.js +4 -28
- package/node/internals/plugins/allPlugins.js +10 -0
- package/node/internals/plugins/corePlugins/corePlugins.js +12 -0
- package/node/internals/plugins/corePlugins/index.js +12 -0
- package/node/internals/plugins/corePlugins/useChartId/index.js +12 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.js +41 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +15 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.types.js +5 -0
- package/node/internals/plugins/corePlugins/useChartId/useChartId.utils.js +12 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/index.js +27 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +81 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +16 -0
- package/node/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.js +5 -0
- package/node/internals/plugins/models/chart.js +5 -0
- package/node/internals/plugins/models/helpers.js +5 -0
- package/node/internals/plugins/models/index.js +33 -0
- package/node/internals/plugins/models/plugin.js +5 -0
- package/node/internals/plugins/utils/ChartStore.js +0 -2
- package/node/internals/store/useCharts.js +80 -0
- package/node/internals/store/useCharts.types.js +5 -0
- package/node/internals/{useStore.js → store/useStore.js} +6 -7
- package/package.json +4 -4
- package/ChartContainer/ResizableContainer.d.ts +0 -22
- package/ChartContainer/ResizableContainer.js +0 -60
- package/context/InteractionProvider.d.ts +0 -7
- package/context/InteractionProvider.js +0 -22
- package/context/SvgRefProvider/SvgRef.types.d.ts +0 -8
- package/context/SvgRefProvider/SvgRefContext.d.ts +0 -4
- package/context/SvgRefProvider/SvgRefContext.js +0 -17
- package/context/SvgRefProvider/SvgRefProvider.d.ts +0 -3
- package/context/SvgRefProvider/SvgRefProvider.js +0 -24
- package/context/SvgRefProvider/index.d.ts +0 -4
- package/context/SvgRefProvider/index.js +0 -4
- package/context/SvgRefProvider/useSurfaceRef.d.ts +0 -2
- package/context/SvgRefProvider/useSurfaceRef.js +0 -14
- package/internals/plugins/utils/ChartsStore.d.ts +0 -12
- package/internals/plugins/utils/ChartsStore.js +0 -26
- package/internals/useCharts.d.ts +0 -6
- package/internals/useCharts.js +0 -29
- package/internals/useSelector.d.ts +0 -4
- package/internals/useStore.d.ts +0 -2
- package/modern/ChartContainer/ResizableContainer.js +0 -60
- package/modern/context/InteractionProvider.js +0 -22
- package/modern/context/SvgRefProvider/SvgRefContext.js +0 -17
- package/modern/context/SvgRefProvider/SvgRefProvider.js +0 -24
- package/modern/context/SvgRefProvider/index.js +0 -4
- package/modern/context/SvgRefProvider/useSurfaceRef.js +0 -14
- package/modern/internals/plugins/utils/ChartsStore.js +0 -26
- package/modern/internals/useCharts.js +0 -29
- package/node/ChartContainer/ResizableContainer.js +0 -68
- package/node/context/InteractionProvider.js +0 -28
- package/node/context/SvgRefProvider/SvgRefContext.js +0 -23
- package/node/context/SvgRefProvider/SvgRefProvider.js +0 -31
- package/node/context/SvgRefProvider/index.js +0 -49
- package/node/context/SvgRefProvider/useSurfaceRef.js +0 -20
- package/node/internals/plugins/utils/ChartsStore.js +0 -33
- package/node/internals/useCharts.js +0 -36
- /package/context/{SvgRefProvider/SvgRef.types.js → ChartProvider/ChartProvider.types.js} +0 -0
- /package/{modern/context/SvgRefProvider/SvgRef.types.js → internals/plugins/corePlugins/useChartId/useChartId.types.js} +0 -0
- /package/internals/{useSelector.js → store/useSelector.js} +0 -0
- /package/modern/internals/{useSelector.js → store/useSelector.js} +0 -0
- /package/node/context/{SvgRefProvider/SvgRef.types.js → ChartProvider/ChartProvider.types.js} +0 -0
- /package/node/internals/{useSelector.js → store/useSelector.js} +0 -0
|
@@ -9,18 +9,43 @@ import * as React from 'react';
|
|
|
9
9
|
import useForkRef from '@mui/utils/useForkRef';
|
|
10
10
|
import { useAxisEvents } from "../hooks/useAxisEvents.js";
|
|
11
11
|
import { ChartsAxesGradients } from "../internals/components/ChartsAxesGradients/index.js";
|
|
12
|
-
import { useDrawingArea } from "../hooks/index.js";
|
|
13
|
-
import { useSurfaceRef } from "../context/SvgRefProvider/index.js";
|
|
12
|
+
import { useDrawingArea, useSvgRef } from "../hooks/index.js";
|
|
14
13
|
import { useSize } from "../context/SizeProvider/index.js";
|
|
15
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
15
|
const ChartsSurfaceStyles = styled('svg', {
|
|
17
16
|
name: 'MuiChartsSurface',
|
|
18
17
|
slot: 'Root'
|
|
19
|
-
})((
|
|
18
|
+
})(({
|
|
19
|
+
ownerState
|
|
20
|
+
}) => ({
|
|
21
|
+
width: ownerState.width ?? '100%',
|
|
22
|
+
height: ownerState.height ?? '100%',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
position: 'relative',
|
|
25
|
+
flexGrow: 1,
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
overflow: 'hidden',
|
|
20
30
|
// This prevents default touch actions when using the svg on mobile devices.
|
|
21
31
|
// For example, prevent page scroll & zoom.
|
|
22
32
|
touchAction: 'none'
|
|
23
33
|
}));
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* It provides the drawing area for the chart elements.
|
|
37
|
+
* It is the root `<svg>` of all the chart elements.
|
|
38
|
+
*
|
|
39
|
+
* It also provides the `title` and `desc` elements for the chart.
|
|
40
|
+
*
|
|
41
|
+
* Demos:
|
|
42
|
+
*
|
|
43
|
+
* - [Composition](http://localhost:3001/x/react-charts/composition/)
|
|
44
|
+
*
|
|
45
|
+
* API:
|
|
46
|
+
*
|
|
47
|
+
* - [ChartsSurface API](https://mui.com/x/api/charts/charts-surface/)
|
|
48
|
+
*/
|
|
24
49
|
const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inProps, ref) {
|
|
25
50
|
const {
|
|
26
51
|
width,
|
|
@@ -31,10 +56,13 @@ const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inPro
|
|
|
31
56
|
bottom
|
|
32
57
|
} = useDrawingArea();
|
|
33
58
|
const {
|
|
34
|
-
hasIntrinsicSize
|
|
59
|
+
hasIntrinsicSize,
|
|
60
|
+
svgRef: containerRef,
|
|
61
|
+
inHeight,
|
|
62
|
+
inWidth
|
|
35
63
|
} = useSize();
|
|
36
|
-
const
|
|
37
|
-
const handleRef = useForkRef(
|
|
64
|
+
const svgRef = useSvgRef();
|
|
65
|
+
const handleRef = useForkRef(containerRef, svgRef, ref);
|
|
38
66
|
const themeProps = useThemeProps({
|
|
39
67
|
props: inProps,
|
|
40
68
|
name: 'MuiChartsSurface'
|
|
@@ -57,6 +85,10 @@ const ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inPro
|
|
|
57
85
|
};
|
|
58
86
|
useAxisEvents(disableAxisListener);
|
|
59
87
|
return /*#__PURE__*/_jsxs(ChartsSurfaceStyles, _extends({
|
|
88
|
+
ownerState: {
|
|
89
|
+
width: inWidth,
|
|
90
|
+
height: inHeight
|
|
91
|
+
},
|
|
60
92
|
viewBox: `${svgView.x} ${svgView.y} ${svgView.width} ${svgView.height}`,
|
|
61
93
|
className: className
|
|
62
94
|
}, other, {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
+
import HTMLElementType from '@mui/utils/HTMLElementType';
|
|
6
7
|
import { ChartsItemTooltipContent } from "./ChartsItemTooltipContent.js";
|
|
7
8
|
import { ChartsAxisTooltipContent } from "./ChartsAxisTooltipContent.js";
|
|
8
9
|
import { ChartsTooltipContainer } from "./ChartsTooltipContainer.js";
|
|
@@ -43,26 +44,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltip.propTypes = {
|
|
|
43
44
|
* It's used to set the position of the popper.
|
|
44
45
|
* The return value will passed as the reference object of the Popper instance.
|
|
45
46
|
*/
|
|
46
|
-
anchorEl: PropTypes
|
|
47
|
-
if (props[propName] == null) {
|
|
48
|
-
return new Error(`Prop '${propName}' is required but wasn't specified`);
|
|
49
|
-
}
|
|
50
|
-
if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
|
|
51
|
-
return new Error(`Expected prop '${propName}' to be of type Element`);
|
|
52
|
-
}
|
|
53
|
-
return null;
|
|
54
|
-
}, PropTypes.func, PropTypes.shape({
|
|
55
|
-
contextElement: (props, propName) => {
|
|
56
|
-
if (props[propName] == null) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
|
|
60
|
-
return new Error(`Expected prop '${propName}' to be of type Element`);
|
|
61
|
-
}
|
|
62
|
-
return null;
|
|
63
|
-
},
|
|
64
|
-
getBoundingClientRect: PropTypes.func.isRequired
|
|
65
|
-
})]),
|
|
47
|
+
anchorEl: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]),
|
|
66
48
|
/**
|
|
67
49
|
* Override or extend the styles applied to the component.
|
|
68
50
|
*/
|
|
@@ -5,16 +5,17 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["trigger", "classes", "children"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
+
import HTMLElementType from '@mui/utils/HTMLElementType';
|
|
8
9
|
import useLazyRef from '@mui/utils/useLazyRef';
|
|
9
10
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
10
11
|
import Popper from '@mui/material/Popper';
|
|
11
12
|
import NoSsr from '@mui/material/NoSsr';
|
|
12
13
|
import { useSvgRef } from "../hooks/useSvgRef.js";
|
|
13
14
|
import { usePointerType } from "./utils.js";
|
|
14
|
-
import { useSelector } from "../internals/useSelector.js";
|
|
15
|
-
import { useStore } from "../internals/useStore.js";
|
|
15
|
+
import { useSelector } from "../internals/store/useSelector.js";
|
|
16
|
+
import { useStore } from "../internals/store/useStore.js";
|
|
16
17
|
import { useXAxis } from "../hooks/index.js";
|
|
17
|
-
import { selectorChartsInteractionItemIsDefined, selectorChartsInteractionXAxisIsDefined, selectorChartsInteractionYAxisIsDefined } from "../
|
|
18
|
+
import { selectorChartsInteractionItemIsDefined, selectorChartsInteractionXAxisIsDefined, selectorChartsInteractionYAxisIsDefined } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
18
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
20
|
const ChartsTooltipRoot = styled(Popper, {
|
|
20
21
|
name: 'MuiChartsTooltip',
|
|
@@ -124,26 +125,7 @@ process.env.NODE_ENV !== "production" ? ChartsTooltipContainer.propTypes = {
|
|
|
124
125
|
* It's used to set the position of the popper.
|
|
125
126
|
* The return value will passed as the reference object of the Popper instance.
|
|
126
127
|
*/
|
|
127
|
-
anchorEl: PropTypes
|
|
128
|
-
if (props[propName] == null) {
|
|
129
|
-
return new Error(`Prop '${propName}' is required but wasn't specified`);
|
|
130
|
-
}
|
|
131
|
-
if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
|
|
132
|
-
return new Error(`Expected prop '${propName}' to be of type Element`);
|
|
133
|
-
}
|
|
134
|
-
return null;
|
|
135
|
-
}, PropTypes.func, PropTypes.shape({
|
|
136
|
-
contextElement: (props, propName) => {
|
|
137
|
-
if (props[propName] == null) {
|
|
138
|
-
return null;
|
|
139
|
-
}
|
|
140
|
-
if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
|
|
141
|
-
return new Error(`Expected prop '${propName}' to be of type Element`);
|
|
142
|
-
}
|
|
143
|
-
return null;
|
|
144
|
-
},
|
|
145
|
-
getBoundingClientRect: PropTypes.func.isRequired
|
|
146
|
-
})]),
|
|
128
|
+
anchorEl: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([HTMLElementType, PropTypes.object, PropTypes.func]),
|
|
147
129
|
/**
|
|
148
130
|
* Popper render function or node.
|
|
149
131
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styled } from '@mui/material/styles';
|
|
2
|
-
import { shouldForwardProp } from '@mui/system';
|
|
2
|
+
import { shouldForwardProp } from '@mui/system/createStyled';
|
|
3
3
|
import { chartsTooltipClasses } from "./chartsTooltipClasses.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -96,7 +96,7 @@ export const ChartsTooltipMark = styled('div', {
|
|
|
96
96
|
height: theme.spacing(1),
|
|
97
97
|
borderRadius: '50%',
|
|
98
98
|
boxShadow: theme.shadows[1],
|
|
99
|
-
|
|
99
|
+
background: color,
|
|
100
100
|
borderColor: (theme.vars || theme).palette.background.paper,
|
|
101
101
|
border: `solid ${(theme.vars || theme).palette.background.paper} ${theme.spacing(0.25)}`,
|
|
102
102
|
boxSizing: 'content-box'
|
|
@@ -5,13 +5,13 @@ import { useSeries } from "../hooks/useSeries.js";
|
|
|
5
5
|
import { useCartesianContext } from "../context/CartesianProvider/index.js";
|
|
6
6
|
import { ZAxisContext } from "../context/ZAxisContextProvider.js";
|
|
7
7
|
import { useColorProcessor } from "../context/PluginProvider/useColorProcessor.js";
|
|
8
|
-
import { useStore } from "../internals/useStore.js";
|
|
9
|
-
import { useSelector } from "../internals/useSelector.js";
|
|
8
|
+
import { useStore } from "../internals/store/useStore.js";
|
|
9
|
+
import { useSelector } from "../internals/store/useSelector.js";
|
|
10
10
|
import { getLabel } from "../internals/getLabel.js";
|
|
11
11
|
import { isCartesianSeriesType } from "../internals/isCartesian.js";
|
|
12
12
|
import { utcFormatter } from "./utils.js";
|
|
13
13
|
import { useXAxis, useYAxis } from "../hooks/useAxis.js";
|
|
14
|
-
import { selectorChartsInteractionXAxis, selectorChartsInteractionYAxis } from "../
|
|
14
|
+
import { selectorChartsInteractionXAxis, selectorChartsInteractionYAxis } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
15
15
|
export function useAxisTooltip() {
|
|
16
16
|
const defaultXAxis = useXAxis();
|
|
17
17
|
const defaultYAxis = useYAxis();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ChartSeriesType, ChartsSeriesConfig } from '../models/seriesType/config';
|
|
2
|
-
import { ItemInteractionData } from '../internals/plugins/models';
|
|
1
|
+
import { ChartItemIdentifier, ChartSeriesType, ChartsSeriesConfig } from '../models/seriesType/config';
|
|
3
2
|
export interface UseItemTooltipReturnValue<T extends ChartSeriesType> {
|
|
4
|
-
identifier:
|
|
3
|
+
identifier: ChartItemIdentifier<T>;
|
|
5
4
|
color: string;
|
|
6
5
|
label: string | undefined;
|
|
7
6
|
value: ChartsSeriesConfig[T]['valueType'];
|
|
@@ -7,9 +7,9 @@ import { useCartesianContext } from "../context/CartesianProvider/index.js";
|
|
|
7
7
|
import { ZAxisContext } from "../context/ZAxisContextProvider.js";
|
|
8
8
|
import { useColorProcessor } from "../context/PluginProvider/useColorProcessor.js";
|
|
9
9
|
import { getLabel } from "../internals/getLabel.js";
|
|
10
|
-
import { selectorChartsInteractionItem } from "../
|
|
11
|
-
import { useSelector } from "../internals/useSelector.js";
|
|
12
|
-
import { useStore } from "../internals/useStore.js";
|
|
10
|
+
import { selectorChartsInteractionItem } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
11
|
+
import { useSelector } from "../internals/store/useSelector.js";
|
|
12
|
+
import { useStore } from "../internals/store/useStore.js";
|
|
13
13
|
export function useItemTooltip() {
|
|
14
14
|
const store = useStore();
|
|
15
15
|
const item = useSelector(store, selectorChartsInteractionItem);
|
|
@@ -7,7 +7,7 @@ import { Delaunay } from '@mui/x-charts-vendor/d3-delaunay';
|
|
|
7
7
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
8
8
|
import { useCartesianContext } from "../context/CartesianProvider/index.js";
|
|
9
9
|
import { getValueToPositionMapper } from "../hooks/useScale.js";
|
|
10
|
-
import { useStore } from "../internals/useStore.js";
|
|
10
|
+
import { useStore } from "../internals/store/useStore.js";
|
|
11
11
|
import { getSVGPoint } from "../internals/getSVGPoint.js";
|
|
12
12
|
import { useDrawingArea, useSvgRef } from "../hooks/index.js";
|
|
13
13
|
import { useHighlighted } from "../context/index.js";
|
|
@@ -101,10 +101,10 @@ function ChartsVoronoiHandler(props) {
|
|
|
101
101
|
lastFind.current = undefined;
|
|
102
102
|
}, [defaultXAxisId, defaultYAxisId, series, seriesOrder, xAxis, yAxis, drawingArea]);
|
|
103
103
|
React.useEffect(() => {
|
|
104
|
-
|
|
105
|
-
if (element === null) {
|
|
104
|
+
if (svgRef.current === null) {
|
|
106
105
|
return undefined;
|
|
107
106
|
}
|
|
107
|
+
const element = svgRef.current;
|
|
108
108
|
function getClosestPoint(event) {
|
|
109
109
|
// Get mouse coordinate in global SVG space
|
|
110
110
|
const svgPoint = getSVGPoint(element, event);
|
|
@@ -137,8 +137,6 @@ function ChartsXAxis(inProps) {
|
|
|
137
137
|
tickLabelStyle,
|
|
138
138
|
label,
|
|
139
139
|
labelStyle,
|
|
140
|
-
tickFontSize,
|
|
141
|
-
labelFontSize,
|
|
142
140
|
tickSize: tickSizeProp,
|
|
143
141
|
valueFormatter,
|
|
144
142
|
slots,
|
|
@@ -171,9 +169,9 @@ function ChartsXAxis(inProps) {
|
|
|
171
169
|
externalSlotProps: slotProps?.axisTickLabel,
|
|
172
170
|
additionalProps: {
|
|
173
171
|
style: _extends({
|
|
172
|
+
fontSize: 12,
|
|
174
173
|
textAnchor: 'middle',
|
|
175
|
-
dominantBaseline: position === 'bottom' ? 'hanging' : 'auto'
|
|
176
|
-
fontSize: tickFontSize ?? 12
|
|
174
|
+
dominantBaseline: position === 'bottom' ? 'hanging' : 'auto'
|
|
177
175
|
}, tickLabelStyle)
|
|
178
176
|
},
|
|
179
177
|
className: classes.tickLabel,
|
|
@@ -202,7 +200,7 @@ function ChartsXAxis(inProps) {
|
|
|
202
200
|
externalSlotProps: slotProps?.axisLabel,
|
|
203
201
|
additionalProps: {
|
|
204
202
|
style: _extends({
|
|
205
|
-
fontSize:
|
|
203
|
+
fontSize: 14,
|
|
206
204
|
textAnchor: 'middle',
|
|
207
205
|
dominantBaseline: position === 'bottom' ? 'hanging' : 'auto'
|
|
208
206
|
}, labelStyle)
|
|
@@ -299,12 +297,6 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
|
299
297
|
* The label of the axis.
|
|
300
298
|
*/
|
|
301
299
|
label: PropTypes.string,
|
|
302
|
-
/**
|
|
303
|
-
* The font size of the axis label.
|
|
304
|
-
* @default 14
|
|
305
|
-
* @deprecated Consider using `labelStyle.fontSize` instead.
|
|
306
|
-
*/
|
|
307
|
-
labelFontSize: PropTypes.number,
|
|
308
300
|
/**
|
|
309
301
|
* The style applied to the axis label.
|
|
310
302
|
*/
|
|
@@ -329,12 +321,6 @@ process.env.NODE_ENV !== "production" ? ChartsXAxis.propTypes = {
|
|
|
329
321
|
*/
|
|
330
322
|
stroke: PropTypes.string,
|
|
331
323
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
332
|
-
/**
|
|
333
|
-
* The font size of the axis ticks text.
|
|
334
|
-
* @default 12
|
|
335
|
-
* @deprecated Consider using `tickLabelStyle.fontSize` instead.
|
|
336
|
-
*/
|
|
337
|
-
tickFontSize: PropTypes.number,
|
|
338
324
|
/**
|
|
339
325
|
* Defines which ticks are displayed.
|
|
340
326
|
* Its value can be:
|
|
@@ -42,8 +42,6 @@ const defaultProps = {
|
|
|
42
42
|
position: 'left',
|
|
43
43
|
disableLine: false,
|
|
44
44
|
disableTicks: false,
|
|
45
|
-
tickFontSize: 12,
|
|
46
|
-
labelFontSize: 14,
|
|
47
45
|
tickSize: 6
|
|
48
46
|
};
|
|
49
47
|
|
|
@@ -76,9 +74,7 @@ function ChartsYAxis(inProps) {
|
|
|
76
74
|
position,
|
|
77
75
|
disableLine,
|
|
78
76
|
disableTicks,
|
|
79
|
-
tickFontSize,
|
|
80
77
|
label,
|
|
81
|
-
labelFontSize,
|
|
82
78
|
labelStyle,
|
|
83
79
|
tickLabelStyle,
|
|
84
80
|
tickSize: tickSizeProp,
|
|
@@ -113,6 +109,7 @@ function ChartsYAxis(inProps) {
|
|
|
113
109
|
tickInterval
|
|
114
110
|
});
|
|
115
111
|
const positionSign = position === 'right' ? 1 : -1;
|
|
112
|
+
const tickFontSize = typeof tickLabelStyle?.fontSize === 'number' ? tickLabelStyle.fontSize : 12;
|
|
116
113
|
const labelRefPoint = {
|
|
117
114
|
x: positionSign * (tickFontSize + tickSize + 10),
|
|
118
115
|
y: top + height / 2
|
|
@@ -140,7 +137,7 @@ function ChartsYAxis(inProps) {
|
|
|
140
137
|
externalSlotProps: slotProps?.axisLabel,
|
|
141
138
|
additionalProps: {
|
|
142
139
|
style: _extends({
|
|
143
|
-
fontSize:
|
|
140
|
+
fontSize: 14,
|
|
144
141
|
angle: positionSign * 90,
|
|
145
142
|
textAnchor: 'middle',
|
|
146
143
|
dominantBaseline: 'auto'
|
|
@@ -243,12 +240,6 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
|
|
|
243
240
|
* The label of the axis.
|
|
244
241
|
*/
|
|
245
242
|
label: PropTypes.string,
|
|
246
|
-
/**
|
|
247
|
-
* The font size of the axis label.
|
|
248
|
-
* @default 14
|
|
249
|
-
* @deprecated Consider using `labelStyle.fontSize` instead.
|
|
250
|
-
*/
|
|
251
|
-
labelFontSize: PropTypes.number,
|
|
252
243
|
/**
|
|
253
244
|
* The style applied to the axis label.
|
|
254
245
|
*/
|
|
@@ -273,12 +264,6 @@ process.env.NODE_ENV !== "production" ? ChartsYAxis.propTypes = {
|
|
|
273
264
|
*/
|
|
274
265
|
stroke: PropTypes.string,
|
|
275
266
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
276
|
-
/**
|
|
277
|
-
* The font size of the axis ticks text.
|
|
278
|
-
* @default 12
|
|
279
|
-
* @deprecated Consider using `tickLabelStyle.fontSize` instead.
|
|
280
|
-
*/
|
|
281
|
-
tickFontSize: PropTypes.number,
|
|
282
267
|
/**
|
|
283
268
|
* Defines which ticks are displayed.
|
|
284
269
|
* Its value can be:
|
package/Gauge/Gauge.d.ts
CHANGED
|
@@ -6,5 +6,5 @@ export interface GaugeProps extends GaugeContainerProps, Pick<GaugeValueTextProp
|
|
|
6
6
|
classes?: Partial<GaugeClasses>;
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
}
|
|
9
|
-
declare const Gauge: React.ForwardRefExoticComponent<GaugeProps & React.RefAttributes<SVGSVGElement>>;
|
|
9
|
+
declare const Gauge: React.ForwardRefExoticComponent<Omit<GaugeProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
10
10
|
export { Gauge };
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { ChartsSurfaceProps } from '../ChartsSurface';
|
|
3
3
|
import { DrawingAreaProviderProps } from '../context/DrawingAreaProvider';
|
|
4
4
|
import { GaugeProviderProps } from './GaugeProvider';
|
|
5
|
-
export interface GaugeContainerProps extends Omit<ChartsSurfaceProps, 'width' | 'height' | 'children'>, Pick<DrawingAreaProviderProps, 'margin'>, Omit<GaugeProviderProps, 'children'> {
|
|
5
|
+
export interface GaugeContainerProps extends Omit<ChartsSurfaceProps, 'width' | 'height' | 'children'>, Pick<DrawingAreaProviderProps, 'margin'>, Omit<GaugeProviderProps, 'children'>, React.SVGProps<SVGSVGElement> {
|
|
6
6
|
/**
|
|
7
7
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
8
8
|
*/
|
|
@@ -13,5 +13,5 @@ export interface GaugeContainerProps extends Omit<ChartsSurfaceProps, 'width' |
|
|
|
13
13
|
height?: number;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
15
|
}
|
|
16
|
-
declare const GaugeContainer: React.ForwardRefExoticComponent<GaugeContainerProps & React.RefAttributes<SVGSVGElement>>;
|
|
16
|
+
declare const GaugeContainer: React.ForwardRefExoticComponent<Omit<GaugeContainerProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
17
17
|
export { GaugeContainer };
|
package/Gauge/GaugeContainer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
const _excluded = ["width", "height", "margin", "title", "desc", "value", "valueMin", "valueMax", "startAngle", "endAngle", "outerRadius", "innerRadius", "cornerRadius", "cx", "cy", "children"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
@@ -9,49 +9,16 @@ import { styled } from '@mui/material/styles';
|
|
|
9
9
|
import { ChartsSurface } from "../ChartsSurface/index.js";
|
|
10
10
|
import { DrawingAreaProvider } from "../context/DrawingAreaProvider/index.js";
|
|
11
11
|
import { GaugeProvider } from "./GaugeProvider.js";
|
|
12
|
-
import { SizeProvider
|
|
13
|
-
import {
|
|
12
|
+
import { SizeProvider } from "../context/SizeProvider/index.js";
|
|
13
|
+
import { ChartProvider } from "../context/ChartProvider/index.js";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
const
|
|
16
|
-
name: 'MuiGauge',
|
|
17
|
-
slot: 'Container'
|
|
18
|
-
})(({
|
|
19
|
-
ownerState,
|
|
15
|
+
const GStyled = styled('g')(({
|
|
20
16
|
theme
|
|
21
17
|
}) => ({
|
|
22
|
-
width: ownerState.width ?? '100%',
|
|
23
|
-
height: ownerState.height ?? '100%',
|
|
24
|
-
display: 'flex',
|
|
25
|
-
position: 'relative',
|
|
26
|
-
flexGrow: 1,
|
|
27
|
-
flexDirection: 'column',
|
|
28
|
-
alignItems: 'center',
|
|
29
|
-
justifyContent: 'center',
|
|
30
|
-
overflow: 'hidden',
|
|
31
|
-
'&>svg': {
|
|
32
|
-
width: '100%',
|
|
33
|
-
height: '100%'
|
|
34
|
-
},
|
|
35
18
|
'& text': {
|
|
36
19
|
fill: (theme.vars || theme).palette.text.primary
|
|
37
20
|
}
|
|
38
21
|
}));
|
|
39
|
-
function ResizableContainer(props) {
|
|
40
|
-
const {
|
|
41
|
-
inHeight,
|
|
42
|
-
inWidth,
|
|
43
|
-
hasIntrinsicSize,
|
|
44
|
-
containerRef
|
|
45
|
-
} = useSize();
|
|
46
|
-
return /*#__PURE__*/_jsx(ResizableContainerRoot, _extends({}, props, {
|
|
47
|
-
ownerState: {
|
|
48
|
-
width: inWidth,
|
|
49
|
-
height: inHeight
|
|
50
|
-
},
|
|
51
|
-
ref: containerRef,
|
|
52
|
-
children: hasIntrinsicSize && props.children
|
|
53
|
-
}));
|
|
54
|
-
}
|
|
55
22
|
const GaugeContainer = /*#__PURE__*/React.forwardRef(function GaugeContainer(props, ref) {
|
|
56
23
|
const {
|
|
57
24
|
width: inWidth,
|
|
@@ -72,10 +39,10 @@ const GaugeContainer = /*#__PURE__*/React.forwardRef(function GaugeContainer(pro
|
|
|
72
39
|
children
|
|
73
40
|
} = props,
|
|
74
41
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
75
|
-
return /*#__PURE__*/_jsx(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
42
|
+
return /*#__PURE__*/_jsx(ChartProvider, {
|
|
43
|
+
children: /*#__PURE__*/_jsx(SizeProvider, {
|
|
44
|
+
width: inWidth,
|
|
45
|
+
height: inHeight,
|
|
79
46
|
children: /*#__PURE__*/_jsx(DrawingAreaProvider, {
|
|
80
47
|
margin: _extends({
|
|
81
48
|
left: 10,
|
|
@@ -94,18 +61,18 @@ const GaugeContainer = /*#__PURE__*/React.forwardRef(function GaugeContainer(pro
|
|
|
94
61
|
cornerRadius: cornerRadius,
|
|
95
62
|
cx: cx,
|
|
96
63
|
cy: cy,
|
|
97
|
-
children: /*#__PURE__*/_jsx(
|
|
64
|
+
children: /*#__PURE__*/_jsx(ChartsSurface, _extends({
|
|
65
|
+
title: title,
|
|
66
|
+
desc: desc,
|
|
67
|
+
disableAxisListener: true,
|
|
98
68
|
role: "meter",
|
|
99
69
|
"aria-valuenow": value === null ? undefined : value,
|
|
100
70
|
"aria-valuemin": valueMin,
|
|
101
71
|
"aria-valuemax": valueMax
|
|
102
72
|
}, other, {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
desc: desc,
|
|
106
|
-
disableAxisListener: true,
|
|
73
|
+
ref: ref,
|
|
74
|
+
children: /*#__PURE__*/_jsx(GStyled, {
|
|
107
75
|
"aria-hidden": "true",
|
|
108
|
-
ref: ref,
|
|
109
76
|
children: children
|
|
110
77
|
})
|
|
111
78
|
}))
|
|
@@ -11,9 +11,9 @@ import { animated, useSpring } from '@react-spring/web';
|
|
|
11
11
|
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
12
12
|
import { useItemHighlighted } from "../context/index.js";
|
|
13
13
|
import { useUtilityClasses } from "./markElementClasses.js";
|
|
14
|
-
import { useSelector } from "../internals/useSelector.js";
|
|
15
|
-
import { selectorChartsInteractionXAxis } from "../
|
|
16
|
-
import { useStore } from "../internals/useStore.js";
|
|
14
|
+
import { useSelector } from "../internals/store/useSelector.js";
|
|
15
|
+
import { selectorChartsInteractionXAxis } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
16
|
+
import { useStore } from "../internals/store/useStore.js";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
/**
|
|
19
19
|
* The line mark element that only render circle for performance improvement.
|
package/LineChart/LineChart.js
CHANGED
|
@@ -247,7 +247,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
247
247
|
hideTooltip: PropTypes.bool,
|
|
248
248
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
249
249
|
label: PropTypes.string,
|
|
250
|
-
labelFontSize: PropTypes.number,
|
|
251
250
|
labelStyle: PropTypes.object,
|
|
252
251
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
253
252
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -258,7 +257,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
258
257
|
slots: PropTypes.object,
|
|
259
258
|
stroke: PropTypes.string,
|
|
260
259
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
261
|
-
tickFontSize: PropTypes.number,
|
|
262
260
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
263
261
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
264
262
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -301,7 +299,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
301
299
|
hideTooltip: PropTypes.bool,
|
|
302
300
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
303
301
|
label: PropTypes.string,
|
|
304
|
-
labelFontSize: PropTypes.number,
|
|
305
302
|
labelStyle: PropTypes.object,
|
|
306
303
|
max: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
307
304
|
min: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.number]),
|
|
@@ -312,7 +309,6 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
312
309
|
slots: PropTypes.object,
|
|
313
310
|
stroke: PropTypes.string,
|
|
314
311
|
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
|
315
|
-
tickFontSize: PropTypes.number,
|
|
316
312
|
tickInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.array, PropTypes.func]),
|
|
317
313
|
tickLabelInterval: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.func]),
|
|
318
314
|
tickLabelPlacement: PropTypes.oneOf(['middle', 'tick']),
|
|
@@ -5,8 +5,8 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
const _excluded = ["slots", "slotProps"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { useStore } from "../internals/useStore.js";
|
|
9
|
-
import { useSelector } from "../internals/useSelector.js";
|
|
8
|
+
import { useStore } from "../internals/store/useStore.js";
|
|
9
|
+
import { useSelector } from "../internals/store/useSelector.js";
|
|
10
10
|
import { useCartesianContext } from "../context/CartesianProvider/index.js";
|
|
11
11
|
import { LineHighlightElement } from "./LineHighlightElement.js";
|
|
12
12
|
import { getValueToPositionMapper } from "../hooks/useScale.js";
|
|
@@ -14,7 +14,7 @@ import { DEFAULT_X_AXIS_KEY } from "../constants/index.js";
|
|
|
14
14
|
import getColor from "./getColor.js";
|
|
15
15
|
import { useLineSeries } from "../hooks/useSeries.js";
|
|
16
16
|
import { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
17
|
-
import { selectorChartsInteractionXAxis } from "../
|
|
17
|
+
import { selectorChartsInteractionXAxis } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
/**
|
|
20
20
|
* Demos:
|
package/LineChart/MarkElement.js
CHANGED
|
@@ -12,9 +12,9 @@ import { getSymbol } from "../internals/getSymbol.js";
|
|
|
12
12
|
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
13
13
|
import { useItemHighlighted } from "../context/index.js";
|
|
14
14
|
import { useUtilityClasses } from "./markElementClasses.js";
|
|
15
|
-
import { selectorChartsInteractionXAxis } from "../
|
|
16
|
-
import { useSelector } from "../internals/useSelector.js";
|
|
17
|
-
import { useStore } from "../internals/useStore.js";
|
|
15
|
+
import { selectorChartsInteractionXAxis } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
16
|
+
import { useSelector } from "../internals/store/useSelector.js";
|
|
17
|
+
import { useStore } from "../internals/store/useStore.js";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
19
|
const MarkElementPath = styled(animated.path, {
|
|
20
20
|
name: 'MuiMarkElement',
|
package/PieChart/PieArc.js
CHANGED
|
@@ -22,10 +22,11 @@ const useUtilityClasses = ownerState => {
|
|
|
22
22
|
classes,
|
|
23
23
|
id,
|
|
24
24
|
isFaded,
|
|
25
|
-
isHighlighted
|
|
25
|
+
isHighlighted,
|
|
26
|
+
dataIndex
|
|
26
27
|
} = ownerState;
|
|
27
28
|
const slots = {
|
|
28
|
-
root: ['root', `series-${id}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
29
|
+
root: ['root', `series-${id}`, `data-index-${dataIndex}`, isHighlighted && 'highlighted', isFaded && 'faded']
|
|
29
30
|
};
|
|
30
31
|
return composeClasses(slots, getPieArcUtilityClass, classes);
|
|
31
32
|
};
|
|
@@ -36,9 +37,9 @@ const PieArcRoot = styled(animated.path, {
|
|
|
36
37
|
})(({
|
|
37
38
|
theme
|
|
38
39
|
}) => ({
|
|
40
|
+
// Got to move stroke to an element prop instead of style.
|
|
39
41
|
stroke: (theme.vars || theme).palette.background.paper,
|
|
40
|
-
|
|
41
|
-
strokeLinejoin: 'round'
|
|
42
|
+
transition: 'opacity 0.2s ease-in, fill 0.2s ease-in, filter 0.2s ease-in'
|
|
42
43
|
}));
|
|
43
44
|
function PieArc(props) {
|
|
44
45
|
const {
|
|
@@ -79,7 +80,12 @@ function PieArc(props) {
|
|
|
79
80
|
onClick: onClick,
|
|
80
81
|
cursor: onClick ? 'pointer' : 'unset',
|
|
81
82
|
ownerState: ownerState,
|
|
82
|
-
className: classes.root
|
|
83
|
+
className: classes.root,
|
|
84
|
+
fill: ownerState.color,
|
|
85
|
+
opacity: ownerState.isFaded ? 0.3 : 1,
|
|
86
|
+
filter: ownerState.isHighlighted ? 'brightness(120%)' : 'none',
|
|
87
|
+
strokeWidth: 1,
|
|
88
|
+
strokeLinejoin: "round"
|
|
83
89
|
}, other, getInteractionItemProps({
|
|
84
90
|
type: 'pie',
|
|
85
91
|
seriesId: id,
|
package/PieChart/PieArcPlot.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRadius", "paddingAngle", "id", "highlighted", "faded", "data", "onItemClick", "skipAnimation"]
|
|
6
|
-
_excluded2 = ["startAngle", "endAngle", "paddingAngle", "innerRadius", "arcLabelRadius", "outerRadius", "cornerRadius"];
|
|
5
|
+
const _excluded = ["slots", "slotProps", "innerRadius", "outerRadius", "cornerRadius", "paddingAngle", "id", "highlighted", "faded", "data", "onItemClick", "skipAnimation"];
|
|
7
6
|
import * as React from 'react';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
import { useTransition } from '@react-spring/web';
|
|
@@ -47,16 +46,14 @@ function PieArcPlot(props) {
|
|
|
47
46
|
}
|
|
48
47
|
const Arc = slots?.pieArc ?? PieArc;
|
|
49
48
|
return /*#__PURE__*/_jsx("g", _extends({}, other, {
|
|
50
|
-
children: transition((
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
} = _ref,
|
|
59
|
-
style = _objectWithoutPropertiesLoose(_ref, _excluded2);
|
|
49
|
+
children: transition(({
|
|
50
|
+
startAngle,
|
|
51
|
+
endAngle,
|
|
52
|
+
paddingAngle: pA,
|
|
53
|
+
innerRadius: iR,
|
|
54
|
+
outerRadius: oR,
|
|
55
|
+
cornerRadius: cR
|
|
56
|
+
}, item, _, index) => {
|
|
60
57
|
return /*#__PURE__*/_jsx(Arc, _extends({
|
|
61
58
|
startAngle: startAngle,
|
|
62
59
|
endAngle: endAngle,
|
|
@@ -64,7 +61,6 @@ function PieArcPlot(props) {
|
|
|
64
61
|
innerRadius: iR,
|
|
65
62
|
outerRadius: oR,
|
|
66
63
|
cornerRadius: cR,
|
|
67
|
-
style: style,
|
|
68
64
|
id: id,
|
|
69
65
|
color: item.color,
|
|
70
66
|
dataIndex: index,
|