@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
package/RadarChart/RadarChart.js
CHANGED
|
@@ -91,6 +91,31 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
|
|
|
91
91
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
92
92
|
*/
|
|
93
93
|
height: _propTypes.default.number,
|
|
94
|
+
/**
|
|
95
|
+
* List of hidden series and/or items.
|
|
96
|
+
*
|
|
97
|
+
* Different chart types use different keys.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* [
|
|
102
|
+
* {
|
|
103
|
+
* type: 'pie',
|
|
104
|
+
* seriesId: 'series-1',
|
|
105
|
+
* dataIndex: 3,
|
|
106
|
+
* },
|
|
107
|
+
* {
|
|
108
|
+
* type: 'line',
|
|
109
|
+
* seriesId: 'series-2',
|
|
110
|
+
* }
|
|
111
|
+
* ]
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
hiddenItems: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
115
|
+
dataIndex: _propTypes.default.number,
|
|
116
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
117
|
+
type: _propTypes.default.oneOf(['radar']).isRequired
|
|
118
|
+
})),
|
|
94
119
|
/**
|
|
95
120
|
* If `true`, the legend is not rendered.
|
|
96
121
|
*/
|
|
@@ -147,6 +172,11 @@ process.env.NODE_ENV !== "production" ? RadarChart.propTypes = {
|
|
|
147
172
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
148
173
|
*/
|
|
149
174
|
onAxisClick: _propTypes.default.func,
|
|
175
|
+
/**
|
|
176
|
+
* Callback fired when any hidden identifiers change.
|
|
177
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
178
|
+
*/
|
|
179
|
+
onHiddenItemsChange: _propTypes.default.func,
|
|
150
180
|
/**
|
|
151
181
|
* The callback fired when the highlighted item changes.
|
|
152
182
|
*
|
|
@@ -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'>];
|
|
@@ -8,4 +8,5 @@ var _useChartPolarAxis = require("../internals/plugins/featurePlugins/useChartPo
|
|
|
8
8
|
var _useChartTooltip = require("../internals/plugins/featurePlugins/useChartTooltip");
|
|
9
9
|
var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
|
|
10
10
|
var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
|
|
11
|
-
|
|
11
|
+
var _useChartVisibilityManager = require("../internals/plugins/featurePlugins/useChartVisibilityManager");
|
|
12
|
+
const RADAR_PLUGINS = exports.RADAR_PLUGINS = [_useChartTooltip.useChartTooltip, _useChartInteraction.useChartInteraction, _useChartPolarAxis.useChartPolarAxis, _useChartHighlight.useChartHighlight, _useChartVisibilityManager.useChartVisibilityManager];
|
|
@@ -13,6 +13,7 @@ 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 _identifierSerializer = require("../../internals/identifierSerializer");
|
|
16
17
|
const radarSeriesConfig = exports.radarSeriesConfig = {
|
|
17
18
|
colorProcessor: _getColor.default,
|
|
18
19
|
seriesProcessor: _seriesProcessor.default,
|
|
@@ -22,5 +23,6 @@ const radarSeriesConfig = exports.radarSeriesConfig = {
|
|
|
22
23
|
axisTooltipGetter: _tooltip.axisTooltipGetter,
|
|
23
24
|
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
|
|
24
25
|
radiusExtremumGetter: _extremums.radiusExtremumGetter,
|
|
25
|
-
rotationExtremumGetter: _extremums.rotationExtremumGetter
|
|
26
|
+
rotationExtremumGetter: _extremums.rotationExtremumGetter,
|
|
27
|
+
identifierSerializer: _identifierSerializer.identifierSerializerSeriesIdDataIndex
|
|
26
28
|
};
|
|
@@ -12,21 +12,12 @@ var _scatterClasses = require("./scatterClasses");
|
|
|
12
12
|
var _ChartProvider = require("../context/ChartProvider");
|
|
13
13
|
var _useScale = require("../hooks/useScale");
|
|
14
14
|
var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
|
|
15
|
+
var _appendAtKey = require("../internals/appendAtKey");
|
|
15
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
17
|
const MAX_POINTS_PER_PATH = 1000;
|
|
17
18
|
/* In an SVG arc, if the arc starts and ends at the same point, it is not rendered, so we add a tiny
|
|
18
19
|
* value to one of the coordinates to ensure that the arc is rendered. */
|
|
19
20
|
const ALMOST_ZERO = 0.01;
|
|
20
|
-
function appendAtKey(map, key, value) {
|
|
21
|
-
let bucket = map.get(key);
|
|
22
|
-
if (!bucket) {
|
|
23
|
-
bucket = [value];
|
|
24
|
-
map.set(key, bucket);
|
|
25
|
-
} else {
|
|
26
|
-
bucket.push(value);
|
|
27
|
-
}
|
|
28
|
-
return bucket;
|
|
29
|
-
}
|
|
30
21
|
function createPath(x, y, markerSize) {
|
|
31
22
|
return `M${x - markerSize} ${y} a${markerSize} ${markerSize} 0 1 1 0 ${ALMOST_ZERO}`;
|
|
32
23
|
}
|
|
@@ -47,15 +38,15 @@ function useCreatePaths(seriesData, markerSize, xScale, yScale, color, colorGett
|
|
|
47
38
|
}
|
|
48
39
|
const path = createPath(x, y, markerSize);
|
|
49
40
|
const fill = colorGetter ? colorGetter(i) : color;
|
|
50
|
-
const tempPath = appendAtKey(temporaryPaths, fill, path);
|
|
41
|
+
const tempPath = (0, _appendAtKey.appendAtKey)(temporaryPaths, fill, path);
|
|
51
42
|
if (tempPath.length >= MAX_POINTS_PER_PATH) {
|
|
52
|
-
appendAtKey(paths, fill, tempPath.join(''));
|
|
43
|
+
(0, _appendAtKey.appendAtKey)(paths, fill, tempPath.join(''));
|
|
53
44
|
temporaryPaths.delete(fill);
|
|
54
45
|
}
|
|
55
46
|
}
|
|
56
47
|
for (const [fill, tempPath] of temporaryPaths.entries()) {
|
|
57
48
|
if (tempPath.length > 0) {
|
|
58
|
-
appendAtKey(paths, fill, tempPath.join(''));
|
|
49
|
+
(0, _appendAtKey.appendAtKey)(paths, fill, tempPath.join(''));
|
|
59
50
|
}
|
|
60
51
|
}
|
|
61
52
|
return paths;
|
|
@@ -87,7 +78,10 @@ function BatchScatterPaths(props) {
|
|
|
87
78
|
}
|
|
88
79
|
const MemoBatchScatterPaths = /*#__PURE__*/React.memo(BatchScatterPaths);
|
|
89
80
|
if (process.env.NODE_ENV !== "production") MemoBatchScatterPaths.displayName = "MemoBatchScatterPaths";
|
|
90
|
-
const Group = (0, _styles.styled)('g'
|
|
81
|
+
const Group = (0, _styles.styled)('g', {
|
|
82
|
+
slot: 'internal',
|
|
83
|
+
shouldForwardProp: undefined
|
|
84
|
+
})({
|
|
91
85
|
'&[data-faded="true"]': {
|
|
92
86
|
opacity: 0.3
|
|
93
87
|
},
|
|
@@ -25,7 +25,7 @@ function FocusedScatterMark(props) {
|
|
|
25
25
|
yAxis,
|
|
26
26
|
yAxisIds
|
|
27
27
|
} = (0, _hooks.useYAxes)();
|
|
28
|
-
if (focusedItem === null || focusedItem.
|
|
28
|
+
if (focusedItem === null || focusedItem.type !== 'scatter' || !scatterSeries) {
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
31
31
|
const series = scatterSeries?.series[focusedItem.seriesId];
|
|
@@ -131,6 +131,31 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
131
131
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
132
132
|
*/
|
|
133
133
|
height: _propTypes.default.number,
|
|
134
|
+
/**
|
|
135
|
+
* List of hidden series and/or items.
|
|
136
|
+
*
|
|
137
|
+
* Different chart types use different keys.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```ts
|
|
141
|
+
* [
|
|
142
|
+
* {
|
|
143
|
+
* type: 'pie',
|
|
144
|
+
* seriesId: 'series-1',
|
|
145
|
+
* dataIndex: 3,
|
|
146
|
+
* },
|
|
147
|
+
* {
|
|
148
|
+
* type: 'line',
|
|
149
|
+
* seriesId: 'series-2',
|
|
150
|
+
* }
|
|
151
|
+
* ]
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
hiddenItems: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
155
|
+
dataIndex: _propTypes.default.number,
|
|
156
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
157
|
+
type: _propTypes.default.oneOf(['scatter']).isRequired
|
|
158
|
+
})),
|
|
134
159
|
/**
|
|
135
160
|
* If `true`, the legend is not rendered.
|
|
136
161
|
*/
|
|
@@ -176,6 +201,11 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
176
201
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
177
202
|
*/
|
|
178
203
|
onAxisClick: _propTypes.default.func,
|
|
204
|
+
/**
|
|
205
|
+
* Callback fired when any hidden identifiers change.
|
|
206
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
207
|
+
*/
|
|
208
|
+
onHiddenItemsChange: _propTypes.default.func,
|
|
179
209
|
/**
|
|
180
210
|
* The callback fired when the highlighted item changes.
|
|
181
211
|
*
|
|
@@ -7,5 +7,6 @@ import { type ConvertSignaturesIntoPlugins } from "../internals/plugins/models/h
|
|
|
7
7
|
import { type UseChartClosestPointSignature } from "../internals/plugins/featurePlugins/useChartClosestPoint/index.js";
|
|
8
8
|
import { type UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
9
9
|
import { type UseChartBrushSignature } from "../internals/plugins/featurePlugins/useChartBrush/index.js";
|
|
10
|
-
|
|
10
|
+
import { type UseChartVisibilityManagerSignature } from "../internals/plugins/featurePlugins/useChartVisibilityManager/index.js";
|
|
11
|
+
export type ScatterChartPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartHighlightSignature, UseChartVisibilityManagerSignature<'scatter'>, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
|
|
11
12
|
export declare const SCATTER_CHART_PLUGINS: ConvertSignaturesIntoPlugins<ScatterChartPluginSignatures>;
|
|
@@ -12,4 +12,5 @@ var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHi
|
|
|
12
12
|
var _useChartClosestPoint = require("../internals/plugins/featurePlugins/useChartClosestPoint");
|
|
13
13
|
var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
|
|
14
14
|
var _useChartBrush = require("../internals/plugins/featurePlugins/useChartBrush");
|
|
15
|
-
|
|
15
|
+
var _useChartVisibilityManager = require("../internals/plugins/featurePlugins/useChartVisibilityManager");
|
|
16
|
+
const SCATTER_CHART_PLUGINS = exports.SCATTER_CHART_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartBrush.useChartBrush, _useChartTooltip.useChartTooltip, _useChartInteraction.useChartInteraction, _useChartCartesianAxis.useChartCartesianAxis, _useChartHighlight.useChartHighlight, _useChartVisibilityManager.useChartVisibilityManager, _useChartClosestPoint.useChartClosestPoint, _useChartKeyboardNavigation.useChartKeyboardNavigation];
|
|
@@ -12,6 +12,8 @@ var _legend = _interopRequireDefault(require("./legend"));
|
|
|
12
12
|
var _tooltip = _interopRequireDefault(require("./tooltip"));
|
|
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 scatterSeriesConfig = exports.scatterSeriesConfig = {
|
|
16
18
|
seriesProcessor: _seriesProcessor.default,
|
|
17
19
|
colorProcessor: _getColor.default,
|
|
@@ -20,5 +22,7 @@ const scatterSeriesConfig = exports.scatterSeriesConfig = {
|
|
|
20
22
|
tooltipItemPositionGetter: _tooltipPosition.default,
|
|
21
23
|
xExtremumGetter: _extremums.getExtremumX,
|
|
22
24
|
yExtremumGetter: _extremums.getExtremumY,
|
|
23
|
-
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default
|
|
25
|
+
getSeriesWithDefaultValues: _getSeriesWithDefaultValues.default,
|
|
26
|
+
keyboardFocusHandler: _keyboardFocusHandler.default,
|
|
27
|
+
identifierSerializer: _identifierSerializer.identifierSerializerSeriesIdDataIndex
|
|
24
28
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { KeyboardFocusHandler } from "../../internals/plugins/featurePlugins/useChartKeyboardNavigation/keyboardFocusHandler.types.js";
|
|
2
|
+
declare const keyboardFocusHandler: KeyboardFocusHandler<'scatter', 'bar' | 'line' | 'scatter'>;
|
|
3
|
+
export default keyboardFocusHandler;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _commonNextFocusItem = require("../../internals/commonNextFocusItem");
|
|
8
|
+
const outSeriesTypes = new Set(['bar', 'line', 'scatter']);
|
|
9
|
+
const keyboardFocusHandler = event => {
|
|
10
|
+
switch (event.key) {
|
|
11
|
+
case 'ArrowRight':
|
|
12
|
+
return (0, _commonNextFocusItem.createGetNextIndexFocusedItem)(outSeriesTypes);
|
|
13
|
+
case 'ArrowLeft':
|
|
14
|
+
return (0, _commonNextFocusItem.createGetPreviousIndexFocusedItem)(outSeriesTypes);
|
|
15
|
+
case 'ArrowDown':
|
|
16
|
+
return (0, _commonNextFocusItem.createGetPreviousSeriesFocusedItem)(outSeriesTypes);
|
|
17
|
+
case 'ArrowUp':
|
|
18
|
+
return (0, _commonNextFocusItem.createGetNextSeriesFocusedItem)(outSeriesTypes);
|
|
19
|
+
default:
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var _default = exports.default = keyboardFocusHandler;
|
|
@@ -248,6 +248,47 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
248
248
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
249
249
|
*/
|
|
250
250
|
height: _propTypes.default.number,
|
|
251
|
+
/**
|
|
252
|
+
* List of hidden series and/or items.
|
|
253
|
+
*
|
|
254
|
+
* Different chart types use different keys.
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* ```ts
|
|
258
|
+
* [
|
|
259
|
+
* {
|
|
260
|
+
* type: 'pie',
|
|
261
|
+
* seriesId: 'series-1',
|
|
262
|
+
* dataIndex: 3,
|
|
263
|
+
* },
|
|
264
|
+
* {
|
|
265
|
+
* type: 'line',
|
|
266
|
+
* seriesId: 'series-2',
|
|
267
|
+
* }
|
|
268
|
+
* ]
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
271
|
+
hiddenItems: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.shape({
|
|
272
|
+
dataIndex: _propTypes.default.number,
|
|
273
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
274
|
+
type: _propTypes.default.oneOf(['bar']).isRequired
|
|
275
|
+
}), _propTypes.default.shape({
|
|
276
|
+
dataIndex: _propTypes.default.number,
|
|
277
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
278
|
+
type: _propTypes.default.oneOf(['line']).isRequired
|
|
279
|
+
}), _propTypes.default.shape({
|
|
280
|
+
dataIndex: _propTypes.default.number,
|
|
281
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
282
|
+
type: _propTypes.default.oneOf(['scatter']).isRequired
|
|
283
|
+
}), _propTypes.default.shape({
|
|
284
|
+
dataIndex: _propTypes.default.number,
|
|
285
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
286
|
+
type: _propTypes.default.oneOf(['pie']).isRequired
|
|
287
|
+
}), _propTypes.default.shape({
|
|
288
|
+
dataIndex: _propTypes.default.number,
|
|
289
|
+
seriesId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
290
|
+
type: _propTypes.default.oneOf(['radar']).isRequired
|
|
291
|
+
})]).isRequired),
|
|
251
292
|
/**
|
|
252
293
|
* The controlled axis highlight.
|
|
253
294
|
* Identified by the axis id, and data index.
|
|
@@ -293,6 +334,11 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
293
334
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
294
335
|
*/
|
|
295
336
|
onAxisClick: _propTypes.default.func,
|
|
337
|
+
/**
|
|
338
|
+
* Callback fired when any hidden identifiers change.
|
|
339
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
340
|
+
*/
|
|
341
|
+
onHiddenItemsChange: _propTypes.default.func,
|
|
296
342
|
/**
|
|
297
343
|
* The callback fired when the highlighted item changes.
|
|
298
344
|
*
|
package/esm/BarChart/BarChart.js
CHANGED
|
@@ -134,6 +134,31 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
134
134
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
135
135
|
*/
|
|
136
136
|
height: PropTypes.number,
|
|
137
|
+
/**
|
|
138
|
+
* List of hidden series and/or items.
|
|
139
|
+
*
|
|
140
|
+
* Different chart types use different keys.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```ts
|
|
144
|
+
* [
|
|
145
|
+
* {
|
|
146
|
+
* type: 'pie',
|
|
147
|
+
* seriesId: 'series-1',
|
|
148
|
+
* dataIndex: 3,
|
|
149
|
+
* },
|
|
150
|
+
* {
|
|
151
|
+
* type: 'line',
|
|
152
|
+
* seriesId: 'series-2',
|
|
153
|
+
* }
|
|
154
|
+
* ]
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
hiddenItems: PropTypes.arrayOf(PropTypes.shape({
|
|
158
|
+
dataIndex: PropTypes.number,
|
|
159
|
+
seriesId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
160
|
+
type: PropTypes.oneOf(['bar']).isRequired
|
|
161
|
+
})),
|
|
137
162
|
/**
|
|
138
163
|
* If `true`, the legend is not rendered.
|
|
139
164
|
*/
|
|
@@ -192,6 +217,11 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
192
217
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
193
218
|
*/
|
|
194
219
|
onAxisClick: PropTypes.func,
|
|
220
|
+
/**
|
|
221
|
+
* Callback fired when any hidden identifiers change.
|
|
222
|
+
* @param {VisibilityIdentifier[]} hiddenItems The new list of hidden identifiers.
|
|
223
|
+
*/
|
|
224
|
+
onHiddenItemsChange: PropTypes.func,
|
|
195
225
|
/**
|
|
196
226
|
* The callback fired when the highlighted item changes.
|
|
197
227
|
*
|
|
@@ -212,6 +242,15 @@ process.env.NODE_ENV !== "production" ? BarChart.propTypes = {
|
|
|
212
242
|
* @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
|
|
213
243
|
*/
|
|
214
244
|
onItemClick: PropTypes.func,
|
|
245
|
+
/**
|
|
246
|
+
* The type of renderer to use for the bar plot.
|
|
247
|
+
* - `svg-single`: Renders every bar in a `<rect />` element.
|
|
248
|
+
* - `svg-batch`: Batch renders bars in `<path />` elements for better performance with large datasets, at the cost of some limitations.
|
|
249
|
+
* Read more: https://mui.com/x/react-charts/bars/#performance
|
|
250
|
+
*
|
|
251
|
+
* @default 'svg-single'
|
|
252
|
+
*/
|
|
253
|
+
renderer: PropTypes.oneOf(['svg-batch', 'svg-single']),
|
|
215
254
|
/**
|
|
216
255
|
* The series to display in the bar chart.
|
|
217
256
|
* An array of [[BarSeries]] objects.
|
|
@@ -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 BarChartPluginSignatures = [UseChartZAxisSignature, UseChartBrushSignature, UseChartTooltipSignature, UseChartInteractionSignature, UseChartCartesianAxisSignature<'bar'>, UseChartHighlightSignature, UseChartVisibilityManagerSignature<'bar'>, UseChartKeyboardNavigationSignature];
|
|
10
11
|
export declare const BAR_CHART_PLUGINS: ConvertSignaturesIntoPlugins<BarChartPluginSignatures>;
|
|
@@ -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 BAR_CHART_PLUGINS = [useChartZAxis, useChartBrush, useChartTooltip, useChartInteraction, useChartCartesianAxis, useChartHighlight, useChartVisibilityManager, useChartKeyboardNavigation];
|
|
@@ -32,6 +32,8 @@ export type BarLabelProps = Omit<React.SVGProps<SVGTextElement>, 'ref' | 'id' |
|
|
|
32
32
|
* @default 'center'
|
|
33
33
|
*/
|
|
34
34
|
placement?: 'center' | 'outside';
|
|
35
|
+
/** If true, the bar label is hidden. */
|
|
36
|
+
hidden?: boolean;
|
|
35
37
|
};
|
|
36
38
|
declare function BarLabel(inProps: BarLabelProps): React.JSX.Element;
|
|
37
39
|
declare namespace BarLabel {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
5
|
-
const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes", "skipAnimation", "layout", "xOrigin", "yOrigin", "placement"];
|
|
5
|
+
const _excluded = ["seriesId", "dataIndex", "color", "isFaded", "isHighlighted", "classes", "skipAnimation", "layout", "xOrigin", "yOrigin", "placement", "hidden"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
@@ -34,7 +34,8 @@ function BarLabel(inProps) {
|
|
|
34
34
|
name: 'MuiBarLabel'
|
|
35
35
|
});
|
|
36
36
|
const {
|
|
37
|
-
isFaded
|
|
37
|
+
isFaded,
|
|
38
|
+
hidden
|
|
38
39
|
} = props,
|
|
39
40
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
41
|
const animatedProps = useAnimateBarLabel(props);
|
|
@@ -44,7 +45,7 @@ function BarLabel(inProps) {
|
|
|
44
45
|
return /*#__PURE__*/_jsx(BarLabelComponent, _extends({
|
|
45
46
|
textAnchor: textAnchor,
|
|
46
47
|
dominantBaseline: dominantBaseline,
|
|
47
|
-
opacity: fadedOpacity
|
|
48
|
+
opacity: hidden ? 0 : fadedOpacity
|
|
48
49
|
}, otherProps, animatedProps));
|
|
49
50
|
}
|
|
50
51
|
function getTextAnchor({
|
|
@@ -86,6 +87,10 @@ process.env.NODE_ENV !== "production" ? BarLabel.propTypes = {
|
|
|
86
87
|
* Height of the bar this label belongs to.
|
|
87
88
|
*/
|
|
88
89
|
height: PropTypes.number.isRequired,
|
|
90
|
+
/**
|
|
91
|
+
* If true, the bar label is hidden.
|
|
92
|
+
*/
|
|
93
|
+
hidden: PropTypes.bool,
|
|
89
94
|
isFaded: PropTypes.bool.isRequired,
|
|
90
95
|
isHighlighted: PropTypes.bool.isRequired,
|
|
91
96
|
layout: PropTypes.oneOf(['horizontal', 'vertical']).isRequired,
|
|
@@ -74,6 +74,8 @@ export type BarLabelItemProps<V extends BarValueType | null> = Omit<BarLabelOwne
|
|
|
74
74
|
* @default 'center'
|
|
75
75
|
*/
|
|
76
76
|
barLabelPlacement?: BarLabelProps['placement'];
|
|
77
|
+
/** If true, the bar label is hidden. */
|
|
78
|
+
hidden?: boolean;
|
|
77
79
|
};
|
|
78
80
|
/**
|
|
79
81
|
* @ignore - internal component.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["seriesId", "classes", "color", "dataIndex", "barLabel", "slots", "slotProps", "xOrigin", "yOrigin", "x", "y", "width", "height", "value", "skipAnimation", "layout", "barLabelPlacement"],
|
|
3
|
+
const _excluded = ["seriesId", "classes", "color", "dataIndex", "barLabel", "slots", "slotProps", "xOrigin", "yOrigin", "x", "y", "width", "height", "value", "skipAnimation", "layout", "barLabelPlacement", "hidden"],
|
|
4
4
|
_excluded2 = ["ownerState"];
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import useSlotProps from '@mui/utils/useSlotProps';
|
|
@@ -31,7 +31,8 @@ function BarLabelItem(props) {
|
|
|
31
31
|
value,
|
|
32
32
|
skipAnimation,
|
|
33
33
|
layout,
|
|
34
|
-
barLabelPlacement
|
|
34
|
+
barLabelPlacement,
|
|
35
|
+
hidden
|
|
35
36
|
} = props,
|
|
36
37
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
37
38
|
const {
|
|
@@ -87,6 +88,7 @@ function BarLabelItem(props) {
|
|
|
87
88
|
return null;
|
|
88
89
|
}
|
|
89
90
|
return /*#__PURE__*/_jsx(Component, _extends({}, barLabelProps, barLabelOwnerState, {
|
|
91
|
+
hidden: hidden,
|
|
90
92
|
children: formattedLabelText
|
|
91
93
|
}));
|
|
92
94
|
}
|
|
@@ -3,6 +3,7 @@ import { type BarElementSlotProps, type BarElementSlots } from "./BarElement.js"
|
|
|
3
3
|
import { type BarItemIdentifier } from "../models/index.js";
|
|
4
4
|
import { type BarLabelSlotProps, type BarLabelSlots } from "./BarLabel/BarLabelItem.js";
|
|
5
5
|
import type { BarItem, BarLabelContext } from "./BarLabel/index.js";
|
|
6
|
+
import { type RendererType } from "../ScatterChart/index.js";
|
|
6
7
|
export interface BarPlotSlots extends BarElementSlots, BarLabelSlots {}
|
|
7
8
|
export interface BarPlotSlotProps extends BarElementSlotProps, BarLabelSlotProps {}
|
|
8
9
|
export interface BarPlotProps {
|
|
@@ -16,7 +17,7 @@ export interface BarPlotProps {
|
|
|
16
17
|
* @param {React.MouseEvent<SVGElement, MouseEvent>} event The event source of the callback.
|
|
17
18
|
* @param {BarItemIdentifier} barItemIdentifier The bar item identifier.
|
|
18
19
|
*/
|
|
19
|
-
onItemClick
|
|
20
|
+
onItemClick?(event: React.MouseEvent<SVGElement, MouseEvent>, barItemIdentifier: BarItemIdentifier): void;
|
|
20
21
|
/**
|
|
21
22
|
* Defines the border radius of the bar element.
|
|
22
23
|
*/
|
|
@@ -30,6 +31,15 @@ export interface BarPlotProps {
|
|
|
30
31
|
* @returns {string} The formatted label.
|
|
31
32
|
*/
|
|
32
33
|
barLabel?: 'value' | ((item: BarItem, context: BarLabelContext) => string | null | undefined);
|
|
34
|
+
/**
|
|
35
|
+
* The type of renderer to use for the bar plot.
|
|
36
|
+
* - `svg-single`: Renders every bar in a `<rect />` element.
|
|
37
|
+
* - `svg-batch`: Batch renders bars in `<path />` elements for better performance with large datasets, at the cost of some limitations.
|
|
38
|
+
* Read more: https://mui.com/x/react-charts/bars/#performance
|
|
39
|
+
*
|
|
40
|
+
* @default 'svg-single'
|
|
41
|
+
*/
|
|
42
|
+
renderer?: RendererType;
|
|
33
43
|
/**
|
|
34
44
|
* The props used for each component slot.
|
|
35
45
|
* @default {}
|
|
@@ -52,7 +62,7 @@ export interface BarPlotProps {
|
|
|
52
62
|
*
|
|
53
63
|
* - [BarPlot API](https://mui.com/x/api/charts/bar-plot/)
|
|
54
64
|
*/
|
|
55
|
-
declare function BarPlot(props: BarPlotProps):
|
|
65
|
+
declare function BarPlot(props: BarPlotProps): React.JSX.Element;
|
|
56
66
|
declare namespace BarPlot {
|
|
57
67
|
var propTypes: any;
|
|
58
68
|
}
|