@mui/x-charts 8.11.3 → 8.13.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 +1 -0
- package/BarChart/index.js +12 -0
- package/BarChart/useBarChartProps.d.ts +2 -2
- package/CHANGELOG.md +296 -6
- package/ChartContainer/ChartContainer.js +4 -2
- package/ChartContainer/useChartContainerProps.js +4 -2
- package/ChartsLegend/ContinuousColorLegend.js +1 -0
- package/ChartsLegend/PiecewiseColorLegend.js +1 -0
- package/ChartsSurface/ChartsSurface.js +23 -3
- package/ChartsWrapper/ChartsWrapper.d.ts +2 -1
- package/ChartsWrapper/ChartsWrapper.js +49 -46
- package/ChartsXAxis/useAxisTicksProps.d.ts +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/useLineChartProps.d.ts +2 -2
- package/PieChart/PieArc.d.ts +4 -0
- package/PieChart/PieArc.js +16 -11
- package/PieChart/PieArcPlot.js +28 -3
- package/PieChart/PieChart.js +1 -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/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/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 +8 -5
- package/SparkLineChart/SparkLineChart.js +10 -5
- package/Toolbar/Toolbar.js +1 -2
- 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 +1 -0
- package/esm/BarChart/index.js +1 -0
- package/esm/BarChart/useBarChartProps.d.ts +2 -2
- package/esm/ChartContainer/ChartContainer.js +4 -2
- package/esm/ChartContainer/useChartContainerProps.js +4 -2
- package/esm/ChartsLegend/ContinuousColorLegend.js +1 -0
- package/esm/ChartsLegend/PiecewiseColorLegend.js +1 -0
- package/esm/ChartsSurface/ChartsSurface.js +23 -3
- package/esm/ChartsWrapper/ChartsWrapper.d.ts +2 -1
- package/esm/ChartsWrapper/ChartsWrapper.js +49 -46
- package/esm/ChartsXAxis/useAxisTicksProps.d.ts +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/useLineChartProps.d.ts +2 -2
- package/esm/PieChart/PieArc.d.ts +4 -0
- package/esm/PieChart/PieArc.js +17 -12
- package/esm/PieChart/PieArcPlot.js +30 -5
- package/esm/PieChart/PieChart.js +1 -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/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/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 +8 -5
- package/esm/SparkLineChart/SparkLineChart.js +10 -5
- package/esm/Toolbar/Toolbar.js +1 -2
- 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 +6 -0
- 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 +3 -2
- package/esm/internals/index.js +3 -2
- package/esm/internals/plugins/allPlugins.d.ts +5 -4
- package/esm/internals/plugins/allPlugins.js +3 -2
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +60 -32
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +19 -5
- 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/esm/internals/plugins/featurePlugins/useChartCartesianAxis/{getAxisExtremum.d.ts → getAxisExtrema.d.ts} +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +24 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +66 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +121 -0
- 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 +49 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +20 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +41 -21
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +2 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +30 -7
- 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/useChartInteraction/useChartInteraction.js +6 -4
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -1
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +2 -1
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +6 -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 +170 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +37 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +33 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +36 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +1 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +2 -5
- 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 +7 -0
- package/esm/internals/scaleGuards.js +6 -0
- package/esm/internals/ticks.d.ts +3 -5
- package/esm/internals/ticks.js +6 -5
- 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/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 +6 -0
- package/index.d.ts +1 -0
- package/index.js +13 -1
- package/internals/animation/Transition.js +0 -2
- package/internals/index.d.ts +3 -2
- package/internals/index.js +20 -8
- package/internals/plugins/allPlugins.d.ts +5 -4
- package/internals/plugins/allPlugins.js +3 -2
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +59 -31
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +19 -5
- 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/internals/plugins/featurePlugins/useChartCartesianAxis/{getAxisExtremum.d.ts → getAxisExtrema.d.ts} +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +30 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +66 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +131 -0
- 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 +49 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +20 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +42 -22
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +30 -7
- 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/useChartInteraction/useChartInteraction.js +6 -4
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -1
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +3 -2
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +6 -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 +178 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +37 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +39 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +36 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +5 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +1 -4
- 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 +7 -0
- package/internals/scaleGuards.js +8 -0
- package/internals/ticks.d.ts +3 -5
- package/internals/ticks.js +7 -5
- 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/package.json +5 -5
- package/plugins/index.d.ts +6 -0
- package/plugins/index.js +47 -0
- 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/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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MakeOptional } from '@mui/x-internals/types';
|
|
3
|
-
import {
|
|
3
|
+
import { RadarChartPluginSignatures } from "../RadarChart.plugins.js";
|
|
4
4
|
import { RadarSeriesType } from "../../models/seriesType/radar.js";
|
|
5
5
|
import { ChartDataProviderProps } from "../../ChartDataProvider/index.js";
|
|
6
6
|
import { RadarConfig } from "./radar.types.js";
|
|
7
7
|
import { ChartAnyPluginSignature } from "../../internals/plugins/models/plugin.js";
|
|
8
8
|
export type RadarSeries = MakeOptional<RadarSeriesType, 'type'>;
|
|
9
|
-
export type RadarDataProviderProps<TSignatures extends readonly ChartAnyPluginSignature[] =
|
|
9
|
+
export type RadarDataProviderProps<TSignatures extends readonly ChartAnyPluginSignature[] = RadarChartPluginSignatures> = Omit<ChartDataProviderProps<'radar', TSignatures>, 'series' | 'rotationAxis' | 'radiusAxis' | 'dataset' | 'experimentalFeatures'> & {
|
|
10
10
|
/**
|
|
11
11
|
* The series to display in the bar chart.
|
|
12
12
|
* An array of [[RadarSeries]] objects.
|
|
@@ -22,5 +22,5 @@ export type RadarDataProviderProps<TSignatures extends readonly ChartAnyPluginSi
|
|
|
22
22
|
*/
|
|
23
23
|
highlight?: 'axis' | 'series' | 'none';
|
|
24
24
|
};
|
|
25
|
-
declare function RadarDataProvider<TSignatures extends readonly ChartAnyPluginSignature[] =
|
|
25
|
+
declare function RadarDataProvider<TSignatures extends readonly ChartAnyPluginSignature[] = RadarChartPluginSignatures>(props: RadarDataProviderProps<TSignatures>): React.JSX.Element;
|
|
26
26
|
export { RadarDataProvider };
|
package/RadarChart/index.d.ts
CHANGED
|
@@ -15,4 +15,5 @@ export * from "./RadarGrid/index.js";
|
|
|
15
15
|
export * from "./RadarAxis/index.js";
|
|
16
16
|
export * from "./RadarAxisHighlight/index.js";
|
|
17
17
|
export * from "./RadarMetricLabels/index.js";
|
|
18
|
-
export * from "./RadarSeriesPlot/index.js";
|
|
18
|
+
export * from "./RadarSeriesPlot/index.js";
|
|
19
|
+
export * from "./RadarChart.plugins.js";
|
package/RadarChart/index.js
CHANGED
|
@@ -84,6 +84,18 @@ Object.keys(_RadarSeriesPlot).forEach(function (key) {
|
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
});
|
|
87
|
+
var _RadarChart2 = require("./RadarChart.plugins");
|
|
88
|
+
Object.keys(_RadarChart2).forEach(function (key) {
|
|
89
|
+
if (key === "default" || key === "__esModule") return;
|
|
90
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
91
|
+
if (key in exports && exports[key] === _RadarChart2[key]) return;
|
|
92
|
+
Object.defineProperty(exports, key, {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
get: function () {
|
|
95
|
+
return _RadarChart2[key];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
87
99
|
/**
|
|
88
100
|
* @deprecated radar chart is now stable, import `RadarChart` instead
|
|
89
101
|
*/
|
|
@@ -5,7 +5,7 @@ import type { ChartsWrapperProps } from "../ChartsWrapper/index.js";
|
|
|
5
5
|
import { RadarDataProviderProps } from "./RadarDataProvider/RadarDataProvider.js";
|
|
6
6
|
import { ChartsSurfaceProps } from "../ChartsSurface/index.js";
|
|
7
7
|
import { RadarGridProps } from "./RadarGrid/index.js";
|
|
8
|
-
import {
|
|
8
|
+
import { RadarChartPluginSignatures } from "./RadarChart.plugins.js";
|
|
9
9
|
import { RadarSeriesAreaProps, RadarSeriesMarksProps } from "./RadarSeriesPlot/index.js";
|
|
10
10
|
/**
|
|
11
11
|
* A helper function that extracts RadarChartProps from the input props
|
|
@@ -18,7 +18,7 @@ export declare const useRadarChartProps: (props: RadarChartProps) => {
|
|
|
18
18
|
highlight: "none" | "series" | "axis";
|
|
19
19
|
chartsWrapperProps: Omit<ChartsWrapperProps, "children">;
|
|
20
20
|
chartsSurfaceProps: ChartsSurfaceProps;
|
|
21
|
-
radarDataProviderProps: RadarDataProviderProps<
|
|
21
|
+
radarDataProviderProps: RadarDataProviderProps<RadarChartPluginSignatures>;
|
|
22
22
|
radarGrid: RadarGridProps;
|
|
23
23
|
radarSeriesAreaProps: RadarSeriesAreaProps;
|
|
24
24
|
radarSeriesMarksProps: RadarSeriesMarksProps;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DefaultizedScatterSeriesType } from "../models/seriesType/scatter.js";
|
|
3
|
+
import { D3Scale } from "../models/axis.js";
|
|
4
|
+
import { ScatterClasses } from "./scatterClasses.js";
|
|
5
|
+
import { ColorGetter } from "../internals/plugins/models/seriesConfig/index.js";
|
|
6
|
+
export interface BatchScatterProps {
|
|
7
|
+
series: DefaultizedScatterSeriesType;
|
|
8
|
+
xScale: D3Scale;
|
|
9
|
+
yScale: D3Scale;
|
|
10
|
+
color: string;
|
|
11
|
+
colorGetter?: ColorGetter<'scatter'>;
|
|
12
|
+
classes?: Partial<ScatterClasses>;
|
|
13
|
+
}
|
|
14
|
+
export interface BatchScatterPathsProps {
|
|
15
|
+
series: DefaultizedScatterSeriesType;
|
|
16
|
+
xScale: D3Scale;
|
|
17
|
+
yScale: D3Scale;
|
|
18
|
+
color: string;
|
|
19
|
+
colorGetter?: ColorGetter<'scatter'>;
|
|
20
|
+
markerSize: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
* A batch version of the Scatter component that uses SVG paths to render points.
|
|
25
|
+
* This component is optimized for performance and is suitable for rendering large datasets, but has limitations. Some of the limitations include:
|
|
26
|
+
* - Limited CSS styling;
|
|
27
|
+
* - Overriding the `marker` slot is not supported;
|
|
28
|
+
* - Highlight style must not contain opacity.
|
|
29
|
+
*
|
|
30
|
+
* You can read about all the limitations [here](https://mui.com/x/react-charts/scatter/#performance).
|
|
31
|
+
*/
|
|
32
|
+
export declare function BatchScatter(props: BatchScatterProps): React.JSX.Element;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.BatchScatter = BatchScatter;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _styles = require("@mui/material/styles");
|
|
11
|
+
var _scatterClasses = require("./scatterClasses");
|
|
12
|
+
var _ChartProvider = require("../context/ChartProvider");
|
|
13
|
+
var _useScale = require("../hooks/useScale");
|
|
14
|
+
var _useSelector = require("../internals/store/useSelector");
|
|
15
|
+
var _useChartHighlight = require("../internals/plugins/featurePlugins/useChartHighlight");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
const MAX_POINTS_PER_PATH = 1000;
|
|
18
|
+
/* In an SVG arc, if the arc starts and ends at the same point, it is not rendered, so we add a tiny
|
|
19
|
+
* value to one of the coordinates to ensure that the arc is rendered. */
|
|
20
|
+
const ALMOST_ZERO = 0.01;
|
|
21
|
+
function appendAtKey(map, key, value) {
|
|
22
|
+
let bucket = map.get(key);
|
|
23
|
+
if (!bucket) {
|
|
24
|
+
bucket = [value];
|
|
25
|
+
map.set(key, bucket);
|
|
26
|
+
} else {
|
|
27
|
+
bucket.push(value);
|
|
28
|
+
}
|
|
29
|
+
return bucket;
|
|
30
|
+
}
|
|
31
|
+
function createPath(x, y, markerSize) {
|
|
32
|
+
return `M${x - markerSize} ${y} a${markerSize} ${markerSize} 0 1 1 0 ${ALMOST_ZERO}`;
|
|
33
|
+
}
|
|
34
|
+
function useCreatePaths(seriesData, markerSize, xScale, yScale, color, colorGetter) {
|
|
35
|
+
const {
|
|
36
|
+
instance
|
|
37
|
+
} = (0, _ChartProvider.useChartContext)();
|
|
38
|
+
const getXPosition = (0, _useScale.getValueToPositionMapper)(xScale);
|
|
39
|
+
const getYPosition = (0, _useScale.getValueToPositionMapper)(yScale);
|
|
40
|
+
const paths = new Map();
|
|
41
|
+
const temporaryPaths = new Map();
|
|
42
|
+
for (let i = 0; i < seriesData.length; i += 1) {
|
|
43
|
+
const scatterPoint = seriesData[i];
|
|
44
|
+
const x = getXPosition(scatterPoint.x);
|
|
45
|
+
const y = getYPosition(scatterPoint.y);
|
|
46
|
+
if (!instance.isPointInside(x, y)) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const path = createPath(x, y, markerSize);
|
|
50
|
+
const fill = colorGetter ? colorGetter(i) : color;
|
|
51
|
+
const tempPath = appendAtKey(temporaryPaths, fill, path);
|
|
52
|
+
if (tempPath.length >= MAX_POINTS_PER_PATH) {
|
|
53
|
+
appendAtKey(paths, fill, tempPath.join(''));
|
|
54
|
+
temporaryPaths.delete(fill);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
for (const [fill, tempPath] of temporaryPaths.entries()) {
|
|
58
|
+
if (tempPath.length > 0) {
|
|
59
|
+
appendAtKey(paths, fill, tempPath.join(''));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return paths;
|
|
63
|
+
}
|
|
64
|
+
function BatchScatterPaths(props) {
|
|
65
|
+
const {
|
|
66
|
+
series,
|
|
67
|
+
xScale,
|
|
68
|
+
yScale,
|
|
69
|
+
color,
|
|
70
|
+
colorGetter,
|
|
71
|
+
markerSize
|
|
72
|
+
} = props;
|
|
73
|
+
const paths = useCreatePaths(series.data, markerSize, xScale, yScale, color, colorGetter);
|
|
74
|
+
const children = [];
|
|
75
|
+
let i = 0;
|
|
76
|
+
for (const [fill, dArray] of paths.entries()) {
|
|
77
|
+
for (const d of dArray) {
|
|
78
|
+
children.push(/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
79
|
+
fill: fill,
|
|
80
|
+
d: d
|
|
81
|
+
}, i));
|
|
82
|
+
i += 1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(React.Fragment, {
|
|
86
|
+
children: children
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const MemoBatchScatterPaths = /*#__PURE__*/React.memo(BatchScatterPaths);
|
|
90
|
+
if (process.env.NODE_ENV !== "production") MemoBatchScatterPaths.displayName = "MemoBatchScatterPaths";
|
|
91
|
+
const Group = (0, _styles.styled)('g')({
|
|
92
|
+
'&[data-faded="true"]': {
|
|
93
|
+
opacity: 0.3
|
|
94
|
+
},
|
|
95
|
+
'& path': {
|
|
96
|
+
/* The browser must do hit testing to know which element a pointer is interacting with.
|
|
97
|
+
* With many data points, we create many paths causing significant time to be spent in the hit test phase.
|
|
98
|
+
* To fix this issue, we disable pointer events for the descendant paths.
|
|
99
|
+
*
|
|
100
|
+
* Ideally, users should be able to override this in case they need pointer events to be enabled,
|
|
101
|
+
* but it can affect performance negatively, especially with many data points. */
|
|
102
|
+
pointerEvents: 'none'
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @internal
|
|
108
|
+
* A batch version of the Scatter component that uses SVG paths to render points.
|
|
109
|
+
* This component is optimized for performance and is suitable for rendering large datasets, but has limitations. Some of the limitations include:
|
|
110
|
+
* - Limited CSS styling;
|
|
111
|
+
* - Overriding the `marker` slot is not supported;
|
|
112
|
+
* - Highlight style must not contain opacity.
|
|
113
|
+
*
|
|
114
|
+
* You can read about all the limitations [here](https://mui.com/x/react-charts/scatter/#performance).
|
|
115
|
+
*/
|
|
116
|
+
function BatchScatter(props) {
|
|
117
|
+
const {
|
|
118
|
+
series,
|
|
119
|
+
xScale,
|
|
120
|
+
yScale,
|
|
121
|
+
color,
|
|
122
|
+
colorGetter,
|
|
123
|
+
classes: inClasses
|
|
124
|
+
} = props;
|
|
125
|
+
const {
|
|
126
|
+
store
|
|
127
|
+
} = (0, _ChartProvider.useChartContext)();
|
|
128
|
+
const isSeriesHighlighted = (0, _useSelector.useSelector)(store, _useChartHighlight.selectorChartIsSeriesHighlighted, [series.id]);
|
|
129
|
+
const isSeriesFaded = (0, _useSelector.useSelector)(store, _useChartHighlight.selectorChartIsSeriesFaded, [series.id]);
|
|
130
|
+
const seriesHighlightedItem = (0, _useSelector.useSelector)(store, _useChartHighlight.selectorChartSeriesHighlightedItem, [series.id]);
|
|
131
|
+
const seriesUnfadedItem = (0, _useSelector.useSelector)(store, _useChartHighlight.selectorChartSeriesUnfadedItem, [series.id]);
|
|
132
|
+
const highlightedModifier = 1.2;
|
|
133
|
+
const markerSize = series.markerSize * (isSeriesHighlighted ? highlightedModifier : 1);
|
|
134
|
+
const classes = (0, _scatterClasses.useUtilityClasses)(inClasses);
|
|
135
|
+
const siblings = [];
|
|
136
|
+
if (seriesHighlightedItem != null) {
|
|
137
|
+
const datum = series.data[seriesHighlightedItem];
|
|
138
|
+
const getXPosition = (0, _useScale.getValueToPositionMapper)(xScale);
|
|
139
|
+
const getYPosition = (0, _useScale.getValueToPositionMapper)(yScale);
|
|
140
|
+
siblings.push(/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
141
|
+
fill: colorGetter ? colorGetter(seriesHighlightedItem) : color,
|
|
142
|
+
"data-highlighted": true,
|
|
143
|
+
d: createPath(getXPosition(datum.x), getYPosition(datum.y), markerSize * highlightedModifier)
|
|
144
|
+
}, `highlighted-${series.id}`));
|
|
145
|
+
}
|
|
146
|
+
if (seriesUnfadedItem != null) {
|
|
147
|
+
const datum = series.data[seriesUnfadedItem];
|
|
148
|
+
const getXPosition = (0, _useScale.getValueToPositionMapper)(xScale);
|
|
149
|
+
const getYPosition = (0, _useScale.getValueToPositionMapper)(yScale);
|
|
150
|
+
siblings.push(/*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
|
|
151
|
+
fill: colorGetter ? colorGetter(seriesUnfadedItem) : color,
|
|
152
|
+
d: createPath(getXPosition(datum.x), getYPosition(datum.y), markerSize)
|
|
153
|
+
}, `unfaded-${series.id}`));
|
|
154
|
+
}
|
|
155
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
|
|
156
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Group, {
|
|
157
|
+
className: classes.root,
|
|
158
|
+
"data-series": series.id,
|
|
159
|
+
"data-faded": isSeriesFaded || undefined,
|
|
160
|
+
"data-highlighted": isSeriesHighlighted || undefined,
|
|
161
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(MemoBatchScatterPaths, {
|
|
162
|
+
series: series,
|
|
163
|
+
xScale: xScale,
|
|
164
|
+
yScale: yScale,
|
|
165
|
+
color: color,
|
|
166
|
+
colorGetter: colorGetter,
|
|
167
|
+
markerSize: markerSize
|
|
168
|
+
})
|
|
169
|
+
}), siblings]
|
|
170
|
+
});
|
|
171
|
+
}
|
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,
|
|
@@ -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/Toolbar/Toolbar.js
CHANGED
|
@@ -33,8 +33,7 @@ const ToolbarRoot = (0, _styles.styled)('div', {
|
|
|
33
33
|
minHeight: 44,
|
|
34
34
|
boxSizing: 'border-box',
|
|
35
35
|
border: `1px solid ${(theme.vars || theme).palette.divider}`,
|
|
36
|
-
borderRadius: 4
|
|
37
|
-
gridArea: 'toolbar'
|
|
36
|
+
borderRadius: 4
|
|
38
37
|
}));
|
|
39
38
|
const Toolbar = exports.Toolbar = /*#__PURE__*/React.forwardRef(function Toolbar(_ref, ref) {
|
|
40
39
|
let {
|