@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
|
@@ -10,11 +10,12 @@ import { getInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
|
10
10
|
import { useStore } from "../internals/store/useStore.js";
|
|
11
11
|
import { useSelector } from "../internals/store/useSelector.js";
|
|
12
12
|
import { useItemHighlightedGetter } from "../hooks/useItemHighlightedGetter.js";
|
|
13
|
-
import {
|
|
13
|
+
import { selectorChartsIsVoronoiEnabled } from "../internals/plugins/featurePlugins/useChartClosestPoint/index.js";
|
|
14
14
|
import { ScatterMarker } from "./ScatterMarker.js";
|
|
15
15
|
import { useUtilityClasses } from "./scatterClasses.js";
|
|
16
16
|
import { useScatterPlotData } from "./useScatterPlotData.js";
|
|
17
17
|
import { useChartContext } from "../context/ChartProvider/index.js";
|
|
18
|
+
import { useIsItemFocusedGetter } from "../hooks/useIsItemFocusedGetter.js";
|
|
18
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
20
|
/**
|
|
20
21
|
* Demos:
|
|
@@ -42,12 +43,13 @@ function Scatter(props) {
|
|
|
42
43
|
instance
|
|
43
44
|
} = useChartContext();
|
|
44
45
|
const store = useStore();
|
|
45
|
-
const isVoronoiEnabled = useSelector(store,
|
|
46
|
+
const isVoronoiEnabled = useSelector(store, selectorChartsIsVoronoiEnabled);
|
|
46
47
|
const skipInteractionHandlers = isVoronoiEnabled || series.disableHover;
|
|
47
48
|
const {
|
|
48
49
|
isFaded,
|
|
49
50
|
isHighlighted
|
|
50
51
|
} = useItemHighlightedGetter();
|
|
52
|
+
const isFocused = useIsItemFocusedGetter();
|
|
51
53
|
const scatterPlotData = useScatterPlotData(series, xScale, yScale, instance.isPointInside);
|
|
52
54
|
const Marker = slots?.marker ?? ScatterMarker;
|
|
53
55
|
const _useSlotProps = useSlotProps({
|
|
@@ -64,12 +66,17 @@ function Scatter(props) {
|
|
|
64
66
|
return /*#__PURE__*/_jsx("g", {
|
|
65
67
|
"data-series": series.id,
|
|
66
68
|
className: classes.root,
|
|
67
|
-
children: scatterPlotData.map(
|
|
69
|
+
children: scatterPlotData.map(dataPoint => {
|
|
68
70
|
const isItemHighlighted = isHighlighted(dataPoint);
|
|
69
71
|
const isItemFaded = !isItemHighlighted && isFaded(dataPoint);
|
|
72
|
+
const isItemFocused = isFocused({
|
|
73
|
+
seriesType: 'scatter',
|
|
74
|
+
seriesId: series.id,
|
|
75
|
+
dataIndex: dataPoint.dataIndex
|
|
76
|
+
});
|
|
70
77
|
return /*#__PURE__*/_jsx(Marker, _extends({
|
|
71
78
|
dataIndex: dataPoint.dataIndex,
|
|
72
|
-
color: colorGetter ? colorGetter(
|
|
79
|
+
color: colorGetter ? colorGetter(dataPoint.dataIndex) : color,
|
|
73
80
|
isHighlighted: isItemHighlighted,
|
|
74
81
|
isFaded: isItemFaded,
|
|
75
82
|
x: dataPoint.x,
|
|
@@ -80,7 +87,8 @@ function Scatter(props) {
|
|
|
80
87
|
dataIndex: dataPoint.dataIndex
|
|
81
88
|
})),
|
|
82
89
|
"data-highlighted": isItemHighlighted || undefined,
|
|
83
|
-
"data-faded": isItemFaded || undefined
|
|
90
|
+
"data-faded": isItemFaded || undefined,
|
|
91
|
+
"data-focused": isItemFocused || undefined
|
|
84
92
|
}, skipInteractionHandlers ? undefined : getInteractionItemProps(instance, dataPoint), markerProps), dataPoint.id ?? dataPoint.dataIndex);
|
|
85
93
|
})
|
|
86
94
|
});
|
|
@@ -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:
|
|
@@ -103,6 +103,7 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
103
103
|
* @default false
|
|
104
104
|
*/
|
|
105
105
|
disableVoronoi: PropTypes.bool,
|
|
106
|
+
enableKeyboardNavigation: PropTypes.bool,
|
|
106
107
|
/**
|
|
107
108
|
* Option to display a cartesian grid in the background.
|
|
108
109
|
*/
|
|
@@ -171,6 +172,15 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
171
172
|
* @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
|
|
172
173
|
*/
|
|
173
174
|
onItemClick: PropTypes.func,
|
|
175
|
+
/**
|
|
176
|
+
* The type of renderer to use for the scatter plot.
|
|
177
|
+
* - `svg-single`: Renders every scatter item in a `<circle />` element.
|
|
178
|
+
* - `svg-batch`: Batch renders scatter items in `<path />` elements for better performance with large datasets, at the cost of some limitations.
|
|
179
|
+
* Read more: https://mui.com/x/react-charts/scatter/#performance
|
|
180
|
+
*
|
|
181
|
+
* @default 'svg-single'
|
|
182
|
+
*/
|
|
183
|
+
renderer: PropTypes.oneOf(['svg-batch', 'svg-single']),
|
|
174
184
|
/**
|
|
175
185
|
* The series to display in the scatter chart.
|
|
176
186
|
* An array of [[ScatterSeries]] objects.
|
|
@@ -200,10 +210,11 @@ process.env.NODE_ENV !== "production" ? ScatterChart.propTypes = {
|
|
|
200
210
|
theme: PropTypes.oneOf(['dark', 'light']),
|
|
201
211
|
title: PropTypes.string,
|
|
202
212
|
/**
|
|
203
|
-
* Defines the
|
|
213
|
+
* Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
|
|
214
|
+
* If set to `'item'`, the radius is the `markerSize`.
|
|
204
215
|
* If `undefined`, the radius is assumed to be infinite.
|
|
205
216
|
*/
|
|
206
|
-
voronoiMaxRadius: PropTypes.number,
|
|
217
|
+
voronoiMaxRadius: PropTypes.oneOfType([PropTypes.oneOf(['item']), PropTypes.number]),
|
|
207
218
|
/**
|
|
208
219
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
209
220
|
*/
|
|
@@ -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>;
|
|
@@ -2,5 +2,6 @@ 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
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { useChartClosestPoint } from "../internals/plugins/featurePlugins/useChartClosestPoint/index.js";
|
|
6
|
+
import { useChartKeyboardNavigation } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
7
|
+
export const SCATTER_CHART_PLUGINS = [useChartZAxis, useChartCartesianAxis, useChartInteraction, useChartHighlight, useChartClosestPoint, 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:
|
|
@@ -8,6 +8,7 @@ import { useScatterSeriesContext } from "../hooks/useScatterSeries.js";
|
|
|
8
8
|
import { useXAxes, useYAxes } from "../hooks/index.js";
|
|
9
9
|
import { useZAxes } from "../hooks/useZAxis.js";
|
|
10
10
|
import { seriesConfig as scatterSeriesConfig } from "./seriesConfig/index.js";
|
|
11
|
+
import { BatchScatter } from "./BatchScatter.js";
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
/**
|
|
13
14
|
* Demos:
|
|
@@ -23,7 +24,8 @@ function ScatterPlot(props) {
|
|
|
23
24
|
const {
|
|
24
25
|
slots,
|
|
25
26
|
slotProps,
|
|
26
|
-
onItemClick
|
|
27
|
+
onItemClick,
|
|
28
|
+
renderer
|
|
27
29
|
} = props;
|
|
28
30
|
const seriesData = useScatterSeriesContext();
|
|
29
31
|
const {
|
|
@@ -48,7 +50,8 @@ function ScatterPlot(props) {
|
|
|
48
50
|
const defaultXAxisId = xAxisIds[0];
|
|
49
51
|
const defaultYAxisId = yAxisIds[0];
|
|
50
52
|
const defaultZAxisId = zAxisIds[0];
|
|
51
|
-
const
|
|
53
|
+
const DefaultScatterItems = renderer === 'svg-batch' ? BatchScatter : Scatter;
|
|
54
|
+
const ScatterItems = slots?.scatter ?? DefaultScatterItems;
|
|
52
55
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
53
56
|
children: seriesOrder.map(seriesId => {
|
|
54
57
|
const {
|
|
@@ -85,6 +88,15 @@ process.env.NODE_ENV !== "production" ? ScatterPlot.propTypes = {
|
|
|
85
88
|
* @param {ScatterItemIdentifier} scatterItemIdentifier The scatter item identifier.
|
|
86
89
|
*/
|
|
87
90
|
onItemClick: PropTypes.func,
|
|
91
|
+
/**
|
|
92
|
+
* The type of renderer to use for the scatter plot.
|
|
93
|
+
* - `svg-single`: Renders every scatter item in a `<circle />` element.
|
|
94
|
+
* - `svg-batch`: Batch renders scatter items in `<path />` elements for better performance with large datasets, at the cost of some limitations.
|
|
95
|
+
* Read more: https://mui.com/x/react-charts/scatter/#performance
|
|
96
|
+
*
|
|
97
|
+
* @default 'svg-single'
|
|
98
|
+
*/
|
|
99
|
+
renderer: PropTypes.oneOf(['svg-batch', 'svg-single']),
|
|
88
100
|
/**
|
|
89
101
|
* The props used for each component slot.
|
|
90
102
|
* @default {}
|
|
@@ -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";
|
|
@@ -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;
|
|
@@ -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 = ["xAxis", "yAxis", "zAxis", "series", "axisHighlight", "voronoiMaxRadius", "disableVoronoi", "hideLegend", "width", "height", "margin", "colors", "sx", "grid", "onItemClick", "children", "slots", "slotProps", "loading", "highlightedItem", "onHighlightChange", "className", "showToolbar"];
|
|
5
|
+
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"];
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { SCATTER_CHART_PLUGINS } from "./ScatterChart.plugins.js";
|
|
8
8
|
/**
|
|
@@ -34,12 +34,14 @@ export const useScatterChartProps = props => {
|
|
|
34
34
|
loading,
|
|
35
35
|
highlightedItem,
|
|
36
36
|
onHighlightChange,
|
|
37
|
-
className
|
|
37
|
+
className,
|
|
38
|
+
renderer
|
|
38
39
|
} = props,
|
|
39
40
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
40
41
|
const seriesWithDefault = React.useMemo(() => series.map(s => _extends({
|
|
41
42
|
type: 'scatter'
|
|
42
43
|
}, s)), [series]);
|
|
44
|
+
const useVoronoiOnItemClick = disableVoronoi !== true || renderer === 'svg-batch';
|
|
43
45
|
const chartContainerProps = _extends({}, other, {
|
|
44
46
|
series: seriesWithDefault,
|
|
45
47
|
width,
|
|
@@ -53,7 +55,7 @@ export const useScatterChartProps = props => {
|
|
|
53
55
|
onHighlightChange,
|
|
54
56
|
disableVoronoi,
|
|
55
57
|
voronoiMaxRadius,
|
|
56
|
-
onItemClick:
|
|
58
|
+
onItemClick: useVoronoiOnItemClick ? onItemClick : undefined,
|
|
57
59
|
className,
|
|
58
60
|
plugins: SCATTER_CHART_PLUGINS,
|
|
59
61
|
slots,
|
|
@@ -68,9 +70,10 @@ export const useScatterChartProps = props => {
|
|
|
68
70
|
horizontal: grid?.horizontal
|
|
69
71
|
};
|
|
70
72
|
const scatterPlotProps = {
|
|
71
|
-
onItemClick:
|
|
73
|
+
onItemClick: useVoronoiOnItemClick ? undefined : onItemClick,
|
|
72
74
|
slots,
|
|
73
|
-
slotProps
|
|
75
|
+
slotProps,
|
|
76
|
+
renderer
|
|
74
77
|
};
|
|
75
78
|
const overlayProps = {
|
|
76
79
|
loading,
|
|
@@ -88,7 +91,8 @@ export const useScatterChartProps = props => {
|
|
|
88
91
|
const chartsWrapperProps = {
|
|
89
92
|
sx,
|
|
90
93
|
legendPosition: props.slotProps?.legend?.position,
|
|
91
|
-
legendDirection: props.slotProps?.legend?.direction
|
|
94
|
+
legendDirection: props.slotProps?.legend?.direction,
|
|
95
|
+
hideLegend: props.hideLegend ?? false
|
|
92
96
|
};
|
|
93
97
|
return {
|
|
94
98
|
chartsWrapperProps,
|
|
@@ -14,6 +14,7 @@ import { ChartsSurface } from "../ChartsSurface/index.js";
|
|
|
14
14
|
import { DEFAULT_X_AXIS_KEY, DEFAULT_Y_AXIS_KEY } from "../constants/index.js";
|
|
15
15
|
import { ChartsTooltip } from "../ChartsTooltip/index.js";
|
|
16
16
|
import { ChartsAxisHighlight } from "../ChartsAxisHighlight/index.js";
|
|
17
|
+
import { FocusedMark } from "../LineChart/FocusedMark.js";
|
|
17
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
19
|
const SPARK_LINE_DEFAULT_MARGIN = 5;
|
|
19
20
|
|
|
@@ -137,9 +138,11 @@ const SparkLineChart = /*#__PURE__*/React.forwardRef(function SparkLineChart(pro
|
|
|
137
138
|
slotProps: slotProps
|
|
138
139
|
})]
|
|
139
140
|
})]
|
|
140
|
-
}), plotType === 'line' && /*#__PURE__*/
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
}), plotType === 'line' && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
142
|
+
children: [/*#__PURE__*/_jsx(LineHighlightPlot, {
|
|
143
|
+
slots: slots,
|
|
144
|
+
slotProps: slotProps
|
|
145
|
+
}), /*#__PURE__*/_jsx(FocusedMark, {})]
|
|
143
146
|
}), disableClipping ? null : /*#__PURE__*/_jsx(ChartsClipPath, {
|
|
144
147
|
id: clipPathId,
|
|
145
148
|
offset: clipPathOffset
|
|
@@ -225,6 +228,7 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
225
228
|
* If true, the voronoi interaction are ignored.
|
|
226
229
|
*/
|
|
227
230
|
disableVoronoi: PropTypes.bool,
|
|
231
|
+
enableKeyboardNavigation: PropTypes.bool,
|
|
228
232
|
/**
|
|
229
233
|
* The height of the chart in px. If not defined, it takes the height of the parent element.
|
|
230
234
|
*/
|
|
@@ -338,10 +342,11 @@ process.env.NODE_ENV !== "production" ? SparkLineChart.propTypes = {
|
|
|
338
342
|
*/
|
|
339
343
|
valueFormatter: PropTypes.func,
|
|
340
344
|
/**
|
|
341
|
-
* Defines the
|
|
345
|
+
* Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
|
|
346
|
+
* If set to `'item'`, the radius is the `markerSize`.
|
|
342
347
|
* If `undefined`, the radius is assumed to be infinite.
|
|
343
348
|
*/
|
|
344
|
-
voronoiMaxRadius: PropTypes.number,
|
|
349
|
+
voronoiMaxRadius: PropTypes.oneOfType([PropTypes.oneOf(['item']), PropTypes.number]),
|
|
345
350
|
/**
|
|
346
351
|
* The width of the chart in px. If not defined, it takes the width of the parent element.
|
|
347
352
|
*/
|
|
@@ -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;
|
|
@@ -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
|
};
|
package/esm/hooks/useAxis.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxisId, ChartsRadiusAxisProps, ChartsRotationAxisProps, PolarAxisDefaultized, ScaleName } from "../models/axis.js";
|
|
1
|
+
import { AxisId, ChartsRadiusAxisProps, ChartsRotationAxisProps, PolarAxisDefaultized, ScaleName, type AxisScaleConfig, type ChartsXAxisProps, type ChartsYAxisProps, type ComputedAxis } from "../models/axis.js";
|
|
2
2
|
/**
|
|
3
3
|
* Get all the x-axes.
|
|
4
4
|
*
|
|
@@ -10,7 +10,7 @@ import { AxisId, ChartsRadiusAxisProps, ChartsRotationAxisProps, PolarAxisDefaul
|
|
|
10
10
|
* @returns `{ xAxis, xAxisIds }` - The x-axes and their IDs.
|
|
11
11
|
*/
|
|
12
12
|
export declare function useXAxes(): {
|
|
13
|
-
xAxis: import("../internals/index.js").ComputedAxisConfig<
|
|
13
|
+
xAxis: import("../internals/index.js").ComputedAxisConfig<ChartsXAxisProps>;
|
|
14
14
|
xAxisIds: AxisId[];
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
@@ -24,7 +24,7 @@ export declare function useXAxes(): {
|
|
|
24
24
|
* @returns `{ yAxis, yAxisIds }` - The y-axes and their IDs.
|
|
25
25
|
*/
|
|
26
26
|
export declare function useYAxes(): {
|
|
27
|
-
yAxis: import("../internals/index.js").ComputedAxisConfig<
|
|
27
|
+
yAxis: import("../internals/index.js").ComputedAxisConfig<ChartsYAxisProps>;
|
|
28
28
|
yAxisIds: AxisId[];
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
@@ -32,13 +32,13 @@ export declare function useYAxes(): {
|
|
|
32
32
|
* @param {AxisId | undefined} axisId - If provided returns the x axis with axisId, else returns the values for the default x axis.
|
|
33
33
|
* @returns The X axis.
|
|
34
34
|
*/
|
|
35
|
-
export declare function useXAxis(axisId?: AxisId):
|
|
35
|
+
export declare function useXAxis<T extends keyof AxisScaleConfig>(axisId?: AxisId): ComputedAxis<T, any, ChartsXAxisProps>;
|
|
36
36
|
/**
|
|
37
37
|
* Get the Y axis.
|
|
38
38
|
* @param {AxisId | undefined} axisId - If provided returns the y axis with axisId, else returns the values for the default y axis.
|
|
39
39
|
* @returns The Y axis.
|
|
40
40
|
*/
|
|
41
|
-
export declare function useYAxis(axisId?: AxisId):
|
|
41
|
+
export declare function useYAxis<T extends keyof AxisScaleConfig>(axisId?: AxisId): ComputedAxis<T, any, ChartsYAxisProps>;
|
|
42
42
|
export declare function useRotationAxes(): {
|
|
43
43
|
rotationAxis: import("../internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js").DefaultizedAxisConfig<ChartsRotationAxisProps>;
|
|
44
44
|
rotationAxisIds: string[];
|
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
export type ChartDrawingArea = {
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The gap between the left border of the SVG and the drawing area.
|
|
4
|
+
*/
|
|
3
5
|
left: number;
|
|
4
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The gap between the top border of the SVG and the drawing area.
|
|
8
|
+
*/
|
|
9
|
+
top: number;
|
|
10
|
+
/**
|
|
11
|
+
* The gap between the bottom border of the SVG and the drawing area.
|
|
12
|
+
*/
|
|
5
13
|
bottom: number;
|
|
14
|
+
/**
|
|
15
|
+
* The gap between the right border of the SVG and the drawing area.
|
|
16
|
+
*/
|
|
17
|
+
right: number;
|
|
18
|
+
/**
|
|
19
|
+
* The width of the drawing area.
|
|
20
|
+
*/
|
|
6
21
|
width: number;
|
|
22
|
+
/**
|
|
23
|
+
* The height of the drawing area.
|
|
24
|
+
*/
|
|
7
25
|
height: number;
|
|
8
26
|
};
|
|
9
27
|
/**
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChartSeriesType } from "../models/seriesType/config.js";
|
|
2
|
+
import { SeriesId } from "../models/seriesType/common.js";
|
|
3
|
+
export type FocusedItemData = {
|
|
4
|
+
seriesType: ChartSeriesType;
|
|
5
|
+
seriesId: SeriesId;
|
|
6
|
+
dataIndex: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Get the focused item from keyboard navigation.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useFocusedItem(): {
|
|
12
|
+
seriesType: keyof import("../internals/index.js").ChartsSeriesConfig;
|
|
13
|
+
seriesId: SeriesId;
|
|
14
|
+
dataIndex: number;
|
|
15
|
+
} | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useStore } from "../internals/store/useStore.js";
|
|
5
|
+
import { useSelector } from "../internals/store/useSelector.js";
|
|
6
|
+
import { selectorChartsFocusedSeriesType, selectorChartsFocusedSeriesId, selectorChartsFocusedDataIndex } from "../internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js";
|
|
7
|
+
/**
|
|
8
|
+
* Get the focused item from keyboard navigation.
|
|
9
|
+
*/
|
|
10
|
+
export function useFocusedItem() {
|
|
11
|
+
const store = useStore();
|
|
12
|
+
const focusedSeriesType = useSelector(store, selectorChartsFocusedSeriesType);
|
|
13
|
+
const focusedSeriesId = useSelector(store, selectorChartsFocusedSeriesId);
|
|
14
|
+
const focusedDataIndex = useSelector(store, selectorChartsFocusedDataIndex);
|
|
15
|
+
return React.useMemo(() => focusedSeriesType === undefined || focusedSeriesId === undefined || focusedDataIndex === undefined ? null : {
|
|
16
|
+
seriesType: focusedSeriesType,
|
|
17
|
+
seriesId: focusedSeriesId,
|
|
18
|
+
dataIndex: focusedDataIndex
|
|
19
|
+
}, [focusedSeriesType, focusedSeriesId, focusedDataIndex]);
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FocusedItemData } from "./useFocusedItem.js";
|
|
2
|
+
type UseItemFocusedParams = FocusedItemData;
|
|
3
|
+
/**
|
|
4
|
+
* A hook to check if an item has the focus.
|
|
5
|
+
*
|
|
6
|
+
* If you need to process multiple points, use the `useIsItemFocusedGetter` hook instead.
|
|
7
|
+
*
|
|
8
|
+
* @param {FocusedItemData} item is the item to check
|
|
9
|
+
* @returns {boolean} the focus state
|
|
10
|
+
*/
|
|
11
|
+
export declare function useIsItemFocused(item: UseItemFocusedParams): boolean;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useFocusedItem } from "./useFocusedItem.js";
|
|
4
|
+
/**
|
|
5
|
+
* A hook to check if an item has the focus.
|
|
6
|
+
*
|
|
7
|
+
* If you need to process multiple points, use the `useIsItemFocusedGetter` hook instead.
|
|
8
|
+
*
|
|
9
|
+
* @param {FocusedItemData} item is the item to check
|
|
10
|
+
* @returns {boolean} the focus state
|
|
11
|
+
*/
|
|
12
|
+
export function useIsItemFocused(item) {
|
|
13
|
+
const focusedItem = useFocusedItem();
|
|
14
|
+
return focusedItem !== null && focusedItem.seriesType === item.seriesType && focusedItem.seriesId === item.seriesId && focusedItem.dataIndex === item.dataIndex;
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FocusedItemData } from "./useFocusedItem.js";
|
|
2
|
+
/**
|
|
3
|
+
* A hook to check focus state of multiple items.
|
|
4
|
+
* If you're interested by a single one, consider using `useIsItemFocused`.
|
|
5
|
+
*
|
|
6
|
+
* @returns {(item: FocusedItemData) => boolean} callback to get the state of the item.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useIsItemFocusedGetter(): (item: FocusedItemData) => boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useFocusedItem } from "./useFocusedItem.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A hook to check focus state of multiple items.
|
|
7
|
+
* If you're interested by a single one, consider using `useIsItemFocused`.
|
|
8
|
+
*
|
|
9
|
+
* @returns {(item: FocusedItemData) => boolean} callback to get the state of the item.
|
|
10
|
+
*/
|
|
11
|
+
export function useIsItemFocusedGetter() {
|
|
12
|
+
const focusedItem = useFocusedItem();
|
|
13
|
+
return item => focusedItem !== null && focusedItem.seriesType === item.seriesType && focusedItem.seriesId === item.seriesId && focusedItem.dataIndex === item.dataIndex;
|
|
14
|
+
}
|
package/esm/hooks/useScale.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { isOrdinalScale } from "../internals/scaleGuards.js";
|
|
4
4
|
import { useRadiusAxis, useRotationAxis, useXAxis, useYAxis } from "./useAxis.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -10,9 +10,15 @@ import { useRadiusAxis, useRotationAxis, useXAxis, useYAxis } from "./useAxis.js
|
|
|
10
10
|
* @returns {(value: any) => number} A function that map value to their position
|
|
11
11
|
*/
|
|
12
12
|
export function getValueToPositionMapper(scale) {
|
|
13
|
-
if (
|
|
13
|
+
if (isOrdinalScale(scale)) {
|
|
14
14
|
return value => (scale(value) ?? 0) + scale.bandwidth() / 2;
|
|
15
15
|
}
|
|
16
|
+
const domain = scale.domain();
|
|
17
|
+
|
|
18
|
+
// Fixes https://github.com/mui/mui-x/issues/18999#issuecomment-3173787401
|
|
19
|
+
if (domain[0] === domain[1]) {
|
|
20
|
+
return value => value === domain[0] ? scale(value) : NaN;
|
|
21
|
+
}
|
|
16
22
|
return value => scale(value);
|
|
17
23
|
}
|
|
18
24
|
|
package/esm/hooks/useTicks.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useChartContext } from "../context/ChartProvider/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { isOrdinalScale } from "../internals/scaleGuards.js";
|
|
6
6
|
import { isInfinity } from "../internals/isInfinity.js";
|
|
7
7
|
const offsetRatio = {
|
|
8
8
|
start: 0,
|
|
@@ -22,7 +22,7 @@ export function getTicks(options) {
|
|
|
22
22
|
} = options;
|
|
23
23
|
|
|
24
24
|
// band scale
|
|
25
|
-
if (
|
|
25
|
+
if (isOrdinalScale(scale)) {
|
|
26
26
|
const domain = scale.domain();
|
|
27
27
|
const tickLabelPlacement = tickLabelPlacementProp ?? 'middle';
|
|
28
28
|
if (scale.bandwidth() > 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { isOrdinalScale } from "../internals/scaleGuards.js";
|
|
5
5
|
const offsetRatio = {
|
|
6
6
|
start: 0,
|
|
7
7
|
extremities: 0,
|
|
@@ -62,7 +62,7 @@ function mapToGrouping(tickValues, groups, tickPlacement, tickLabelPlacement, sc
|
|
|
62
62
|
if (isNew) {
|
|
63
63
|
currentValueCount = 1;
|
|
64
64
|
// Calculate tick offset
|
|
65
|
-
const tickOffset =
|
|
65
|
+
const tickOffset = isOrdinalScale(scale) ? scale(tickValue) - (scale.step() - scale.bandwidth()) / 2 + offsetRatio[tickPlacement] * scale.step() : scale(tickValue);
|
|
66
66
|
|
|
67
67
|
// Calculate the label offset
|
|
68
68
|
const labelOffset = scale.step() * currentValueCount * (offsetRatio[tickLabelPlacement] - offsetRatio[tickPlacement]);
|
package/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./constants/index.js";
|
|
2
2
|
export * from "./context/index.js";
|
|
3
3
|
export * from "./hooks/index.js";
|
|
4
|
+
export * from "./plugins/index.js";
|
|
4
5
|
export * from "./colorPalettes/index.js";
|
|
5
6
|
export * from "./models/index.js";
|
|
6
7
|
export * from "./ChartsClipPath/index.js";
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts v8.
|
|
2
|
+
* @mui/x-charts v8.12.0
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
export * from "./constants/index.js";
|
|
9
9
|
export * from "./context/index.js";
|
|
10
10
|
export * from "./hooks/index.js";
|
|
11
|
+
export * from "./plugins/index.js";
|
|
11
12
|
export * from "./colorPalettes/index.js";
|
|
12
13
|
export * from "./models/index.js";
|
|
13
14
|
export * from "./ChartsClipPath/index.js";
|