@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
|
@@ -16,8 +16,11 @@ var _animation = require("../internals/animation/animation");
|
|
|
16
16
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
17
17
|
var _markElementClasses = require("./markElementClasses");
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
const _excluded = ["x", "y", "id", "classes", "color", "dataIndex", "onClick", "skipAnimation", "isFaded", "isHighlighted"];
|
|
20
|
-
const Circle = (0, _styles.styled)('circle'
|
|
19
|
+
const _excluded = ["x", "y", "id", "classes", "color", "dataIndex", "onClick", "skipAnimation", "isFaded", "isHighlighted", "shape", "hidden"];
|
|
20
|
+
const Circle = (0, _styles.styled)('circle', {
|
|
21
|
+
slot: 'internal',
|
|
22
|
+
shouldForwardProp: undefined
|
|
23
|
+
})({
|
|
21
24
|
[`&.${_markElementClasses.markElementClasses.animate}`]: {
|
|
22
25
|
transitionDuration: `${_animation.ANIMATION_DURATION_MS}ms`,
|
|
23
26
|
transitionProperty: 'cx, cy, opacity',
|
|
@@ -49,6 +52,10 @@ function CircleMarkElement(props) {
|
|
|
49
52
|
skipAnimation,
|
|
50
53
|
isFaded = false,
|
|
51
54
|
isHighlighted = false
|
|
55
|
+
// @ts-expect-error, prevents it from being passed to the svg element
|
|
56
|
+
,
|
|
57
|
+
|
|
58
|
+
hidden
|
|
52
59
|
} = props,
|
|
53
60
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
54
61
|
const theme = (0, _styles.useTheme)();
|
|
@@ -62,7 +69,6 @@ function CircleMarkElement(props) {
|
|
|
62
69
|
classes: innerClasses,
|
|
63
70
|
isHighlighted,
|
|
64
71
|
isFaded,
|
|
65
|
-
color,
|
|
66
72
|
skipAnimation
|
|
67
73
|
};
|
|
68
74
|
const classes = (0, _markElementClasses.useUtilityClasses)(ownerState);
|
|
@@ -75,10 +81,12 @@ function CircleMarkElement(props) {
|
|
|
75
81
|
strokeWidth: 2,
|
|
76
82
|
className: classes.root,
|
|
77
83
|
onClick: onClick,
|
|
78
|
-
cursor: onClick ? 'pointer' : 'unset'
|
|
84
|
+
cursor: onClick ? 'pointer' : 'unset',
|
|
85
|
+
pointerEvents: hidden ? 'none' : undefined
|
|
79
86
|
}, interactionProps, {
|
|
80
87
|
"data-highlighted": isHighlighted || undefined,
|
|
81
|
-
"data-faded": isFaded || undefined
|
|
88
|
+
"data-faded": isFaded || undefined,
|
|
89
|
+
opacity: hidden ? 0 : 1
|
|
82
90
|
}));
|
|
83
91
|
}
|
|
84
92
|
process.env.NODE_ENV !== "production" ? CircleMarkElement.propTypes = {
|
|
@@ -22,10 +22,14 @@ 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
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
const series = lineSeries.series[focusedItem.seriesId];
|
|
29
|
+
if (series.data[focusedItem.dataIndex] == null) {
|
|
30
|
+
// Handle missing data
|
|
26
31
|
return null;
|
|
27
32
|
}
|
|
28
|
-
const series = lineSeries?.series[focusedItem.seriesId];
|
|
29
33
|
const xAxisId = series.xAxisId ?? xAxisIds[0];
|
|
30
34
|
const yAxisId = series.yAxisId ?? yAxisIds[0];
|
|
31
35
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("rect", {
|
package/LineChart/LineChart.js
CHANGED
|
@@ -145,6 +145,31 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
145
145
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
146
146
|
*/
|
|
147
147
|
height: _propTypes.default.number,
|
|
148
|
+
/**
|
|
149
|
+
* List of hidden series and/or items.
|
|
150
|
+
*
|
|
151
|
+
* Different chart types use different keys.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```ts
|
|
155
|
+
* [
|
|
156
|
+
* {
|
|
157
|
+
* type: 'pie',
|
|
158
|
+
* seriesId: 'series-1',
|
|
159
|
+
* dataIndex: 3,
|
|
160
|
+
* },
|
|
161
|
+
* {
|
|
162
|
+
* type: 'line',
|
|
163
|
+
* seriesId: 'series-2',
|
|
164
|
+
* }
|
|
165
|
+
* ]
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
hiddenItems: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
169
|
+
dataIndex: _propTypes.default.number,
|
|
170
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
171
|
+
type: _propTypes.default.oneOf(['line']).isRequired
|
|
172
|
+
})),
|
|
148
173
|
/**
|
|
149
174
|
* If `true`, the legend is not rendered.
|
|
150
175
|
*/
|
|
@@ -202,6 +227,11 @@ process.env.NODE_ENV !== "production" ? LineChart.propTypes = {
|
|
|
202
227
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
203
228
|
*/
|
|
204
229
|
onAxisClick: _propTypes.default.func,
|
|
230
|
+
/**
|
|
231
|
+
* Callback fired when any hidden identifiers change.
|
|
232
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
233
|
+
*/
|
|
234
|
+
onHiddenItemsChange: _propTypes.default.func,
|
|
205
235
|
/**
|
|
206
236
|
* The callback fired when the highlighted item changes.
|
|
207
237
|
*
|
|
@@ -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>;
|
|
@@ -11,4 +11,5 @@ var _useChartInteraction = require("../internals/plugins/featurePlugins/useChart
|
|
|
11
11
|
var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
|
|
12
12
|
var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
|
|
13
13
|
var _useChartBrush = require("../internals/plugins/featurePlugins/useChartBrush");
|
|
14
|
-
|
|
14
|
+
var _useChartVisibilityManager = require("../internals/plugins/featurePlugins/useChartVisibilityManager");
|
|
15
|
+
const LINE_CHART_PLUGINS = exports.LINE_CHART_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartBrush.useChartBrush, _useChartTooltip.useChartTooltip, _useChartInteraction.useChartInteraction, _useChartCartesianAxis.useChartCartesianAxis, _useChartHighlight.useChartHighlight, _useChartVisibilityManager.useChartVisibilityManager, _useChartKeyboardNavigation.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 {}
|
package/LineChart/LineElement.js
CHANGED
|
@@ -21,7 +21,7 @@ var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
|
21
21
|
var _AnimatedLine = require("./AnimatedLine");
|
|
22
22
|
var _useItemHighlighted = require("../hooks/useItemHighlighted");
|
|
23
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
|
-
const _excluded = ["id", "classes", "color", "gradientId", "slots", "slotProps", "onClick"];
|
|
24
|
+
const _excluded = ["id", "classes", "color", "gradientId", "slots", "slotProps", "onClick", "hidden"];
|
|
25
25
|
function getLineElementUtilityClass(slot) {
|
|
26
26
|
return (0, _generateUtilityClass.default)('MuiLineElement', slot);
|
|
27
27
|
}
|
|
@@ -56,7 +56,8 @@ function LineElement(props) {
|
|
|
56
56
|
gradientId,
|
|
57
57
|
slots,
|
|
58
58
|
slotProps,
|
|
59
|
-
onClick
|
|
59
|
+
onClick,
|
|
60
|
+
hidden
|
|
60
61
|
} = props,
|
|
61
62
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
62
63
|
const interactionProps = (0, _useInteractionItemProps.useInteractionItemProps)({
|
|
@@ -75,7 +76,8 @@ function LineElement(props) {
|
|
|
75
76
|
color,
|
|
76
77
|
gradientId,
|
|
77
78
|
isFaded,
|
|
78
|
-
isHighlighted
|
|
79
|
+
isHighlighted,
|
|
80
|
+
hidden
|
|
79
81
|
};
|
|
80
82
|
const classes = useUtilityClasses(ownerState);
|
|
81
83
|
const Line = slots?.line ?? _AnimatedLine.AnimatedLine;
|
|
@@ -100,6 +102,8 @@ process.env.NODE_ENV !== "production" ? LineElement.propTypes = {
|
|
|
100
102
|
color: _propTypes.default.string.isRequired,
|
|
101
103
|
d: _propTypes.default.string.isRequired,
|
|
102
104
|
gradientId: _propTypes.default.string,
|
|
105
|
+
/** If `true`, the line is hidden. */
|
|
106
|
+
hidden: _propTypes.default.bool,
|
|
103
107
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
104
108
|
/**
|
|
105
109
|
* 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
|
package/LineChart/MarkElement.js
CHANGED
|
@@ -18,17 +18,14 @@ var _getSymbol = require("../internals/getSymbol");
|
|
|
18
18
|
var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
19
19
|
var _markElementClasses = require("./markElementClasses");
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
const _excluded = ["x", "y", "id", "classes", "color", "shape", "dataIndex", "onClick", "skipAnimation", "isFaded", "isHighlighted"];
|
|
21
|
+
const _excluded = ["x", "y", "id", "classes", "color", "shape", "dataIndex", "onClick", "skipAnimation", "isFaded", "isHighlighted", "hidden", "style"];
|
|
22
22
|
const MarkElementPath = (0, _styles.styled)('path', {
|
|
23
23
|
name: 'MuiMarkElement',
|
|
24
24
|
slot: 'Root'
|
|
25
25
|
})(({
|
|
26
|
-
ownerState,
|
|
27
26
|
theme
|
|
28
27
|
}) => ({
|
|
29
28
|
fill: (theme.vars || theme).palette.background.paper,
|
|
30
|
-
stroke: ownerState.color,
|
|
31
|
-
strokeWidth: 2,
|
|
32
29
|
[`&.${_markElementClasses.markElementClasses.animate}`]: {
|
|
33
30
|
transitionDuration: `${_animation.ANIMATION_DURATION_MS}ms`,
|
|
34
31
|
transitionProperty: 'transform, transform-origin, opacity',
|
|
@@ -57,7 +54,9 @@ function MarkElement(props) {
|
|
|
57
54
|
onClick,
|
|
58
55
|
skipAnimation,
|
|
59
56
|
isFaded = false,
|
|
60
|
-
isHighlighted = false
|
|
57
|
+
isHighlighted = false,
|
|
58
|
+
hidden,
|
|
59
|
+
style
|
|
61
60
|
} = props,
|
|
62
61
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
63
62
|
const interactionProps = (0, _useInteractionItemProps.useInteractionItemProps)({
|
|
@@ -70,23 +69,26 @@ function MarkElement(props) {
|
|
|
70
69
|
classes: innerClasses,
|
|
71
70
|
isHighlighted,
|
|
72
71
|
isFaded,
|
|
73
|
-
color,
|
|
74
72
|
skipAnimation
|
|
75
73
|
};
|
|
76
74
|
const classes = (0, _markElementClasses.useUtilityClasses)(ownerState);
|
|
77
75
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MarkElementPath, (0, _extends2.default)({}, other, {
|
|
78
|
-
style: {
|
|
76
|
+
style: (0, _extends2.default)({}, style, {
|
|
79
77
|
transform: `translate(${x}px, ${y}px)`,
|
|
80
78
|
transformOrigin: `${x}px ${y}px`
|
|
81
|
-
},
|
|
79
|
+
}),
|
|
82
80
|
ownerState: ownerState,
|
|
83
81
|
className: classes.root,
|
|
84
82
|
d: (0, _d3Shape.symbol)(_d3Shape.symbolsFill[(0, _getSymbol.getSymbol)(shape)])(),
|
|
85
83
|
onClick: onClick,
|
|
86
|
-
cursor: onClick ? 'pointer' : 'unset'
|
|
84
|
+
cursor: onClick ? 'pointer' : 'unset',
|
|
85
|
+
pointerEvents: hidden ? 'none' : undefined
|
|
87
86
|
}, interactionProps, {
|
|
88
87
|
"data-highlighted": isHighlighted || undefined,
|
|
89
|
-
"data-faded": isFaded || undefined
|
|
88
|
+
"data-faded": isFaded || undefined,
|
|
89
|
+
opacity: hidden ? 0 : 1,
|
|
90
|
+
strokeWidth: 2,
|
|
91
|
+
stroke: color
|
|
90
92
|
}));
|
|
91
93
|
}
|
|
92
94
|
process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
|
|
@@ -99,6 +101,11 @@ process.env.NODE_ENV !== "production" ? MarkElement.propTypes = {
|
|
|
99
101
|
* The index to the element in the series' data array.
|
|
100
102
|
*/
|
|
101
103
|
dataIndex: _propTypes.default.number.isRequired,
|
|
104
|
+
/**
|
|
105
|
+
* If `true`, the marker is hidden.
|
|
106
|
+
* @default false
|
|
107
|
+
*/
|
|
108
|
+
hidden: _propTypes.default.bool,
|
|
102
109
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
103
110
|
/**
|
|
104
111
|
* 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>;
|
|
@@ -13,6 +13,8 @@ var _legend = _interopRequireDefault(require("./legend"));
|
|
|
13
13
|
var _tooltip = _interopRequireWildcard(require("./tooltip"));
|
|
14
14
|
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
|
|
15
15
|
var _tooltipPosition = _interopRequireDefault(require("./tooltipPosition"));
|
|
16
|
+
var _keyboardFocusHandler = _interopRequireDefault(require("./keyboardFocusHandler"));
|
|
17
|
+
var _identifierSerializer = require("../../internals/identifierSerializer");
|
|
16
18
|
const lineSeriesConfig = exports.lineSeriesConfig = {
|
|
17
19
|
colorProcessor: _getColor.default,
|
|
18
20
|
seriesProcessor: _seriesProcessor.default,
|
|
@@ -22,5 +24,7 @@ const lineSeriesConfig = exports.lineSeriesConfig = {
|
|
|
22
24
|
axisTooltipGetter: _tooltip.axisTooltipGetter,
|
|
23
25
|
xExtremumGetter: _extremums.getExtremumX,
|
|
24
26
|
yExtremumGetter: _extremums.getExtremumY,
|
|
25
|
-
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default
|
|
27
|
+
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
|
|
28
|
+
keyboardFocusHandler: _keyboardFocusHandler.default,
|
|
29
|
+
identifierSerializer: _identifierSerializer.identifierSerializerSeriesIdDataIndex
|
|
26
30
|
};
|
|
@@ -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,13 +8,13 @@ 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 seriesProcessor = (params, dataset) => {
|
|
13
13
|
const {
|
|
14
14
|
seriesOrder,
|
|
15
15
|
series
|
|
16
16
|
} = params;
|
|
17
|
-
const stackingGroups = (0,
|
|
17
|
+
const stackingGroups = (0, _stacking.getStackingGroups)((0, _extends2.default)({}, params, {
|
|
18
18
|
defaultStrategy: {
|
|
19
19
|
stackOffset: 'none'
|
|
20
20
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
9
|
exports.FocusedPieArc = FocusedPieArc;
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
12
|
var React = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _styles = require("@mui/material/styles");
|
|
13
14
|
var _useFocusedItem = require("../hooks/useFocusedItem");
|
|
@@ -16,6 +17,7 @@ var _PieArc = require("./PieArc");
|
|
|
16
17
|
var _useItemHighlighted = require("../hooks/useItemHighlighted");
|
|
17
18
|
var _getModifiedArcProperties = require("./dataTransform/getModifiedArcProperties");
|
|
18
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
+
const _excluded = ["arcLabelRadius"];
|
|
19
21
|
function FocusedPieArc(props) {
|
|
20
22
|
const theme = (0, _styles.useTheme)();
|
|
21
23
|
const focusedItem = (0, _useFocusedItem.useFocusedItem)();
|
|
@@ -25,7 +27,7 @@ function FocusedPieArc(props) {
|
|
|
25
27
|
isFaded
|
|
26
28
|
} = (0, _useItemHighlighted.useItemHighlighted)(focusedItem);
|
|
27
29
|
const pieSeries = (0, _usePieSeries.usePieSeriesContext)();
|
|
28
|
-
if (focusedItem === null || focusedItem.
|
|
30
|
+
if (focusedItem === null || focusedItem.type !== 'pie' || !pieSeries) {
|
|
29
31
|
return null;
|
|
30
32
|
}
|
|
31
33
|
const series = pieSeries?.series[focusedItem.seriesId];
|
|
@@ -37,7 +39,8 @@ function FocusedPieArc(props) {
|
|
|
37
39
|
return null;
|
|
38
40
|
}
|
|
39
41
|
const item = series.data[focusedItem.dataIndex];
|
|
40
|
-
const
|
|
42
|
+
const _getModifiedArcProper = (0, _getModifiedArcProperties.getModifiedArcProperties)(series, pieSeriesLayout[focusedItem.seriesId], isHighlighted, isFaded),
|
|
43
|
+
arcSizes = (0, _objectWithoutPropertiesLoose2.default)(_getModifiedArcProper, _excluded);
|
|
41
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PieArc.PieArc, (0, _extends2.default)({
|
|
42
45
|
transform: `translate(${pieSeriesLayout[series.id].center.x}, ${pieSeriesLayout[series.id].center.y})`,
|
|
43
46
|
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 };
|
package/PieChart/PieArcLabel.js
CHANGED
|
@@ -20,7 +20,7 @@ var _generateUtilityClasses = _interopRequireDefault(require("@mui/utils/generat
|
|
|
20
20
|
var _animation = require("../internals/animation/animation");
|
|
21
21
|
var _useAnimatePieArcLabel = require("../hooks/animation/useAnimatePieArcLabel");
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "arcLabelRadius", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "skipAnimation"];
|
|
23
|
+
const _excluded = ["id", "classes", "color", "startAngle", "endAngle", "paddingAngle", "arcLabelRadius", "innerRadius", "outerRadius", "cornerRadius", "formattedArcLabel", "isHighlighted", "isFaded", "skipAnimation", "hidden"];
|
|
24
24
|
function getPieArcLabelUtilityClass(slot) {
|
|
25
25
|
return (0, _generateUtilityClass.default)('MuiPieArcLabel', slot);
|
|
26
26
|
}
|
|
@@ -76,7 +76,8 @@ const PieArcLabel = exports.PieArcLabel = /*#__PURE__*/React.forwardRef(function
|
|
|
76
76
|
formattedArcLabel,
|
|
77
77
|
isHighlighted,
|
|
78
78
|
isFaded,
|
|
79
|
-
skipAnimation
|
|
79
|
+
skipAnimation,
|
|
80
|
+
hidden
|
|
80
81
|
} = props,
|
|
81
82
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
82
83
|
const ownerState = {
|
|
@@ -101,6 +102,7 @@ const PieArcLabel = exports.PieArcLabel = /*#__PURE__*/React.forwardRef(function
|
|
|
101
102
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PieArcLabelRoot, (0, _extends2.default)({
|
|
102
103
|
className: classes.root
|
|
103
104
|
}, other, animatedProps, {
|
|
105
|
+
opacity: hidden ? 0 : 1,
|
|
104
106
|
children: formattedArcLabel
|
|
105
107
|
}));
|
|
106
108
|
});
|
|
@@ -116,6 +118,7 @@ process.env.NODE_ENV !== "production" ? PieArcLabel.propTypes = {
|
|
|
116
118
|
cornerRadius: _propTypes.default.number.isRequired,
|
|
117
119
|
endAngle: _propTypes.default.number.isRequired,
|
|
118
120
|
formattedArcLabel: _propTypes.default.string,
|
|
121
|
+
hidden: _propTypes.default.bool,
|
|
119
122
|
id: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]).isRequired,
|
|
120
123
|
innerRadius: _propTypes.default.number.isRequired,
|
|
121
124
|
isFaded: _propTypes.default.bool.isRequired,
|
package/PieChart/PieChart.js
CHANGED
|
@@ -80,15 +80,15 @@ const PieChart = exports.PieChart = /*#__PURE__*/React.forwardRef(function PieCh
|
|
|
80
80
|
plugins: _PieChart2.PIE_CHART_PLUGINS
|
|
81
81
|
}), ref);
|
|
82
82
|
const Tooltip = slots?.tooltip ?? _ChartsTooltip.ChartsTooltip;
|
|
83
|
-
const Toolbar =
|
|
83
|
+
const Toolbar = slots?.toolbar;
|
|
84
84
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartDataProvider.ChartDataProvider, (0, _extends2.default)({}, chartDataProviderProps, {
|
|
85
85
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsWrapper.ChartsWrapper, {
|
|
86
|
-
legendPosition:
|
|
87
|
-
legendDirection:
|
|
86
|
+
legendPosition: slotProps?.legend?.position,
|
|
87
|
+
legendDirection: slotProps?.legend?.direction ?? 'vertical',
|
|
88
88
|
sx: sx,
|
|
89
89
|
hideLegend: hideLegend ?? false,
|
|
90
|
-
children: [showToolbar && Toolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({},
|
|
91
|
-
direction:
|
|
90
|
+
children: [showToolbar && Toolbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Toolbar, (0, _extends2.default)({}, slotProps?.toolbar)) : null, !hideLegend && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsLegend.ChartsLegend, {
|
|
91
|
+
direction: slotProps?.legend?.direction ?? 'vertical',
|
|
92
92
|
slots: slots,
|
|
93
93
|
slotProps: slotProps
|
|
94
94
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChartsSurface.ChartsSurface, (0, _extends2.default)({}, chartsSurfaceProps, {
|
|
@@ -133,6 +133,31 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
133
133
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
134
134
|
*/
|
|
135
135
|
height: _propTypes.default.number,
|
|
136
|
+
/**
|
|
137
|
+
* List of hidden series and/or items.
|
|
138
|
+
*
|
|
139
|
+
* Different chart types use different keys.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* [
|
|
144
|
+
* {
|
|
145
|
+
* type: 'pie',
|
|
146
|
+
* seriesId: 'series-1',
|
|
147
|
+
* dataIndex: 3,
|
|
148
|
+
* },
|
|
149
|
+
* {
|
|
150
|
+
* type: 'line',
|
|
151
|
+
* seriesId: 'series-2',
|
|
152
|
+
* }
|
|
153
|
+
* ]
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
hiddenItems: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
157
|
+
dataIndex: _propTypes.default.number,
|
|
158
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
159
|
+
type: _propTypes.default.oneOf(['pie']).isRequired
|
|
160
|
+
})),
|
|
136
161
|
/**
|
|
137
162
|
* If `true`, the legend is not rendered.
|
|
138
163
|
*/
|
|
@@ -171,6 +196,11 @@ process.env.NODE_ENV !== "production" ? PieChart.propTypes = {
|
|
|
171
196
|
right: _propTypes.default.number,
|
|
172
197
|
top: _propTypes.default.number
|
|
173
198
|
})]),
|
|
199
|
+
/**
|
|
200
|
+
* Callback fired when any hidden identifiers change.
|
|
201
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
202
|
+
*/
|
|
203
|
+
onHiddenItemsChange: _propTypes.default.func,
|
|
174
204
|
/**
|
|
175
205
|
* The callback fired when the highlighted item changes.
|
|
176
206
|
*
|
|
@@ -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>;
|
|
@@ -8,4 +8,5 @@ var _useChartInteraction = require("../internals/plugins/featurePlugins/useChart
|
|
|
8
8
|
var _useChartTooltip = require("../internals/plugins/featurePlugins/useChartTooltip");
|
|
9
9
|
var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
|
|
10
10
|
var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
|
|
11
|
-
|
|
11
|
+
var _useChartVisibilityManager = require("../internals/plugins/featurePlugins/useChartVisibilityManager");
|
|
12
|
+
const PIE_CHART_PLUGINS = exports.PIE_CHART_PLUGINS = [_useChartTooltip.useChartTooltip, _useChartInteraction.useChartInteraction, _useChartHighlight.useChartHighlight, _useChartVisibilityManager.useChartVisibilityManager, _useChartKeyboardNavigation.useChartKeyboardNavigation];
|
|
@@ -32,7 +32,7 @@ function useTransformData(series) {
|
|
|
32
32
|
const isHighlighted = isItemHighlighted(currentItem);
|
|
33
33
|
const isFaded = !isHighlighted && isItemFaded(currentItem);
|
|
34
34
|
const isFocused = isItemFocused({
|
|
35
|
-
|
|
35
|
+
type: 'pie',
|
|
36
36
|
seriesId,
|
|
37
37
|
dataIndex: itemIndex
|
|
38
38
|
});
|
|
@@ -12,6 +12,8 @@ var _tooltip = _interopRequireDefault(require("./tooltip"));
|
|
|
12
12
|
var _seriesLayout = _interopRequireDefault(require("./seriesLayout"));
|
|
13
13
|
var _getSeriesWithDefaultValues = _interopRequireDefault(require("./getSeriesWithDefaultValues"));
|
|
14
14
|
var _tooltipPosition = _interopRequireDefault(require("./tooltipPosition"));
|
|
15
|
+
var _keyboardFocusHandler = _interopRequireDefault(require("./keyboardFocusHandler"));
|
|
16
|
+
var _identifierSerializer = require("../../internals/identifierSerializer");
|
|
15
17
|
const pieSeriesConfig = exports.pieSeriesConfig = {
|
|
16
18
|
colorProcessor: _getColor.default,
|
|
17
19
|
seriesProcessor: _seriesProcessor.default,
|
|
@@ -19,5 +21,7 @@ const pieSeriesConfig = exports.pieSeriesConfig = {
|
|
|
19
21
|
legendGetter: _legend.default,
|
|
20
22
|
tooltipGetter: _tooltip.default,
|
|
21
23
|
tooltipItemPositionGetter: _tooltipPosition.default,
|
|
22
|
-
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default
|
|
24
|
+
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
|
|
25
|
+
keyboardFocusHandler: _keyboardFocusHandler.default,
|
|
26
|
+
identifierSerializer: _identifierSerializer.identifierSerializerSeriesIdDataIndex
|
|
23
27
|
};
|
|
@@ -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(['pie']);
|
|
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;
|
|
@@ -16,13 +16,16 @@ const legendGetter = params => {
|
|
|
16
16
|
if (formattedLabel === undefined) {
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
+
const id = item.id ?? dataIndex;
|
|
19
20
|
acc.push({
|
|
21
|
+
type: 'pie',
|
|
20
22
|
markType: item.labelMarkType ?? series[seriesId].labelMarkType,
|
|
21
|
-
id: item.id ?? dataIndex,
|
|
22
23
|
seriesId,
|
|
24
|
+
id,
|
|
25
|
+
itemId: id,
|
|
26
|
+
dataIndex,
|
|
23
27
|
color: item.color,
|
|
24
|
-
label: formattedLabel
|
|
25
|
-
itemId: item.id ?? dataIndex
|
|
28
|
+
label: formattedLabel
|
|
26
29
|
});
|
|
27
30
|
});
|
|
28
31
|
return acc;
|