@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
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
7
|
+
import { getNextSeriesWithData, getPreviousSeriesWithData, seriesHasData } from "./useChartKeyboardNavigation.helpers.js";
|
|
8
|
+
export const useChartKeyboardNavigation = ({
|
|
9
|
+
params,
|
|
10
|
+
store,
|
|
11
|
+
svgRef
|
|
12
|
+
}) => {
|
|
13
|
+
const focusNextItem = useEventCallback(function focusNextItem() {
|
|
14
|
+
store.update(state => {
|
|
15
|
+
let {
|
|
16
|
+
type,
|
|
17
|
+
seriesId
|
|
18
|
+
} = state.keyboardNavigation.item ?? {};
|
|
19
|
+
if (type === undefined ||
|
|
20
|
+
// @ts-ignore sankey is not in MIT version
|
|
21
|
+
type === 'sankey' || seriesId === undefined || !seriesHasData(state.series.processedSeries, type, seriesId)) {
|
|
22
|
+
const nextSeries = getNextSeriesWithData(state.series.processedSeries, type, seriesId);
|
|
23
|
+
if (nextSeries === null) {
|
|
24
|
+
return _extends({}, state, {
|
|
25
|
+
keyboardNavigation: _extends({}, state.keyboardNavigation, {
|
|
26
|
+
item: null // No series to move the focus too.
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
type = nextSeries.type;
|
|
31
|
+
seriesId = nextSeries.seriesId;
|
|
32
|
+
}
|
|
33
|
+
const dataLength = state.series.processedSeries[type].series[seriesId].data.length;
|
|
34
|
+
return _extends({}, state, {
|
|
35
|
+
keyboardNavigation: _extends({}, state.keyboardNavigation, {
|
|
36
|
+
item: {
|
|
37
|
+
type,
|
|
38
|
+
seriesId,
|
|
39
|
+
dataIndex: ((state.keyboardNavigation.item?.dataIndex ?? -1) + 1) % dataLength
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
const focusPreviousItem = useEventCallback(function focusPreviousItem() {
|
|
46
|
+
store.update(state => {
|
|
47
|
+
let {
|
|
48
|
+
type,
|
|
49
|
+
seriesId
|
|
50
|
+
} = state.keyboardNavigation.item ?? {};
|
|
51
|
+
if (type === undefined ||
|
|
52
|
+
// @ts-ignore sankey is not in MIT version
|
|
53
|
+
type === 'sankey' || seriesId === undefined || !seriesHasData(state.series.processedSeries, type, seriesId)) {
|
|
54
|
+
const previousSeries = getPreviousSeriesWithData(state.series.processedSeries, type, seriesId);
|
|
55
|
+
if (previousSeries === null) {
|
|
56
|
+
return _extends({}, state, {
|
|
57
|
+
keyboardNavigation: _extends({}, state.keyboardNavigation, {
|
|
58
|
+
item: null // No series to move the focus too.} };
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
type = previousSeries.type;
|
|
63
|
+
seriesId = previousSeries.seriesId;
|
|
64
|
+
}
|
|
65
|
+
const dataLength = state.series.processedSeries[type].series[seriesId].data.length;
|
|
66
|
+
return _extends({}, state, {
|
|
67
|
+
keyboardNavigation: _extends({}, state.keyboardNavigation, {
|
|
68
|
+
item: {
|
|
69
|
+
type,
|
|
70
|
+
seriesId,
|
|
71
|
+
dataIndex: (dataLength + (state.keyboardNavigation.item?.dataIndex ?? 1) - 1) % dataLength
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
const focusPreviousSeries = useEventCallback(function focusPreviousSeries() {
|
|
78
|
+
let setNewSeries = false;
|
|
79
|
+
store.update(state => {
|
|
80
|
+
let {
|
|
81
|
+
type,
|
|
82
|
+
seriesId
|
|
83
|
+
} = state.keyboardNavigation.item ?? {};
|
|
84
|
+
const previousSeries = getPreviousSeriesWithData(state.series.processedSeries, type, seriesId);
|
|
85
|
+
if (previousSeries === null) {
|
|
86
|
+
return _extends({}, state, {
|
|
87
|
+
keyboardNavigation: _extends({}, state.keyboardNavigation, {
|
|
88
|
+
item: null // No series to move the focus too.
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
type = previousSeries.type;
|
|
93
|
+
seriesId = previousSeries.seriesId;
|
|
94
|
+
const dataLength = state.series.processedSeries[type].series[seriesId].data.length;
|
|
95
|
+
setNewSeries = true;
|
|
96
|
+
return _extends({}, state, {
|
|
97
|
+
keyboardNavigation: _extends({}, state.keyboardNavigation, {
|
|
98
|
+
item: {
|
|
99
|
+
type,
|
|
100
|
+
seriesId,
|
|
101
|
+
dataIndex: Math.min(dataLength - 1, state.keyboardNavigation.item?.dataIndex ?? 0)
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
return setNewSeries;
|
|
107
|
+
});
|
|
108
|
+
const focusNextSeries = useEventCallback(function focusNextSeries() {
|
|
109
|
+
let setNewSeries = false;
|
|
110
|
+
store.update(state => {
|
|
111
|
+
let {
|
|
112
|
+
type,
|
|
113
|
+
seriesId
|
|
114
|
+
} = state.keyboardNavigation.item ?? {};
|
|
115
|
+
const nextSeries = getNextSeriesWithData(state.series.processedSeries, type, seriesId);
|
|
116
|
+
if (nextSeries === null) {
|
|
117
|
+
return _extends({}, state, {
|
|
118
|
+
keyboardNavigation: _extends({}, state.keyboardNavigation, {
|
|
119
|
+
item: null // No series to move the focus too.
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
type = nextSeries.type;
|
|
124
|
+
seriesId = nextSeries.seriesId;
|
|
125
|
+
const dataLength = state.series.processedSeries[type].series[seriesId].data.length;
|
|
126
|
+
setNewSeries = true;
|
|
127
|
+
return _extends({}, state, {
|
|
128
|
+
keyboardNavigation: _extends({}, state.keyboardNavigation, {
|
|
129
|
+
item: {
|
|
130
|
+
type,
|
|
131
|
+
seriesId,
|
|
132
|
+
dataIndex: Math.min(dataLength - 1, state.keyboardNavigation.item?.dataIndex ?? 0)
|
|
133
|
+
}
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
return setNewSeries;
|
|
138
|
+
});
|
|
139
|
+
const removeFocus = useEventCallback(function removeFocus() {
|
|
140
|
+
store.update(state => {
|
|
141
|
+
if (state.keyboardNavigation.item === null) {
|
|
142
|
+
return state;
|
|
143
|
+
}
|
|
144
|
+
return _extends({}, state, {
|
|
145
|
+
keyboardNavigation: _extends({}, state.keyboardNavigation, {
|
|
146
|
+
item: null
|
|
147
|
+
})
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
React.useEffect(() => {
|
|
152
|
+
const element = svgRef.current;
|
|
153
|
+
if (!element || !params.enableKeyboardNavigation) {
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
156
|
+
function keyboardHandler(event) {
|
|
157
|
+
switch (event.key) {
|
|
158
|
+
case 'ArrowRight':
|
|
159
|
+
focusNextItem();
|
|
160
|
+
break;
|
|
161
|
+
case 'ArrowLeft':
|
|
162
|
+
focusPreviousItem();
|
|
163
|
+
break;
|
|
164
|
+
case 'ArrowDown':
|
|
165
|
+
{
|
|
166
|
+
const updatedStore = focusPreviousSeries();
|
|
167
|
+
if (updatedStore) {
|
|
168
|
+
// prevents scrolling
|
|
169
|
+
event.preventDefault();
|
|
170
|
+
}
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
case 'ArrowUp':
|
|
174
|
+
{
|
|
175
|
+
const updatedStore = focusNextSeries();
|
|
176
|
+
if (updatedStore) {
|
|
177
|
+
// prevents scrolling
|
|
178
|
+
event.preventDefault();
|
|
179
|
+
}
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
default:
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
element.addEventListener('keydown', keyboardHandler);
|
|
187
|
+
element.addEventListener('blur', removeFocus);
|
|
188
|
+
return () => {
|
|
189
|
+
element.removeEventListener('keydown', keyboardHandler);
|
|
190
|
+
element.removeEventListener('blur', removeFocus);
|
|
191
|
+
};
|
|
192
|
+
}, [svgRef, focusNextItem, focusPreviousItem, removeFocus, focusPreviousSeries, focusNextSeries, params.enableKeyboardNavigation]);
|
|
193
|
+
useEnhancedEffect(() => store.update(prev => prev.keyboardNavigation.enableKeyboardNavigation === params.enableKeyboardNavigation ? prev : _extends({}, prev, {
|
|
194
|
+
keyboardNavigation: _extends({}, prev.keyboardNavigation, {
|
|
195
|
+
enableKeyboardNavigation: !!params.enableKeyboardNavigation
|
|
196
|
+
})
|
|
197
|
+
})), [store, params.enableKeyboardNavigation]);
|
|
198
|
+
return {
|
|
199
|
+
instance: {}
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
useChartKeyboardNavigation.getInitialState = params => ({
|
|
203
|
+
keyboardNavigation: {
|
|
204
|
+
item: null,
|
|
205
|
+
enableKeyboardNavigation: !!params.enableKeyboardNavigation
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
useChartKeyboardNavigation.params = {
|
|
209
|
+
enableKeyboardNavigation: true
|
|
210
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const selectorChartsHasFocusedItem: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartKeyboardNavigation.types.js").UseChartKeyboardNavigationState> & {
|
|
2
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
3
|
+
} & {
|
|
4
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
5
|
+
}, boolean, any[]>;
|
|
6
|
+
export declare const selectorChartsFocusedSeriesType: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartKeyboardNavigation.types.js").UseChartKeyboardNavigationState> & {
|
|
7
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
|
+
} & {
|
|
9
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
10
|
+
}, keyof import("../../../index.js").ChartsSeriesConfig | undefined, any[]>;
|
|
11
|
+
export declare const selectorChartsFocusedSeriesId: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartKeyboardNavigation.types.js").UseChartKeyboardNavigationState> & {
|
|
12
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
13
|
+
} & {
|
|
14
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
15
|
+
}, import("../../../index.js").SeriesId | undefined, any[]>;
|
|
16
|
+
export declare const selectorChartsFocusedDataIndex: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartKeyboardNavigation.types.js").UseChartKeyboardNavigationState> & {
|
|
17
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
18
|
+
} & {
|
|
19
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
20
|
+
}, number | undefined, any[]>;
|
|
21
|
+
export declare const selectorChartsIsKeyboardNavigationEnabled: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartKeyboardNavigation.types.js").UseChartKeyboardNavigationState> & {
|
|
22
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
23
|
+
} & {
|
|
24
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
25
|
+
}, boolean, any[]>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createSelector } from "../../utils/selectors.js";
|
|
2
|
+
const selectKeyboardNavigation = state => state.keyboardNavigation;
|
|
3
|
+
export const selectorChartsHasFocusedItem = createSelector([selectKeyboardNavigation], keyboardNavigationState => keyboardNavigationState?.item != null);
|
|
4
|
+
export const selectorChartsFocusedSeriesType = createSelector([selectKeyboardNavigation], keyboardNavigationState => keyboardNavigationState?.item?.type);
|
|
5
|
+
export const selectorChartsFocusedSeriesId = createSelector([selectKeyboardNavigation], keyboardNavigationState => keyboardNavigationState?.item?.seriesId);
|
|
6
|
+
export const selectorChartsFocusedDataIndex = createSelector([selectKeyboardNavigation], keyboardNavigationState => keyboardNavigationState?.item?.dataIndex);
|
|
7
|
+
export const selectorChartsIsKeyboardNavigationEnabled = createSelector([selectKeyboardNavigation], keyboardNavigationState => !!keyboardNavigationState?.enableKeyboardNavigation);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ChartPluginSignature } from "../../models/index.js";
|
|
2
|
+
import { ChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
3
|
+
import { SeriesId } from "../../../../models/seriesType/common.js";
|
|
4
|
+
export interface UseChartKeyboardNavigationInstance {}
|
|
5
|
+
type SeriesItemIdentifier = {
|
|
6
|
+
/**
|
|
7
|
+
* The type of the series
|
|
8
|
+
*/
|
|
9
|
+
type: ChartSeriesType;
|
|
10
|
+
/**
|
|
11
|
+
* The id of the series with focus.
|
|
12
|
+
*/
|
|
13
|
+
seriesId: SeriesId;
|
|
14
|
+
/**
|
|
15
|
+
* The index of the data point with focus.
|
|
16
|
+
*/
|
|
17
|
+
dataIndex: number;
|
|
18
|
+
};
|
|
19
|
+
export interface UseChartKeyboardNavigationState {
|
|
20
|
+
keyboardNavigation: {
|
|
21
|
+
item: null | SeriesItemIdentifier;
|
|
22
|
+
enableKeyboardNavigation: boolean;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
type UseChartKeyboardNavigationParameters = {
|
|
26
|
+
enableKeyboardNavigation?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type UseChartKeyboardNavigationSignature = ChartPluginSignature<{
|
|
29
|
+
params: UseChartKeyboardNavigationParameters;
|
|
30
|
+
defaultizedParams: UseChartKeyboardNavigationParameters;
|
|
31
|
+
instance: UseChartKeyboardNavigationInstance;
|
|
32
|
+
state: UseChartKeyboardNavigationState;
|
|
33
|
+
}>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isOrdinalScale } from "../../../scaleGuards.js";
|
|
2
2
|
import { clampAngleRad } from "../../../clampAngle.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -11,7 +11,7 @@ export function getAxisIndex(axisConfig, pointerValue) {
|
|
|
11
11
|
data: axisData,
|
|
12
12
|
reverse
|
|
13
13
|
} = axisConfig;
|
|
14
|
-
if (!
|
|
14
|
+
if (!isOrdinalScale(scale)) {
|
|
15
15
|
throw new Error('MUI X Charts: getAxisValue is not implemented for polare continuous axes.');
|
|
16
16
|
}
|
|
17
17
|
if (!axisData) {
|
|
@@ -12,6 +12,7 @@ import { getSVGPoint } from "../../../getSVGPoint.js";
|
|
|
12
12
|
import { generatePolar2svg, generateSvg2polar, generateSvg2rotation } from "./coordinateTransformation.js";
|
|
13
13
|
import { getAxisIndex } from "./getAxisIndex.js";
|
|
14
14
|
import { selectorChartSeriesProcessed } from "../../corePlugins/useChartSeries/index.js";
|
|
15
|
+
import { checkHasInteractionPlugin } from "../useChartInteraction/checkHasInteractionPlugin.js";
|
|
15
16
|
export const useChartPolarAxis = ({
|
|
16
17
|
params,
|
|
17
18
|
store,
|
|
@@ -78,9 +79,10 @@ export const useChartPolarAxis = ({
|
|
|
78
79
|
const mousePosition = React.useRef({
|
|
79
80
|
isInChart: false
|
|
80
81
|
});
|
|
82
|
+
const hasInteractionPlugin = checkHasInteractionPlugin(instance);
|
|
81
83
|
React.useEffect(() => {
|
|
82
84
|
const element = svgRef.current;
|
|
83
|
-
if (!isInteractionEnabled || element === null || params.disableAxisListener) {
|
|
85
|
+
if (!isInteractionEnabled || !hasInteractionPlugin || element === null || params.disableAxisListener) {
|
|
84
86
|
return () => {};
|
|
85
87
|
}
|
|
86
88
|
|
|
@@ -94,13 +96,13 @@ export const useChartPolarAxis = ({
|
|
|
94
96
|
const panEndHandler = instance.addInteractionListener('panEnd', event => {
|
|
95
97
|
if (!event.detail.activeGestures.move) {
|
|
96
98
|
mousePosition.current.isInChart = false;
|
|
97
|
-
instance.cleanInteraction();
|
|
99
|
+
instance.cleanInteraction?.();
|
|
98
100
|
}
|
|
99
101
|
});
|
|
100
102
|
const pressEndHandler = instance.addInteractionListener('quickPressEnd', event => {
|
|
101
103
|
if (!event.detail.activeGestures.move && !event.detail.activeGestures.pan) {
|
|
102
104
|
mousePosition.current.isInChart = false;
|
|
103
|
-
instance.cleanInteraction();
|
|
105
|
+
instance.cleanInteraction?.();
|
|
104
106
|
}
|
|
105
107
|
});
|
|
106
108
|
const gestureHandler = event => {
|
|
@@ -112,12 +114,12 @@ export const useChartPolarAxis = ({
|
|
|
112
114
|
const svgRect = element.getBoundingClientRect();
|
|
113
115
|
if (srcEvent.clientX < svgRect.left || srcEvent.clientX > svgRect.right || srcEvent.clientY < svgRect.top || srcEvent.clientY > svgRect.bottom) {
|
|
114
116
|
mousePosition.current.isInChart = false;
|
|
115
|
-
instance.cleanInteraction();
|
|
117
|
+
instance.cleanInteraction?.();
|
|
116
118
|
return;
|
|
117
119
|
}
|
|
118
120
|
const svgPoint = getSVGPoint(element, srcEvent);
|
|
119
121
|
mousePosition.current.isInChart = true;
|
|
120
|
-
instance.setPointerCoordinate(svgPoint);
|
|
122
|
+
instance.setPointerCoordinate?.(svgPoint);
|
|
121
123
|
return;
|
|
122
124
|
}
|
|
123
125
|
|
|
@@ -128,7 +130,7 @@ export const useChartPolarAxis = ({
|
|
|
128
130
|
// Test if it's in the drawing area
|
|
129
131
|
if (!instance.isPointInside(svgPoint.x, svgPoint.y, event.detail.target)) {
|
|
130
132
|
if (mousePosition.current.isInChart) {
|
|
131
|
-
instance?.
|
|
133
|
+
instance.cleanInteraction?.();
|
|
132
134
|
mousePosition.current.isInChart = false;
|
|
133
135
|
}
|
|
134
136
|
return;
|
|
@@ -139,7 +141,7 @@ export const useChartPolarAxis = ({
|
|
|
139
141
|
const maxRadius = radiusAxisWithScale[usedRadiusAxisId].scale.range()[1];
|
|
140
142
|
if (radiusSquare > maxRadius ** 2) {
|
|
141
143
|
if (mousePosition.current.isInChart) {
|
|
142
|
-
instance?.
|
|
144
|
+
instance.cleanInteraction?.();
|
|
143
145
|
mousePosition.current.isInChart = false;
|
|
144
146
|
}
|
|
145
147
|
return;
|
|
@@ -158,7 +160,7 @@ export const useChartPolarAxis = ({
|
|
|
158
160
|
pressHandler.cleanup();
|
|
159
161
|
pressEndHandler.cleanup();
|
|
160
162
|
};
|
|
161
|
-
}, [svgRef, store, center, radiusAxisWithScale, usedRadiusAxisId, rotationAxisWithScale, usedRotationAxisId, instance, params.disableAxisListener, isInteractionEnabled, svg2rotation]);
|
|
163
|
+
}, [svgRef, store, center, radiusAxisWithScale, usedRadiusAxisId, rotationAxisWithScale, usedRotationAxisId, instance, params.disableAxisListener, isInteractionEnabled, svg2rotation, hasInteractionPlugin]);
|
|
162
164
|
React.useEffect(() => {
|
|
163
165
|
const element = svgRef.current;
|
|
164
166
|
const onAxisClick = params.onAxisClick;
|
|
@@ -69,5 +69,6 @@ export type UseChartPolarAxisSignature<SeriesType extends ChartSeriesType = Char
|
|
|
69
69
|
defaultizedParams: UseChartPolarAxisDefaultizedParameters;
|
|
70
70
|
state: UseChartPolarAxisState;
|
|
71
71
|
instance: UseChartPolarAxisInstance;
|
|
72
|
-
dependencies: [
|
|
72
|
+
dependencies: [UseChartSeriesSignature<SeriesType>];
|
|
73
|
+
optionalDependencies: [UseChartInteractionSignature];
|
|
73
74
|
}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ChartSeries, ChartSeriesType } from "../../../../models/seriesType/config.js";
|
|
2
2
|
import type { AllSeriesType } from "../../../../models/seriesType/index.js";
|
|
3
|
-
export type GetSeriesWithDefaultValues<T extends ChartSeriesType> = (series: AllSeriesType<T>, seriesIndex: number, colors: string[]) => ChartSeries<T>;
|
|
3
|
+
export type GetSeriesWithDefaultValues<T extends ChartSeriesType> = (series: AllSeriesType<T>, seriesIndex: number, colors: readonly string[]) => ChartSeries<T>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ScaleBand } from '@mui/x-charts-vendor/d3-scale';
|
|
2
|
+
import { D3OrdinalScale, D3Scale } from "../models/axis.js";
|
|
3
|
+
export declare function isOrdinalScale<T extends {
|
|
4
|
+
toString(): string;
|
|
5
|
+
}>(scale: D3Scale<T>): scale is D3OrdinalScale<T>;
|
|
6
|
+
export declare function isBandScale<T extends {
|
|
7
|
+
toString(): string;
|
|
8
|
+
}>(scale: D3Scale<T>): scale is ScaleBand<T>;
|
|
9
|
+
export declare function isPointScale<T extends {
|
|
10
|
+
toString(): string;
|
|
11
|
+
}>(scale: D3Scale<T>): scale is D3OrdinalScale<T>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function isOrdinalScale(scale) {
|
|
2
|
+
return scale.bandwidth !== undefined;
|
|
3
|
+
}
|
|
4
|
+
export function isBandScale(scale) {
|
|
5
|
+
return isOrdinalScale(scale) && scale.paddingOuter !== undefined;
|
|
6
|
+
}
|
|
7
|
+
export function isPointScale(scale) {
|
|
8
|
+
return isOrdinalScale(scale) && !('paddingOuter' in scale);
|
|
9
|
+
}
|
package/esm/locales/elGR.d.ts
CHANGED
|
@@ -12,6 +12,102 @@ export declare const elGR: {
|
|
|
12
12
|
toolbarExport?: string | undefined;
|
|
13
13
|
toolbarExportPrint?: string | undefined;
|
|
14
14
|
toolbarExportImage?: ((mimeType: import("./utils/imageMimeTypes.js").ChartImageExportMimeType | (string & {})) => string) | undefined;
|
|
15
|
+
chartTypeBar?: string | undefined;
|
|
16
|
+
chartTypeColumn?: string | undefined;
|
|
17
|
+
chartTypeLine?: string | undefined;
|
|
18
|
+
chartTypeArea?: string | undefined;
|
|
19
|
+
chartTypePie?: string | undefined;
|
|
20
|
+
chartPaletteLabel?: string | undefined;
|
|
21
|
+
chartPaletteNameRainbowSurge?: string | undefined;
|
|
22
|
+
chartPaletteNameBlueberryTwilight?: string | undefined;
|
|
23
|
+
chartPaletteNameMangoFusion?: string | undefined;
|
|
24
|
+
chartPaletteNameCheerfulFiesta?: string | undefined;
|
|
25
|
+
chartPaletteNameStrawberrySky?: string | undefined;
|
|
26
|
+
chartPaletteNameBlue?: string | undefined;
|
|
27
|
+
chartPaletteNameGreen?: string | undefined;
|
|
28
|
+
chartPaletteNamePurple?: string | undefined;
|
|
29
|
+
chartPaletteNameRed?: string | undefined;
|
|
30
|
+
chartPaletteNameOrange?: string | undefined;
|
|
31
|
+
chartPaletteNameYellow?: string | undefined;
|
|
32
|
+
chartPaletteNameCyan?: string | undefined;
|
|
33
|
+
chartPaletteNamePink?: string | undefined;
|
|
34
|
+
chartConfigurationSectionChart?: string | undefined;
|
|
35
|
+
chartConfigurationSectionAxes?: string | undefined;
|
|
36
|
+
chartConfigurationSectionTooltip?: string | undefined;
|
|
37
|
+
chartConfigurationSectionLegend?: string | undefined;
|
|
38
|
+
chartConfigurationSectionColumns?: string | undefined;
|
|
39
|
+
chartConfigurationSectionBars?: string | undefined;
|
|
40
|
+
chartConfigurationSectionLines?: string | undefined;
|
|
41
|
+
chartConfigurationSectionAreas?: string | undefined;
|
|
42
|
+
chartConfigurationSectionArcs?: string | undefined;
|
|
43
|
+
chartConfigurationGrid?: string | undefined;
|
|
44
|
+
chartConfigurationBorderRadius?: string | undefined;
|
|
45
|
+
chartConfigurationCategoryGapRatio?: string | undefined;
|
|
46
|
+
chartConfigurationBarGapRatio?: string | undefined;
|
|
47
|
+
chartConfigurationStacked?: string | undefined;
|
|
48
|
+
chartConfigurationShowToolbar?: string | undefined;
|
|
49
|
+
chartConfigurationSkipAnimation?: string | undefined;
|
|
50
|
+
chartConfigurationInnerRadius?: string | undefined;
|
|
51
|
+
chartConfigurationOuterRadius?: string | undefined;
|
|
52
|
+
chartConfigurationColors?: string | undefined;
|
|
53
|
+
chartConfigurationHideLegend?: string | undefined;
|
|
54
|
+
chartConfigurationShowMark?: string | undefined;
|
|
55
|
+
chartConfigurationHeight?: string | undefined;
|
|
56
|
+
chartConfigurationWidth?: string | undefined;
|
|
57
|
+
chartConfigurationSeriesGap?: string | undefined;
|
|
58
|
+
chartConfigurationTickPlacement?: string | undefined;
|
|
59
|
+
chartConfigurationTickLabelPlacement?: string | undefined;
|
|
60
|
+
chartConfigurationCategoriesAxisLabel?: string | undefined;
|
|
61
|
+
chartConfigurationSeriesAxisLabel?: string | undefined;
|
|
62
|
+
chartConfigurationXAxisPosition?: string | undefined;
|
|
63
|
+
chartConfigurationYAxisPosition?: string | undefined;
|
|
64
|
+
chartConfigurationSeriesAxisReverse?: string | undefined;
|
|
65
|
+
chartConfigurationTooltipPlacement?: string | undefined;
|
|
66
|
+
chartConfigurationTooltipTrigger?: string | undefined;
|
|
67
|
+
chartConfigurationLegendPosition?: string | undefined;
|
|
68
|
+
chartConfigurationLegendDirection?: string | undefined;
|
|
69
|
+
chartConfigurationBarLabels?: string | undefined;
|
|
70
|
+
chartConfigurationColumnLabels?: string | undefined;
|
|
71
|
+
chartConfigurationInterpolation?: string | undefined;
|
|
72
|
+
chartConfigurationPaddingAngle?: string | undefined;
|
|
73
|
+
chartConfigurationCornerRadius?: string | undefined;
|
|
74
|
+
chartConfigurationArcLabels?: string | undefined;
|
|
75
|
+
chartConfigurationStartAngle?: string | undefined;
|
|
76
|
+
chartConfigurationEndAngle?: string | undefined;
|
|
77
|
+
chartConfigurationPieTooltipTrigger?: string | undefined;
|
|
78
|
+
chartConfigurationPieLegendPosition?: string | undefined;
|
|
79
|
+
chartConfigurationPieLegendDirection?: string | undefined;
|
|
80
|
+
chartConfigurationOptionNone?: string | undefined;
|
|
81
|
+
chartConfigurationOptionValue?: string | undefined;
|
|
82
|
+
chartConfigurationOptionAuto?: string | undefined;
|
|
83
|
+
chartConfigurationOptionTop?: string | undefined;
|
|
84
|
+
chartConfigurationOptionTopLeft?: string | undefined;
|
|
85
|
+
chartConfigurationOptionTopRight?: string | undefined;
|
|
86
|
+
chartConfigurationOptionBottom?: string | undefined;
|
|
87
|
+
chartConfigurationOptionBottomLeft?: string | undefined;
|
|
88
|
+
chartConfigurationOptionBottomRight?: string | undefined;
|
|
89
|
+
chartConfigurationOptionLeft?: string | undefined;
|
|
90
|
+
chartConfigurationOptionRight?: string | undefined;
|
|
91
|
+
chartConfigurationOptionAxis?: string | undefined;
|
|
92
|
+
chartConfigurationOptionItem?: string | undefined;
|
|
93
|
+
chartConfigurationOptionHorizontal?: string | undefined;
|
|
94
|
+
chartConfigurationOptionVertical?: string | undefined;
|
|
95
|
+
chartConfigurationOptionBoth?: string | undefined;
|
|
96
|
+
chartConfigurationOptionStart?: string | undefined;
|
|
97
|
+
chartConfigurationOptionMiddle?: string | undefined;
|
|
98
|
+
chartConfigurationOptionEnd?: string | undefined;
|
|
99
|
+
chartConfigurationOptionExtremities?: string | undefined;
|
|
100
|
+
chartConfigurationOptionTick?: string | undefined;
|
|
101
|
+
chartConfigurationOptionMonotoneX?: string | undefined;
|
|
102
|
+
chartConfigurationOptionMonotoneY?: string | undefined;
|
|
103
|
+
chartConfigurationOptionCatmullRom?: string | undefined;
|
|
104
|
+
chartConfigurationOptionLinear?: string | undefined;
|
|
105
|
+
chartConfigurationOptionNatural?: string | undefined;
|
|
106
|
+
chartConfigurationOptionStep?: string | undefined;
|
|
107
|
+
chartConfigurationOptionStepBefore?: string | undefined;
|
|
108
|
+
chartConfigurationOptionStepAfter?: string | undefined;
|
|
109
|
+
chartConfigurationOptionBumpX?: string | undefined;
|
|
110
|
+
chartConfigurationOptionBumpY?: string | undefined;
|
|
15
111
|
};
|
|
16
112
|
};
|
|
17
113
|
};
|
package/esm/locales/elGR.js
CHANGED
|
@@ -11,5 +11,105 @@ export const elGRLocaleText = {
|
|
|
11
11
|
// Toolbar Export Menu
|
|
12
12
|
toolbarExportPrint: 'Εκτύπωση',
|
|
13
13
|
toolbarExportImage: mimeType => `Εξαγωγή ως ${imageMimeTypes[mimeType] ?? mimeType}`
|
|
14
|
+
|
|
15
|
+
// Charts renderer configuration
|
|
16
|
+
// chartTypeBar: 'Bar',
|
|
17
|
+
// chartTypeColumn: 'Column',
|
|
18
|
+
// chartTypeLine: 'Line',
|
|
19
|
+
// chartTypeArea: 'Area',
|
|
20
|
+
// chartTypePie: 'Pie',
|
|
21
|
+
// chartPaletteLabel: 'Color palette',
|
|
22
|
+
// chartPaletteNameRainbowSurge: 'Rainbow Surge',
|
|
23
|
+
// chartPaletteNameBlueberryTwilight: 'Blueberry Twilight',
|
|
24
|
+
// chartPaletteNameMangoFusion: 'Mango Fusion',
|
|
25
|
+
// chartPaletteNameCheerfulFiesta: 'Cheerful Fiesta',
|
|
26
|
+
// chartPaletteNameStrawberrySky: 'Strawberry Sky',
|
|
27
|
+
// chartPaletteNameBlue: 'Blue',
|
|
28
|
+
// chartPaletteNameGreen: 'Green',
|
|
29
|
+
// chartPaletteNamePurple: 'Purple',
|
|
30
|
+
// chartPaletteNameRed: 'Red',
|
|
31
|
+
// chartPaletteNameOrange: 'Orange',
|
|
32
|
+
// chartPaletteNameYellow: 'Yellow',
|
|
33
|
+
// chartPaletteNameCyan: 'Cyan',
|
|
34
|
+
// chartPaletteNamePink: 'Pink',
|
|
35
|
+
// chartConfigurationSectionChart: 'Chart',
|
|
36
|
+
// chartConfigurationSectionColumns: 'Columns',
|
|
37
|
+
// chartConfigurationSectionBars: 'Bars',
|
|
38
|
+
// chartConfigurationSectionAxes: 'Axes',
|
|
39
|
+
// chartConfigurationGrid: 'Grid',
|
|
40
|
+
// chartConfigurationBorderRadius: 'Border radius',
|
|
41
|
+
// chartConfigurationCategoryGapRatio: 'Category gap ratio',
|
|
42
|
+
// chartConfigurationBarGapRatio: 'Series gap ratio',
|
|
43
|
+
// chartConfigurationStacked: 'Stacked',
|
|
44
|
+
// chartConfigurationShowToolbar: 'Show toolbar',
|
|
45
|
+
// chartConfigurationSkipAnimation: 'Skip animation',
|
|
46
|
+
// chartConfigurationInnerRadius: 'Inner radius',
|
|
47
|
+
// chartConfigurationOuterRadius: 'Outer radius',
|
|
48
|
+
// chartConfigurationColors: 'Colors',
|
|
49
|
+
// chartConfigurationHideLegend: 'Hide legend',
|
|
50
|
+
// chartConfigurationShowMark: 'Show mark',
|
|
51
|
+
// chartConfigurationHeight: 'Height',
|
|
52
|
+
// chartConfigurationWidth: 'Width',
|
|
53
|
+
// chartConfigurationSeriesGap: 'Series gap',
|
|
54
|
+
// chartConfigurationTickPlacement: 'Tick placement',
|
|
55
|
+
// chartConfigurationTickLabelPlacement: 'Tick label placement',
|
|
56
|
+
// chartConfigurationCategoriesAxisLabel: 'Categories axis label',
|
|
57
|
+
// chartConfigurationSeriesAxisLabel: 'Series axis label',
|
|
58
|
+
// chartConfigurationXAxisPosition: 'X-axis position',
|
|
59
|
+
// chartConfigurationYAxisPosition: 'Y-axis position',
|
|
60
|
+
// chartConfigurationSeriesAxisReverse: 'Reverse series axis',
|
|
61
|
+
// chartConfigurationTooltipPlacement: 'Placement',
|
|
62
|
+
// chartConfigurationTooltipTrigger: 'Trigger',
|
|
63
|
+
// chartConfigurationLegendPosition: 'Position',
|
|
64
|
+
// chartConfigurationLegendDirection: 'Direction',
|
|
65
|
+
// chartConfigurationBarLabels: 'Bar labels',
|
|
66
|
+
// chartConfigurationColumnLabels: 'Column labels',
|
|
67
|
+
// chartConfigurationInterpolation: 'Interpolation',
|
|
68
|
+
// chartConfigurationSectionTooltip: 'Tooltip',
|
|
69
|
+
// chartConfigurationSectionLegend: 'Legend',
|
|
70
|
+
// chartConfigurationSectionLines: 'Lines',
|
|
71
|
+
// chartConfigurationSectionAreas: 'Areas',
|
|
72
|
+
// chartConfigurationSectionArcs: 'Arcs',
|
|
73
|
+
// chartConfigurationPaddingAngle: 'Padding angle',
|
|
74
|
+
// chartConfigurationCornerRadius: 'Corner radius',
|
|
75
|
+
// chartConfigurationArcLabels: 'Arc labels',
|
|
76
|
+
// chartConfigurationStartAngle: 'Start angle',
|
|
77
|
+
// chartConfigurationEndAngle: 'End angle',
|
|
78
|
+
// chartConfigurationPieTooltipTrigger: 'Trigger',
|
|
79
|
+
// chartConfigurationPieLegendPosition: 'Position',
|
|
80
|
+
// chartConfigurationPieLegendDirection: 'Direction',
|
|
81
|
+
|
|
82
|
+
// Common option labels
|
|
83
|
+
// chartConfigurationOptionNone: 'None',
|
|
84
|
+
// chartConfigurationOptionValue: 'Value',
|
|
85
|
+
// chartConfigurationOptionAuto: 'Auto',
|
|
86
|
+
// chartConfigurationOptionTop: 'Top',
|
|
87
|
+
// chartConfigurationOptionTopLeft: 'Top Left',
|
|
88
|
+
// chartConfigurationOptionTopRight: 'Top Right',
|
|
89
|
+
// chartConfigurationOptionBottom: 'Bottom',
|
|
90
|
+
// chartConfigurationOptionBottomLeft: 'Bottom Left',
|
|
91
|
+
// chartConfigurationOptionBottomRight: 'Bottom Right',
|
|
92
|
+
// chartConfigurationOptionLeft: 'Left',
|
|
93
|
+
// chartConfigurationOptionRight: 'Right',
|
|
94
|
+
// chartConfigurationOptionAxis: 'Axis',
|
|
95
|
+
// chartConfigurationOptionItem: 'Item',
|
|
96
|
+
// chartConfigurationOptionHorizontal: 'Horizontal',
|
|
97
|
+
// chartConfigurationOptionVertical: 'Vertical',
|
|
98
|
+
// chartConfigurationOptionBoth: 'Both',
|
|
99
|
+
// chartConfigurationOptionStart: 'Start',
|
|
100
|
+
// chartConfigurationOptionMiddle: 'Middle',
|
|
101
|
+
// chartConfigurationOptionEnd: 'End',
|
|
102
|
+
// chartConfigurationOptionExtremities: 'Extremities',
|
|
103
|
+
// chartConfigurationOptionTick: 'Tick',
|
|
104
|
+
// chartConfigurationOptionMonotoneX: 'Monotone X',
|
|
105
|
+
// chartConfigurationOptionMonotoneY: 'Monotone Y',
|
|
106
|
+
// chartConfigurationOptionCatmullRom: 'Catmull-Rom',
|
|
107
|
+
// chartConfigurationOptionLinear: 'Linear',
|
|
108
|
+
// chartConfigurationOptionNatural: 'Natural',
|
|
109
|
+
// chartConfigurationOptionStep: 'Step',
|
|
110
|
+
// chartConfigurationOptionStepBefore: 'Step Before',
|
|
111
|
+
// chartConfigurationOptionStepAfter: 'Step After',
|
|
112
|
+
// chartConfigurationOptionBumpX: 'Bump X',
|
|
113
|
+
// chartConfigurationOptionBumpY: 'Bump Y',
|
|
14
114
|
};
|
|
15
115
|
export const elGR = getChartsLocalization(elGRLocaleText);
|