@mui/x-charts 8.11.2 → 8.12.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.d.ts +2 -2
- package/BarChart/BarChart.js +1 -0
- package/BarChart/BarChart.plugins.d.ts +3 -2
- package/BarChart/BarChart.plugins.js +2 -1
- package/BarChart/BarElement.js +10 -2
- package/BarChart/index.d.ts +2 -0
- package/BarChart/index.js +12 -0
- package/BarChart/useBarChartProps.d.ts +2 -2
- package/BarChart/useBarChartProps.js +4 -3
- package/CHANGELOG.md +231 -0
- package/ChartContainer/ChartContainer.js +4 -2
- package/ChartContainer/useChartContainerProps.js +4 -2
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +4 -4
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +4 -4
- package/ChartsLegend/ChartsLegend.js +2 -1
- package/ChartsLegend/ContinuousColorLegend.js +1 -0
- package/ChartsLegend/PiecewiseColorLegend.d.ts +2 -2
- package/ChartsLegend/PiecewiseColorLegend.js +33 -22
- package/ChartsLegend/piecewiseColorLegendClasses.d.ts +4 -0
- package/ChartsLegend/piecewiseColorLegendClasses.js +2 -2
- package/ChartsSurface/ChartsSurface.js +22 -2
- package/ChartsWrapper/ChartsWrapper.d.ts +5 -0
- package/ChartsWrapper/ChartsWrapper.js +87 -36
- package/ChartsXAxis/ChartsGroupedXAxisTicks.js +2 -2
- package/ChartsXAxis/ChartsXAxisImpl.js +3 -3
- package/ChartsXAxis/getVisibleLabels.js +5 -1
- package/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
- package/ChartsYAxis/ChartsGroupedYAxisTicks.js +2 -2
- package/ChartsYAxis/ChartsYAxisImpl.js +3 -3
- package/ChartsYAxis/useAxisTicksProps.d.ts +3 -3
- package/LineChart/FocusedMark.d.ts +2 -0
- package/LineChart/FocusedMark.js +44 -0
- package/LineChart/LineChart.d.ts +2 -2
- package/LineChart/LineChart.js +3 -1
- package/LineChart/LineChart.plugins.d.ts +3 -2
- package/LineChart/LineChart.plugins.js +2 -1
- package/LineChart/index.d.ts +1 -0
- package/LineChart/index.js +12 -0
- package/LineChart/useAreaPlotData.js +2 -2
- package/LineChart/useLineChartProps.d.ts +2 -2
- package/LineChart/useLineChartProps.js +2 -1
- package/LineChart/useLinePlotData.js +2 -2
- package/PieChart/PieArc.d.ts +1 -0
- package/PieChart/PieArc.js +7 -3
- package/PieChart/PieArcPlot.js +1 -0
- package/PieChart/PieChart.js +2 -0
- package/PieChart/PieChart.plugins.d.ts +2 -1
- package/PieChart/PieChart.plugins.js +2 -1
- package/PieChart/dataTransform/useTransformData.d.ts +1 -0
- package/PieChart/dataTransform/useTransformData.js +9 -1
- package/PieChart/index.d.ts +1 -0
- package/PieChart/index.js +12 -0
- package/RadarChart/RadarAxis/useRadarAxis.js +2 -2
- package/RadarChart/RadarChart.plugins.d.ts +1 -1
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -3
- package/RadarChart/index.d.ts +2 -1
- package/RadarChart/index.js +12 -0
- package/RadarChart/useRadarChartProps.d.ts +2 -2
- package/RadarChart/useRadarChartProps.js +2 -1
- package/ScatterChart/BatchScatter.d.ts +32 -0
- package/ScatterChart/BatchScatter.js +171 -0
- package/ScatterChart/Scatter.js +13 -5
- package/ScatterChart/ScatterChart.d.ts +4 -4
- package/ScatterChart/ScatterChart.js +13 -2
- package/ScatterChart/ScatterChart.plugins.d.ts +4 -3
- package/ScatterChart/ScatterChart.plugins.js +3 -2
- package/ScatterChart/ScatterPlot.d.ts +10 -0
- package/ScatterChart/ScatterPlot.js +14 -2
- package/ScatterChart/index.d.ts +1 -0
- package/ScatterChart/index.js +12 -0
- package/ScatterChart/useScatterChartProps.d.ts +2 -2
- package/ScatterChart/useScatterChartProps.js +10 -6
- package/SparkLineChart/SparkLineChart.js +10 -5
- package/colorPalettes/types.d.ts +1 -1
- package/context/ChartApi.d.ts +6 -6
- package/esm/BarChart/BarChart.d.ts +2 -2
- package/esm/BarChart/BarChart.js +1 -0
- package/esm/BarChart/BarChart.plugins.d.ts +3 -2
- package/esm/BarChart/BarChart.plugins.js +2 -1
- package/esm/BarChart/BarElement.js +10 -2
- package/esm/BarChart/index.d.ts +2 -0
- package/esm/BarChart/index.js +1 -0
- package/esm/BarChart/useBarChartProps.d.ts +2 -2
- package/esm/BarChart/useBarChartProps.js +4 -3
- package/esm/ChartContainer/ChartContainer.js +4 -2
- package/esm/ChartContainer/useChartContainerProps.js +4 -2
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +4 -4
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +4 -4
- package/esm/ChartsLegend/ChartsLegend.js +2 -1
- package/esm/ChartsLegend/ContinuousColorLegend.js +1 -0
- package/esm/ChartsLegend/PiecewiseColorLegend.d.ts +2 -2
- package/esm/ChartsLegend/PiecewiseColorLegend.js +33 -22
- package/esm/ChartsLegend/piecewiseColorLegendClasses.d.ts +4 -0
- package/esm/ChartsLegend/piecewiseColorLegendClasses.js +2 -2
- package/esm/ChartsSurface/ChartsSurface.js +22 -2
- package/esm/ChartsWrapper/ChartsWrapper.d.ts +5 -0
- package/esm/ChartsWrapper/ChartsWrapper.js +87 -36
- package/esm/ChartsXAxis/ChartsGroupedXAxisTicks.js +2 -2
- package/esm/ChartsXAxis/ChartsXAxisImpl.js +3 -3
- package/esm/ChartsXAxis/getVisibleLabels.js +5 -1
- package/esm/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
- package/esm/ChartsYAxis/ChartsGroupedYAxisTicks.js +2 -2
- package/esm/ChartsYAxis/ChartsYAxisImpl.js +3 -3
- package/esm/ChartsYAxis/useAxisTicksProps.d.ts +3 -3
- package/esm/LineChart/FocusedMark.d.ts +2 -0
- package/esm/LineChart/FocusedMark.js +38 -0
- package/esm/LineChart/LineChart.d.ts +2 -2
- package/esm/LineChart/LineChart.js +3 -1
- package/esm/LineChart/LineChart.plugins.d.ts +3 -2
- package/esm/LineChart/LineChart.plugins.js +2 -1
- package/esm/LineChart/index.d.ts +1 -0
- package/esm/LineChart/index.js +1 -0
- package/esm/LineChart/useAreaPlotData.js +2 -2
- package/esm/LineChart/useLineChartProps.d.ts +2 -2
- package/esm/LineChart/useLineChartProps.js +2 -1
- package/esm/LineChart/useLinePlotData.js +2 -2
- package/esm/PieChart/PieArc.d.ts +1 -0
- package/esm/PieChart/PieArc.js +7 -3
- package/esm/PieChart/PieArcPlot.js +1 -0
- package/esm/PieChart/PieChart.js +2 -0
- package/esm/PieChart/PieChart.plugins.d.ts +2 -1
- package/esm/PieChart/PieChart.plugins.js +2 -1
- package/esm/PieChart/dataTransform/useTransformData.d.ts +1 -0
- package/esm/PieChart/dataTransform/useTransformData.js +9 -1
- package/esm/PieChart/index.d.ts +1 -0
- package/esm/PieChart/index.js +1 -0
- package/esm/RadarChart/RadarAxis/useRadarAxis.js +2 -2
- package/esm/RadarChart/RadarChart.plugins.d.ts +1 -1
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -3
- package/esm/RadarChart/index.d.ts +2 -1
- package/esm/RadarChart/index.js +2 -1
- package/esm/RadarChart/useRadarChartProps.d.ts +2 -2
- package/esm/RadarChart/useRadarChartProps.js +2 -1
- package/esm/ScatterChart/BatchScatter.d.ts +32 -0
- package/esm/ScatterChart/BatchScatter.js +165 -0
- package/esm/ScatterChart/Scatter.js +13 -5
- package/esm/ScatterChart/ScatterChart.d.ts +4 -4
- package/esm/ScatterChart/ScatterChart.js +13 -2
- package/esm/ScatterChart/ScatterChart.plugins.d.ts +4 -3
- package/esm/ScatterChart/ScatterChart.plugins.js +3 -2
- package/esm/ScatterChart/ScatterPlot.d.ts +10 -0
- package/esm/ScatterChart/ScatterPlot.js +14 -2
- package/esm/ScatterChart/index.d.ts +1 -0
- package/esm/ScatterChart/index.js +1 -0
- package/esm/ScatterChart/useScatterChartProps.d.ts +2 -2
- package/esm/ScatterChart/useScatterChartProps.js +10 -6
- package/esm/SparkLineChart/SparkLineChart.js +10 -5
- package/esm/colorPalettes/types.d.ts +1 -1
- package/esm/context/ChartApi.d.ts +6 -6
- package/esm/hooks/useAxis.d.ts +5 -5
- package/esm/hooks/useDrawingArea.d.ts +20 -2
- package/esm/hooks/useFocusedItem.d.ts +15 -0
- package/esm/hooks/useFocusedItem.js +20 -0
- package/esm/hooks/useIsItemFocused.d.ts +12 -0
- package/esm/hooks/useIsItemFocused.js +15 -0
- package/esm/hooks/useIsItemFocusedGetter.d.ts +8 -0
- package/esm/hooks/useIsItemFocusedGetter.js +14 -0
- package/esm/hooks/useScale.js +8 -2
- package/esm/hooks/useTicks.js +2 -2
- package/esm/hooks/useTicksGrouped.js +2 -2
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/internals/animation/Transition.js +1 -3
- package/esm/internals/index.d.ts +4 -3
- package/esm/internals/index.js +4 -3
- package/esm/internals/invertScale.js +2 -2
- package/esm/internals/plugins/allPlugins.d.ts +5 -4
- package/esm/internals/plugins/allPlugins.js +3 -2
- package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +66 -72
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -19
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +10 -18
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +1 -1
- package/{internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.d.ts → esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.d.ts} +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +24 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +63 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +123 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +3 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +8 -6
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +46 -4
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +32 -21
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/index.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/index.js +2 -0
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.js → useChartClosestPoint/useChartClosestPoint.js} +9 -7
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +5 -0
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +3 -0
- package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.d.ts → useChartClosestPoint/useChartClosestPoint.types.d.ts} +8 -4
- package/esm/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.ts +16 -0
- package/esm/internals/plugins/featurePlugins/useChartHighlight/highlightStates.js +32 -0
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +5 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.js +3 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +2 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +20 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +88 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +210 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +25 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +7 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +34 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +1 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +10 -8
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +2 -1
- package/esm/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +1 -1
- package/esm/internals/scaleGuards.d.ts +11 -0
- package/esm/internals/scaleGuards.js +9 -0
- package/esm/locales/elGR.d.ts +96 -0
- package/esm/locales/elGR.js +100 -0
- package/esm/locales/enUS.d.ts +96 -0
- package/esm/locales/enUS.js +99 -1
- package/esm/locales/frFR.d.ts +96 -0
- package/esm/locales/frFR.js +100 -2
- package/esm/locales/ptBR.d.ts +96 -0
- package/esm/locales/ptBR.js +100 -0
- package/esm/locales/ptPT.d.ts +96 -0
- package/esm/locales/ptPT.js +100 -0
- package/esm/locales/svSE.d.ts +97 -1
- package/esm/locales/svSE.js +100 -0
- package/esm/locales/utils/chartsLocaleTextApi.d.ts +384 -0
- package/esm/locales/utils/getChartsLocalization.d.ts +96 -0
- package/esm/models/axis.d.ts +3 -0
- package/esm/plugins/index.d.ts +6 -0
- package/esm/plugins/index.js +12 -0
- package/hooks/useAxis.d.ts +5 -5
- package/hooks/useDrawingArea.d.ts +20 -2
- package/hooks/useFocusedItem.d.ts +15 -0
- package/hooks/useFocusedItem.js +26 -0
- package/hooks/useIsItemFocused.d.ts +12 -0
- package/hooks/useIsItemFocused.js +20 -0
- package/hooks/useIsItemFocusedGetter.d.ts +8 -0
- package/hooks/useIsItemFocusedGetter.js +18 -0
- package/hooks/useScale.js +8 -2
- package/hooks/useTicks.js +2 -2
- package/hooks/useTicksGrouped.js +2 -2
- package/index.d.ts +1 -0
- package/index.js +13 -1
- package/internals/animation/Transition.js +0 -2
- package/internals/index.d.ts +4 -3
- package/internals/index.js +24 -12
- package/internals/invertScale.js +2 -2
- package/internals/plugins/allPlugins.d.ts +5 -4
- package/internals/plugins/allPlugins.js +3 -2
- package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +63 -69
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -19
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +10 -18
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +1 -1
- package/{esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.d.ts → internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.d.ts} +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +30 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +63 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +134 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +3 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +8 -6
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +47 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +33 -22
- package/internals/plugins/featurePlugins/useChartClosestPoint/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartClosestPoint/index.js +27 -0
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.d.ts +3 -0
- package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.js → useChartClosestPoint/useChartClosestPoint.js} +11 -9
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +5 -0
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +9 -0
- package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.d.ts → useChartClosestPoint/useChartClosestPoint.types.d.ts} +8 -4
- package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.ts +16 -0
- package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.js +41 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +6 -1
- package/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.js +9 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +27 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +20 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +96 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +218 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +25 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +13 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +34 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +5 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/getAxisIndex.js +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +10 -8
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +2 -1
- package/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +1 -1
- package/internals/scaleGuards.d.ts +11 -0
- package/internals/scaleGuards.js +17 -0
- package/locales/elGR.d.ts +96 -0
- package/locales/elGR.js +100 -0
- package/locales/enUS.d.ts +96 -0
- package/locales/enUS.js +99 -1
- package/locales/frFR.d.ts +96 -0
- package/locales/frFR.js +100 -2
- package/locales/ptBR.d.ts +96 -0
- package/locales/ptBR.js +100 -0
- package/locales/ptPT.d.ts +96 -0
- package/locales/ptPT.js +100 -0
- package/locales/svSE.d.ts +97 -1
- package/locales/svSE.js +100 -0
- package/locales/utils/chartsLocaleTextApi.d.ts +384 -0
- package/locales/utils/getChartsLocalization.d.ts +96 -0
- package/models/axis.d.ts +3 -0
- package/package.json +4 -4
- package/plugins/index.d.ts +6 -0
- package/plugins/index.js +47 -0
- package/esm/internals/isBandScale.d.ts +0 -5
- package/esm/internals/isBandScale.js +0 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +0 -22
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/index.d.ts +0 -3
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/index.js +0 -2
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.d.ts +0 -3
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +0 -5
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +0 -3
- package/internals/isBandScale.d.ts +0 -5
- package/internals/isBandScale.js +0 -9
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +0 -29
- package/internals/plugins/featurePlugins/useChartVoronoi/index.d.ts +0 -3
- package/internals/plugins/featurePlugins/useChartVoronoi/index.js +0 -27
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.d.ts +0 -3
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +0 -5
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +0 -9
- /package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.js → useChartClosestPoint/useChartClosestPoint.types.js} +0 -0
- /package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.js → useChartClosestPoint/useChartClosestPoint.types.js} +0 -0
package/ScatterChart/Scatter.js
CHANGED
|
@@ -16,11 +16,12 @@ var _useInteractionItemProps = require("../hooks/useInteractionItemProps");
|
|
|
16
16
|
var _useStore = require("../internals/store/useStore");
|
|
17
17
|
var _useSelector = require("../internals/store/useSelector");
|
|
18
18
|
var _useItemHighlightedGetter = require("../hooks/useItemHighlightedGetter");
|
|
19
|
-
var
|
|
19
|
+
var _useChartClosestPoint = require("../internals/plugins/featurePlugins/useChartClosestPoint");
|
|
20
20
|
var _ScatterMarker = require("./ScatterMarker");
|
|
21
21
|
var _scatterClasses = require("./scatterClasses");
|
|
22
22
|
var _useScatterPlotData = require("./useScatterPlotData");
|
|
23
23
|
var _ChartProvider = require("../context/ChartProvider");
|
|
24
|
+
var _useIsItemFocusedGetter = require("../hooks/useIsItemFocusedGetter");
|
|
24
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
26
|
const _excluded = ["ownerState"];
|
|
26
27
|
/**
|
|
@@ -49,12 +50,13 @@ function Scatter(props) {
|
|
|
49
50
|
instance
|
|
50
51
|
} = (0, _ChartProvider.useChartContext)();
|
|
51
52
|
const store = (0, _useStore.useStore)();
|
|
52
|
-
const isVoronoiEnabled = (0, _useSelector.useSelector)(store,
|
|
53
|
+
const isVoronoiEnabled = (0, _useSelector.useSelector)(store, _useChartClosestPoint.selectorChartsIsVoronoiEnabled);
|
|
53
54
|
const skipInteractionHandlers = isVoronoiEnabled || series.disableHover;
|
|
54
55
|
const {
|
|
55
56
|
isFaded,
|
|
56
57
|
isHighlighted
|
|
57
58
|
} = (0, _useItemHighlightedGetter.useItemHighlightedGetter)();
|
|
59
|
+
const isFocused = (0, _useIsItemFocusedGetter.useIsItemFocusedGetter)();
|
|
58
60
|
const scatterPlotData = (0, _useScatterPlotData.useScatterPlotData)(series, xScale, yScale, instance.isPointInside);
|
|
59
61
|
const Marker = slots?.marker ?? _ScatterMarker.ScatterMarker;
|
|
60
62
|
const _useSlotProps = (0, _useSlotProps2.default)({
|
|
@@ -71,12 +73,17 @@ function Scatter(props) {
|
|
|
71
73
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("g", {
|
|
72
74
|
"data-series": series.id,
|
|
73
75
|
className: classes.root,
|
|
74
|
-
children: scatterPlotData.map(
|
|
76
|
+
children: scatterPlotData.map(dataPoint => {
|
|
75
77
|
const isItemHighlighted = isHighlighted(dataPoint);
|
|
76
78
|
const isItemFaded = !isItemHighlighted && isFaded(dataPoint);
|
|
79
|
+
const isItemFocused = isFocused({
|
|
80
|
+
seriesType: 'scatter',
|
|
81
|
+
seriesId: series.id,
|
|
82
|
+
dataIndex: dataPoint.dataIndex
|
|
83
|
+
});
|
|
77
84
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Marker, (0, _extends2.default)({
|
|
78
85
|
dataIndex: dataPoint.dataIndex,
|
|
79
|
-
color: colorGetter ? colorGetter(
|
|
86
|
+
color: colorGetter ? colorGetter(dataPoint.dataIndex) : color,
|
|
80
87
|
isHighlighted: isItemHighlighted,
|
|
81
88
|
isFaded: isItemFaded,
|
|
82
89
|
x: dataPoint.x,
|
|
@@ -87,7 +94,8 @@ function Scatter(props) {
|
|
|
87
94
|
dataIndex: dataPoint.dataIndex
|
|
88
95
|
})),
|
|
89
96
|
"data-highlighted": isItemHighlighted || undefined,
|
|
90
|
-
"data-faded": isItemFaded || undefined
|
|
97
|
+
"data-faded": isItemFaded || undefined,
|
|
98
|
+
"data-focused": isItemFocused || undefined
|
|
91
99
|
}, skipInteractionHandlers ? undefined : (0, _useInteractionItemProps.getInteractionItemProps)(instance, dataPoint), markerProps), dataPoint.id ?? dataPoint.dataIndex);
|
|
92
100
|
})
|
|
93
101
|
});
|
|
@@ -13,8 +13,8 @@ import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "
|
|
|
13
13
|
import { ChartsAxisHighlightProps } from "../ChartsAxisHighlight/index.js";
|
|
14
14
|
import { ChartsAxisSlots, ChartsAxisSlotProps } from "../models/axis.js";
|
|
15
15
|
import { ChartsGridProps } from "../ChartsGrid/index.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
16
|
+
import { UseChartClosestPointSignature } from "../internals/plugins/featurePlugins/useChartClosestPoint/index.js";
|
|
17
|
+
import { ScatterChartPluginSignatures } from "./ScatterChart.plugins.js";
|
|
18
18
|
export interface ScatterChartSlots extends ChartsAxisSlots, ScatterPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
19
19
|
export interface ScatterChartSlotProps extends ChartsAxisSlotProps, ScatterPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, Omit<ChartsTooltipSlotProps, 'tooltip'>, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {
|
|
20
20
|
/**
|
|
@@ -24,7 +24,7 @@ export interface ScatterChartSlotProps extends ChartsAxisSlotProps, ScatterPlotS
|
|
|
24
24
|
tooltip?: Partial<ChartsTooltipProps<'item' | 'none'>>;
|
|
25
25
|
}
|
|
26
26
|
export type ScatterSeries = MakeOptional<ScatterSeriesType, 'type'>;
|
|
27
|
-
export interface ScatterChartProps extends Omit<ChartContainerProps<'scatter',
|
|
27
|
+
export interface ScatterChartProps extends Omit<ChartContainerProps<'scatter', ScatterChartPluginSignatures>, 'series' | 'plugins' | 'onItemClick' | 'experimentalFeatures' | 'highlightedAxis' | 'onHighlightedAxisChange'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'>, Pick<ScatterPlotProps, 'renderer'> {
|
|
28
28
|
/**
|
|
29
29
|
* The series to display in the scatter chart.
|
|
30
30
|
* An array of [[ScatterSeries]] objects.
|
|
@@ -69,7 +69,7 @@ export interface ScatterChartProps extends Omit<ChartContainerProps<'scatter', S
|
|
|
69
69
|
* @param {MouseEvent} event The mouse event recorded on the `<svg/>` element if using Voronoi cells. Or the Mouse event from the scatter element, when `disableVoronoi=true`.
|
|
70
70
|
* @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
|
|
71
71
|
*/
|
|
72
|
-
onItemClick?: ScatterPlotProps['onItemClick'] |
|
|
72
|
+
onItemClick?: ScatterPlotProps['onItemClick'] | UseChartClosestPointSignature['params']['onItemClick'];
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Demos:
|
|
@@ -110,6 +110,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
110
110
|
* @default false
|
|
111
111
|
*/
|
|
112
112
|
disableVoronoi: _propTypes.default.bool,
|
|
113
|
+
enableKeyboardNavigation: _propTypes.default.bool,
|
|
113
114
|
/**
|
|
114
115
|
* Option to display a cartesian grid in the background.
|
|
115
116
|
*/
|
|
@@ -178,6 +179,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
178
179
|
* @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
|
|
179
180
|
*/
|
|
180
181
|
onItemClick: _propTypes.default.func,
|
|
182
|
+
/**
|
|
183
|
+
* The type of renderer to use for the scatter plot.
|
|
184
|
+
* - `svg-single`: Renders every scatter item in a `<circle />` element.
|
|
185
|
+
* - `svg-batch`: Batch renders scatter items in `<path />` elements for better performance with large datasets, at the cost of some limitations.
|
|
186
|
+
* Read more: https://mui.com/x/react-charts/scatter/#performance
|
|
187
|
+
*
|
|
188
|
+
* @default 'svg-single'
|
|
189
|
+
*/
|
|
190
|
+
renderer: _propTypes.default.oneOf(['svg-batch', 'svg-single']),
|
|
181
191
|
/**
|
|
182
192
|
* The series to display in the scatter chart.
|
|
183
193
|
* An array of [[ScatterSeries]] objects.
|
|
@@ -207,10 +217,11 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
207
217
|
theme: _propTypes.default.oneOf(['dark', 'light']),
|
|
208
218
|
title: _propTypes.default.string,
|
|
209
219
|
/**
|
|
210
|
-
* Defines the
|
|
220
|
+
* Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
|
|
221
|
+
* If set to `'item'`, the radius is the `markerSize`.
|
|
211
222
|
* If `undefined`, the radius is assumed to be infinite.
|
|
212
223
|
*/
|
|
213
|
-
voronoiMaxRadius: _propTypes.default.number,
|
|
224
|
+
voronoiMaxRadius: _propTypes.default.oneOfType([_propTypes.default.oneOf(['item']), _propTypes.default.number]),
|
|
214
225
|
/**
|
|
215
226
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
216
227
|
*/
|
|
@@ -3,6 +3,7 @@ import { UseChartCartesianAxisSignature } from "../internals/plugins/featurePlug
|
|
|
3
3
|
import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
4
4
|
import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
5
5
|
import { ConvertSignaturesIntoPlugins } from "../internals/plugins/models/helpers.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
export
|
|
6
|
+
import { UseChartClosestPointSignature } from "../internals/plugins/featurePlugins/useChartClosestPoint/index.js";
|
|
7
|
+
import { UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
8
|
+
export type ScatterChartPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'scatter'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartClosestPointSignature, UseChartKeyboardNavigationSignature];
|
|
9
|
+
export declare const SCATTER_CHART_PLUGINS: ConvertSignaturesIntoPlugins<ScatterChartPluginSignatures>;
|
|
@@ -8,5 +8,6 @@ var _useChartZAxis = require("../internals/plugins/featurePlugins/useChartZAxis"
|
|
|
8
8
|
var _useChartCartesianAxis = require("../internals/plugins/featurePlugins/useChartCartesianAxis");
|
|
9
9
|
var _useChartInteraction = require("../internals/plugins/featurePlugins/useChartInteraction");
|
|
10
10
|
var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
|
|
11
|
-
var
|
|
12
|
-
|
|
11
|
+
var _useChartClosestPoint = require("../internals/plugins/featurePlugins/useChartClosestPoint");
|
|
12
|
+
var _useChartKeyboardNavigation = require("../internals/plugins/featurePlugins/useChartKeyboardNavigation");
|
|
13
|
+
const SCATTER_CHART_PLUGINS = exports.SCATTER_CHART_PLUGINS = [_useChartZAxis.useChartZAxis, _useChartCartesianAxis.useChartCartesianAxis, _useChartInteraction.useChartInteraction, _useChartHighlight.useChartHighlight, _useChartClosestPoint.useChartClosestPoint, _useChartKeyboardNavigation.useChartKeyboardNavigation];
|
|
@@ -6,6 +6,7 @@ export interface ScatterPlotSlots extends ScatterSlots {
|
|
|
6
6
|
export interface ScatterPlotSlotProps extends ScatterSlotProps {
|
|
7
7
|
scatter?: Partial<ScatterProps>;
|
|
8
8
|
}
|
|
9
|
+
export type RendererType = 'svg-single' | 'svg-batch';
|
|
9
10
|
export interface ScatterPlotProps extends Pick<ScatterProps, 'onItemClick'> {
|
|
10
11
|
/**
|
|
11
12
|
* Overridable component slots.
|
|
@@ -17,6 +18,15 @@ export interface ScatterPlotProps extends Pick<ScatterProps, 'onItemClick'> {
|
|
|
17
18
|
* @default {}
|
|
18
19
|
*/
|
|
19
20
|
slotProps?: ScatterPlotSlotProps;
|
|
21
|
+
/**
|
|
22
|
+
* The type of renderer to use for the scatter plot.
|
|
23
|
+
* - `svg-single`: Renders every scatter item in a `<circle />` element.
|
|
24
|
+
* - `svg-batch`: Batch renders scatter items in `<path />` elements for better performance with large datasets, at the cost of some limitations.
|
|
25
|
+
* Read more: https://mui.com/x/react-charts/scatter/#performance
|
|
26
|
+
*
|
|
27
|
+
* @default 'svg-single'
|
|
28
|
+
*/
|
|
29
|
+
renderer?: RendererType;
|
|
20
30
|
}
|
|
21
31
|
/**
|
|
22
32
|
* Demos:
|
|
@@ -15,6 +15,7 @@ var _useScatterSeries = require("../hooks/useScatterSeries");
|
|
|
15
15
|
var _hooks = require("../hooks");
|
|
16
16
|
var _useZAxis = require("../hooks/useZAxis");
|
|
17
17
|
var _seriesConfig = require("./seriesConfig");
|
|
18
|
+
var _BatchScatter = require("./BatchScatter");
|
|
18
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
20
|
/**
|
|
20
21
|
* Demos:
|
|
@@ -30,7 +31,8 @@ function ScatterPlot(props) {
|
|
|
30
31
|
const {
|
|
31
32
|
slots,
|
|
32
33
|
slotProps,
|
|
33
|
-
onItemClick
|
|
34
|
+
onItemClick,
|
|
35
|
+
renderer
|
|
34
36
|
} = props;
|
|
35
37
|
const seriesData = (0, _useScatterSeries.useScatterSeriesContext)();
|
|
36
38
|
const {
|
|
@@ -55,7 +57,8 @@ function ScatterPlot(props) {
|
|
|
55
57
|
const defaultXAxisId = xAxisIds[0];
|
|
56
58
|
const defaultYAxisId = yAxisIds[0];
|
|
57
59
|
const defaultZAxisId = zAxisIds[0];
|
|
58
|
-
const
|
|
60
|
+
const DefaultScatterItems = renderer === 'svg-batch' ? _BatchScatter.BatchScatter : _Scatter.Scatter;
|
|
61
|
+
const ScatterItems = slots?.scatter ?? DefaultScatterItems;
|
|
59
62
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
60
63
|
children: seriesOrder.map(seriesId => {
|
|
61
64
|
const {
|
|
@@ -92,6 +95,15 @@ process.env.NODE_ENV !== "production" ? ScatterPlot.propTypes = {
|
|
|
92
95
|
* @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
|
|
93
96
|
*/
|
|
94
97
|
onItemClick: _propTypes.default.func,
|
|
98
|
+
/**
|
|
99
|
+
* The type of renderer to use for the scatter plot.
|
|
100
|
+
* - `svg-single`: Renders every scatter item in a `<circle />` element.
|
|
101
|
+
* - `svg-batch`: Batch renders scatter items in `<path />` elements for better performance with large datasets, at the cost of some limitations.
|
|
102
|
+
* Read more: https://mui.com/x/react-charts/scatter/#performance
|
|
103
|
+
*
|
|
104
|
+
* @default 'svg-single'
|
|
105
|
+
*/
|
|
106
|
+
renderer: _propTypes.default.oneOf(['svg-batch', 'svg-single']),
|
|
95
107
|
/**
|
|
96
108
|
* The props used for each component slot.
|
|
97
109
|
* @default {}
|
package/ScatterChart/index.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export * from "./ScatterPlot.js";
|
|
|
3
3
|
export * from "./Scatter.js";
|
|
4
4
|
export * from "./ScatterMarker.types.js";
|
|
5
5
|
export * from "./ScatterMarker.js";
|
|
6
|
+
export * from "./ScatterChart.plugins.js";
|
|
6
7
|
export type { ScatterClasses } from "./scatterClasses.js";
|
|
7
8
|
export { scatterClasses } from "./scatterClasses.js";
|
package/ScatterChart/index.js
CHANGED
|
@@ -72,4 +72,16 @@ Object.keys(_ScatterMarker2).forEach(function (key) {
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
|
+
var _ScatterChart2 = require("./ScatterChart.plugins");
|
|
76
|
+
Object.keys(_ScatterChart2).forEach(function (key) {
|
|
77
|
+
if (key === "default" || key === "__esModule") return;
|
|
78
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
79
|
+
if (key in exports && exports[key] === _ScatterChart2[key]) return;
|
|
80
|
+
Object.defineProperty(exports, key, {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function () {
|
|
83
|
+
return _ScatterChart2[key];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
75
87
|
var _scatterClasses = require("./scatterClasses");
|
|
@@ -8,7 +8,7 @@ import { ChartContainerProps } from "../ChartContainer/index.js";
|
|
|
8
8
|
import type { ScatterChartProps } from "./ScatterChart.js";
|
|
9
9
|
import type { ScatterPlotProps } from "./ScatterPlot.js";
|
|
10
10
|
import type { ChartsWrapperProps } from "../ChartsWrapper/index.js";
|
|
11
|
-
import {
|
|
11
|
+
import { ScatterChartPluginSignatures } from "./ScatterChart.plugins.js";
|
|
12
12
|
/**
|
|
13
13
|
* A helper function that extracts ScatterChartProps from the input props
|
|
14
14
|
* and returns an object with props for the children components of ScatterChart.
|
|
@@ -18,7 +18,7 @@ import { ScatterChartPluginsSignatures } from "./ScatterChart.plugins.js";
|
|
|
18
18
|
*/
|
|
19
19
|
export declare const useScatterChartProps: (props: ScatterChartProps) => {
|
|
20
20
|
chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
|
|
21
|
-
chartContainerProps: ChartContainerProps<"scatter",
|
|
21
|
+
chartContainerProps: ChartContainerProps<"scatter", ScatterChartPluginSignatures>;
|
|
22
22
|
chartsAxisProps: ChartsAxisProps;
|
|
23
23
|
gridProps: ChartsGridProps;
|
|
24
24
|
scatterPlotProps: ScatterPlotProps;
|
|
@@ -11,7 +11,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
11
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
12
12
|
var React = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _ScatterChart = require("./ScatterChart.plugins");
|
|
14
|
-
const _excluded = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className", "showToolbar"];
|
|
14
|
+
const _excluded = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className", "showToolbar", "renderer"];
|
|
15
15
|
/**
|
|
16
16
|
* A helper function that extracts ScatterChartProps from the input props
|
|
17
17
|
* and returns an object with props for the children components of ScatterChart.
|
|
@@ -41,12 +41,14 @@ const useScatterChartProps = props => {
|
|
|
41
41
|
loading,
|
|
42
42
|
highlightedItem,
|
|
43
43
|
onHighlightChange,
|
|
44
|
-
className
|
|
44
|
+
className,
|
|
45
|
+
renderer
|
|
45
46
|
} = props,
|
|
46
47
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
47
48
|
const seriesWithDefault = React.useMemo(() => series.map(s => (0, _extends2.default)({
|
|
48
49
|
type: 'scatter'
|
|
49
50
|
}, s)), [series]);
|
|
51
|
+
const useVoronoiOnItemClick = disableVoronoi !== true || renderer === 'svg-batch';
|
|
50
52
|
const chartContainerProps = (0, _extends2.default)({}, other, {
|
|
51
53
|
series: seriesWithDefault,
|
|
52
54
|
width,
|
|
@@ -60,7 +62,7 @@ const useScatterChartProps = props => {
|
|
|
60
62
|
onHighlightChange,
|
|
61
63
|
disableVoronoi,
|
|
62
64
|
voronoiMaxRadius,
|
|
63
|
-
onItemClick:
|
|
65
|
+
onItemClick: useVoronoiOnItemClick ? onItemClick : undefined,
|
|
64
66
|
className,
|
|
65
67
|
plugins: _ScatterChart.SCATTER_CHART_PLUGINS,
|
|
66
68
|
slots,
|
|
@@ -75,9 +77,10 @@ const useScatterChartProps = props => {
|
|
|
75
77
|
horizontal: grid?.horizontal
|
|
76
78
|
};
|
|
77
79
|
const scatterPlotProps = {
|
|
78
|
-
onItemClick:
|
|
80
|
+
onItemClick: useVoronoiOnItemClick ? undefined : onItemClick,
|
|
79
81
|
slots,
|
|
80
|
-
slotProps
|
|
82
|
+
slotProps,
|
|
83
|
+
renderer
|
|
81
84
|
};
|
|
82
85
|
const overlayProps = {
|
|
83
86
|
loading,
|
|
@@ -95,7 +98,8 @@ const useScatterChartProps = props => {
|
|
|
95
98
|
const chartsWrapperProps = {
|
|
96
99
|
sx,
|
|
97
100
|
legendPosition: props.slotProps?.legend?.position,
|
|
98
|
-
legendDirection: props.slotProps?.legend?.direction
|
|
101
|
+
legendDirection: props.slotProps?.legend?.direction,
|
|
102
|
+
hideLegend: props.hideLegend ?? false
|
|
99
103
|
};
|
|
100
104
|
return {
|
|
101
105
|
chartsWrapperProps,
|
|
@@ -20,6 +20,7 @@ var _ChartsSurface = require("../ChartsSurface");
|
|
|
20
20
|
var _constants = require("../constants");
|
|
21
21
|
var _ChartsTooltip = require("../ChartsTooltip");
|
|
22
22
|
var _ChartsAxisHighlight = require("../ChartsAxisHighlight");
|
|
23
|
+
var _FocusedMark = require("../LineChart/FocusedMark");
|
|
23
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
25
|
const _excluded = ["xAxis", "yAxis", "width", "height", "margin", "color", "baseline", "sx", "showTooltip", "showHighlight", "axisHighlight", "children", "slots", "slotProps", "data", "plotType", "valueFormatter", "area", "curve", "className", "disableClipping", "clipAreaOffset", "onHighlightChange", "onHighlightedAxisChange", "highlightedAxis", "highlightedItem"];
|
|
25
26
|
const SPARK_LINE_DEFAULT_MARGIN = 5;
|
|
@@ -144,9 +145,11 @@ const SparkLineChart = exports.SparkLineChart = /*#__PURE__*/React.forwardRef(fu
|
|
|
144
145
|
slotProps: slotProps
|
|
145
146
|
})]
|
|
146
147
|
})]
|
|
147
|
-
}), plotType === 'line' && /*#__PURE__*/(0, _jsxRuntime.
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
}), plotType === 'line' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
149
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_LineChart.LineHighlightPlot, {
|
|
150
|
+
slots: slots,
|
|
151
|
+
slotProps: slotProps
|
|
152
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_FocusedMark.FocusedMark, {})]
|
|
150
153
|
}), disableClipping ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChartsClipPath.ChartsClipPath, {
|
|
151
154
|
id: clipPathId,
|
|
152
155
|
offset: clipPathOffset
|
|
@@ -232,6 +235,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
232
235
|
* If true, the voronoi interaction are ignored.
|
|
233
236
|
*/
|
|
234
237
|
disableVoronoi: _propTypes.default.bool,
|
|
238
|
+
enableKeyboardNavigation: _propTypes.default.bool,
|
|
235
239
|
/**
|
|
236
240
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
237
241
|
*/
|
|
@@ -345,10 +349,11 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
345
349
|
*/
|
|
346
350
|
valueFormatter: _propTypes.default.func,
|
|
347
351
|
/**
|
|
348
|
-
* Defines the
|
|
352
|
+
* Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
|
|
353
|
+
* If set to `'item'`, the radius is the `markerSize`.
|
|
349
354
|
* If `undefined`, the radius is assumed to be infinite.
|
|
350
355
|
*/
|
|
351
|
-
voronoiMaxRadius: _propTypes.default.number,
|
|
356
|
+
voronoiMaxRadius: _propTypes.default.oneOfType([_propTypes.default.oneOf(['item']), _propTypes.default.number]),
|
|
352
357
|
/**
|
|
353
358
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
354
359
|
*/
|
package/colorPalettes/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type ChartsColorPaletteCallback = (mode: 'light' | 'dark') => string[];
|
|
2
|
-
export type ChartsColorPalette = string[] | ChartsColorPaletteCallback;
|
|
2
|
+
export type ChartsColorPalette = readonly string[] | ChartsColorPaletteCallback;
|
|
3
3
|
export type ChartsColorCallback = (mode: 'light' | 'dark') => string;
|
|
4
4
|
export type ChartsColor = string | ChartsColorCallback;
|
package/context/ChartApi.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { PieChartPluginSignatures } from "../PieChart/PieChart.plugins.js";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
2
|
+
import type { BarChartPluginSignatures } from "../BarChart/BarChart.plugins.js";
|
|
3
|
+
import type { ScatterChartPluginSignatures } from "../ScatterChart/ScatterChart.plugins.js";
|
|
4
|
+
import type { LineChartPluginSignatures } from "../LineChart/LineChart.plugins.js";
|
|
5
5
|
import type { AllPluginSignatures, DefaultPluginSignatures } from "../internals/plugins/allPlugins.js";
|
|
6
6
|
import type { ChartAnyPluginSignature } from "../internals/plugins/models/plugin.js";
|
|
7
7
|
import type { ChartPublicAPI } from "../internals/plugins/models/index.js";
|
|
8
8
|
export type PluginsPerSeriesType = {
|
|
9
|
-
line:
|
|
10
|
-
scatter:
|
|
11
|
-
bar:
|
|
9
|
+
line: LineChartPluginSignatures;
|
|
10
|
+
scatter: ScatterChartPluginSignatures;
|
|
11
|
+
bar: BarChartPluginSignatures;
|
|
12
12
|
pie: PieChartPluginSignatures;
|
|
13
13
|
composition: DefaultPluginSignatures;
|
|
14
14
|
};
|
|
@@ -12,11 +12,11 @@ import { ChartsAxisHighlightProps } from "../ChartsAxisHighlight/index.js";
|
|
|
12
12
|
import { ChartsAxisSlots, ChartsAxisSlotProps } from "../models/axis.js";
|
|
13
13
|
import { ChartsGridProps } from "../ChartsGrid/index.js";
|
|
14
14
|
import { ChartsOverlayProps, ChartsOverlaySlotProps, ChartsOverlaySlots } from "../ChartsOverlay/ChartsOverlay.js";
|
|
15
|
-
import {
|
|
15
|
+
import { BarChartPluginSignatures } from "./BarChart.plugins.js";
|
|
16
16
|
export interface BarChartSlots extends ChartsAxisSlots, BarPlotSlots, ChartsLegendSlots, ChartsOverlaySlots, ChartsTooltipSlots, ChartsToolbarSlots, Partial<ChartsSlots> {}
|
|
17
17
|
export interface BarChartSlotProps extends ChartsAxisSlotProps, BarPlotSlotProps, ChartsLegendSlotProps, ChartsOverlaySlotProps, ChartsTooltipSlotProps, ChartsToolbarSlotProps, Partial<ChartsSlotProps> {}
|
|
18
18
|
export type BarSeries = MakeOptional<BarSeriesType, 'type'>;
|
|
19
|
-
export interface BarChartProps extends Omit<ChartContainerProps<'bar',
|
|
19
|
+
export interface BarChartProps extends Omit<ChartContainerProps<'bar', BarChartPluginSignatures>, 'series' | 'plugins' | 'zAxis' | 'experimentalFeatures'>, Omit<ChartsAxisProps, 'slots' | 'slotProps'>, Omit<BarPlotProps, 'slots' | 'slotProps'>, Omit<ChartsOverlayProps, 'slots' | 'slotProps'> {
|
|
20
20
|
/**
|
|
21
21
|
* The series to display in the bar chart.
|
|
22
22
|
* An array of [[BarSeries]] objects.
|
package/esm/BarChart/BarChart.js
CHANGED
|
@@ -2,6 +2,7 @@ import { UseChartZAxisSignature } from "../internals/plugins/featurePlugins/useC
|
|
|
2
2
|
import { UseChartCartesianAxisSignature } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
3
3
|
import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
4
4
|
import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
5
|
+
import { UseChartKeyboardNavigationSignature } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
5
6
|
import { ConvertSignaturesIntoPlugins } from "../internals/plugins/models/helpers.js";
|
|
6
|
-
export type
|
|
7
|
-
export declare const BAR_CHART_PLUGINS: ConvertSignaturesIntoPlugins<
|
|
7
|
+
export type BarChartPluginSignatures = [UseChartZAxisSignature, UseChartCartesianAxisSignature<'bar'>, UseChartInteractionSignature, UseChartHighlightSignature, UseChartKeyboardNavigationSignature];
|
|
8
|
+
export declare const BAR_CHART_PLUGINS: ConvertSignaturesIntoPlugins<BarChartPluginSignatures>;
|
|
@@ -2,4 +2,5 @@ import { useChartZAxis } from "../internals/plugins/featurePlugins/useChartZAxis
|
|
|
2
2
|
import { useChartCartesianAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
3
3
|
import { useChartInteraction } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
4
4
|
import { useChartHighlight } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
5
|
-
|
|
5
|
+
import { useChartKeyboardNavigation } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
6
|
+
export const BAR_CHART_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartKeyboardNavigation];
|
|
@@ -10,6 +10,7 @@ import { useUtilityClasses } from "./barElementClasses.js";
|
|
|
10
10
|
import { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
11
11
|
import { useItemHighlighted } from "../hooks/useItemHighlighted.js";
|
|
12
12
|
import { AnimatedBarElement } from "./AnimatedBarElement.js";
|
|
13
|
+
import { useIsItemFocused } from "../hooks/useIsItemFocused.js";
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
15
|
function BarElement(props) {
|
|
15
16
|
const {
|
|
@@ -43,13 +44,19 @@ function BarElement(props) {
|
|
|
43
44
|
seriesId: id,
|
|
44
45
|
dataIndex
|
|
45
46
|
});
|
|
47
|
+
const isFocused = useIsItemFocused({
|
|
48
|
+
seriesType: 'bar',
|
|
49
|
+
seriesId: id,
|
|
50
|
+
dataIndex
|
|
51
|
+
});
|
|
46
52
|
const ownerState = {
|
|
47
53
|
id,
|
|
48
54
|
dataIndex,
|
|
49
55
|
classes: innerClasses,
|
|
50
56
|
color,
|
|
51
57
|
isFaded,
|
|
52
|
-
isHighlighted
|
|
58
|
+
isHighlighted,
|
|
59
|
+
isFocused
|
|
53
60
|
};
|
|
54
61
|
const classes = useUtilityClasses(ownerState);
|
|
55
62
|
const Bar = slots?.bar ?? AnimatedBarElement;
|
|
@@ -73,7 +80,8 @@ function BarElement(props) {
|
|
|
73
80
|
stroke: 'none',
|
|
74
81
|
fill: color,
|
|
75
82
|
skipAnimation,
|
|
76
|
-
layout
|
|
83
|
+
layout,
|
|
84
|
+
'data-focused': isFocused || undefined
|
|
77
85
|
}),
|
|
78
86
|
className: classes.root,
|
|
79
87
|
ownerState
|
package/esm/BarChart/index.d.ts
CHANGED
|
@@ -3,5 +3,7 @@ export * from "./BarPlot.js";
|
|
|
3
3
|
export * from "./BarElement.js";
|
|
4
4
|
export * from "./BarLabel/index.js";
|
|
5
5
|
export * from "./barElementClasses.js";
|
|
6
|
+
export * from "./BarChart.plugins.js";
|
|
7
|
+
export { type BarProps } from "./AnimatedBarElement.js";
|
|
6
8
|
export { barClasses, getBarUtilityClass } from "./barClasses.js";
|
|
7
9
|
export type { BarClassKey, BarClasses } from "./barClasses.js";
|
package/esm/BarChart/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { ChartsAxisProps } from "../ChartsAxis/index.js";
|
|
|
9
9
|
import { ChartsAxisHighlightProps } from "../ChartsAxisHighlight/index.js";
|
|
10
10
|
import { ChartsLegendSlotExtension } from "../ChartsLegend/index.js";
|
|
11
11
|
import type { ChartsWrapperProps } from "../ChartsWrapper/index.js";
|
|
12
|
-
import {
|
|
12
|
+
import { BarChartPluginSignatures } from "./BarChart.plugins.js";
|
|
13
13
|
/**
|
|
14
14
|
* A helper function that extracts BarChartProps from the input props
|
|
15
15
|
* and returns an object with props for the children components of BarChart.
|
|
@@ -19,7 +19,7 @@ import { BarChartPluginsSignatures } from "./BarChart.plugins.js";
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const useBarChartProps: (props: BarChartProps) => {
|
|
21
21
|
chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
|
|
22
|
-
chartContainerProps: ChartContainerProps<"bar",
|
|
22
|
+
chartContainerProps: ChartContainerProps<"bar", BarChartPluginSignatures>;
|
|
23
23
|
barPlotProps: BarPlotProps;
|
|
24
24
|
gridProps: ChartsGridProps;
|
|
25
25
|
clipPathProps: ChartsClipPathProps;
|
|
@@ -41,7 +41,7 @@ export const useBarChartProps = props => {
|
|
|
41
41
|
barLabel,
|
|
42
42
|
className
|
|
43
43
|
} = props,
|
|
44
|
-
|
|
44
|
+
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
45
45
|
const id = useId();
|
|
46
46
|
const clipPathId = `${id}-clip-path`;
|
|
47
47
|
const hasHorizontalSeries = layout === 'horizontal' || layout === undefined && series.some(item => item.layout === 'horizontal');
|
|
@@ -82,7 +82,7 @@ export const useBarChartProps = props => {
|
|
|
82
82
|
scaleType: 'band'
|
|
83
83
|
}, axis)) : yAxis;
|
|
84
84
|
}, [defaultYAxis, hasHorizontalSeries, yAxis]);
|
|
85
|
-
const chartContainerProps = _extends({},
|
|
85
|
+
const chartContainerProps = _extends({}, other, {
|
|
86
86
|
series: seriesWithDefault,
|
|
87
87
|
width,
|
|
88
88
|
height,
|
|
@@ -136,7 +136,8 @@ export const useBarChartProps = props => {
|
|
|
136
136
|
const chartsWrapperProps = {
|
|
137
137
|
sx,
|
|
138
138
|
legendPosition: props.slotProps?.legend?.position,
|
|
139
|
-
legendDirection: props.slotProps?.legend?.direction
|
|
139
|
+
legendDirection: props.slotProps?.legend?.direction,
|
|
140
|
+
hideLegend: props.hideLegend ?? false
|
|
140
141
|
};
|
|
141
142
|
return {
|
|
142
143
|
chartsWrapperProps,
|
|
@@ -76,6 +76,7 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
76
76
|
* If true, the voronoi interaction are ignored.
|
|
77
77
|
*/
|
|
78
78
|
disableVoronoi: PropTypes.bool,
|
|
79
|
+
enableKeyboardNavigation: PropTypes.bool,
|
|
79
80
|
/**
|
|
80
81
|
* Options to enable features planned for the next major.
|
|
81
82
|
*/
|
|
@@ -658,10 +659,11 @@ process.env.NODE_ENV !== "production" ? ChartContainer.propTypes = {
|
|
|
658
659
|
theme: PropTypes.oneOf(['dark', 'light']),
|
|
659
660
|
title: PropTypes.string,
|
|
660
661
|
/**
|
|
661
|
-
* Defines the
|
|
662
|
+
* Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
|
|
663
|
+
* If set to `'item'`, the radius is the `markerSize`.
|
|
662
664
|
* If `undefined`, the radius is assumed to be infinite.
|
|
663
665
|
*/
|
|
664
|
-
voronoiMaxRadius: PropTypes.number,
|
|
666
|
+
voronoiMaxRadius: PropTypes.oneOfType([PropTypes.oneOf(['item']), PropTypes.number]),
|
|
665
667
|
/**
|
|
666
668
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
667
669
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
|
-
const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "highlightedAxis", "onHighlightedAxisChange", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText", "slots", "slotProps", "experimentalFeatures"];
|
|
5
|
+
const _excluded = ["width", "height", "margin", "children", "series", "colors", "dataset", "desc", "onAxisClick", "highlightedAxis", "onHighlightedAxisChange", "disableVoronoi", "voronoiMaxRadius", "onItemClick", "disableAxisListener", "highlightedItem", "onHighlightChange", "sx", "title", "xAxis", "yAxis", "zAxis", "rotationAxis", "radiusAxis", "skipAnimation", "seriesConfig", "plugins", "localeText", "slots", "slotProps", "experimentalFeatures", "enableKeyboardNavigation"];
|
|
6
6
|
import { DEFAULT_PLUGINS } from "../internals/plugins/allPlugins.js";
|
|
7
7
|
export const useChartContainerProps = (props, ref) => {
|
|
8
8
|
const _ref = props,
|
|
@@ -37,7 +37,8 @@ export const useChartContainerProps = (props, ref) => {
|
|
|
37
37
|
localeText,
|
|
38
38
|
slots,
|
|
39
39
|
slotProps,
|
|
40
|
-
experimentalFeatures
|
|
40
|
+
experimentalFeatures,
|
|
41
|
+
enableKeyboardNavigation
|
|
41
42
|
} = _ref,
|
|
42
43
|
other = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
43
44
|
const chartsSurfaceProps = _extends({
|
|
@@ -71,6 +72,7 @@ export const useChartContainerProps = (props, ref) => {
|
|
|
71
72
|
localeText,
|
|
72
73
|
seriesConfig,
|
|
73
74
|
experimentalFeatures,
|
|
75
|
+
enableKeyboardNavigation,
|
|
74
76
|
plugins: plugins ?? DEFAULT_PLUGINS,
|
|
75
77
|
slots,
|
|
76
78
|
slotProps
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { getValueToPositionMapper } from "../hooks/useScale.js";
|
|
5
|
-
import {
|
|
5
|
+
import { isOrdinalScale } from "../internals/scaleGuards.js";
|
|
6
6
|
import { useSelector } from "../internals/store/useSelector.js";
|
|
7
7
|
import { useStore } from "../internals/store/useStore.js";
|
|
8
8
|
import { selectorChartsHighlightXAxisValue, selectorChartXAxis } from "../internals/plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
@@ -35,15 +35,15 @@ export default function ChartsXHighlight(props) {
|
|
|
35
35
|
const xAxis = xAxes.axis[axisId];
|
|
36
36
|
const xScale = xAxis.scale;
|
|
37
37
|
const getXPosition = getValueToPositionMapper(xScale);
|
|
38
|
-
const
|
|
38
|
+
const isXScaleOrdinal = type === 'band' && value !== null && isOrdinalScale(xScale);
|
|
39
39
|
if (process.env.NODE_ENV !== 'production') {
|
|
40
|
-
const isError =
|
|
40
|
+
const isError = isXScaleOrdinal && xScale(value) === undefined;
|
|
41
41
|
if (isError) {
|
|
42
42
|
console.error([`MUI X Charts: The position value provided for the axis is not valid for the current scale.`, `This probably means something is wrong with the data passed to the chart.`, `The ChartsAxisHighlight component will not be displayed.`].join('\n'));
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
46
|
-
children: [
|
|
46
|
+
children: [isXScaleOrdinal && xScale(value) !== undefined && /*#__PURE__*/_jsx(ChartsAxisHighlightPath, {
|
|
47
47
|
d: `M ${xScale(value) - (xScale.step() - xScale.bandwidth()) / 2} ${top} l ${xScale.step()} 0 l 0 ${height} l ${-xScale.step()} 0 Z`,
|
|
48
48
|
className: classes.root,
|
|
49
49
|
ownerState: {
|