@mui/x-charts 8.22.1 → 8.24.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 +39 -0
- package/BarChart/BarChart.plugins.d.ts +2 -1
- package/BarChart/BarChart.plugins.js +2 -1
- package/BarChart/BarElement.js +1 -1
- package/BarChart/BarLabel/BarLabel.d.ts +2 -0
- package/BarChart/BarLabel/BarLabel.js +8 -3
- package/BarChart/BarLabel/BarLabelItem.d.ts +2 -0
- package/BarChart/BarLabel/BarLabelItem.js +4 -2
- package/BarChart/BarPlot.d.ts +12 -2
- package/BarChart/BarPlot.js +29 -86
- package/BarChart/BatchBarPlot/BarGroup.d.ts +15 -0
- package/BarChart/BatchBarPlot/BarGroup.js +142 -0
- package/BarChart/BatchBarPlot/BatchBarPlot.d.ts +12 -0
- package/BarChart/BatchBarPlot/BatchBarPlot.js +140 -0
- package/BarChart/BatchBarPlot/index.d.ts +1 -0
- package/BarChart/BatchBarPlot/index.js +12 -0
- package/BarChart/BatchBarPlot/useCreateBarPaths.d.ts +8 -0
- package/BarChart/BatchBarPlot/useCreateBarPaths.js +53 -0
- package/BarChart/FocusedBar.js +6 -2
- package/BarChart/IndividualBarPlot.d.ts +21 -0
- package/BarChart/IndividualBarPlot.js +106 -0
- package/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +1 -1
- package/BarChart/seriesConfig/bar/keyboardFocusHandler.d.ts +3 -0
- package/BarChart/seriesConfig/bar/keyboardFocusHandler.js +23 -0
- package/BarChart/seriesConfig/bar/legend.js +1 -0
- package/BarChart/seriesConfig/bar/seriesProcessor.js +2 -2
- package/BarChart/seriesConfig/index.js +5 -1
- package/BarChart/types.d.ts +2 -0
- package/BarChart/useBarChartProps.d.ts +6 -2
- package/BarChart/useBarChartProps.js +4 -2
- package/BarChart/useBarPlotData.d.ts +1 -1
- package/BarChart/useBarPlotData.js +23 -4
- package/BarChart/useRegisterItemClickHandlers.d.ts +6 -0
- package/BarChart/useRegisterItemClickHandlers.js +72 -0
- package/CHANGELOG.md +211 -0
- package/ChartContainer/ChartContainer.js +34 -0
- package/ChartContainer/useChartContainerProps.js +6 -2
- package/ChartsLegend/ChartsLegend.js +2 -2
- package/ChartsLegend/legendContext.types.d.ts +12 -0
- package/ChartsLegend/onClickContextBuilder.js +2 -1
- package/ChartsOverlay/ChartsLoadingOverlay.js +4 -1
- package/ChartsOverlay/ChartsNoDataOverlay.js +4 -1
- package/ChartsReferenceLine/common.d.ts +1 -1
- package/ChartsReferenceLine/common.js +4 -1
- package/ChartsTooltip/ChartsTooltipContainer.js +25 -21
- package/Gauge/GaugeContainer.js +4 -1
- package/LineChart/AnimatedLine.js +7 -3
- package/LineChart/AppearingMask.js +4 -1
- package/LineChart/CircleMarkElement.d.ts +5 -0
- package/LineChart/CircleMarkElement.js +13 -5
- package/LineChart/FocusedLineMark.js +6 -2
- package/LineChart/LineChart.js +30 -0
- package/LineChart/LineChart.plugins.d.ts +2 -1
- package/LineChart/LineChart.plugins.js +2 -1
- package/LineChart/LineElement.d.ts +4 -0
- package/LineChart/LineElement.js +7 -3
- package/LineChart/MarkElement.d.ts +5 -0
- package/LineChart/MarkElement.js +17 -10
- package/LineChart/markElementClasses.d.ts +0 -1
- package/LineChart/seriesConfig/index.js +5 -1
- package/LineChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/LineChart/seriesConfig/keyboardFocusHandler.js +23 -0
- package/LineChart/seriesConfig/legend.js +1 -0
- package/LineChart/seriesConfig/seriesProcessor.js +2 -2
- package/PieChart/FocusedPieArc.js +6 -3
- package/PieChart/PieArcLabel.d.ts +2 -0
- package/PieChart/PieArcLabel.js +5 -2
- package/PieChart/PieChart.js +35 -5
- package/PieChart/PieChart.plugins.d.ts +2 -1
- package/PieChart/PieChart.plugins.js +2 -1
- package/PieChart/dataTransform/useTransformData.js +1 -1
- package/PieChart/seriesConfig/index.js +5 -1
- package/PieChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/PieChart/seriesConfig/keyboardFocusHandler.js +23 -0
- package/PieChart/seriesConfig/legend.js +6 -3
- package/RadarChart/RadarChart.js +30 -0
- package/RadarChart/RadarChart.plugins.d.ts +3 -2
- package/RadarChart/RadarChart.plugins.js +2 -1
- package/RadarChart/seriesConfig/index.js +3 -1
- package/RadarChart/seriesConfig/legend.js +1 -0
- package/ScatterChart/BatchScatter.js +8 -14
- package/ScatterChart/FocusedScatterMark.js +1 -1
- package/ScatterChart/ScatterChart.js +30 -0
- package/ScatterChart/ScatterChart.plugins.d.ts +2 -1
- package/ScatterChart/ScatterChart.plugins.js +2 -1
- package/ScatterChart/seriesConfig/index.js +5 -1
- package/ScatterChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/ScatterChart/seriesConfig/keyboardFocusHandler.js +23 -0
- package/ScatterChart/seriesConfig/legend.js +1 -0
- package/SparkLineChart/SparkLineChart.js +46 -0
- package/esm/BarChart/BarChart.js +39 -0
- package/esm/BarChart/BarChart.plugins.d.ts +2 -1
- package/esm/BarChart/BarChart.plugins.js +2 -1
- package/esm/BarChart/BarElement.js +1 -1
- package/esm/BarChart/BarLabel/BarLabel.d.ts +2 -0
- package/esm/BarChart/BarLabel/BarLabel.js +8 -3
- package/esm/BarChart/BarLabel/BarLabelItem.d.ts +2 -0
- package/esm/BarChart/BarLabel/BarLabelItem.js +4 -2
- package/esm/BarChart/BarPlot.d.ts +12 -2
- package/esm/BarChart/BarPlot.js +29 -86
- package/esm/BarChart/BatchBarPlot/BarGroup.d.ts +15 -0
- package/esm/BarChart/BatchBarPlot/BarGroup.js +134 -0
- package/esm/BarChart/BatchBarPlot/BatchBarPlot.d.ts +12 -0
- package/esm/BarChart/BatchBarPlot/BatchBarPlot.js +133 -0
- package/esm/BarChart/BatchBarPlot/index.d.ts +1 -0
- package/esm/BarChart/BatchBarPlot/index.js +1 -0
- package/esm/BarChart/BatchBarPlot/useCreateBarPaths.d.ts +8 -0
- package/esm/BarChart/BatchBarPlot/useCreateBarPaths.js +46 -0
- package/esm/BarChart/FocusedBar.js +6 -2
- package/esm/BarChart/IndividualBarPlot.d.ts +21 -0
- package/esm/BarChart/IndividualBarPlot.js +98 -0
- package/esm/BarChart/seriesConfig/bar/getSeriesWithDefaultValues.d.ts +1 -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/legend.js +1 -0
- package/esm/BarChart/seriesConfig/bar/seriesProcessor.js +1 -1
- package/esm/BarChart/seriesConfig/index.js +5 -1
- package/esm/BarChart/types.d.ts +2 -0
- package/esm/BarChart/useBarChartProps.d.ts +6 -2
- package/esm/BarChart/useBarChartProps.js +4 -3
- package/esm/BarChart/useBarPlotData.d.ts +1 -1
- package/esm/BarChart/useBarPlotData.js +20 -1
- package/esm/BarChart/useRegisterItemClickHandlers.d.ts +6 -0
- package/esm/BarChart/useRegisterItemClickHandlers.js +67 -0
- package/esm/ChartContainer/ChartContainer.js +34 -0
- package/esm/ChartContainer/useChartContainerProps.js +6 -2
- package/esm/ChartsLegend/ChartsLegend.js +2 -2
- package/esm/ChartsLegend/legendContext.types.d.ts +12 -0
- package/esm/ChartsLegend/onClickContextBuilder.js +2 -1
- package/esm/ChartsOverlay/ChartsLoadingOverlay.js +4 -1
- package/esm/ChartsOverlay/ChartsNoDataOverlay.js +4 -1
- package/esm/ChartsReferenceLine/common.d.ts +1 -1
- package/esm/ChartsReferenceLine/common.js +4 -1
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +26 -22
- package/esm/Gauge/GaugeContainer.js +4 -1
- package/esm/LineChart/AnimatedLine.js +7 -3
- package/esm/LineChart/AppearingMask.js +4 -1
- package/esm/LineChart/CircleMarkElement.d.ts +5 -0
- package/esm/LineChart/CircleMarkElement.js +13 -5
- package/esm/LineChart/FocusedLineMark.js +6 -2
- package/esm/LineChart/LineChart.js +30 -0
- package/esm/LineChart/LineChart.plugins.d.ts +2 -1
- package/esm/LineChart/LineChart.plugins.js +2 -1
- package/esm/LineChart/LineElement.d.ts +4 -0
- package/esm/LineChart/LineElement.js +7 -3
- package/esm/LineChart/MarkElement.d.ts +5 -0
- package/esm/LineChart/MarkElement.js +17 -10
- package/esm/LineChart/markElementClasses.d.ts +0 -1
- package/esm/LineChart/seriesConfig/index.js +5 -1
- package/esm/LineChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/esm/LineChart/seriesConfig/keyboardFocusHandler.js +17 -0
- package/esm/LineChart/seriesConfig/legend.js +1 -0
- package/esm/LineChart/seriesConfig/seriesProcessor.js +1 -1
- package/esm/PieChart/FocusedPieArc.js +5 -2
- package/esm/PieChart/PieArcLabel.d.ts +2 -0
- package/esm/PieChart/PieArcLabel.js +5 -2
- package/esm/PieChart/PieChart.js +35 -5
- package/esm/PieChart/PieChart.plugins.d.ts +2 -1
- package/esm/PieChart/PieChart.plugins.js +2 -1
- package/esm/PieChart/dataTransform/useTransformData.js +1 -1
- package/esm/PieChart/seriesConfig/index.js +5 -1
- package/esm/PieChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/esm/PieChart/seriesConfig/keyboardFocusHandler.js +17 -0
- package/esm/PieChart/seriesConfig/legend.js +6 -3
- package/esm/RadarChart/RadarChart.js +30 -0
- package/esm/RadarChart/RadarChart.plugins.d.ts +3 -2
- package/esm/RadarChart/RadarChart.plugins.js +2 -1
- package/esm/RadarChart/seriesConfig/index.js +3 -1
- package/esm/RadarChart/seriesConfig/legend.js +1 -0
- package/esm/ScatterChart/BatchScatter.js +5 -11
- package/esm/ScatterChart/FocusedScatterMark.js +1 -1
- package/esm/ScatterChart/ScatterChart.js +30 -0
- package/esm/ScatterChart/ScatterChart.plugins.d.ts +2 -1
- package/esm/ScatterChart/ScatterChart.plugins.js +2 -1
- package/esm/ScatterChart/seriesConfig/index.js +5 -1
- package/esm/ScatterChart/seriesConfig/keyboardFocusHandler.d.ts +3 -0
- package/esm/ScatterChart/seriesConfig/keyboardFocusHandler.js +17 -0
- package/esm/ScatterChart/seriesConfig/legend.js +1 -0
- package/esm/SparkLineChart/SparkLineChart.js +46 -0
- package/esm/hooks/useFocusedItem.d.ts +1 -12
- package/esm/hooks/useFocusedItem.js +3 -10
- package/esm/hooks/useIsItemFocused.d.ts +4 -3
- package/esm/hooks/useIsItemFocused.js +1 -1
- package/esm/hooks/useIsItemFocusedGetter.d.ts +3 -2
- package/esm/hooks/useIsItemFocusedGetter.js +2 -1
- package/esm/index.js +1 -1
- package/esm/internals/appendAtKey.d.ts +8 -0
- package/esm/internals/appendAtKey.js +17 -0
- package/esm/internals/commonNextFocusItem.d.ts +14 -0
- package/esm/internals/commonNextFocusItem.js +88 -0
- package/esm/internals/getBarDimensions.d.ts +1 -2
- package/esm/internals/identifierSerializer.d.ts +9 -0
- package/esm/internals/identifierSerializer.js +6 -0
- package/esm/internals/index.d.ts +7 -3
- package/esm/internals/index.js +7 -3
- package/esm/internals/invertScale.d.ts +6 -2
- package/esm/internals/invertScale.js +9 -1
- package/esm/internals/plugins/allPlugins.d.ts +4 -3
- package/esm/internals/plugins/allPlugins.js +2 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/serializeIdentifier.d.ts +14 -0
- package/esm/internals/plugins/corePlugins/useChartSeries/serializeIdentifier.js +18 -0
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +8 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +12 -1
- package/esm/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.d.ts +11 -0
- package/esm/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.js +74 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +20 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +10 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.js +83 -0
- 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/getMaxSeriesLength.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.js +6 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.d.ts +15 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.js +18 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.d.ts +7 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.js +9 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.d.ts +11 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.js +18 -0
- package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +2 -10
- package/esm/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/index.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/index.js +3 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/isIdentifierVisible.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/isIdentifierVisible.js +5 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.js +78 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.d.ts +16 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.js +19 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.d.ts +90 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.js +1 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.js +11 -0
- package/esm/internals/plugins/models/seriesConfig/identifierSerializer.types.d.ts +2 -0
- package/esm/internals/plugins/models/seriesConfig/identifierSerializer.types.js +1 -0
- package/esm/internals/plugins/models/seriesConfig/index.d.ts +2 -1
- package/esm/internals/plugins/models/seriesConfig/index.js +2 -1
- package/esm/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +9 -0
- package/esm/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
- package/esm/internals/seriesHasData.d.ts +4 -0
- package/esm/internals/seriesHasData.js +8 -0
- 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/axis.d.ts +5 -4
- package/esm/models/featureFlags.d.ts +1 -0
- package/esm/models/featureFlags.js +1 -0
- package/esm/models/index.d.ts +1 -0
- package/esm/models/index.js +1 -0
- package/esm/models/seriesType/index.d.ts +3 -1
- package/esm/moduleAugmentation/barChartBatchRendererOnItemClick.d.ts +13 -0
- package/esm/moduleAugmentation/barChartBatchRendererOnItemClick.js +1 -0
- package/hooks/useFocusedItem.d.ts +1 -12
- package/hooks/useFocusedItem.js +1 -10
- package/hooks/useIsItemFocused.d.ts +4 -3
- package/hooks/useIsItemFocused.js +1 -1
- package/hooks/useIsItemFocusedGetter.d.ts +3 -2
- package/hooks/useIsItemFocusedGetter.js +2 -1
- package/index.js +1 -1
- package/internals/appendAtKey.d.ts +8 -0
- package/internals/appendAtKey.js +23 -0
- package/internals/commonNextFocusItem.d.ts +14 -0
- package/internals/commonNextFocusItem.js +97 -0
- package/internals/getBarDimensions.d.ts +1 -2
- package/internals/identifierSerializer.d.ts +9 -0
- package/internals/identifierSerializer.js +16 -0
- package/internals/index.d.ts +7 -3
- package/internals/index.js +55 -11
- package/internals/invertScale.d.ts +6 -2
- package/internals/invertScale.js +10 -1
- package/internals/plugins/allPlugins.d.ts +4 -3
- package/internals/plugins/allPlugins.js +2 -1
- package/internals/plugins/corePlugins/useChartSeries/serializeIdentifier.d.ts +14 -0
- package/internals/plugins/corePlugins/useChartSeries/serializeIdentifier.js +25 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.js +8 -1
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.types.d.ts +12 -1
- package/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.d.ts +11 -0
- package/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.js +81 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +20 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +10 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPosition.selectors.js +89 -0
- 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/getMaxSeriesLength.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getMaxSeriesLength.js +12 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.d.ts +15 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNextNonEmptySeries.js +23 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.d.ts +7 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getNonEmptySeriesArray.js +15 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.d.ts +11 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/utils/getPreviousNonEmptySeries.js +23 -0
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.d.ts +2 -10
- package/internals/plugins/featurePlugins/useChartTooltip/useChartTooltip.selectors.js +1 -1
- package/internals/plugins/featurePlugins/useChartVisibilityManager/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/index.js +39 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/isIdentifierVisible.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/isIdentifierVisible.js +12 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.js +85 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.d.ts +16 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.selectors.js +25 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.d.ts +90 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/useChartVisibilityManager.types.js +5 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartVisibilityManager/visibilityParamToMap.js +18 -0
- package/internals/plugins/models/seriesConfig/identifierSerializer.types.d.ts +2 -0
- package/internals/plugins/models/seriesConfig/identifierSerializer.types.js +5 -0
- package/internals/plugins/models/seriesConfig/index.d.ts +2 -1
- package/internals/plugins/models/seriesConfig/index.js +11 -0
- package/internals/plugins/models/seriesConfig/seriesConfig.types.d.ts +9 -0
- package/internals/plugins/models/seriesConfig/seriesProcessor.types.d.ts +1 -1
- package/internals/seriesHasData.d.ts +4 -0
- package/internals/seriesHasData.js +14 -0
- 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/axis.d.ts +5 -4
- package/models/featureFlags.d.ts +1 -0
- package/models/featureFlags.js +5 -0
- package/models/index.d.ts +1 -0
- package/models/index.js +11 -0
- package/models/seriesType/index.d.ts +3 -1
- package/moduleAugmentation/barChartBatchRendererOnItemClick.d.ts +13 -0
- package/moduleAugmentation/barChartBatchRendererOnItemClick.js +5 -0
- package/package.json +14 -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/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
|
@@ -2,7 +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 = ["x", "y", "id", "classes", "color", "dataIndex", "onClick", "skipAnimation", "isFaded", "isHighlighted"];
|
|
5
|
+
const _excluded = ["x", "y", "id", "classes", "color", "dataIndex", "onClick", "skipAnimation", "isFaded", "isHighlighted", "shape", "hidden"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { styled, useTheme } from '@mui/material/styles';
|
|
@@ -10,7 +10,10 @@ import { ANIMATION_DURATION_MS, ANIMATION_TIMING_FUNCTION } from "../internals/a
|
|
|
10
10
|
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
11
11
|
import { markElementClasses, useUtilityClasses } from "./markElementClasses.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
const Circle = styled('circle'
|
|
13
|
+
const Circle = styled('circle', {
|
|
14
|
+
slot: 'internal',
|
|
15
|
+
shouldForwardProp: undefined
|
|
16
|
+
})({
|
|
14
17
|
[`&.${markElementClasses.animate}`]: {
|
|
15
18
|
transitionDuration: `${ANIMATION_DURATION_MS}ms`,
|
|
16
19
|
transitionProperty: 'cx, cy, opacity',
|
|
@@ -42,6 +45,10 @@ function CircleMarkElement(props) {
|
|
|
42
45
|
skipAnimation,
|
|
43
46
|
isFaded = false,
|
|
44
47
|
isHighlighted = false
|
|
48
|
+
// @ts-expect-error, prevents it from being passed to the svg element
|
|
49
|
+
,
|
|
50
|
+
|
|
51
|
+
hidden
|
|
45
52
|
} = props,
|
|
46
53
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
47
54
|
const theme = useTheme();
|
|
@@ -55,7 +62,6 @@ function CircleMarkElement(props) {
|
|
|
55
62
|
classes: innerClasses,
|
|
56
63
|
isHighlighted,
|
|
57
64
|
isFaded,
|
|
58
|
-
color,
|
|
59
65
|
skipAnimation
|
|
60
66
|
};
|
|
61
67
|
const classes = useUtilityClasses(ownerState);
|
|
@@ -68,10 +74,12 @@ function CircleMarkElement(props) {
|
|
|
68
74
|
strokeWidth: 2,
|
|
69
75
|
className: classes.root,
|
|
70
76
|
onClick: onClick,
|
|
71
|
-
cursor: onClick ? 'pointer' : 'unset'
|
|
77
|
+
cursor: onClick ? 'pointer' : 'unset',
|
|
78
|
+
pointerEvents: hidden ? 'none' : undefined
|
|
72
79
|
}, interactionProps, {
|
|
73
80
|
"data-highlighted": isHighlighted || undefined,
|
|
74
|
-
"data-faded": isFaded || undefined
|
|
81
|
+
"data-faded": isFaded || undefined,
|
|
82
|
+
opacity: hidden ? 0 : 1
|
|
75
83
|
}));
|
|
76
84
|
}
|
|
77
85
|
process.env.NODE_ENV !== "production" ? CircleMarkElement.propTypes = {
|
|
@@ -17,10 +17,14 @@ export function FocusedLineMark() {
|
|
|
17
17
|
yAxis,
|
|
18
18
|
yAxisIds
|
|
19
19
|
} = useYAxes();
|
|
20
|
-
if (focusedItem === null || focusedItem.
|
|
20
|
+
if (focusedItem === null || focusedItem.type !== 'line' || !lineSeries) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const series = lineSeries.series[focusedItem.seriesId];
|
|
24
|
+
if (series.data[focusedItem.dataIndex] == null) {
|
|
25
|
+
// Handle missing data
|
|
21
26
|
return null;
|
|
22
27
|
}
|
|
23
|
-
const series = lineSeries?.series[focusedItem.seriesId];
|
|
24
28
|
const xAxisId = series.xAxisId ?? xAxisIds[0];
|
|
25
29
|
const yAxisId = series.yAxisId ?? yAxisIds[0];
|
|
26
30
|
return /*#__PURE__*/_jsx("rect", {
|
|
@@ -138,6 +138,31 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
138
138
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
139
139
|
*/
|
|
140
140
|
height: PropTypes.number,
|
|
141
|
+
/**
|
|
142
|
+
* List of hidden series and/or items.
|
|
143
|
+
*
|
|
144
|
+
* Different chart types use different keys.
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```ts
|
|
148
|
+
* [
|
|
149
|
+
* {
|
|
150
|
+
* type: 'pie',
|
|
151
|
+
* seriesId: 'series-1',
|
|
152
|
+
* dataIndex: 3,
|
|
153
|
+
* },
|
|
154
|
+
* {
|
|
155
|
+
* type: 'line',
|
|
156
|
+
* seriesId: 'series-2',
|
|
157
|
+
* }
|
|
158
|
+
* ]
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
hiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
162
|
+
dataIndex: PropTypes.number,
|
|
163
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
164
|
+
type: PropTypes.oneOf(['line']).isRequired
|
|
165
|
+
})),
|
|
141
166
|
/**
|
|
142
167
|
* If `true`, the legend is not rendered.
|
|
143
168
|
*/
|
|
@@ -195,6 +220,11 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
195
220
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
196
221
|
*/
|
|
197
222
|
onAxisClick: PropTypes.func,
|
|
223
|
+
/**
|
|
224
|
+
* Callback fired when any hidden identifiers change.
|
|
225
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
226
|
+
*/
|
|
227
|
+
onHiddenItemsChange: PropTypes.func,
|
|
198
228
|
/**
|
|
199
229
|
* The callback fired when the highlighted item changes.
|
|
200
230
|
*
|
|
@@ -6,5 +6,6 @@ import { type UseChartHighlightSignature } from "../internals/plugins/featurePlu
|
|
|
6
6
|
import { type UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
7
7
|
import { type ConvertSignaturesIntoPlugins } from "../internals/plugins/models/helpers.js";
|
|
8
8
|
import { type UseChartBrushSignature } from "../internals/plugins/featurePlugins/useChartBrush/index.js";
|
|
9
|
-
|
|
9
|
+
import { type UseChartVisibilityManagerSignature } from "../internals/plugins/featurePlugins/useChartVisibilityManager/index.js";
|
|
10
|
+
export type LineChartPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'line'>, UseChartHighlightSignature, UseChartVisibilityManagerSignature<'line'>, UseChartKeyboardNavigationSignature];
|
|
10
11
|
export declare const LINE_CHART_PLUGINS: ConvertSignaturesIntoPlugins<LineChartPluginSignatures>;
|
|
@@ -5,4 +5,5 @@ import { useChartInteraction } from "../internals/plugins/featurePlugins/useChar
|
|
|
5
5
|
import { useChartHighlight } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
6
6
|
import { useChartKeyboardNavigation } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
7
7
|
import { useChartBrush } from "../internals/plugins/featurePlugins/useChartBrush/index.js";
|
|
8
|
-
|
|
8
|
+
import { useChartVisibilityManager } from "../internals/plugins/featurePlugins/useChartVisibilityManager/index.js";
|
|
9
|
+
export const LINE_CHART_PLUGINS = [useChartZAxis, useChartBrush, useChartTooltip, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartVisibilityManager, useChartKeyboardNavigation];
|
|
@@ -23,6 +23,8 @@ export interface LineElementOwnerState {
|
|
|
23
23
|
isFaded: boolean;
|
|
24
24
|
isHighlighted: boolean;
|
|
25
25
|
classes?: Partial<LineElementClasses>;
|
|
26
|
+
/** If `true`, the line is hidden. */
|
|
27
|
+
hidden?: boolean;
|
|
26
28
|
}
|
|
27
29
|
export declare function getLineElementUtilityClass(slot: string): string;
|
|
28
30
|
export declare const lineElementClasses: LineElementClasses;
|
|
@@ -38,6 +40,8 @@ export interface LineElementSlotProps {
|
|
|
38
40
|
}
|
|
39
41
|
export interface LineElementProps extends Omit<LineElementOwnerState, 'isFaded' | 'isHighlighted'>, Pick<AnimatedLineProps, 'skipAnimation'>, Omit<React.SVGProps<SVGPathElement>, 'ref' | 'color' | 'id'> {
|
|
40
42
|
d: string;
|
|
43
|
+
/** If `true`, the line is hidden. */
|
|
44
|
+
hidden?: boolean;
|
|
41
45
|
/**
|
|
42
46
|
* The props used for each component slot.
|
|
43
47
|
* @default {}
|
|
@@ -2,7 +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 = ["id", "classes", "color", "gradientId", "slots", "slotProps", "onClick"];
|
|
5
|
+
const _excluded = ["id", "classes", "color", "gradientId", "slots", "slotProps", "onClick", "hidden"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
@@ -47,7 +47,8 @@ function LineElement(props) {
|
|
|
47
47
|
gradientId,
|
|
48
48
|
slots,
|
|
49
49
|
slotProps,
|
|
50
|
-
onClick
|
|
50
|
+
onClick,
|
|
51
|
+
hidden
|
|
51
52
|
} = props,
|
|
52
53
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
53
54
|
const interactionProps = useInteractionItemProps({
|
|
@@ -66,7 +67,8 @@ function LineElement(props) {
|
|
|
66
67
|
color,
|
|
67
68
|
gradientId,
|
|
68
69
|
isFaded,
|
|
69
|
-
isHighlighted
|
|
70
|
+
isHighlighted,
|
|
71
|
+
hidden
|
|
70
72
|
};
|
|
71
73
|
const classes = useUtilityClasses(ownerState);
|
|
72
74
|
const Line = slots?.line ?? AnimatedLine;
|
|
@@ -91,6 +93,8 @@ process.env.NODE_ENV !== "production" ? LineElement.propTypes = {
|
|
|
91
93
|
color: PropTypes.string.isRequired,
|
|
92
94
|
d: PropTypes.string.isRequired,
|
|
93
95
|
gradientId: PropTypes.string,
|
|
96
|
+
/** If `true`, the line is hidden. */
|
|
97
|
+
hidden: PropTypes.bool,
|
|
94
98
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
95
99
|
/**
|
|
96
100
|
* If `true`, animations are skipped.
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type MarkElementOwnerState } from "./markElementClasses.js";
|
|
3
3
|
export type MarkElementProps = Omit<MarkElementOwnerState, 'isFaded' | 'isHighlighted'> & Omit<React.SVGProps<SVGPathElement>, 'ref' | 'id'> & {
|
|
4
|
+
/**
|
|
5
|
+
* If `true`, the marker is hidden.
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
hidden?: boolean;
|
|
4
9
|
/**
|
|
5
10
|
* If `true`, animations are skipped.
|
|
6
11
|
* @default false
|
|
@@ -2,7 +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 = ["x", "y", "id", "classes", "color", "shape", "dataIndex", "onClick", "skipAnimation", "isFaded", "isHighlighted"];
|
|
5
|
+
const _excluded = ["x", "y", "id", "classes", "color", "shape", "dataIndex", "onClick", "skipAnimation", "isFaded", "isHighlighted", "hidden", "style"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { styled } from '@mui/material/styles';
|
|
@@ -16,12 +16,9 @@ const MarkElementPath = styled('path', {
|
|
|
16
16
|
name: 'MuiMarkElement',
|
|
17
17
|
slot: 'Root'
|
|
18
18
|
})(({
|
|
19
|
-
ownerState,
|
|
20
19
|
theme
|
|
21
20
|
}) => ({
|
|
22
21
|
fill: (theme.vars || theme).palette.background.paper,
|
|
23
|
-
stroke: ownerState.color,
|
|
24
|
-
strokeWidth: 2,
|
|
25
22
|
[`&.${markElementClasses.animate}`]: {
|
|
26
23
|
transitionDuration: `${ANIMATION_DURATION_MS}ms`,
|
|
27
24
|
transitionProperty: 'transform, transform-origin, opacity',
|
|
@@ -50,7 +47,9 @@ function MarkElement(props) {
|
|
|
50
47
|
onClick,
|
|
51
48
|
skipAnimation,
|
|
52
49
|
isFaded = false,
|
|
53
|
-
isHighlighted = false
|
|
50
|
+
isHighlighted = false,
|
|
51
|
+
hidden,
|
|
52
|
+
style
|
|
54
53
|
} = props,
|
|
55
54
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
56
55
|
const interactionProps = useInteractionItemProps({
|
|
@@ -63,23 +62,26 @@ function MarkElement(props) {
|
|
|
63
62
|
classes: innerClasses,
|
|
64
63
|
isHighlighted,
|
|
65
64
|
isFaded,
|
|
66
|
-
color,
|
|
67
65
|
skipAnimation
|
|
68
66
|
};
|
|
69
67
|
const classes = useUtilityClasses(ownerState);
|
|
70
68
|
return /*#__PURE__*/_jsx(MarkElementPath, _extends({}, other, {
|
|
71
|
-
style: {
|
|
69
|
+
style: _extends({}, style, {
|
|
72
70
|
transform: `translate(${x}px, ${y}px)`,
|
|
73
71
|
transformOrigin: `${x}px ${y}px`
|
|
74
|
-
},
|
|
72
|
+
}),
|
|
75
73
|
ownerState: ownerState,
|
|
76
74
|
className: classes.root,
|
|
77
75
|
d: d3Symbol(d3SymbolsFill[getSymbol(shape)])(),
|
|
78
76
|
onClick: onClick,
|
|
79
|
-
cursor: onClick ? 'pointer' : 'unset'
|
|
77
|
+
cursor: onClick ? 'pointer' : 'unset',
|
|
78
|
+
pointerEvents: hidden ? 'none' : undefined
|
|
80
79
|
}, interactionProps, {
|
|
81
80
|
"data-highlighted": isHighlighted || undefined,
|
|
82
|
-
"data-faded": isFaded || undefined
|
|
81
|
+
"data-faded": isFaded || undefined,
|
|
82
|
+
opacity: hidden ? 0 : 1,
|
|
83
|
+
strokeWidth: 2,
|
|
84
|
+
stroke: color
|
|
83
85
|
}));
|
|
84
86
|
}
|
|
85
87
|
process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
|
|
@@ -92,6 +94,11 @@ process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
|
|
|
92
94
|
* The index to the element in the series' data array.
|
|
93
95
|
*/
|
|
94
96
|
dataIndex: PropTypes.number.isRequired,
|
|
97
|
+
/**
|
|
98
|
+
* If `true`, the marker is hidden.
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
hidden: PropTypes.bool,
|
|
95
102
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
96
103
|
/**
|
|
97
104
|
* If `true`, the marker is faded.
|
|
@@ -17,7 +17,6 @@ export interface MarkElementClasses {
|
|
|
17
17
|
export type MarkElementClassKey = keyof MarkElementClasses;
|
|
18
18
|
export interface MarkElementOwnerState {
|
|
19
19
|
id: SeriesId;
|
|
20
|
-
color: string;
|
|
21
20
|
isFaded: boolean;
|
|
22
21
|
isHighlighted: boolean;
|
|
23
22
|
classes?: Partial<MarkElementClasses>;
|
|
@@ -5,6 +5,8 @@ import legendGetter from "./legend.js";
|
|
|
5
5
|
import tooltipGetter, { axisTooltipGetter } from "./tooltip.js";
|
|
6
6
|
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
7
7
|
import tooltipItemPositionGetter from "./tooltipPosition.js";
|
|
8
|
+
import keyboardFocusHandler from "./keyboardFocusHandler.js";
|
|
9
|
+
import { identifierSerializerSeriesIdDataIndex } from "../../internals/identifierSerializer.js";
|
|
8
10
|
export const lineSeriesConfig = {
|
|
9
11
|
colorProcessor: getColor,
|
|
10
12
|
seriesProcessor,
|
|
@@ -14,5 +16,7 @@ export const lineSeriesConfig = {
|
|
|
14
16
|
axisTooltipGetter,
|
|
15
17
|
xExtremumGetter: getExtremumX,
|
|
16
18
|
yExtremumGetter: getExtremumY,
|
|
17
|
-
getSeriesWithDefaultValues
|
|
19
|
+
getSeriesWithDefaultValues,
|
|
20
|
+
keyboardFocusHandler,
|
|
21
|
+
identifierSerializer: identifierSerializerSeriesIdDataIndex
|
|
18
22
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createGetNextIndexFocusedItem, createGetPreviousIndexFocusedItem, createGetNextSeriesFocusedItem, createGetPreviousSeriesFocusedItem } from "../../internals/commonNextFocusItem.js";
|
|
2
|
+
const outSeriesTypes = new Set(['bar', 'line', 'scatter']);
|
|
3
|
+
const keyboardFocusHandler = event => {
|
|
4
|
+
switch (event.key) {
|
|
5
|
+
case 'ArrowRight':
|
|
6
|
+
return createGetNextIndexFocusedItem(outSeriesTypes);
|
|
7
|
+
case 'ArrowLeft':
|
|
8
|
+
return createGetPreviousIndexFocusedItem(outSeriesTypes);
|
|
9
|
+
case 'ArrowDown':
|
|
10
|
+
return createGetPreviousSeriesFocusedItem(outSeriesTypes);
|
|
11
|
+
case 'ArrowUp':
|
|
12
|
+
return createGetNextSeriesFocusedItem(outSeriesTypes);
|
|
13
|
+
default:
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export default keyboardFocusHandler;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { stack as d3Stack } from '@mui/x-charts-vendor/d3-shape';
|
|
3
3
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
4
|
-
import { getStackingGroups } from "../../internals/
|
|
4
|
+
import { getStackingGroups } from "../../internals/stacking/index.js";
|
|
5
5
|
const seriesProcessor = (params, dataset) => {
|
|
6
6
|
const {
|
|
7
7
|
seriesOrder,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
+
const _excluded = ["arcLabelRadius"];
|
|
4
6
|
import * as React from 'react';
|
|
5
7
|
import { useTheme } from '@mui/material/styles';
|
|
6
8
|
import { useFocusedItem } from "../hooks/useFocusedItem.js";
|
|
@@ -18,7 +20,7 @@ export function FocusedPieArc(props) {
|
|
|
18
20
|
isFaded
|
|
19
21
|
} = useItemHighlighted(focusedItem);
|
|
20
22
|
const pieSeries = usePieSeriesContext();
|
|
21
|
-
if (focusedItem === null || focusedItem.
|
|
23
|
+
if (focusedItem === null || focusedItem.type !== 'pie' || !pieSeries) {
|
|
22
24
|
return null;
|
|
23
25
|
}
|
|
24
26
|
const series = pieSeries?.series[focusedItem.seriesId];
|
|
@@ -30,7 +32,8 @@ export function FocusedPieArc(props) {
|
|
|
30
32
|
return null;
|
|
31
33
|
}
|
|
32
34
|
const item = series.data[focusedItem.dataIndex];
|
|
33
|
-
const
|
|
35
|
+
const _getModifiedArcProper = getModifiedArcProperties(series, pieSeriesLayout[focusedItem.seriesId], isHighlighted, isFaded),
|
|
36
|
+
arcSizes = _objectWithoutPropertiesLoose(_getModifiedArcProper, _excluded);
|
|
34
37
|
return /*#__PURE__*/_jsx(PieArc, _extends({
|
|
35
38
|
transform: `translate(${pieSeriesLayout[series.id].center.x}, ${pieSeriesLayout[series.id].center.y})`,
|
|
36
39
|
startAngle: item.startAngle,
|
|
@@ -36,6 +36,7 @@ export type PieArcLabelProps = PieArcLabelOwnerState & Omit<React.SVGProps<SVGTe
|
|
|
36
36
|
paddingAngle: number;
|
|
37
37
|
skipAnimation: boolean;
|
|
38
38
|
formattedArcLabel?: string | null;
|
|
39
|
+
hidden?: boolean;
|
|
39
40
|
};
|
|
40
41
|
declare const PieArcLabel: React.ForwardRefExoticComponent<PieArcLabelOwnerState & Omit<React.SVGProps<SVGTextElement>, "ref" | "color" | "id"> & {
|
|
41
42
|
startAngle: number;
|
|
@@ -47,5 +48,6 @@ declare const PieArcLabel: React.ForwardRefExoticComponent<PieArcLabelOwnerState
|
|
|
47
48
|
paddingAngle: number;
|
|
48
49
|
skipAnimation: boolean;
|
|
49
50
|
formattedArcLabel?: string | null;
|
|
51
|
+
hidden?: boolean;
|
|
50
52
|
} & React.RefAttributes<SVGTextElement>>;
|
|
51
53
|
export { PieArcLabel };
|
|
@@ -2,7 +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 = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "arcLabelRadius", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "skipAnimation"];
|
|
5
|
+
const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "arcLabelRadius", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "skipAnimation", "hidden"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import composeClasses from '@mui/utils/composeClasses';
|
|
@@ -67,7 +67,8 @@ const PieArcLabel = /*#__PURE__*/React.forwardRef(function PieArcLabel(props, re
|
|
|
67
67
|
formattedArcLabel,
|
|
68
68
|
isHighlighted,
|
|
69
69
|
isFaded,
|
|
70
|
-
skipAnimation
|
|
70
|
+
skipAnimation,
|
|
71
|
+
hidden
|
|
71
72
|
} = props,
|
|
72
73
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
73
74
|
const ownerState = {
|
|
@@ -92,6 +93,7 @@ const PieArcLabel = /*#__PURE__*/React.forwardRef(function PieArcLabel(props, re
|
|
|
92
93
|
return /*#__PURE__*/_jsx(PieArcLabelRoot, _extends({
|
|
93
94
|
className: classes.root
|
|
94
95
|
}, other, animatedProps, {
|
|
96
|
+
opacity: hidden ? 0 : 1,
|
|
95
97
|
children: formattedArcLabel
|
|
96
98
|
}));
|
|
97
99
|
});
|
|
@@ -107,6 +109,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabel.propTypes = {
|
|
|
107
109
|
cornerRadius: PropTypes.number.isRequired,
|
|
108
110
|
endAngle: PropTypes.number.isRequired,
|
|
109
111
|
formattedArcLabel: PropTypes.string,
|
|
112
|
+
hidden: PropTypes.bool,
|
|
110
113
|
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
111
114
|
innerRadius: PropTypes.number.isRequired,
|
|
112
115
|
isFaded: PropTypes.bool.isRequired,
|
package/esm/PieChart/PieChart.js
CHANGED
|
@@ -73,15 +73,15 @@ const PieChart = /*#__PURE__*/React.forwardRef(function PieChart(inProps, ref) {
|
|
|
73
73
|
plugins: PIE_CHART_PLUGINS
|
|
74
74
|
}), ref);
|
|
75
75
|
const Tooltip = slots?.tooltip ?? ChartsTooltip;
|
|
76
|
-
const Toolbar =
|
|
76
|
+
const Toolbar = slots?.toolbar;
|
|
77
77
|
return /*#__PURE__*/_jsx(ChartDataProvider, _extends({}, chartDataProviderProps, {
|
|
78
78
|
children: /*#__PURE__*/_jsxs(ChartsWrapper, {
|
|
79
|
-
legendPosition:
|
|
80
|
-
legendDirection:
|
|
79
|
+
legendPosition: slotProps?.legend?.position,
|
|
80
|
+
legendDirection: slotProps?.legend?.direction ?? 'vertical',
|
|
81
81
|
sx: sx,
|
|
82
82
|
hideLegend: hideLegend ?? false,
|
|
83
|
-
children: [showToolbar && Toolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({},
|
|
84
|
-
direction:
|
|
83
|
+
children: [showToolbar && Toolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, slotProps?.toolbar)) : null, !hideLegend && /*#__PURE__*/_jsx(ChartsLegend, {
|
|
84
|
+
direction: slotProps?.legend?.direction ?? 'vertical',
|
|
85
85
|
slots: slots,
|
|
86
86
|
slotProps: slotProps
|
|
87
87
|
}), /*#__PURE__*/_jsxs(ChartsSurface, _extends({}, chartsSurfaceProps, {
|
|
@@ -126,6 +126,31 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
126
126
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
127
127
|
*/
|
|
128
128
|
height: PropTypes.number,
|
|
129
|
+
/**
|
|
130
|
+
* List of hidden series and/or items.
|
|
131
|
+
*
|
|
132
|
+
* Different chart types use different keys.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* [
|
|
137
|
+
* {
|
|
138
|
+
* type: 'pie',
|
|
139
|
+
* seriesId: 'series-1',
|
|
140
|
+
* dataIndex: 3,
|
|
141
|
+
* },
|
|
142
|
+
* {
|
|
143
|
+
* type: 'line',
|
|
144
|
+
* seriesId: 'series-2',
|
|
145
|
+
* }
|
|
146
|
+
* ]
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
hiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
150
|
+
dataIndex: PropTypes.number,
|
|
151
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
152
|
+
type: PropTypes.oneOf(['pie']).isRequired
|
|
153
|
+
})),
|
|
129
154
|
/**
|
|
130
155
|
* If `true`, the legend is not rendered.
|
|
131
156
|
*/
|
|
@@ -164,6 +189,11 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
164
189
|
right: PropTypes.number,
|
|
165
190
|
top: PropTypes.number
|
|
166
191
|
})]),
|
|
192
|
+
/**
|
|
193
|
+
* Callback fired when any hidden identifiers change.
|
|
194
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
195
|
+
*/
|
|
196
|
+
onHiddenItemsChange: PropTypes.func,
|
|
167
197
|
/**
|
|
168
198
|
* The callback fired when the highlighted item changes.
|
|
169
199
|
*
|
|
@@ -3,5 +3,6 @@ import { type UseChartTooltipSignature } from "../internals/plugins/featurePlugi
|
|
|
3
3
|
import { type UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
4
4
|
import { type UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
5
5
|
import { type ConvertSignaturesIntoPlugins } from "../internals/plugins/models/helpers.js";
|
|
6
|
-
|
|
6
|
+
import { type UseChartVisibilityManagerSignature } from "../internals/plugins/featurePlugins/useChartVisibilityManager/index.js";
|
|
7
|
+
export type PieChartPluginSignatures = [UseChartTooltipSignature, UseChartInteractionSignature, UseChartHighlightSignature, UseChartVisibilityManagerSignature<'pie'>, UseChartKeyboardNavigationSignature];
|
|
7
8
|
export declare const PIE_CHART_PLUGINS: ConvertSignaturesIntoPlugins<PieChartPluginSignatures>;
|
|
@@ -2,4 +2,5 @@ import { useChartInteraction } from "../internals/plugins/featurePlugins/useChar
|
|
|
2
2
|
import { useChartTooltip } from "../internals/plugins/featurePlugins/useChartTooltip/index.js";
|
|
3
3
|
import { useChartHighlight } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
4
4
|
import { useChartKeyboardNavigation } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
5
|
-
|
|
5
|
+
import { useChartVisibilityManager } from "../internals/plugins/featurePlugins/useChartVisibilityManager/index.js";
|
|
6
|
+
export const PIE_CHART_PLUGINS = [useChartTooltip, useChartInteraction, useChartHighlight, useChartVisibilityManager, useChartKeyboardNavigation];
|
|
@@ -25,7 +25,7 @@ export function useTransformData(series) {
|
|
|
25
25
|
const isHighlighted = isItemHighlighted(currentItem);
|
|
26
26
|
const isFaded = !isHighlighted && isItemFaded(currentItem);
|
|
27
27
|
const isFocused = isItemFocused({
|
|
28
|
-
|
|
28
|
+
type: 'pie',
|
|
29
29
|
seriesId,
|
|
30
30
|
dataIndex: itemIndex
|
|
31
31
|
});
|
|
@@ -5,6 +5,8 @@ import tooltipGetter from "./tooltip.js";
|
|
|
5
5
|
import seriesLayout from "./seriesLayout.js";
|
|
6
6
|
import getSeriesWithDefaultValues from "./getSeriesWithDefaultValues.js";
|
|
7
7
|
import tooltipItemPositionGetter from "./tooltipPosition.js";
|
|
8
|
+
import keyboardFocusHandler from "./keyboardFocusHandler.js";
|
|
9
|
+
import { identifierSerializerSeriesIdDataIndex } from "../../internals/identifierSerializer.js";
|
|
8
10
|
export const pieSeriesConfig = {
|
|
9
11
|
colorProcessor: getColor,
|
|
10
12
|
seriesProcessor,
|
|
@@ -12,5 +14,7 @@ export const pieSeriesConfig = {
|
|
|
12
14
|
legendGetter,
|
|
13
15
|
tooltipGetter,
|
|
14
16
|
tooltipItemPositionGetter,
|
|
15
|
-
getSeriesWithDefaultValues
|
|
17
|
+
getSeriesWithDefaultValues,
|
|
18
|
+
keyboardFocusHandler,
|
|
19
|
+
identifierSerializer: identifierSerializerSeriesIdDataIndex
|
|
16
20
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createGetNextIndexFocusedItem, createGetPreviousIndexFocusedItem, createGetNextSeriesFocusedItem, createGetPreviousSeriesFocusedItem } from "../../internals/commonNextFocusItem.js";
|
|
2
|
+
const outSeriesTypes = new Set(['pie']);
|
|
3
|
+
const keyboardFocusHandler = event => {
|
|
4
|
+
switch (event.key) {
|
|
5
|
+
case 'ArrowRight':
|
|
6
|
+
return createGetNextIndexFocusedItem(outSeriesTypes);
|
|
7
|
+
case 'ArrowLeft':
|
|
8
|
+
return createGetPreviousIndexFocusedItem(outSeriesTypes);
|
|
9
|
+
case 'ArrowDown':
|
|
10
|
+
return createGetPreviousSeriesFocusedItem(outSeriesTypes);
|
|
11
|
+
case 'ArrowUp':
|
|
12
|
+
return createGetNextSeriesFocusedItem(outSeriesTypes);
|
|
13
|
+
default:
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export default keyboardFocusHandler;
|
|
@@ -10,13 +10,16 @@ const legendGetter = params => {
|
|
|
10
10
|
if (formattedLabel === undefined) {
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
+
const id = item.id ?? dataIndex;
|
|
13
14
|
acc.push({
|
|
15
|
+
type: 'pie',
|
|
14
16
|
markType: item.labelMarkType ?? series[seriesId].labelMarkType,
|
|
15
|
-
id: item.id ?? dataIndex,
|
|
16
17
|
seriesId,
|
|
18
|
+
id,
|
|
19
|
+
itemId: id,
|
|
20
|
+
dataIndex,
|
|
17
21
|
color: item.color,
|
|
18
|
-
label: formattedLabel
|
|
19
|
-
itemId: item.id ?? dataIndex
|
|
22
|
+
label: formattedLabel
|
|
20
23
|
});
|
|
21
24
|
});
|
|
22
25
|
return acc;
|
|
@@ -84,6 +84,31 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
|
|
|
84
84
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
85
85
|
*/
|
|
86
86
|
height: PropTypes.number,
|
|
87
|
+
/**
|
|
88
|
+
* List of hidden series and/or items.
|
|
89
|
+
*
|
|
90
|
+
* Different chart types use different keys.
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* [
|
|
95
|
+
* {
|
|
96
|
+
* type: 'pie',
|
|
97
|
+
* seriesId: 'series-1',
|
|
98
|
+
* dataIndex: 3,
|
|
99
|
+
* },
|
|
100
|
+
* {
|
|
101
|
+
* type: 'line',
|
|
102
|
+
* seriesId: 'series-2',
|
|
103
|
+
* }
|
|
104
|
+
* ]
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
hiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
108
|
+
dataIndex: PropTypes.number,
|
|
109
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
110
|
+
type: PropTypes.oneOf(['radar']).isRequired
|
|
111
|
+
})),
|
|
87
112
|
/**
|
|
88
113
|
* If `true`, the legend is not rendered.
|
|
89
114
|
*/
|
|
@@ -140,6 +165,11 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
|
|
|
140
165
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
141
166
|
*/
|
|
142
167
|
onAxisClick: PropTypes.func,
|
|
168
|
+
/**
|
|
169
|
+
* Callback fired when any hidden identifiers change.
|
|
170
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
171
|
+
*/
|
|
172
|
+
onHiddenItemsChange: PropTypes.func,
|
|
143
173
|
/**
|
|
144
174
|
* The callback fired when the highlighted item changes.
|
|
145
175
|
*
|
|
@@ -2,5 +2,6 @@ import { type UseChartPolarAxisSignature } from "../internals/plugins/featurePlu
|
|
|
2
2
|
import { type UseChartTooltipSignature } from "../internals/plugins/featurePlugins/useChartTooltip/index.js";
|
|
3
3
|
import { type UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
4
4
|
import { type UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
5
|
-
|
|
6
|
-
export
|
|
5
|
+
import { type UseChartVisibilityManagerSignature } from "../internals/plugins/featurePlugins/useChartVisibilityManager/index.js";
|
|
6
|
+
export declare const RADAR_PLUGINS: readonly [import("../internals/index.js").ChartPlugin<UseChartTooltipSignature>, import("../internals/index.js").ChartPlugin<UseChartInteractionSignature>, import("../internals/index.js").ChartPlugin<UseChartPolarAxisSignature<any>>, import("../internals/index.js").ChartPlugin<UseChartHighlightSignature>, import("../internals/index.js").ChartPlugin<UseChartVisibilityManagerSignature<any>>];
|
|
7
|
+
export type RadarChartPluginSignatures = [UseChartTooltipSignature, UseChartInteractionSignature, UseChartPolarAxisSignature, UseChartHighlightSignature, UseChartVisibilityManagerSignature<'radar'>];
|