@mui/x-charts 8.22.0 → 8.23.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/BarElement.js +1 -1
- package/BarChart/BarLabel/BarLabel.types.d.ts +3 -3
- package/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
- package/BarChart/BarLabel/BarLabelPlot.d.ts +9 -9
- package/BarChart/BarLabel/getBarLabel.d.ts +3 -3
- package/BarChart/FocusedBar.js +1 -1
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +18 -1
- package/BarChart/seriesConfig/bar/keyboardFocusHandler.d.ts +3 -0
- package/BarChart/seriesConfig/bar/keyboardFocusHandler.js +23 -0
- package/BarChart/seriesConfig/bar/seriesProcessor.js +2 -2
- package/BarChart/seriesConfig/index.js +3 -1
- package/CHANGELOG.md +202 -0
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +2 -3
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +2 -3
- package/ChartsBrushOverlay/ChartsBrushOverlay.js +6 -7
- package/ChartsSurface/ChartsSurface.js +7 -8
- package/ChartsTooltip/ChartsTooltipContainer.js +4 -5
- package/ChartsTooltip/useAxisTooltip.js +3 -4
- package/ChartsTooltip/useItemTooltip.js +2 -3
- package/ChartsWrapper/ChartsWrapper.js +2 -3
- package/LineChart/FocusedLineMark.js +1 -1
- package/LineChart/LineHighlightPlot.js +1 -2
- package/LineChart/MarkPlot.js +1 -2
- package/LineChart/seriesConfig/index.js +3 -1
- package/LineChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/LineChart/seriesConfig/keyboardFocusHandler.js +23 -0
- package/LineChart/seriesConfig/seriesProcessor.js +2 -2
- package/PieChart/FocusedPieArc.d.ts +2 -0
- package/PieChart/FocusedPieArc.js +58 -0
- package/PieChart/PieArcPlot.js +3 -31
- package/PieChart/PieChart.js +2 -1
- package/PieChart/dataTransform/getModifiedArcProperties.d.ts +11 -0
- package/PieChart/dataTransform/getModifiedArcProperties.js +42 -0
- package/PieChart/dataTransform/useTransformData.js +16 -21
- package/PieChart/seriesConfig/index.js +3 -1
- package/PieChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/PieChart/seriesConfig/keyboardFocusHandler.js +23 -0
- package/PieChart/seriesConfig/tooltipPosition.js +11 -20
- package/RadarChart/RadarAxis/useRadarAxis.js +1 -2
- package/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +3 -4
- package/RadarChart/RadarGrid/useRadarGridData.js +1 -2
- package/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +1 -2
- package/ScatterChart/BatchScatter.js +4 -5
- package/ScatterChart/FocusedScatterMark.js +1 -1
- package/ScatterChart/Scatter.js +1 -2
- package/ScatterChart/seriesConfig/index.js +3 -1
- package/ScatterChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/ScatterChart/seriesConfig/keyboardFocusHandler.js +23 -0
- package/esm/BarChart/BarElement.js +1 -1
- package/esm/BarChart/BarLabel/BarLabel.types.d.ts +3 -3
- package/esm/BarChart/BarLabel/BarLabelItem.d.ts +1 -1
- package/esm/BarChart/BarLabel/BarLabelPlot.d.ts +9 -9
- package/esm/BarChart/BarLabel/getBarLabel.d.ts +3 -3
- package/esm/BarChart/FocusedBar.js +1 -1
- package/esm/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +18 -1
- package/esm/BarChart/seriesConfig/bar/keyboardFocusHandler.d.ts +3 -0
- package/esm/BarChart/seriesConfig/bar/keyboardFocusHandler.js +17 -0
- package/esm/BarChart/seriesConfig/bar/seriesProcessor.js +1 -1
- package/esm/BarChart/seriesConfig/index.js +3 -1
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +2 -3
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +2 -3
- package/esm/ChartsBrushOverlay/ChartsBrushOverlay.js +6 -7
- package/esm/ChartsSurface/ChartsSurface.js +7 -8
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +4 -5
- package/esm/ChartsTooltip/useAxisTooltip.js +3 -4
- package/esm/ChartsTooltip/useItemTooltip.js +2 -3
- package/esm/ChartsWrapper/ChartsWrapper.js +2 -3
- package/esm/LineChart/FocusedLineMark.js +1 -1
- package/esm/LineChart/LineHighlightPlot.js +1 -2
- package/esm/LineChart/MarkPlot.js +1 -2
- package/esm/LineChart/seriesConfig/index.js +3 -1
- package/esm/LineChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/esm/LineChart/seriesConfig/keyboardFocusHandler.js +17 -0
- package/esm/LineChart/seriesConfig/seriesProcessor.js +1 -1
- package/esm/PieChart/FocusedPieArc.d.ts +2 -0
- package/esm/PieChart/FocusedPieArc.js +51 -0
- package/esm/PieChart/PieArcPlot.js +5 -33
- package/esm/PieChart/PieChart.js +2 -1
- package/esm/PieChart/dataTransform/getModifiedArcProperties.d.ts +11 -0
- package/esm/PieChart/dataTransform/getModifiedArcProperties.js +36 -0
- package/esm/PieChart/dataTransform/useTransformData.js +16 -21
- package/esm/PieChart/seriesConfig/index.js +3 -1
- package/esm/PieChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/esm/PieChart/seriesConfig/keyboardFocusHandler.js +17 -0
- package/esm/PieChart/seriesConfig/tooltipPosition.js +11 -20
- package/esm/RadarChart/RadarAxis/useRadarAxis.js +1 -2
- package/esm/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +3 -4
- package/esm/RadarChart/RadarGrid/useRadarGridData.js +1 -2
- package/esm/RadarChart/RadarSeriesPlot/useRadarRotationIndex.js +1 -2
- package/esm/ScatterChart/BatchScatter.js +4 -5
- package/esm/ScatterChart/FocusedScatterMark.js +1 -1
- package/esm/ScatterChart/Scatter.js +1 -2
- package/esm/ScatterChart/seriesConfig/index.js +3 -1
- package/esm/ScatterChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/esm/ScatterChart/seriesConfig/keyboardFocusHandler.js +17 -0
- package/esm/hooks/useAxis.js +8 -9
- package/esm/hooks/useAxisSystem.js +2 -3
- package/esm/hooks/useBrush.js +1 -2
- package/esm/hooks/useChartId.js +1 -2
- package/esm/hooks/useDataset.js +1 -2
- package/esm/hooks/useDrawingArea.js +1 -2
- package/esm/hooks/useFocusedItem.d.ts +1 -12
- package/esm/hooks/useFocusedItem.js +3 -11
- package/esm/hooks/useInteractionItemProps.d.ts +3 -2
- package/esm/hooks/useInteractionItemProps.js +13 -2
- package/esm/hooks/useIsItemFocused.d.ts +4 -3
- package/esm/hooks/useIsItemFocused.js +2 -3
- package/esm/hooks/useIsItemFocusedGetter.d.ts +3 -2
- package/esm/hooks/useIsItemFocusedGetter.js +2 -1
- package/esm/hooks/useItemHighlighted.js +2 -3
- package/esm/hooks/useItemHighlightedGetter.js +2 -3
- package/esm/hooks/useLegend.js +1 -2
- package/esm/hooks/usePieSeries.js +1 -2
- package/esm/hooks/useSeries.js +1 -2
- package/esm/hooks/useSkipAnimation.js +1 -2
- package/esm/hooks/useZAxis.js +1 -2
- package/esm/index.js +1 -1
- package/esm/internals/commonNextFocusItem.d.ts +14 -0
- package/esm/internals/commonNextFocusItem.js +84 -0
- package/esm/internals/index.d.ts +1 -2
- package/esm/internals/index.js +1 -2
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -2
- package/esm/internals/plugins/corePlugins/useChartSeries/useColorProcessor.js +1 -2
- package/esm/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +1 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +5 -6
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting.js +1 -2
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +5 -6
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +4 -1
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.d.ts +13 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js +1 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +2 -2
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +12 -105
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +5 -31
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +9 -15
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +6 -21
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.d.ts +15 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.js +45 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.d.ts +11 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.js +40 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +6 -7
- package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +1 -9
- package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.types.d.ts +7 -6
- package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +2 -0
- package/esm/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
- package/esm/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +4 -3
- package/esm/internals/plugins/models/seriesConfig/tooltipItemPositionGetter.types.d.ts +3 -2
- package/esm/internals/seriesHasData.d.ts +4 -0
- package/esm/internals/seriesHasData.js +8 -0
- package/esm/internals/seriesSelectorOfType.js +2 -3
- package/esm/internals/stacking/index.d.ts +1 -0
- package/esm/internals/stacking/index.js +1 -0
- package/esm/internals/stacking/offset/index.d.ts +1 -0
- package/esm/internals/stacking/offset/index.js +1 -0
- package/esm/internals/stacking/offset/offsetDiverging.d.ts +8 -0
- package/esm/internals/stacking/offset/offsetDiverging.js +47 -0
- package/esm/internals/{stackSeries.d.ts → stacking/stackSeries.d.ts} +8 -8
- package/esm/internals/{stackSeries.js → stacking/stackSeries.js} +8 -6
- package/esm/models/seriesType/config.d.ts +0 -2
- package/esm/models/seriesType/index.d.ts +3 -1
- package/hooks/useAxis.js +8 -9
- package/hooks/useAxisSystem.js +2 -3
- package/hooks/useBrush.js +1 -2
- package/hooks/useChartId.js +1 -2
- package/hooks/useDataset.js +1 -2
- package/hooks/useDrawingArea.js +1 -2
- package/hooks/useFocusedItem.d.ts +1 -12
- package/hooks/useFocusedItem.js +1 -11
- package/hooks/useInteractionItemProps.d.ts +3 -2
- package/hooks/useInteractionItemProps.js +13 -2
- package/hooks/useIsItemFocused.d.ts +4 -3
- package/hooks/useIsItemFocused.js +2 -3
- package/hooks/useIsItemFocusedGetter.d.ts +3 -2
- package/hooks/useIsItemFocusedGetter.js +2 -1
- package/hooks/useItemHighlighted.js +2 -3
- package/hooks/useItemHighlightedGetter.js +2 -3
- package/hooks/useLegend.js +1 -2
- package/hooks/usePieSeries.js +1 -2
- package/hooks/useSeries.js +1 -2
- package/hooks/useSkipAnimation.js +1 -2
- package/hooks/useZAxis.js +1 -2
- package/index.js +1 -1
- package/internals/commonNextFocusItem.d.ts +14 -0
- package/internals/commonNextFocusItem.js +93 -0
- package/internals/index.d.ts +1 -2
- package/internals/index.js +4 -16
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -2
- package/internals/plugins/corePlugins/useChartSeries/useColorProcessor.js +1 -2
- package/internals/plugins/featurePlugins/useChartBrush/useChartBrush.js +1 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +5 -6
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting.js +1 -2
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +5 -6
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.js +4 -1
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.d.ts +13 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js +5 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +11 -104
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +5 -31
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +10 -16
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +6 -21
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.d.ts +15 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.js +51 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.d.ts +11 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.js +46 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +6 -7
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +1 -9
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +1 -1
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.types.d.ts +7 -6
- package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +2 -0
- package/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
- package/internals/plugins/models/seriesConfig/tooltipGetter.types.d.ts +4 -3
- package/internals/plugins/models/seriesConfig/tooltipItemPositionGetter.types.d.ts +3 -2
- package/internals/seriesHasData.d.ts +4 -0
- package/internals/seriesHasData.js +14 -0
- package/internals/seriesSelectorOfType.js +2 -3
- package/internals/stacking/index.d.ts +1 -0
- package/internals/stacking/index.js +16 -0
- package/internals/stacking/offset/index.d.ts +1 -0
- package/internals/stacking/offset/index.js +16 -0
- package/internals/stacking/offset/offsetDiverging.d.ts +8 -0
- package/internals/stacking/offset/offsetDiverging.js +53 -0
- package/internals/{stackSeries.d.ts → stacking/stackSeries.d.ts} +8 -8
- package/internals/{stackSeries.js → stacking/stackSeries.js} +3 -1
- package/models/seriesType/config.d.ts +0 -2
- package/models/seriesType/index.d.ts +3 -1
- package/package.json +4 -4
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.d.ts +0 -3
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.js +0 -4
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +0 -21
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +0 -92
- package/esm/internals/store/useSelector.d.ts +0 -2
- package/esm/internals/store/useSelector.js +0 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.d.ts +0 -3
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/isFocusableSeriesType.js +0 -10
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +0 -21
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +0 -99
- package/internals/store/useSelector.d.ts +0 -2
- package/internals/store/useSelector.js +0 -8
package/BarChart/BarElement.js
CHANGED
|
@@ -50,7 +50,7 @@ function BarElement(props) {
|
|
|
50
50
|
isHighlighted
|
|
51
51
|
} = (0, _useItemHighlighted.useItemHighlighted)(itemIdentifier);
|
|
52
52
|
const isFocused = (0, _useIsItemFocused.useIsItemFocused)(React.useMemo(() => ({
|
|
53
|
-
|
|
53
|
+
type: 'bar',
|
|
54
54
|
seriesId: id,
|
|
55
55
|
dataIndex
|
|
56
56
|
}), [id, dataIndex]));
|
|
@@ -11,7 +11,7 @@ export interface BarLabelOwnerState {
|
|
|
11
11
|
layout: 'vertical' | 'horizontal';
|
|
12
12
|
classes?: Partial<BarLabelClasses>;
|
|
13
13
|
}
|
|
14
|
-
export type BarItem
|
|
14
|
+
export type BarItem = {
|
|
15
15
|
/**
|
|
16
16
|
* The series id of the bar.
|
|
17
17
|
*/
|
|
@@ -23,7 +23,7 @@ export type BarItem<V extends BarValueType | null = BarValueType | null> = {
|
|
|
23
23
|
/**
|
|
24
24
|
* The value of the data point.
|
|
25
25
|
*/
|
|
26
|
-
value:
|
|
26
|
+
value: BarValueType | null;
|
|
27
27
|
};
|
|
28
28
|
export type BarLabelContext = {
|
|
29
29
|
bar: {
|
|
@@ -39,4 +39,4 @@ export type BarLabelContext = {
|
|
|
39
39
|
width: number;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
|
-
export type BarLabelFunction
|
|
42
|
+
export type BarLabelFunction = (item: BarItem, context: BarLabelContext) => string | null | undefined;
|
|
@@ -67,7 +67,7 @@ export type BarLabelItemProps<V extends BarValueType | null> = Omit<BarLabelOwne
|
|
|
67
67
|
* @param {BarLabelContext} context data about the bar.
|
|
68
68
|
* @returns {string} The formatted label.
|
|
69
69
|
*/
|
|
70
|
-
barLabel?: 'value' | ((item: BarItem
|
|
70
|
+
barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
|
|
71
71
|
/**
|
|
72
72
|
* The placement of the bar label.
|
|
73
73
|
* It controls whether the label is rendered in the center or outside the bar.
|
|
@@ -3,29 +3,29 @@ import { type BarLabelItemProps } from "./BarLabelItem.js";
|
|
|
3
3
|
import type { SeriesId } from "../../models/seriesType/common.js";
|
|
4
4
|
import { type BarSeriesType, type BarValueType } from "../../models/seriesType/bar.js";
|
|
5
5
|
import { type BarLabelFunction } from "./BarLabel.types.js";
|
|
6
|
-
interface BarLabelPlotProps
|
|
7
|
-
processedSeries: ProcessedBarLabelSeriesData
|
|
6
|
+
interface BarLabelPlotProps {
|
|
7
|
+
processedSeries: ProcessedBarLabelSeriesData;
|
|
8
8
|
className: string;
|
|
9
9
|
skipAnimation?: boolean;
|
|
10
|
-
barLabel?: BarLabelItemProps<
|
|
10
|
+
barLabel?: BarLabelItemProps<BarValueType | null>['barLabel'];
|
|
11
11
|
}
|
|
12
|
-
export interface ProcessedBarLabelSeriesData
|
|
12
|
+
export interface ProcessedBarLabelSeriesData {
|
|
13
13
|
seriesId: SeriesId;
|
|
14
|
-
data: ProcessedBarLabelData
|
|
15
|
-
barLabel?: 'value' | BarLabelFunction
|
|
14
|
+
data: ProcessedBarLabelData[];
|
|
15
|
+
barLabel?: 'value' | BarLabelFunction;
|
|
16
16
|
barLabelPlacement?: BarSeriesType['barLabelPlacement'];
|
|
17
17
|
layout?: 'vertical' | 'horizontal';
|
|
18
18
|
xOrigin: number;
|
|
19
19
|
yOrigin: number;
|
|
20
20
|
}
|
|
21
|
-
export interface ProcessedBarLabelData
|
|
21
|
+
export interface ProcessedBarLabelData extends AnimationData {
|
|
22
22
|
seriesId: SeriesId;
|
|
23
23
|
dataIndex: number;
|
|
24
24
|
color: string;
|
|
25
|
-
value:
|
|
25
|
+
value: BarValueType | null;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
28
|
* @ignore - internal component.
|
|
29
29
|
*/
|
|
30
|
-
declare function BarLabelPlot
|
|
30
|
+
declare function BarLabelPlot(props: BarLabelPlotProps): import("react/jsx-runtime").JSX.Element | null;
|
|
31
31
|
export { BarLabelPlot };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type SeriesId } from "../../models/seriesType/common.js";
|
|
2
2
|
import { type BarLabelFunction } from "./BarLabel.types.js";
|
|
3
3
|
import { type BarValueType } from "../../models/seriesType/bar.js";
|
|
4
|
-
export declare function getBarLabel
|
|
5
|
-
barLabel: 'value' | BarLabelFunction
|
|
6
|
-
value:
|
|
4
|
+
export declare function getBarLabel(options: {
|
|
5
|
+
barLabel: 'value' | BarLabelFunction;
|
|
6
|
+
value: BarValueType | null;
|
|
7
7
|
dataIndex: number;
|
|
8
8
|
seriesId: SeriesId;
|
|
9
9
|
height: number;
|
package/BarChart/FocusedBar.js
CHANGED
|
@@ -26,7 +26,7 @@ function FocusedBar(props) {
|
|
|
26
26
|
yAxis,
|
|
27
27
|
yAxisIds
|
|
28
28
|
} = (0, _hooks.useYAxes)();
|
|
29
|
-
if (focusedItem === null || focusedItem.
|
|
29
|
+
if (focusedItem === null || focusedItem.type !== 'bar' || !barSeries) {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
32
|
const series = barSeries?.series[focusedItem.seriesId];
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { type AllSeriesType } from "../../../models/seriesType/index.js";
|
|
2
|
-
export declare function getSeriesWithDefaultValues
|
|
2
|
+
export declare function getSeriesWithDefaultValues(seriesData: AllSeriesType<'bar'>, seriesIndex: number, colors: readonly string[]): {
|
|
3
3
|
id: import("../../../index.js").SeriesId;
|
|
4
4
|
color: string;
|
|
5
|
+
type: "bar";
|
|
6
|
+
data?: ReadonlyArray<import("../../../index.js").BarValueType | null>;
|
|
7
|
+
dataKey?: string;
|
|
8
|
+
label?: string | ((location: "tooltip" | "legend") => string);
|
|
9
|
+
layout?: "horizontal" | "vertical";
|
|
10
|
+
stackOffset?: import("../../../index.js").StackOffsetType;
|
|
11
|
+
minBarSize?: number;
|
|
12
|
+
barLabel?: "value" | ((item: import("../../index.js").BarItem, context: import("../../index.js").BarLabelContext) => string | null | undefined);
|
|
13
|
+
barLabelPlacement?: "center" | "outside";
|
|
14
|
+
valueFormatter?: import("../../../internals/index.js").SeriesValueFormatter<number | null> | undefined;
|
|
15
|
+
highlightScope?: import("../../../index.js").HighlightScope;
|
|
16
|
+
labelMarkType?: import("../../../internals/index.js").ChartsLabelMarkType;
|
|
17
|
+
colorGetter?: ((data: import("../../../internals/index.js").ColorCallbackValue<number | null>) => string) | undefined;
|
|
18
|
+
xAxisId?: import("../../../internals/index.js").AxisId;
|
|
19
|
+
yAxisId?: import("../../../internals/index.js").AxisId;
|
|
20
|
+
stack?: string;
|
|
21
|
+
stackOrder?: import("../../../index.js").StackOrderType;
|
|
5
22
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { KeyboardFocusHandler } from "../../../internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js";
|
|
2
|
+
declare const keyboardFocusHandler: KeyboardFocusHandler<'bar', 'bar' | 'line' | 'scatter'>;
|
|
3
|
+
export default keyboardFocusHandler;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _commonNextFocusItem = require("../../../internals/commonNextFocusItem");
|
|
8
|
+
const outSeriesTypes = new Set(['bar', 'line', 'scatter']);
|
|
9
|
+
const keyboardFocusHandler = event => {
|
|
10
|
+
switch (event.key) {
|
|
11
|
+
case 'ArrowRight':
|
|
12
|
+
return (0, _commonNextFocusItem.createGetNextIndexFocusedItem)(outSeriesTypes);
|
|
13
|
+
case 'ArrowLeft':
|
|
14
|
+
return (0, _commonNextFocusItem.createGetPreviousIndexFocusedItem)(outSeriesTypes);
|
|
15
|
+
case 'ArrowDown':
|
|
16
|
+
return (0, _commonNextFocusItem.createGetPreviousSeriesFocusedItem)(outSeriesTypes);
|
|
17
|
+
case 'ArrowUp':
|
|
18
|
+
return (0, _commonNextFocusItem.createGetNextSeriesFocusedItem)(outSeriesTypes);
|
|
19
|
+
default:
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var _default = exports.default = keyboardFocusHandler;
|
|
@@ -8,14 +8,14 @@ exports.default = void 0;
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _d3Shape = require("@mui/x-charts-vendor/d3-shape");
|
|
10
10
|
var _warning = require("@mui/x-internals/warning");
|
|
11
|
-
var
|
|
11
|
+
var _stacking = require("../../../internals/stacking");
|
|
12
12
|
const barValueFormatter = v => v == null ? '' : v.toLocaleString();
|
|
13
13
|
const seriesProcessor = (params, dataset) => {
|
|
14
14
|
const {
|
|
15
15
|
seriesOrder,
|
|
16
16
|
series
|
|
17
17
|
} = params;
|
|
18
|
-
const stackingGroups = (0,
|
|
18
|
+
const stackingGroups = (0, _stacking.getStackingGroups)(params);
|
|
19
19
|
|
|
20
20
|
// Create a data set with format adapted to d3
|
|
21
21
|
const d3Dataset = dataset ?? [];
|
|
@@ -10,6 +10,7 @@ var _extremums = require("./bar/extremums");
|
|
|
10
10
|
var _seriesProcessor = _interopRequireDefault(require("./bar/seriesProcessor"));
|
|
11
11
|
var _legend = _interopRequireDefault(require("./bar/legend"));
|
|
12
12
|
var _getColor = _interopRequireDefault(require("./bar/getColor"));
|
|
13
|
+
var _keyboardFocusHandler = _interopRequireDefault(require("./bar/keyboardFocusHandler"));
|
|
13
14
|
var _tooltip = _interopRequireWildcard(require("./bar/tooltip"));
|
|
14
15
|
var _tooltipPosition = _interopRequireDefault(require("./bar/tooltipPosition"));
|
|
15
16
|
var _getSeriesWithDefaultValues = require("./bar/getSeriesWithDefaultValues");
|
|
@@ -22,5 +23,6 @@ const barSeriesConfig = exports.barSeriesConfig = {
|
|
|
22
23
|
axisTooltipGetter: _tooltip.axisTooltipGetter,
|
|
23
24
|
xExtremumGetter: _extremums.getExtremumX,
|
|
24
25
|
yExtremumGetter: _extremums.getExtremumY,
|
|
25
|
-
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.getSeriesWithDefaultValues
|
|
26
|
+
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.getSeriesWithDefaultValues,
|
|
27
|
+
keyboardFocusHandler: _keyboardFocusHandler.default
|
|
26
28
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,208 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.23.0
|
|
9
|
+
|
|
10
|
+
_Dec 23, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🧮 Support Data Grid `size`, `size(true)`, and `size(false)` [aggregations for `'boolean'` column type](https://mui.com/x/react-data-grid/aggregation/#usage-with-row-grouping)
|
|
15
|
+
- 🔎 Allow zooming a heatmap
|
|
16
|
+
|
|
17
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
18
|
+
@henkerik, @sai6855
|
|
19
|
+
|
|
20
|
+
The following team members contributed to this release:
|
|
21
|
+
@alelthomas, @alexfauquette, @arminmeh, @bernardobelchior, @brijeshb42, @flaviendelangle, @JCQuintas, @mapache-salvaje, @MBilalShafi, @siriwatknp
|
|
22
|
+
|
|
23
|
+
### Data Grid
|
|
24
|
+
|
|
25
|
+
#### `@mui/x-data-grid@8.23.0`
|
|
26
|
+
|
|
27
|
+
- [DataGrid] Fix columns state and columns prop sync issue (#20703) @arminmeh
|
|
28
|
+
- [DataGrid] Fix filter datetime with seconds (#20557) @siriwatknp
|
|
29
|
+
- [DataGrid] Add new `includeHeaderFilters` flag to include header filters when autosizing columns (#20510) @siriwatknp
|
|
30
|
+
- [DataGrid] Prevent default on `Enter` key down when starting editing (#20751) @siriwatknp
|
|
31
|
+
- [l10n] Improve Portuguese from Portugal (pt-PT) locale (#20722) @Copilot
|
|
32
|
+
|
|
33
|
+
#### `@mui/x-data-grid-pro@8.23.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
34
|
+
|
|
35
|
+
Same changes as in `@mui/x-data-grid@8.23.0`, plus:
|
|
36
|
+
|
|
37
|
+
- [DataGridPro] Fix crash on rows change in tree data with pagination (#20215) @Copilot
|
|
38
|
+
|
|
39
|
+
#### `@mui/x-data-grid-premium@8.23.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
40
|
+
|
|
41
|
+
Same changes as in `@mui/x-data-grid-pro@8.23.0`, plus:
|
|
42
|
+
|
|
43
|
+
- [DataGridPremium] Add aggregation for `'boolean'` column type (#20683) @arminmeh
|
|
44
|
+
- [DataGridPremium] Fix strategy value computation with row grouping (#20725) @MBilalShafi
|
|
45
|
+
- [DataGridPremium] Handle `isRowSelectable()` checks for the rows missing due to `keepNonExistentRowsSelected` (#20668) @arminmeh
|
|
46
|
+
|
|
47
|
+
### Date and Time Pickers
|
|
48
|
+
|
|
49
|
+
#### `@mui/x-date-pickers@8.23.0`
|
|
50
|
+
|
|
51
|
+
Internal changes.
|
|
52
|
+
|
|
53
|
+
#### `@mui/x-date-pickers-pro@8.23.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
54
|
+
|
|
55
|
+
Same changes as in `@mui/x-date-pickers@8.23.0`.
|
|
56
|
+
|
|
57
|
+
### Charts
|
|
58
|
+
|
|
59
|
+
#### `@mui/x-charts@8.23.0`
|
|
60
|
+
|
|
61
|
+
- [charts] Custom stack functions implementation (#20679) @JCQuintas
|
|
62
|
+
- [charts] Extract keyboard focus navigation to the series config (#20693) @alexfauquette
|
|
63
|
+
- [charts] Fix demo not wrapping in mobile (#20713) @JCQuintas
|
|
64
|
+
- [charts] Fix missing dependencies in `x-charts-vendor` (#20685) @henkerik
|
|
65
|
+
- [charts] Remove webkit test differences (#20707) @JCQuintas
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-charts-pro@8.23.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
68
|
+
|
|
69
|
+
Same changes as in `@mui/x-charts@8.23.0`, plus:
|
|
70
|
+
|
|
71
|
+
- [charts-pro] Allow registering preview plots from higher tier packages (#20716) @bernardobelchior
|
|
72
|
+
- [charts-pro] Fix erroneous behavior when adding/removing pointers from zoom&pan gestures (#20698) @JCQuintas
|
|
73
|
+
- [charts-pro] Move heatmap highlight handling to plot component (#20701) @bernardobelchior
|
|
74
|
+
- [charts-pro] Add zoom to heatmap (#20708) @bernardobelchior
|
|
75
|
+
|
|
76
|
+
#### `@mui/x-charts-premium@8.23.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
77
|
+
|
|
78
|
+
Same changes as in `@mui/x-charts-pro@8.23.0`.
|
|
79
|
+
|
|
80
|
+
### Tree View
|
|
81
|
+
|
|
82
|
+
#### `@mui/x-tree-view@8.23.0`
|
|
83
|
+
|
|
84
|
+
- [tree view] Add new APIs to disable selection feature for tree view item (#20666) @siriwatknp
|
|
85
|
+
|
|
86
|
+
#### `@mui/x-tree-view-pro@8.23.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
87
|
+
|
|
88
|
+
Same changes as in `@mui/x-tree-view@8.23.0`.
|
|
89
|
+
|
|
90
|
+
### Codemod
|
|
91
|
+
|
|
92
|
+
#### `@mui/x-codemod@8.23.0`
|
|
93
|
+
|
|
94
|
+
Internal changes.
|
|
95
|
+
|
|
96
|
+
### Docs
|
|
97
|
+
|
|
98
|
+
- [docs] Clarify feature availability and relationship between Community and Pro/Premium docs (#20714) @mapache-salvaje
|
|
99
|
+
- [docs] Copyedit Tree View docs and apply new component style rules (DX-19) (#20652) @mapache-salvaje
|
|
100
|
+
- [docs] Fix `ColumnPinningDynamicRowHeight` demo (#20750) @sai6855
|
|
101
|
+
- [docs] Clean up Charts docs sidebar (DX-97) (#20700) @alelthomas
|
|
102
|
+
- [docs] Fix tick labels not being shown on a demo (#20718) @sai6855
|
|
103
|
+
|
|
104
|
+
### Core
|
|
105
|
+
|
|
106
|
+
- [code-infra] Bump prettier to 3.7.4 (#20709) @JCQuintas
|
|
107
|
+
- [code-infra] Fix contributor generation logic in changelog script (#20705) @brijeshb42
|
|
108
|
+
|
|
109
|
+
## 8.22.1
|
|
110
|
+
|
|
111
|
+
_Dec 17, 2025_
|
|
112
|
+
|
|
113
|
+
We'd like to extend a big thank you to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
114
|
+
|
|
115
|
+
- 🌎 Improve Swedish (sv-SE) locale on the Data Grid
|
|
116
|
+
- 🐞 Bugfixes
|
|
117
|
+
|
|
118
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
119
|
+
@KyeongJooni, @VismaAndreasIvarsson
|
|
120
|
+
|
|
121
|
+
The following team members contributed to this release:
|
|
122
|
+
@alelthomas, @alexfauquette, @arminmeh, @bernardobelchior, @Janpot, @JCQuintas, @mapache-salvaje, @michelengelen, @mj12albert, @prakhargupta1, @romgrk, @siriwatknp
|
|
123
|
+
|
|
124
|
+
### Data Grid
|
|
125
|
+
|
|
126
|
+
#### `@mui/x-data-grid@8.22.1`
|
|
127
|
+
|
|
128
|
+
- [data grid] Fix column menu keyboard shortcut (#20621) @mj12albert
|
|
129
|
+
- [data grid] Fix row checkbox disabled state on first render and keep cell focusable (ARIA) (#20641) @michelengelen
|
|
130
|
+
- [data grid] Fix tree data selection bug (#20528) @michelengelen
|
|
131
|
+
- [data grid] Prevent clear cell selection on edit mode (#20544) @siriwatknp
|
|
132
|
+
- [data grid] Refactor column merge logic to prioritize defined properties only (#20640) @michelengelen
|
|
133
|
+
- [data grid] Reset row spanning on row expansion change (#20661) @siriwatknp
|
|
134
|
+
- [data grid] Resize newly added rows while resize action is happening (#20676)
|
|
135
|
+
- [l10n] Improve Swedish (sv-SE) locale (#20682) @VismaAndreasIvarsson
|
|
136
|
+
|
|
137
|
+
#### `@mui/x-data-grid-pro@8.22.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
138
|
+
|
|
139
|
+
Same changes as in `@mui/x-data-grid@8.22.1`.
|
|
140
|
+
|
|
141
|
+
#### `@mui/x-data-grid-premium@8.22.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
142
|
+
|
|
143
|
+
Same changes as in `@mui/x-data-grid-pro@8.22.1`, plus:
|
|
144
|
+
|
|
145
|
+
- [DataGridPremium] Import `useId()` from `@mui/utils` to maintain React 17 compatibility (#20635) @arminmeh
|
|
146
|
+
|
|
147
|
+
### Date and Time Pickers
|
|
148
|
+
|
|
149
|
+
#### `@mui/x-date-pickers@8.22.1`
|
|
150
|
+
|
|
151
|
+
- [pickers] Add minutesStep validation test (#20672) @KyeongJooni
|
|
152
|
+
- [pickers] Fix `onAccept()` returning wrong year after selecting year then month (#20639) @michelengelen
|
|
153
|
+
|
|
154
|
+
#### `@mui/x-date-pickers-pro@8.22.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
155
|
+
|
|
156
|
+
Same changes as in `@mui/x-date-pickers@8.22.1`.
|
|
157
|
+
|
|
158
|
+
### Charts
|
|
159
|
+
|
|
160
|
+
#### `@mui/x-charts@8.22.1`
|
|
161
|
+
|
|
162
|
+
- [charts] Extract `FocusedPieArc` from `PieArcPlot` (#20613) @alexfauquette
|
|
163
|
+
- [charts] Fix regression on the highlight control (#20627) @alexfauquette
|
|
164
|
+
- [charts] Refactor: `useSelector()` => `store.use()` (#20681) @romgrk
|
|
165
|
+
- [charts] Remove duplicated types (#20694) @alexfauquette
|
|
166
|
+
- [charts] Remove unused generics from bar charts (#20642) @bernardobelchior
|
|
167
|
+
- [charts] Simplify tooltip position getter for pie chart (#20625) @alexfauquette
|
|
168
|
+
|
|
169
|
+
#### `@mui/x-charts-pro@8.22.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
170
|
+
|
|
171
|
+
Same changes as in `@mui/x-charts@8.22.1`, plus:
|
|
172
|
+
|
|
173
|
+
- [charts-pro] Add heatmap performance benchmark (#20695) @bernardobelchior
|
|
174
|
+
|
|
175
|
+
#### `@mui/x-charts-premium@8.22.1` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
176
|
+
|
|
177
|
+
Same changes as in `@mui/x-charts-pro@8.22.1`, plus:
|
|
178
|
+
|
|
179
|
+
- [charts-premium] Create `BarChartPremium` (#20643) @bernardobelchior
|
|
180
|
+
|
|
181
|
+
### Tree View
|
|
182
|
+
|
|
183
|
+
#### `@mui/x-tree-view@8.22.1`
|
|
184
|
+
|
|
185
|
+
Internal changes.
|
|
186
|
+
|
|
187
|
+
#### `@mui/x-tree-view-pro@8.22.1` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
188
|
+
|
|
189
|
+
Same changes as in `@mui/x-tree-view@8.22.1`.
|
|
190
|
+
|
|
191
|
+
### Codemod
|
|
192
|
+
|
|
193
|
+
#### `@mui/x-codemod@8.22.1`
|
|
194
|
+
|
|
195
|
+
Internal changes.
|
|
196
|
+
|
|
197
|
+
### Docs
|
|
198
|
+
|
|
199
|
+
- [docs] Add button to GitHub source code for the Data Grid advanced demos (DX-50) (#20633) @alelthomas
|
|
200
|
+
- [docs] Remove `seriesConfig` to prevent future confusion (#20678) @alexfauquette
|
|
201
|
+
- [docs] Revise the Data Grid's API object doc for clarity and style (#20649) @mapache-salvaje
|
|
202
|
+
- [docs] Update list of charts (#20479) @prakhargupta1
|
|
203
|
+
|
|
204
|
+
### Core
|
|
205
|
+
|
|
206
|
+
- [code-infra] Regression tests improvements (#20441) @Janpot
|
|
207
|
+
- [code-infra] Test utils upgrade (#20592) @Janpot
|
|
208
|
+
- [code-infra] Try to fix the Tree View flacky tests (#20573) @JCQuintas
|
|
209
|
+
|
|
8
210
|
## 8.22.0
|
|
9
211
|
|
|
10
212
|
_Dec 11, 2025_
|
|
@@ -9,7 +9,6 @@ exports.default = ChartsXHighlight;
|
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _useScale = require("../hooks/useScale");
|
|
11
11
|
var _scaleGuards = require("../internals/scaleGuards");
|
|
12
|
-
var _useSelector = require("../internals/store/useSelector");
|
|
13
12
|
var _useStore = require("../internals/store/useStore");
|
|
14
13
|
var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
|
|
15
14
|
var _hooks = require("../hooks");
|
|
@@ -28,8 +27,8 @@ function ChartsXHighlight(props) {
|
|
|
28
27
|
height
|
|
29
28
|
} = (0, _hooks.useDrawingArea)();
|
|
30
29
|
const store = (0, _useStore.useStore)();
|
|
31
|
-
const axisXValues =
|
|
32
|
-
const xAxes =
|
|
30
|
+
const axisXValues = store.use(_useChartCartesianAxis.selectorChartsHighlightXAxisValue);
|
|
31
|
+
const xAxes = store.use(_useChartCartesianAxis.selectorChartXAxis);
|
|
33
32
|
if (axisXValues.length === 0) {
|
|
34
33
|
return null;
|
|
35
34
|
}
|
|
@@ -9,7 +9,6 @@ exports.default = ChartsYHighlight;
|
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _useScale = require("../hooks/useScale");
|
|
11
11
|
var _scaleGuards = require("../internals/scaleGuards");
|
|
12
|
-
var _useSelector = require("../internals/store/useSelector");
|
|
13
12
|
var _useStore = require("../internals/store/useStore");
|
|
14
13
|
var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
|
|
15
14
|
var _hooks = require("../hooks");
|
|
@@ -28,8 +27,8 @@ function ChartsYHighlight(props) {
|
|
|
28
27
|
width
|
|
29
28
|
} = (0, _hooks.useDrawingArea)();
|
|
30
29
|
const store = (0, _useStore.useStore)();
|
|
31
|
-
const axisYValues =
|
|
32
|
-
const yAxes =
|
|
30
|
+
const axisYValues = store.use(_useChartCartesianAxis.selectorChartsHighlightYAxisValue);
|
|
31
|
+
const yAxes = store.use(_useChartCartesianAxis.selectorChartYAxis);
|
|
33
32
|
if (axisYValues.length === 0) {
|
|
34
33
|
return null;
|
|
35
34
|
}
|
|
@@ -14,7 +14,6 @@ var _styles = require("@mui/material/styles");
|
|
|
14
14
|
var _ChartsBrushOverlay = require("./ChartsBrushOverlay.classes");
|
|
15
15
|
var _useChartDimensions = require("../internals/plugins/corePlugins/useChartDimensions");
|
|
16
16
|
var _useChartBrush = require("../internals/plugins/featurePlugins/useChartBrush");
|
|
17
|
-
var _useSelector = require("../internals/store/useSelector");
|
|
18
17
|
var _useStore = require("../internals/store/useStore");
|
|
19
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
19
|
function BrushRect(props) {
|
|
@@ -30,13 +29,13 @@ function BrushRect(props) {
|
|
|
30
29
|
*/
|
|
31
30
|
function ChartsBrushOverlay(props) {
|
|
32
31
|
const store = (0, _useStore.useStore)();
|
|
33
|
-
const drawingArea =
|
|
32
|
+
const drawingArea = store.use(_useChartDimensions.selectorChartDrawingArea);
|
|
34
33
|
const theme = (0, _styles.useTheme)();
|
|
35
|
-
const brushStartX =
|
|
36
|
-
const brushStartY =
|
|
37
|
-
const brushCurrentX =
|
|
38
|
-
const brushCurrentY =
|
|
39
|
-
const brushConfig =
|
|
34
|
+
const brushStartX = store.use(_useChartBrush.selectorBrushStartX);
|
|
35
|
+
const brushStartY = store.use(_useChartBrush.selectorBrushStartY);
|
|
36
|
+
const brushCurrentX = store.use(_useChartBrush.selectorBrushCurrentX);
|
|
37
|
+
const brushCurrentY = store.use(_useChartBrush.selectorBrushCurrentY);
|
|
38
|
+
const brushConfig = store.use(_useChartBrush.selectorBrushConfig);
|
|
40
39
|
if (brushStartX === null || brushStartY === null || brushCurrentX === null || brushCurrentY === null) {
|
|
41
40
|
return null;
|
|
42
41
|
}
|
|
@@ -16,7 +16,6 @@ var _useForkRef = _interopRequireDefault(require("@mui/utils/useForkRef"));
|
|
|
16
16
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
17
17
|
var _ChartsAxesGradients = require("../internals/components/ChartsAxesGradients");
|
|
18
18
|
var _useSvgRef = require("../hooks/useSvgRef");
|
|
19
|
-
var _useSelector = require("../internals/store/useSelector");
|
|
20
19
|
var _useStore = require("../internals/store/useStore");
|
|
21
20
|
var _useChartDimensions = require("../internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors");
|
|
22
21
|
var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
|
|
@@ -64,13 +63,13 @@ const ChartsSurfaceStyles = (0, _styles.styled)('svg', {
|
|
|
64
63
|
*/
|
|
65
64
|
const ChartsSurface = exports.ChartsSurface = /*#__PURE__*/React.forwardRef(function ChartsSurface(inProps, ref) {
|
|
66
65
|
const store = (0, _useStore.useStore)();
|
|
67
|
-
const svgWidth =
|
|
68
|
-
const svgHeight =
|
|
69
|
-
const propsWidth =
|
|
70
|
-
const propsHeight =
|
|
71
|
-
const isKeyboardNavigationEnabled =
|
|
72
|
-
const hasFocusedItem =
|
|
73
|
-
const hasZoom =
|
|
66
|
+
const svgWidth = store.use(_useChartDimensions.selectorChartSvgWidth);
|
|
67
|
+
const svgHeight = store.use(_useChartDimensions.selectorChartSvgHeight);
|
|
68
|
+
const propsWidth = store.use(_useChartDimensions.selectorChartPropsWidth);
|
|
69
|
+
const propsHeight = store.use(_useChartDimensions.selectorChartPropsHeight);
|
|
70
|
+
const isKeyboardNavigationEnabled = store.use(_useChartKeyboardNavigation.selectorChartsIsKeyboardNavigationEnabled);
|
|
71
|
+
const hasFocusedItem = store.use(_useChartKeyboardNavigation.selectorChartsHasFocusedItem);
|
|
72
|
+
const hasZoom = store.use(_useChartCartesianAxisRendering.selectorChartHasZoom);
|
|
74
73
|
const svgRef = (0, _useSvgRef.useSvgRef)();
|
|
75
74
|
const handleRef = (0, _useForkRef.default)(svgRef, ref);
|
|
76
75
|
const themeProps = (0, _styles.useThemeProps)({
|
|
@@ -19,7 +19,6 @@ var _NoSsr = _interopRequireDefault(require("@mui/material/NoSsr"));
|
|
|
19
19
|
var _rafThrottle = require("@mui/x-internals/rafThrottle");
|
|
20
20
|
var _utils = require("./utils");
|
|
21
21
|
var _chartsTooltipClasses = require("./chartsTooltipClasses");
|
|
22
|
-
var _useSelector = require("../internals/store/useSelector");
|
|
23
22
|
var _useStore = require("../internals/store/useStore");
|
|
24
23
|
var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
|
|
25
24
|
var _useChartTooltip = require("../internals/plugins/featurePlugins/useChartTooltip");
|
|
@@ -90,11 +89,11 @@ function ChartsTooltipContainer(inProps) {
|
|
|
90
89
|
}));
|
|
91
90
|
const axisSystem = (0, _useAxisSystem.useAxisSystem)();
|
|
92
91
|
const store = (0, _useStore.useStore)();
|
|
93
|
-
const shouldPreventBecauseOfBrush =
|
|
94
|
-
const isOpen =
|
|
95
|
-
const lastInteraction =
|
|
92
|
+
const shouldPreventBecauseOfBrush = store.use(_useChartBrush.selectorBrushShouldPreventTooltip);
|
|
93
|
+
const isOpen = store.use(getIsOpenSelector(trigger, axisSystem, shouldPreventBecauseOfBrush));
|
|
94
|
+
const lastInteraction = store.use(_useChartInteraction.selectorChartsLastInteraction);
|
|
96
95
|
const computedAnchor = lastInteraction === 'keyboard' ? 'node' : anchor;
|
|
97
|
-
const itemPosition =
|
|
96
|
+
const itemPosition = store.use(trigger === 'item' && computedAnchor === 'node' ? _useChartTooltip.selectorChartsTooltipItemPosition : selectorReturnNull, position);
|
|
98
97
|
React.useEffect(() => {
|
|
99
98
|
const svgElement = svgRef.current;
|
|
100
99
|
if (svgElement === null) {
|
|
@@ -8,7 +8,6 @@ exports.useAxisTooltip = useAxisTooltip;
|
|
|
8
8
|
var _useSeries = require("../hooks/useSeries");
|
|
9
9
|
var _useColorProcessor = require("../internals/plugins/corePlugins/useChartSeries/useColorProcessor");
|
|
10
10
|
var _useStore = require("../internals/store/useStore");
|
|
11
|
-
var _useSelector = require("../internals/store/useSelector");
|
|
12
11
|
var _getLabel = require("../internals/getLabel");
|
|
13
12
|
var _isCartesian = require("../internals/isCartesian");
|
|
14
13
|
var _utils = require("./utils");
|
|
@@ -48,9 +47,9 @@ function useAxisTooltip(params = {}) {
|
|
|
48
47
|
const defaultYAxis = (0, _useAxis.useYAxis)();
|
|
49
48
|
const defaultRotationAxis = (0, _useAxis.useRotationAxis)();
|
|
50
49
|
const store = (0, _useStore.useStore)();
|
|
51
|
-
const tooltipXAxes =
|
|
52
|
-
const tooltipYAxes =
|
|
53
|
-
const tooltipRotationAxes =
|
|
50
|
+
const tooltipXAxes = store.use(_useChartCartesianAxis.selectorChartsInteractionTooltipXAxes);
|
|
51
|
+
const tooltipYAxes = store.use(_useChartCartesianAxis.selectorChartsInteractionTooltipYAxes);
|
|
52
|
+
const tooltipRotationAxes = store.use(_useChartPolarInteraction.selectorChartsInteractionTooltipRotationAxes);
|
|
54
53
|
const series = (0, _useSeries.useSeries)();
|
|
55
54
|
const {
|
|
56
55
|
xAxis
|
|
@@ -8,7 +8,6 @@ exports.useInternalItemTooltip = useInternalItemTooltip;
|
|
|
8
8
|
exports.useRadarItemTooltip = exports.useItemTooltip = void 0;
|
|
9
9
|
var _useSeries = require("../hooks/useSeries");
|
|
10
10
|
var _useChartTooltip = require("../internals/plugins/featurePlugins/useChartTooltip");
|
|
11
|
-
var _useSelector = require("../internals/store/useSelector");
|
|
12
11
|
var _useStore = require("../internals/store/useStore");
|
|
13
12
|
var _useAxis = require("../hooks/useAxis");
|
|
14
13
|
var _useZAxis = require("../hooks/useZAxis");
|
|
@@ -16,8 +15,8 @@ var _useChartSeries = require("../internals/plugins/corePlugins/useChartSeries/u
|
|
|
16
15
|
var _isCartesian = require("../internals/isCartesian");
|
|
17
16
|
function useInternalItemTooltip() {
|
|
18
17
|
const store = (0, _useStore.useStore)();
|
|
19
|
-
const identifier =
|
|
20
|
-
const seriesConfig =
|
|
18
|
+
const identifier = store.use(_useChartTooltip.selectorChartsTooltipItem);
|
|
19
|
+
const seriesConfig = store.use(_useChartSeries.selectorChartSeriesConfig);
|
|
21
20
|
const series = (0, _useSeries.useSeries)();
|
|
22
21
|
const {
|
|
23
22
|
xAxis,
|
|
@@ -12,7 +12,6 @@ var _styles = require("@mui/material/styles");
|
|
|
12
12
|
var _createStyled = require("@mui/system/createStyled");
|
|
13
13
|
var _useChartRootRef = require("../hooks/useChartRootRef");
|
|
14
14
|
var _useStore = require("../internals/store/useStore");
|
|
15
|
-
var _useSelector = require("../internals/store/useSelector");
|
|
16
15
|
var _useChartDimensions = require("../internals/plugins/corePlugins/useChartDimensions");
|
|
17
16
|
var _Toolbar = require("../Toolbar");
|
|
18
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -125,8 +124,8 @@ function ChartsWrapper(props) {
|
|
|
125
124
|
} = props;
|
|
126
125
|
const chartRootRef = (0, _useChartRootRef.useChartRootRef)();
|
|
127
126
|
const store = (0, _useStore.useStore)();
|
|
128
|
-
const propsWidth =
|
|
129
|
-
const propsHeight =
|
|
127
|
+
const propsWidth = store.use(_useChartDimensions.selectorChartPropsWidth);
|
|
128
|
+
const propsHeight = store.use(_useChartDimensions.selectorChartPropsHeight);
|
|
130
129
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
|
|
131
130
|
ref: chartRootRef,
|
|
132
131
|
ownerState: props,
|
|
@@ -22,7 +22,7 @@ function FocusedLineMark() {
|
|
|
22
22
|
yAxis,
|
|
23
23
|
yAxisIds
|
|
24
24
|
} = (0, _hooks.useYAxes)();
|
|
25
|
-
if (focusedItem === null || focusedItem.
|
|
25
|
+
if (focusedItem === null || focusedItem.type !== 'line' || !lineSeries) {
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
28
|
const series = lineSeries?.series[focusedItem.seriesId];
|
|
@@ -12,7 +12,6 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
14
|
var _useStore = require("../internals/store/useStore");
|
|
15
|
-
var _useSelector = require("../internals/store/useSelector");
|
|
16
15
|
var _LineHighlightElement = require("./LineHighlightElement");
|
|
17
16
|
var _useScale = require("../hooks/useScale");
|
|
18
17
|
var _constants = require("../constants");
|
|
@@ -52,7 +51,7 @@ function LineHighlightPlot(props) {
|
|
|
52
51
|
instance
|
|
53
52
|
} = (0, _ChartProvider.useChartContext)();
|
|
54
53
|
const store = (0, _useStore.useStore)();
|
|
55
|
-
const highlightedIndexes =
|
|
54
|
+
const highlightedIndexes = store.use(_useChartCartesianAxis.selectorChartsHighlightXAxisIndex);
|
|
56
55
|
if (highlightedIndexes.length === 0) {
|
|
57
56
|
return null;
|
|
58
57
|
}
|
package/LineChart/MarkPlot.js
CHANGED
|
@@ -17,7 +17,6 @@ var _MarkElement = require("./MarkElement");
|
|
|
17
17
|
var _hooks = require("../hooks");
|
|
18
18
|
var _useInternalIsZoomInteracting = require("../internals/plugins/featurePlugins/useChartCartesianAxis/useInternalIsZoomInteracting");
|
|
19
19
|
var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
|
|
20
|
-
var _useSelector = require("../internals/store/useSelector");
|
|
21
20
|
var _ChartProvider = require("../context/ChartProvider");
|
|
22
21
|
var _useMarkPlotData = require("./useMarkPlotData");
|
|
23
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -55,7 +54,7 @@ function MarkPlot(props) {
|
|
|
55
54
|
isFaded,
|
|
56
55
|
isHighlighted
|
|
57
56
|
} = (0, _hooks.useItemHighlightedGetter)();
|
|
58
|
-
const xAxisHighlightIndexes =
|
|
57
|
+
const xAxisHighlightIndexes = store.use(_useChartCartesianAxis.selectorChartsHighlightXAxisIndex);
|
|
59
58
|
const highlightedItems = React.useMemo(() => {
|
|
60
59
|
const rep = {};
|
|
61
60
|
for (const {
|