@mui/x-charts 7.5.0 → 7.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarChart.js +30 -3
- package/BarChart/BarElement.d.ts +0 -3
- package/BarChart/BarElement.js +8 -19
- package/BarChart/BarLabel/BarLabel.d.ts +1342 -0
- package/BarChart/BarLabel/BarLabel.js +60 -0
- package/BarChart/BarLabel/BarLabel.types.d.ts +39 -0
- package/BarChart/BarLabel/BarLabel.types.js +5 -0
- package/BarChart/BarLabel/BarLabelItem.d.ts +53 -0
- package/BarChart/BarLabel/BarLabelItem.js +127 -0
- package/BarChart/BarLabel/BarLabelPlot.d.ts +16 -0
- package/BarChart/BarLabel/BarLabelPlot.js +106 -0
- package/BarChart/BarLabel/barLabelClasses.d.ts +13 -0
- package/BarChart/BarLabel/barLabelClasses.js +29 -0
- package/BarChart/BarLabel/getBarLabel.d.ts +10 -0
- package/BarChart/BarLabel/getBarLabel.js +31 -0
- package/BarChart/BarLabel/index.d.ts +6 -0
- package/BarChart/BarLabel/index.js +25 -0
- package/BarChart/BarPlot.d.ts +15 -4
- package/BarChart/BarPlot.js +22 -34
- package/BarChart/checkScaleErrors.d.ts +11 -0
- package/BarChart/checkScaleErrors.js +33 -0
- package/BarChart/index.d.ts +1 -0
- package/BarChart/index.js +11 -0
- package/BarChart/types.d.ts +0 -2
- package/CHANGELOG.md +148 -5418
- package/ChartContainer/ChartContainer.d.ts +3 -2
- package/ChartContainer/ChartContainer.js +20 -3
- package/ChartsAxis/ChartsAxis.js +1 -1
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/ChartsClipPath/ChartsClipPath.js +1 -1
- package/ChartsGrid/ChartsGrid.js +1 -1
- package/ChartsLegend/ChartsLegend.js +1 -1
- package/ChartsLegend/DefaultChartsLegend.js +1 -1
- package/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/ChartsSurface.js +1 -1
- package/ChartsText/ChartsText.js +1 -1
- package/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/ChartsTooltip/ChartsItemTooltipContent.js +1 -1
- package/ChartsTooltip/ChartsTooltip.js +1 -1
- package/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
- package/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/ChartsVoronoiHandler/ChartsVoronoiHandler.js +14 -2
- package/ChartsXAxis/ChartsXAxis.js +1 -1
- package/ChartsYAxis/ChartsYAxis.js +1 -1
- package/Gauge/Gauge.js +1 -1
- package/Gauge/GaugeContainer.js +1 -1
- package/Gauge/GaugeValueText.js +1 -1
- package/LineChart/AnimatedArea.js +1 -1
- package/LineChart/AnimatedLine.js +1 -1
- package/LineChart/AreaElement.d.ts +0 -2
- package/LineChart/AreaElement.js +8 -18
- package/LineChart/AreaPlot.js +1 -3
- package/LineChart/LineChart.js +19 -2
- package/LineChart/LineElement.d.ts +0 -2
- package/LineChart/LineElement.js +8 -18
- package/LineChart/LineHighlightElement.js +1 -1
- package/LineChart/LineHighlightPlot.js +1 -1
- package/LineChart/LinePlot.js +1 -3
- package/LineChart/MarkElement.d.ts +0 -2
- package/LineChart/MarkElement.js +11 -33
- package/LineChart/MarkPlot.js +1 -2
- package/PieChart/PieArc.d.ts +4 -1
- package/PieChart/PieArc.js +8 -4
- package/PieChart/PieArcLabel.js +1 -1
- package/PieChart/PieArcLabelPlot.d.ts +1 -1
- package/PieChart/PieArcLabelPlot.js +2 -8
- package/PieChart/PieArcPlot.d.ts +1 -1
- package/PieChart/PieArcPlot.js +6 -8
- package/PieChart/PieChart.js +19 -2
- package/PieChart/PiePlot.js +3 -7
- package/PieChart/dataTransform/useTransformData.d.ts +1 -1
- package/PieChart/dataTransform/useTransformData.js +10 -25
- package/ResponsiveChartContainer/ResponsiveChartContainer.js +14 -1
- package/ScatterChart/Scatter.js +15 -11
- package/ScatterChart/ScatterChart.js +19 -2
- package/ScatterChart/ScatterPlot.js +1 -1
- package/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.js +14 -1
- package/context/HighlightedProvider/HighlightedContext.d.ts +65 -0
- package/context/HighlightedProvider/HighlightedContext.js +36 -0
- package/context/HighlightedProvider/HighlightedProvider.d.ts +20 -0
- package/context/HighlightedProvider/HighlightedProvider.js +97 -0
- package/context/HighlightedProvider/createIsFaded.d.ts +2 -0
- package/context/HighlightedProvider/createIsFaded.js +19 -0
- package/context/HighlightedProvider/createIsHighlighted.d.ts +2 -0
- package/context/HighlightedProvider/createIsHighlighted.js +19 -0
- package/context/HighlightedProvider/index.d.ts +4 -0
- package/context/HighlightedProvider/index.js +49 -0
- package/context/HighlightedProvider/useHighlighted.d.ts +9 -0
- package/context/HighlightedProvider/useHighlighted.js +24 -0
- package/context/HighlightedProvider/useItemHighlighted.d.ts +21 -0
- package/context/HighlightedProvider/useItemHighlighted.js +37 -0
- package/context/ZAxisContextProvider.js +1 -1
- package/context/index.d.ts +1 -1
- package/context/index.js +15 -0
- package/esm/BarChart/BarChart.js +30 -3
- package/esm/BarChart/BarElement.js +9 -20
- package/esm/BarChart/BarLabel/BarLabel.js +51 -0
- package/esm/BarChart/BarLabel/BarLabel.types.js +1 -0
- package/esm/BarChart/BarLabel/BarLabelItem.js +119 -0
- package/esm/BarChart/BarLabel/BarLabelPlot.js +98 -0
- package/esm/BarChart/BarLabel/barLabelClasses.js +19 -0
- package/esm/BarChart/BarLabel/getBarLabel.js +24 -0
- package/esm/BarChart/BarLabel/index.js +2 -0
- package/esm/BarChart/BarPlot.js +22 -34
- package/esm/BarChart/checkScaleErrors.js +27 -0
- package/esm/BarChart/index.js +2 -1
- package/esm/ChartContainer/ChartContainer.js +20 -3
- package/esm/ChartsAxis/ChartsAxis.js +1 -1
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/esm/ChartsClipPath/ChartsClipPath.js +1 -1
- package/esm/ChartsGrid/ChartsGrid.js +1 -1
- package/esm/ChartsLegend/ChartsLegend.js +1 -1
- package/esm/ChartsLegend/DefaultChartsLegend.js +1 -1
- package/esm/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/esm/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/esm/ChartsSurface.js +1 -1
- package/esm/ChartsText/ChartsText.js +1 -1
- package/esm/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/esm/ChartsTooltip/ChartsItemTooltipContent.js +1 -1
- package/esm/ChartsTooltip/ChartsTooltip.js +1 -1
- package/esm/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
- package/esm/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/esm/ChartsVoronoiHandler/ChartsVoronoiHandler.js +14 -2
- package/esm/ChartsXAxis/ChartsXAxis.js +1 -1
- package/esm/ChartsYAxis/ChartsYAxis.js +1 -1
- package/esm/Gauge/Gauge.js +1 -1
- package/esm/Gauge/GaugeContainer.js +1 -1
- package/esm/Gauge/GaugeValueText.js +1 -1
- package/esm/LineChart/AnimatedArea.js +1 -1
- package/esm/LineChart/AnimatedLine.js +1 -1
- package/esm/LineChart/AreaElement.js +9 -19
- package/esm/LineChart/AreaPlot.js +1 -3
- package/esm/LineChart/LineChart.js +19 -2
- package/esm/LineChart/LineElement.js +9 -19
- package/esm/LineChart/LineHighlightElement.js +1 -1
- package/esm/LineChart/LineHighlightPlot.js +1 -1
- package/esm/LineChart/LinePlot.js +1 -3
- package/esm/LineChart/MarkElement.js +12 -34
- package/esm/LineChart/MarkPlot.js +1 -2
- package/esm/PieChart/PieArc.js +8 -4
- package/esm/PieChart/PieArcLabel.js +1 -1
- package/esm/PieChart/PieArcLabelPlot.js +2 -8
- package/esm/PieChart/PieArcPlot.js +6 -8
- package/esm/PieChart/PieChart.js +19 -2
- package/esm/PieChart/PiePlot.js +3 -7
- package/esm/PieChart/dataTransform/useTransformData.js +10 -25
- package/esm/ResponsiveChartContainer/ResponsiveChartContainer.js +14 -1
- package/esm/ScatterChart/Scatter.js +16 -12
- package/esm/ScatterChart/ScatterChart.js +19 -2
- package/esm/ScatterChart/ScatterPlot.js +1 -1
- package/esm/SparkLineChart/SparkLineChart.js +14 -1
- package/esm/context/HighlightedProvider/HighlightedContext.js +29 -0
- package/esm/context/HighlightedProvider/HighlightedProvider.js +89 -0
- package/esm/context/HighlightedProvider/createIsFaded.js +12 -0
- package/esm/context/HighlightedProvider/createIsHighlighted.js +12 -0
- package/esm/context/HighlightedProvider/index.js +4 -0
- package/esm/context/HighlightedProvider/useHighlighted.js +17 -0
- package/esm/context/HighlightedProvider/useItemHighlighted.js +29 -0
- package/esm/context/ZAxisContextProvider.js +1 -1
- package/esm/context/index.js +1 -0
- package/esm/hooks/useInteractionItemProps.js +9 -41
- package/hooks/useInteractionItemProps.d.ts +1 -4
- package/hooks/useInteractionItemProps.js +11 -45
- package/index.js +1 -1
- package/internals/colorScale.d.ts +1 -1
- package/internals/defaultizeColor.d.ts +13 -13
- package/models/seriesType/common.d.ts +4 -1
- package/modern/BarChart/BarChart.js +30 -3
- package/modern/BarChart/BarElement.js +9 -20
- package/modern/BarChart/BarLabel/BarLabel.js +51 -0
- package/modern/BarChart/BarLabel/BarLabel.types.js +1 -0
- package/modern/BarChart/BarLabel/BarLabelItem.js +119 -0
- package/modern/BarChart/BarLabel/BarLabelPlot.js +98 -0
- package/modern/BarChart/BarLabel/barLabelClasses.js +19 -0
- package/modern/BarChart/BarLabel/getBarLabel.js +24 -0
- package/modern/BarChart/BarLabel/index.js +2 -0
- package/modern/BarChart/BarPlot.js +22 -34
- package/modern/BarChart/checkScaleErrors.js +27 -0
- package/modern/BarChart/index.js +2 -1
- package/modern/ChartContainer/ChartContainer.js +20 -3
- package/modern/ChartsAxis/ChartsAxis.js +1 -1
- package/modern/ChartsAxisHighlight/ChartsAxisHighlight.js +1 -1
- package/modern/ChartsClipPath/ChartsClipPath.js +1 -1
- package/modern/ChartsGrid/ChartsGrid.js +1 -1
- package/modern/ChartsLegend/ChartsLegend.js +1 -1
- package/modern/ChartsLegend/DefaultChartsLegend.js +1 -1
- package/modern/ChartsOnAxisClickHandler/ChartsOnAxisClickHandler.js +1 -1
- package/modern/ChartsReferenceLine/ChartsReferenceLine.js +1 -1
- package/modern/ChartsSurface.js +1 -1
- package/modern/ChartsText/ChartsText.js +1 -1
- package/modern/ChartsTooltip/ChartsAxisTooltipContent.js +1 -1
- package/modern/ChartsTooltip/ChartsItemTooltipContent.js +1 -1
- package/modern/ChartsTooltip/ChartsTooltip.js +1 -1
- package/modern/ChartsTooltip/DefaultChartsAxisTooltipContent.js +1 -1
- package/modern/ChartsTooltip/DefaultChartsItemTooltipContent.js +1 -1
- package/modern/ChartsVoronoiHandler/ChartsVoronoiHandler.js +14 -2
- package/modern/ChartsXAxis/ChartsXAxis.js +1 -1
- package/modern/ChartsYAxis/ChartsYAxis.js +1 -1
- package/modern/Gauge/Gauge.js +1 -1
- package/modern/Gauge/GaugeContainer.js +1 -1
- package/modern/Gauge/GaugeValueText.js +1 -1
- package/modern/LineChart/AnimatedArea.js +1 -1
- package/modern/LineChart/AnimatedLine.js +1 -1
- package/modern/LineChart/AreaElement.js +9 -19
- package/modern/LineChart/AreaPlot.js +1 -3
- package/modern/LineChart/LineChart.js +19 -2
- package/modern/LineChart/LineElement.js +9 -19
- package/modern/LineChart/LineHighlightElement.js +1 -1
- package/modern/LineChart/LineHighlightPlot.js +1 -1
- package/modern/LineChart/LinePlot.js +1 -3
- package/modern/LineChart/MarkElement.js +12 -34
- package/modern/LineChart/MarkPlot.js +1 -2
- package/modern/PieChart/PieArc.js +8 -4
- package/modern/PieChart/PieArcLabel.js +1 -1
- package/modern/PieChart/PieArcLabelPlot.js +2 -8
- package/modern/PieChart/PieArcPlot.js +6 -8
- package/modern/PieChart/PieChart.js +19 -2
- package/modern/PieChart/PiePlot.js +3 -7
- package/modern/PieChart/dataTransform/useTransformData.js +10 -25
- package/modern/ResponsiveChartContainer/ResponsiveChartContainer.js +14 -1
- package/modern/ScatterChart/Scatter.js +16 -12
- package/modern/ScatterChart/ScatterChart.js +19 -2
- package/modern/ScatterChart/ScatterPlot.js +1 -1
- package/modern/SparkLineChart/SparkLineChart.js +14 -1
- package/modern/context/HighlightedProvider/HighlightedContext.js +29 -0
- package/modern/context/HighlightedProvider/HighlightedProvider.js +89 -0
- package/modern/context/HighlightedProvider/createIsFaded.js +12 -0
- package/modern/context/HighlightedProvider/createIsHighlighted.js +12 -0
- package/modern/context/HighlightedProvider/index.js +4 -0
- package/modern/context/HighlightedProvider/useHighlighted.js +17 -0
- package/modern/context/HighlightedProvider/useItemHighlighted.js +29 -0
- package/modern/context/ZAxisContextProvider.js +1 -1
- package/modern/context/index.js +1 -0
- package/modern/hooks/useInteractionItemProps.js +9 -41
- package/modern/index.js +1 -1
- package/package.json +3 -3
- package/themeAugmentation/components.d.ts +4 -0
- package/themeAugmentation/overrides.d.ts +3 -0
- package/themeAugmentation/props.d.ts +2 -0
- package/context/HighlightProvider.d.ts +0 -45
- package/context/HighlightProvider.js +0 -60
- package/esm/context/HighlightProvider.js +0 -51
- package/modern/context/HighlightProvider.js +0 -51
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { getIsHighlighted, getIsFaded } from '../../hooks/useInteractionItemProps';
|
|
3
|
+
import { useHighlighted } from '../../context';
|
|
5
4
|
export function useTransformData(series) {
|
|
6
5
|
const {
|
|
7
6
|
id: seriesId,
|
|
8
|
-
highlightScope,
|
|
9
7
|
data,
|
|
10
8
|
faded,
|
|
11
9
|
highlighted,
|
|
@@ -16,29 +14,16 @@ export function useTransformData(series) {
|
|
|
16
14
|
cornerRadius: baseCornerRadius = 0
|
|
17
15
|
} = series;
|
|
18
16
|
const {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
seriesId,
|
|
25
|
-
dataIndex
|
|
26
|
-
}, highlightScope);
|
|
27
|
-
const isFaded = !isHighlighted && getIsFaded(highlightedItem, {
|
|
28
|
-
type: 'pie',
|
|
17
|
+
isFaded: isItemFaded,
|
|
18
|
+
isHighlighted: isItemHighlighted
|
|
19
|
+
} = useHighlighted();
|
|
20
|
+
const dataWithHighlight = React.useMemo(() => data.map((item, itemIndex) => {
|
|
21
|
+
const currentItem = {
|
|
29
22
|
seriesId,
|
|
30
|
-
dataIndex
|
|
31
|
-
}, highlightScope);
|
|
32
|
-
return {
|
|
33
|
-
isHighlighted,
|
|
34
|
-
isFaded
|
|
23
|
+
dataIndex: itemIndex
|
|
35
24
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const {
|
|
39
|
-
isHighlighted,
|
|
40
|
-
isFaded
|
|
41
|
-
} = getHighlightStatus(itemIndex);
|
|
25
|
+
const isHighlighted = isItemHighlighted(currentItem);
|
|
26
|
+
const isFaded = !isHighlighted && isItemFaded(currentItem);
|
|
42
27
|
const attributesOverride = _extends({
|
|
43
28
|
additionalRadius: 0
|
|
44
29
|
}, isFaded && faded || isHighlighted && highlighted || {});
|
|
@@ -56,6 +41,6 @@ export function useTransformData(series) {
|
|
|
56
41
|
cornerRadius,
|
|
57
42
|
arcLabelRadius
|
|
58
43
|
});
|
|
59
|
-
}), [baseCornerRadius, baseInnerRadius, baseOuterRadius, basePaddingAngle, baseArcLabelRadius, data, faded,
|
|
44
|
+
}), [baseCornerRadius, baseInnerRadius, baseOuterRadius, basePaddingAngle, baseArcLabelRadius, data, faded, highlighted, isItemFaded, isItemHighlighted, seriesId]);
|
|
60
45
|
return dataWithHighlight;
|
|
61
46
|
}
|
|
@@ -50,7 +50,7 @@ const ResponsiveChartContainer = /*#__PURE__*/React.forwardRef(function Responsi
|
|
|
50
50
|
process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
|
|
51
51
|
// ----------------------------- Warning --------------------------------
|
|
52
52
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
53
|
-
// | To update them edit the TypeScript types and run "
|
|
53
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
54
54
|
// ----------------------------------------------------------------------
|
|
55
55
|
children: PropTypes.node,
|
|
56
56
|
className: PropTypes.string,
|
|
@@ -74,6 +74,13 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
|
|
|
74
74
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
75
75
|
*/
|
|
76
76
|
height: PropTypes.number,
|
|
77
|
+
/**
|
|
78
|
+
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
79
|
+
*/
|
|
80
|
+
highlightedItem: PropTypes.shape({
|
|
81
|
+
dataIndex: PropTypes.number,
|
|
82
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
83
|
+
}),
|
|
77
84
|
/**
|
|
78
85
|
* The margin between the SVG and the drawing area.
|
|
79
86
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
@@ -86,6 +93,12 @@ process.env.NODE_ENV !== "production" ? ResponsiveChartContainer.propTypes = {
|
|
|
86
93
|
right: PropTypes.number,
|
|
87
94
|
top: PropTypes.number
|
|
88
95
|
}),
|
|
96
|
+
/**
|
|
97
|
+
* The callback fired when the highlighted item changes.
|
|
98
|
+
*
|
|
99
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
100
|
+
*/
|
|
101
|
+
onHighlightChange: PropTypes.func,
|
|
89
102
|
/**
|
|
90
103
|
* The array of series to display.
|
|
91
104
|
* Each type of series has its own specificity.
|
|
@@ -2,8 +2,9 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { getValueToPositionMapper } from '../hooks/useScale';
|
|
5
|
-
import {
|
|
5
|
+
import { useInteractionItemProps } from '../hooks/useInteractionItemProps';
|
|
6
6
|
import { InteractionContext } from '../context/InteractionProvider';
|
|
7
|
+
import { useHighlighted } from '../context';
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
/**
|
|
9
10
|
* Demos:
|
|
@@ -25,16 +26,15 @@ function Scatter(props) {
|
|
|
25
26
|
markerSize,
|
|
26
27
|
onItemClick
|
|
27
28
|
} = props;
|
|
28
|
-
const highlightScope = React.useMemo(() => _extends({
|
|
29
|
-
highlighted: 'item',
|
|
30
|
-
faded: 'global'
|
|
31
|
-
}, series.highlightScope), [series.highlightScope]);
|
|
32
29
|
const {
|
|
33
|
-
item,
|
|
34
30
|
useVoronoiInteraction
|
|
35
31
|
} = React.useContext(InteractionContext);
|
|
36
32
|
const skipInteractionHandlers = useVoronoiInteraction || series.disableHover;
|
|
37
|
-
const getInteractionItemProps = useInteractionItemProps(
|
|
33
|
+
const getInteractionItemProps = useInteractionItemProps(skipInteractionHandlers);
|
|
34
|
+
const {
|
|
35
|
+
isFaded,
|
|
36
|
+
isHighlighted
|
|
37
|
+
} = useHighlighted();
|
|
38
38
|
const cleanData = React.useMemo(() => {
|
|
39
39
|
const getXPosition = getValueToPositionMapper(xScale);
|
|
40
40
|
const getYPosition = getValueToPositionMapper(yScale);
|
|
@@ -56,12 +56,16 @@ function Scatter(props) {
|
|
|
56
56
|
dataIndex: i
|
|
57
57
|
};
|
|
58
58
|
if (isInRange) {
|
|
59
|
-
const
|
|
59
|
+
const currentItem = {
|
|
60
|
+
seriesId: pointCtx.seriesId,
|
|
61
|
+
dataIndex: pointCtx.dataIndex
|
|
62
|
+
};
|
|
63
|
+
const isItemHighlighted = isHighlighted(currentItem);
|
|
60
64
|
temp.push({
|
|
61
65
|
x,
|
|
62
66
|
y,
|
|
63
|
-
isHighlighted,
|
|
64
|
-
isFaded: !
|
|
67
|
+
isHighlighted: isItemHighlighted,
|
|
68
|
+
isFaded: !isItemHighlighted && isFaded(currentItem),
|
|
65
69
|
interactionProps: getInteractionItemProps(pointCtx),
|
|
66
70
|
id: scatterPoint.id,
|
|
67
71
|
dataIndex: i,
|
|
@@ -70,7 +74,7 @@ function Scatter(props) {
|
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
return temp;
|
|
73
|
-
}, [xScale, yScale, series.data, series.id,
|
|
77
|
+
}, [xScale, yScale, series.data, series.id, getInteractionItemProps, color, colorGetter, isFaded, isHighlighted]);
|
|
74
78
|
return /*#__PURE__*/_jsx("g", {
|
|
75
79
|
children: cleanData.map(dataPoint => /*#__PURE__*/_jsx("circle", _extends({
|
|
76
80
|
cx: 0,
|
|
@@ -91,7 +95,7 @@ function Scatter(props) {
|
|
|
91
95
|
process.env.NODE_ENV !== "production" ? Scatter.propTypes = {
|
|
92
96
|
// ----------------------------- Warning --------------------------------
|
|
93
97
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
94
|
-
// | To update them edit the TypeScript types and run "
|
|
98
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
95
99
|
// ----------------------------------------------------------------------
|
|
96
100
|
color: PropTypes.string.isRequired,
|
|
97
101
|
colorGetter: PropTypes.func,
|
|
@@ -47,7 +47,9 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props,
|
|
|
47
47
|
children,
|
|
48
48
|
slots,
|
|
49
49
|
slotProps,
|
|
50
|
-
loading
|
|
50
|
+
loading,
|
|
51
|
+
highlightedItem,
|
|
52
|
+
onHighlightChange
|
|
51
53
|
} = props;
|
|
52
54
|
return /*#__PURE__*/_jsx(ResponsiveChartContainer, {
|
|
53
55
|
ref: ref,
|
|
@@ -61,6 +63,8 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props,
|
|
|
61
63
|
xAxis: xAxis,
|
|
62
64
|
yAxis: yAxis,
|
|
63
65
|
sx: sx,
|
|
66
|
+
highlightedItem: highlightedItem,
|
|
67
|
+
onHighlightChange: onHighlightChange,
|
|
64
68
|
children: /*#__PURE__*/_jsxs(ZAxisContextProvider, {
|
|
65
69
|
zAxis: zAxis,
|
|
66
70
|
children: [!disableVoronoi && /*#__PURE__*/_jsx(ChartsVoronoiHandler, {
|
|
@@ -99,7 +103,7 @@ const ScatterChart = /*#__PURE__*/React.forwardRef(function ScatterChart(props,
|
|
|
99
103
|
process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
100
104
|
// ----------------------------- Warning --------------------------------
|
|
101
105
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
102
|
-
// | To update them edit the TypeScript types and run "
|
|
106
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
103
107
|
// ----------------------------------------------------------------------
|
|
104
108
|
/**
|
|
105
109
|
* The configuration of axes highlight.
|
|
@@ -150,6 +154,13 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
150
154
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
151
155
|
*/
|
|
152
156
|
height: PropTypes.number,
|
|
157
|
+
/**
|
|
158
|
+
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
159
|
+
*/
|
|
160
|
+
highlightedItem: PropTypes.shape({
|
|
161
|
+
dataIndex: PropTypes.number,
|
|
162
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
163
|
+
}),
|
|
153
164
|
/**
|
|
154
165
|
* Indicate which axis to display the left of the charts.
|
|
155
166
|
* Can be a string (the id of the axis) or an object `ChartsYAxisProps`.
|
|
@@ -187,6 +198,12 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
187
198
|
right: PropTypes.number,
|
|
188
199
|
top: PropTypes.number
|
|
189
200
|
}),
|
|
201
|
+
/**
|
|
202
|
+
* The callback fired when the highlighted item changes.
|
|
203
|
+
*
|
|
204
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
205
|
+
*/
|
|
206
|
+
onHighlightChange: PropTypes.func,
|
|
190
207
|
/**
|
|
191
208
|
* Callback fired when clicking on a scatter item.
|
|
192
209
|
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element if using Voronoi cells. Or the Mouse event from the scatter element, when `disableVoronoi=true`.
|
|
@@ -74,7 +74,7 @@ function ScatterPlot(props) {
|
|
|
74
74
|
process.env.NODE_ENV !== "production" ? ScatterPlot.propTypes = {
|
|
75
75
|
// ----------------------------- Warning --------------------------------
|
|
76
76
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
77
|
-
// | To update them edit the TypeScript types and run "
|
|
77
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
78
78
|
// ----------------------------------------------------------------------
|
|
79
79
|
/**
|
|
80
80
|
* Callback fired when clicking on a scatter item.
|
|
@@ -105,7 +105,7 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
105
105
|
process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
106
106
|
// ----------------------------- Warning --------------------------------
|
|
107
107
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
108
|
-
// | To update them edit the TypeScript types and run "
|
|
108
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
109
109
|
// ----------------------------------------------------------------------
|
|
110
110
|
/**
|
|
111
111
|
* Set to `true` to fill spark line area.
|
|
@@ -147,6 +147,13 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
147
147
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
148
148
|
*/
|
|
149
149
|
height: PropTypes.number,
|
|
150
|
+
/**
|
|
151
|
+
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
152
|
+
*/
|
|
153
|
+
highlightedItem: PropTypes.shape({
|
|
154
|
+
dataIndex: PropTypes.number,
|
|
155
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
156
|
+
}),
|
|
150
157
|
/**
|
|
151
158
|
* The margin between the SVG and the drawing area.
|
|
152
159
|
* It's used for leaving some space for extra information such as the x- and y-axis or legend.
|
|
@@ -164,6 +171,12 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
164
171
|
right: PropTypes.number,
|
|
165
172
|
top: PropTypes.number
|
|
166
173
|
}),
|
|
174
|
+
/**
|
|
175
|
+
* The callback fired when the highlighted item changes.
|
|
176
|
+
*
|
|
177
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
178
|
+
*/
|
|
179
|
+
onHighlightChange: PropTypes.func,
|
|
167
180
|
/**
|
|
168
181
|
* Type of plot used.
|
|
169
182
|
* @default 'line'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The data of the highlighted item.
|
|
5
|
+
* To highlight an item, you need to provide the series id and the item id.
|
|
6
|
+
* If targeting the whole series, you can omit the item id.
|
|
7
|
+
* To clear the highlight, set the value to an empty object.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* // Highlight the item with the series id 'london' and the item id 0.
|
|
11
|
+
* { seriesId: 'london', dataIndex: 0 }
|
|
12
|
+
*
|
|
13
|
+
* // Highlight the whole series with the series id 'london'.
|
|
14
|
+
* { seriesId: 'london' }
|
|
15
|
+
*
|
|
16
|
+
* // Clear the highlight.
|
|
17
|
+
* {}
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export const HighlightedContext = /*#__PURE__*/React.createContext({
|
|
21
|
+
highlightedItem: null,
|
|
22
|
+
setHighlighted: () => {},
|
|
23
|
+
clearHighlighted: () => {},
|
|
24
|
+
isHighlighted: () => false,
|
|
25
|
+
isFaded: () => false
|
|
26
|
+
});
|
|
27
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
28
|
+
HighlightedContext.displayName = 'HighlightedContext';
|
|
29
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
const _excluded = ["highlighted", "faded"];
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import useControlled from '@mui/utils/useControlled';
|
|
7
|
+
import { HighlightedContext } from './HighlightedContext';
|
|
8
|
+
import { createIsFaded } from './createIsFaded';
|
|
9
|
+
import { createIsHighlighted } from './createIsHighlighted';
|
|
10
|
+
import { useSeries } from '../../hooks/useSeries';
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
const mergeDeprecatedOptions = options => {
|
|
13
|
+
const _ref = options ?? {},
|
|
14
|
+
{
|
|
15
|
+
highlighted,
|
|
16
|
+
faded
|
|
17
|
+
} = _ref,
|
|
18
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
19
|
+
return _extends({
|
|
20
|
+
highlight: highlighted,
|
|
21
|
+
fade: faded
|
|
22
|
+
}, rest);
|
|
23
|
+
};
|
|
24
|
+
function HighlightedProvider({
|
|
25
|
+
children,
|
|
26
|
+
highlightedItem: highlightedItemProps,
|
|
27
|
+
onHighlightChange
|
|
28
|
+
}) {
|
|
29
|
+
const [highlightedItem, setHighlightedItem] = useControlled({
|
|
30
|
+
controlled: highlightedItemProps,
|
|
31
|
+
default: null,
|
|
32
|
+
name: 'HighlightedProvider',
|
|
33
|
+
state: 'highlightedItem'
|
|
34
|
+
});
|
|
35
|
+
const series = useSeries();
|
|
36
|
+
const seriesById = React.useMemo(() => {
|
|
37
|
+
const map = new Map();
|
|
38
|
+
Object.keys(series).forEach(seriesType => {
|
|
39
|
+
const seriesData = series[seriesType];
|
|
40
|
+
Object.keys(seriesData?.series ?? {}).forEach(seriesId => {
|
|
41
|
+
const seriesItem = seriesData?.series[seriesId];
|
|
42
|
+
map.set(seriesId, mergeDeprecatedOptions(seriesItem?.highlightScope));
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
return map;
|
|
46
|
+
}, [series]);
|
|
47
|
+
const highlightScope = highlightedItem && highlightedItem.seriesId ? seriesById.get(highlightedItem.seriesId) ?? undefined : undefined;
|
|
48
|
+
const providerValue = React.useMemo(() => {
|
|
49
|
+
return {
|
|
50
|
+
highlightScope,
|
|
51
|
+
highlightedItem,
|
|
52
|
+
setHighlighted: itemData => {
|
|
53
|
+
setHighlightedItem(itemData);
|
|
54
|
+
onHighlightChange?.(itemData);
|
|
55
|
+
},
|
|
56
|
+
clearHighlighted: () => {
|
|
57
|
+
setHighlightedItem(null);
|
|
58
|
+
onHighlightChange?.(null);
|
|
59
|
+
},
|
|
60
|
+
isHighlighted: createIsHighlighted(highlightScope, highlightedItem),
|
|
61
|
+
isFaded: createIsFaded(highlightScope, highlightedItem)
|
|
62
|
+
};
|
|
63
|
+
}, [highlightedItem, highlightScope, setHighlightedItem, onHighlightChange]);
|
|
64
|
+
return /*#__PURE__*/_jsx(HighlightedContext.Provider, {
|
|
65
|
+
value: providerValue,
|
|
66
|
+
children: children
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
process.env.NODE_ENV !== "production" ? HighlightedProvider.propTypes = {
|
|
70
|
+
// ----------------------------- Warning --------------------------------
|
|
71
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
72
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
73
|
+
// ----------------------------------------------------------------------
|
|
74
|
+
children: PropTypes.node,
|
|
75
|
+
/**
|
|
76
|
+
* The item currently highlighted. Turns highlighting into a controlled prop.
|
|
77
|
+
*/
|
|
78
|
+
highlightedItem: PropTypes.shape({
|
|
79
|
+
dataIndex: PropTypes.number,
|
|
80
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
81
|
+
}),
|
|
82
|
+
/**
|
|
83
|
+
* The callback fired when the highlighted item changes.
|
|
84
|
+
*
|
|
85
|
+
* @param {HighlightItemData | null} highlightedItem The newly highlighted item.
|
|
86
|
+
*/
|
|
87
|
+
onHighlightChange: PropTypes.func
|
|
88
|
+
} : void 0;
|
|
89
|
+
export { HighlightedProvider };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const createIsFaded = (highlightScope, highlightedItem) => input => {
|
|
2
|
+
if (!highlightScope) {
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
5
|
+
if (highlightScope.fade === 'series') {
|
|
6
|
+
return input.seriesId === highlightedItem?.seriesId && input.dataIndex !== highlightedItem?.dataIndex;
|
|
7
|
+
}
|
|
8
|
+
if (highlightScope.fade === 'global') {
|
|
9
|
+
return input.seriesId !== highlightedItem?.seriesId || input.dataIndex !== highlightedItem?.dataIndex;
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const createIsHighlighted = (highlightScope, highlightedItem) => input => {
|
|
2
|
+
if (!highlightScope) {
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
5
|
+
if (highlightScope.highlight === 'series') {
|
|
6
|
+
return input.seriesId === highlightedItem?.seriesId;
|
|
7
|
+
}
|
|
8
|
+
if (highlightScope.highlight === 'item') {
|
|
9
|
+
return input.dataIndex === highlightedItem?.dataIndex && input.seriesId === highlightedItem?.seriesId;
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { HighlightedContext } from './HighlightedContext';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A hook to get the highlighted state of the chart.
|
|
6
|
+
*
|
|
7
|
+
* Please consider using the `useItemHighlighted` hook if you need to check the state of a specific item.
|
|
8
|
+
*
|
|
9
|
+
* @returns {HighlightedState} the state of the chart
|
|
10
|
+
*/
|
|
11
|
+
export function useHighlighted() {
|
|
12
|
+
const highlighted = React.useContext(HighlightedContext);
|
|
13
|
+
if (highlighted === undefined) {
|
|
14
|
+
throw new Error(['MUI X: Could not find the highlighted ref context.', 'It looks like you rendered your component outside of a ChartsContainer parent component.'].join('\n'));
|
|
15
|
+
}
|
|
16
|
+
return highlighted;
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { HighlightedContext } from './HighlightedContext';
|
|
3
|
+
/**
|
|
4
|
+
* A hook to check the highlighted state of the item.
|
|
5
|
+
* This function already calculates that an item is not faded if it is highlighted.
|
|
6
|
+
*
|
|
7
|
+
* If you need fine control over the state, use the `useHighlighted` hook instead.
|
|
8
|
+
*
|
|
9
|
+
* @param {HighlightItemData} item is the item to check
|
|
10
|
+
* @returns {ItemHighlightedState} the state of the item
|
|
11
|
+
*/
|
|
12
|
+
export function useItemHighlighted(item) {
|
|
13
|
+
const highlighted = React.useContext(HighlightedContext);
|
|
14
|
+
if (highlighted === undefined) {
|
|
15
|
+
throw new Error(['MUI X: Could not find the highlighted ref context.', 'It looks like you rendered your component outside of a ChartsContainer parent component.'].join('\n'));
|
|
16
|
+
}
|
|
17
|
+
if (!item) {
|
|
18
|
+
return {
|
|
19
|
+
isHighlighted: false,
|
|
20
|
+
isFaded: false
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const isHighlighted = highlighted.isHighlighted(item);
|
|
24
|
+
const isFaded = !isHighlighted && highlighted.isFaded(item);
|
|
25
|
+
return {
|
|
26
|
+
isHighlighted,
|
|
27
|
+
isFaded
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -55,7 +55,7 @@ function ZAxisContextProvider(props) {
|
|
|
55
55
|
process.env.NODE_ENV !== "production" ? ZAxisContextProvider.propTypes = {
|
|
56
56
|
// ----------------------------- Warning --------------------------------
|
|
57
57
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
58
|
-
// | To update them edit the TypeScript types and run "
|
|
58
|
+
// | To update them edit the TypeScript types and run "pnpm proptypes" |
|
|
59
59
|
// ----------------------------------------------------------------------
|
|
60
60
|
children: PropTypes.node,
|
|
61
61
|
/**
|
package/modern/context/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { InteractionContext } from '../context/InteractionProvider';
|
|
3
|
-
import {
|
|
4
|
-
export const useInteractionItemProps =
|
|
3
|
+
import { HighlightedContext } from '../context';
|
|
4
|
+
export const useInteractionItemProps = skip => {
|
|
5
5
|
const {
|
|
6
6
|
dispatch: dispatchInteraction
|
|
7
7
|
} = React.useContext(InteractionContext);
|
|
8
8
|
const {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
setHighlighted,
|
|
10
|
+
clearHighlighted
|
|
11
|
+
} = React.useContext(HighlightedContext);
|
|
11
12
|
if (skip) {
|
|
12
13
|
return () => ({});
|
|
13
14
|
}
|
|
@@ -17,10 +18,9 @@ export const useInteractionItemProps = (scope, skip) => {
|
|
|
17
18
|
type: 'enterItem',
|
|
18
19
|
data
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
scope
|
|
21
|
+
setHighlighted({
|
|
22
|
+
seriesId: data.seriesId,
|
|
23
|
+
dataIndex: data.dataIndex
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
const onMouseLeave = () => {
|
|
@@ -28,10 +28,7 @@ export const useInteractionItemProps = (scope, skip) => {
|
|
|
28
28
|
type: 'leaveItem',
|
|
29
29
|
data
|
|
30
30
|
});
|
|
31
|
-
|
|
32
|
-
type: 'leaveItem',
|
|
33
|
-
item: data
|
|
34
|
-
});
|
|
31
|
+
clearHighlighted();
|
|
35
32
|
};
|
|
36
33
|
return {
|
|
37
34
|
onMouseEnter,
|
|
@@ -39,33 +36,4 @@ export const useInteractionItemProps = (scope, skip) => {
|
|
|
39
36
|
};
|
|
40
37
|
};
|
|
41
38
|
return getInteractionItemProps;
|
|
42
|
-
};
|
|
43
|
-
export const getIsHighlighted = (selectedItem, currentItem, highlightScope) => {
|
|
44
|
-
if (!highlightScope?.highlighted || highlightScope.highlighted === 'none' || selectedItem === null) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
const isSeriesSelected = selectedItem.type === currentItem.type && selectedItem.seriesId === currentItem.seriesId;
|
|
48
|
-
if (!isSeriesSelected) {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
if (highlightScope.highlighted === 'series') {
|
|
52
|
-
return isSeriesSelected;
|
|
53
|
-
}
|
|
54
|
-
return selectedItem.dataIndex !== undefined && selectedItem.dataIndex === currentItem.dataIndex;
|
|
55
|
-
};
|
|
56
|
-
export const getIsFaded = (selectedItem, currentItem, highlightScope) => {
|
|
57
|
-
if (!highlightScope?.faded || highlightScope.faded === 'none' || selectedItem === null) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
const isSeriesSelected = selectedItem.type === currentItem.type && selectedItem.seriesId === currentItem.seriesId;
|
|
61
|
-
if (highlightScope.faded === 'series') {
|
|
62
|
-
return isSeriesSelected && selectedItem.dataIndex !== currentItem.dataIndex;
|
|
63
|
-
}
|
|
64
|
-
if (highlightScope.faded === 'global') {
|
|
65
|
-
if (!isSeriesSelected) {
|
|
66
|
-
return true;
|
|
67
|
-
}
|
|
68
|
-
return selectedItem.dataIndex !== undefined && selectedItem.dataIndex !== currentItem.dataIndex;
|
|
69
|
-
}
|
|
70
|
-
return false;
|
|
71
39
|
};
|
package/modern/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.0",
|
|
4
4
|
"description": "The community edition of the Charts components (MUI X).",
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"directory": "packages/x-charts"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@babel/runtime": "^7.24.
|
|
32
|
+
"@babel/runtime": "^7.24.6",
|
|
33
33
|
"@mui/base": "^5.0.0-beta.40",
|
|
34
|
-
"@mui/system": "^5.15.
|
|
34
|
+
"@mui/system": "^5.15.15",
|
|
35
35
|
"@mui/utils": "^5.15.14",
|
|
36
36
|
"@react-spring/rafz": "^9.7.3",
|
|
37
37
|
"@react-spring/web": "^9.7.3",
|
|
@@ -40,6 +40,10 @@ export interface ChartsComponents {
|
|
|
40
40
|
defaultProps?: ComponentsProps['MuiBarElement'];
|
|
41
41
|
styleOverrides?: ComponentsOverrides['MuiBarElement'];
|
|
42
42
|
};
|
|
43
|
+
MuiBarLabel?: {
|
|
44
|
+
defaultProps?: ComponentsProps['MuiBarLabel'];
|
|
45
|
+
styleOverrides?: ComponentsOverrides['MuiBarLabel'];
|
|
46
|
+
};
|
|
43
47
|
MuiLineChart?: {
|
|
44
48
|
defaultProps?: ComponentsProps['MuiLineChart'];
|
|
45
49
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BarLabelClassKey } from '../BarChart';
|
|
1
2
|
import { BarElementClassKey } from '../BarChart/BarElement';
|
|
2
3
|
import { ChartsAxisClassKey } from '../ChartsAxis';
|
|
3
4
|
import { ChartsAxisHighlightClassKey } from '../ChartsAxisHighlight';
|
|
@@ -16,6 +17,8 @@ export interface PickersComponentNameToClassKey {
|
|
|
16
17
|
|
|
17
18
|
// BarChart components
|
|
18
19
|
MuiBarElement: BarElementClassKey;
|
|
20
|
+
MuiBarLabel: BarLabelClassKey;
|
|
21
|
+
|
|
19
22
|
// LineChart components
|
|
20
23
|
|
|
21
24
|
MuiAreaElement: AreaElementClassKey;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BarLabelProps } from '../BarChart/BarLabel';
|
|
1
2
|
import { BarChartProps } from '../BarChart/BarChart';
|
|
2
3
|
import { BarElementProps } from '../BarChart/BarElement';
|
|
3
4
|
import { ChartsAxisProps } from '../ChartsAxis';
|
|
@@ -27,6 +28,7 @@ export interface ChartsComponentsPropsList {
|
|
|
27
28
|
// BarChart components
|
|
28
29
|
MuiBarChart: BarChartProps;
|
|
29
30
|
MuiBarElement: BarElementProps;
|
|
31
|
+
MuiBarLabel: BarLabelProps;
|
|
30
32
|
// LineChart components
|
|
31
33
|
MuiLineChart: LineChartProps;
|
|
32
34
|
MuiAreaElement: AreaElementProps;
|