@mui/x-charts 9.0.0-alpha.3 → 9.0.0-beta.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.mts +2 -2
- package/BarChart/BarChart.d.ts +2 -2
- package/BarChart/BarChart.js +55 -34
- package/BarChart/BarChart.mjs +55 -34
- package/BarChart/BarElement.js +4 -8
- package/BarChart/BarElement.mjs +4 -8
- package/BarChart/BarLabel/BarLabel.js +1 -11
- package/BarChart/BarLabel/BarLabel.mjs +1 -11
- package/BarChart/BarLabel/BarLabelItem.js +1 -3
- package/BarChart/BarLabel/BarLabelItem.mjs +1 -3
- package/BarChart/BarLabel/BarLabelPlot.d.mts +0 -2
- package/BarChart/BarLabel/BarLabelPlot.d.ts +0 -2
- package/BarChart/BarLabel/BarLabelPlot.js +2 -3
- package/BarChart/BarLabel/BarLabelPlot.mjs +2 -3
- package/BarChart/BarLabel/index.d.mts +1 -3
- package/BarChart/BarLabel/index.d.ts +1 -3
- package/BarChart/BarLabel/index.js +1 -14
- package/BarChart/BarLabel/index.mjs +1 -2
- package/BarChart/BarPlot.d.mts +6 -12
- package/BarChart/BarPlot.d.ts +6 -12
- package/BarChart/BarPlot.js +11 -19
- package/BarChart/BarPlot.mjs +11 -19
- package/BarChart/BatchBarPlot/BatchBarPlot.js +3 -30
- package/BarChart/BatchBarPlot/BatchBarPlot.mjs +3 -30
- package/BarChart/IndividualBarPlot.d.mts +1 -2
- package/BarChart/IndividualBarPlot.d.ts +1 -2
- package/BarChart/IndividualBarPlot.js +5 -10
- package/BarChart/IndividualBarPlot.mjs +5 -10
- package/BarChart/index.d.mts +0 -1
- package/BarChart/index.d.ts +0 -1
- package/BarChart/index.js +0 -12
- package/BarChart/index.mjs +0 -1
- package/BarChart/seriesConfig/bar/descriptionGetter.d.mts +3 -0
- package/BarChart/seriesConfig/bar/descriptionGetter.d.ts +3 -0
- package/BarChart/seriesConfig/bar/descriptionGetter.js +36 -0
- package/BarChart/seriesConfig/bar/descriptionGetter.mjs +30 -0
- package/BarChart/seriesConfig/bar/legend.js +2 -21
- package/BarChart/seriesConfig/bar/legend.mjs +2 -21
- package/BarChart/seriesConfig/index.js +5 -1
- package/BarChart/seriesConfig/index.mjs +5 -1
- package/BarChart/useBarChartProps.d.mts +2 -2
- package/BarChart/useBarChartProps.d.ts +2 -2
- package/BarChart/useBarChartProps.js +4 -6
- package/BarChart/useBarChartProps.mjs +4 -6
- package/BarChart/useRegisterItemClickHandlers.js +2 -2
- package/BarChart/useRegisterItemClickHandlers.mjs +2 -2
- package/CHANGELOG.md +229 -0
- package/ChartsAxis/index.d.mts +2 -1
- package/ChartsAxis/index.d.ts +2 -1
- package/ChartsAxis/index.js +11 -11
- package/ChartsAxis/index.mjs +1 -1
- package/ChartsAxisHighlight/index.d.mts +2 -1
- package/ChartsAxisHighlight/index.d.ts +2 -1
- package/ChartsAxisHighlight/index.js +12 -10
- package/ChartsAxisHighlight/index.mjs +1 -1
- package/ChartsBrushOverlay/ChartsBrushOverlay.d.mts +6 -1
- package/ChartsBrushOverlay/ChartsBrushOverlay.d.ts +6 -1
- package/ChartsBrushOverlay/ChartsBrushOverlay.js +12 -9
- package/ChartsBrushOverlay/ChartsBrushOverlay.mjs +12 -9
- package/ChartsContainer/ChartsContainer.js +77 -43
- package/ChartsContainer/ChartsContainer.mjs +77 -43
- package/ChartsContainer/useChartsContainerProps.d.mts +2 -2
- package/ChartsContainer/useChartsContainerProps.d.ts +2 -2
- package/ChartsContainer/useChartsContainerProps.js +8 -8
- package/ChartsContainer/useChartsContainerProps.mjs +8 -8
- package/ChartsDataProvider/ChartsDataProvider.js +0 -6
- package/ChartsDataProvider/ChartsDataProvider.mjs +0 -6
- package/ChartsDataProvider/useChartsDataProviderProps.js +1 -1
- package/ChartsDataProvider/useChartsDataProviderProps.mjs +1 -1
- package/ChartsGrid/ChartsGrid.d.mts +4 -0
- package/ChartsGrid/ChartsGrid.d.ts +4 -0
- package/ChartsGrid/ChartsGrid.js +4 -2
- package/ChartsGrid/ChartsGrid.mjs +4 -2
- package/ChartsGrid/ChartsHorizontalGrid.js +2 -2
- package/ChartsGrid/ChartsHorizontalGrid.mjs +2 -2
- package/ChartsGrid/ChartsVerticalGrid.js +2 -2
- package/ChartsGrid/ChartsVerticalGrid.mjs +2 -2
- package/ChartsGrid/index.d.mts +2 -1
- package/ChartsGrid/index.d.ts +2 -1
- package/ChartsGrid/index.js +11 -11
- package/ChartsGrid/index.mjs +1 -1
- package/ChartsLayerContainer/ChartsLayerContainer.d.mts +10 -0
- package/ChartsLayerContainer/ChartsLayerContainer.d.ts +10 -0
- package/ChartsLayerContainer/ChartsLayerContainer.js +53 -9
- package/ChartsLayerContainer/ChartsLayerContainer.mjs +55 -10
- package/ChartsLayerContainer/chartsLayerContainerClasses.d.mts +6 -0
- package/ChartsLayerContainer/chartsLayerContainerClasses.d.ts +6 -0
- package/ChartsLayerContainer/chartsLayerContainerClasses.js +21 -0
- package/ChartsLayerContainer/chartsLayerContainerClasses.mjs +13 -0
- package/ChartsLegend/ChartsLegend.js +2 -2
- package/ChartsLegend/ChartsLegend.mjs +2 -2
- package/ChartsLegend/legendContext.types.d.mts +0 -6
- package/ChartsLegend/legendContext.types.d.ts +0 -6
- package/ChartsLegend/onClickContextBuilder.js +0 -1
- package/ChartsLegend/onClickContextBuilder.mjs +0 -1
- package/ChartsOverlay/ChartsLoadingOverlay.js +2 -8
- package/ChartsOverlay/ChartsLoadingOverlay.mjs +2 -8
- package/ChartsOverlay/ChartsNoDataOverlay.js +2 -8
- package/ChartsOverlay/ChartsNoDataOverlay.mjs +2 -8
- package/ChartsOverlay/ChartsOverlay.d.mts +0 -6
- package/ChartsOverlay/ChartsOverlay.d.ts +0 -6
- package/ChartsReferenceLine/index.d.mts +2 -1
- package/ChartsReferenceLine/index.d.ts +2 -1
- package/ChartsReferenceLine/index.js +11 -11
- package/ChartsReferenceLine/index.mjs +1 -2
- package/ChartsSurface/ChartsSurface.d.mts +2 -3
- package/ChartsSurface/ChartsSurface.d.ts +2 -3
- package/ChartsSurface/ChartsSurface.js +14 -2
- package/ChartsSurface/ChartsSurface.mjs +14 -2
- package/ChartsSvgLayer/ChartsSvgLayer.d.mts +0 -4
- package/ChartsSvgLayer/ChartsSvgLayer.d.ts +0 -4
- package/ChartsSvgLayer/ChartsSvgLayer.js +8 -30
- package/ChartsSvgLayer/ChartsSvgLayer.mjs +8 -30
- package/ChartsTooltip/ChartsAxisTooltipContent.js +45 -31
- package/ChartsTooltip/ChartsAxisTooltipContent.mjs +45 -31
- package/ChartsTooltip/ChartsItemTooltipContent.js +77 -41
- package/ChartsTooltip/ChartsItemTooltipContent.mjs +76 -41
- package/ChartsTooltip/ChartsTooltipContainer.js +5 -1
- package/ChartsTooltip/ChartsTooltipContainer.mjs +5 -1
- package/ChartsTooltip/index.d.mts +1 -2
- package/ChartsTooltip/index.d.ts +1 -2
- package/ChartsTooltip/index.js +1 -16
- package/ChartsTooltip/index.mjs +1 -2
- package/ChartsTooltip/useAxesTooltip.d.mts +2 -3
- package/ChartsTooltip/useAxesTooltip.d.ts +2 -3
- package/ChartsTooltip/useItemTooltip.d.mts +2 -4
- package/ChartsTooltip/useItemTooltip.d.ts +2 -4
- package/ChartsTooltip/utils.d.mts +0 -4
- package/ChartsTooltip/utils.d.ts +0 -4
- package/ChartsTooltip/utils.js +0 -39
- package/ChartsTooltip/utils.mjs +0 -38
- package/ChartsXAxis/ChartsGroupedXAxisTicks.js +14 -5
- package/ChartsXAxis/ChartsGroupedXAxisTicks.mjs +14 -5
- package/ChartsXAxis/ChartsSingleXAxisTicks.js +2 -2
- package/ChartsXAxis/ChartsSingleXAxisTicks.mjs +2 -2
- package/ChartsXAxis/ChartsXAxisImpl.js +3 -1
- package/ChartsXAxis/ChartsXAxisImpl.mjs +3 -1
- package/ChartsXAxis/useAxisTicksProps.d.mts +170 -89
- package/ChartsXAxis/useAxisTicksProps.d.ts +170 -89
- package/ChartsYAxis/ChartsGroupedYAxisTicks.js +14 -5
- package/ChartsYAxis/ChartsGroupedYAxisTicks.mjs +14 -5
- package/ChartsYAxis/ChartsSingleYAxisTicks.js +2 -2
- package/ChartsYAxis/ChartsSingleYAxisTicks.mjs +2 -2
- package/ChartsYAxis/ChartsYAxisImpl.js +3 -1
- package/ChartsYAxis/ChartsYAxisImpl.mjs +3 -1
- package/ChartsYAxis/useAxisTicksProps.d.mts +170 -89
- package/ChartsYAxis/useAxisTicksProps.d.ts +170 -89
- package/Gauge/Gauge.js +8 -0
- package/Gauge/Gauge.mjs +8 -0
- package/Gauge/GaugeContainer.d.mts +1 -1
- package/Gauge/GaugeContainer.d.ts +1 -1
- package/Gauge/GaugeContainer.js +10 -2
- package/Gauge/GaugeContainer.mjs +10 -2
- package/Gauge/index.d.mts +2 -1
- package/Gauge/index.d.ts +2 -1
- package/Gauge/index.js +7 -11
- package/Gauge/index.mjs +1 -1
- package/LineChart/AreaElement.d.mts +2 -35
- package/LineChart/AreaElement.d.ts +2 -35
- package/LineChart/AreaElement.js +8 -42
- package/LineChart/AreaElement.mjs +8 -42
- package/LineChart/CircleMarkElement.d.mts +1 -1
- package/LineChart/CircleMarkElement.d.ts +1 -1
- package/LineChart/CircleMarkElement.js +11 -16
- package/LineChart/CircleMarkElement.mjs +12 -17
- package/LineChart/LineChart.d.mts +2 -2
- package/LineChart/LineChart.d.ts +2 -2
- package/LineChart/LineChart.js +51 -25
- package/LineChart/LineChart.mjs +51 -25
- package/LineChart/LineElement.d.mts +2 -35
- package/LineChart/LineElement.d.ts +2 -35
- package/LineChart/LineElement.js +8 -42
- package/LineChart/LineElement.mjs +8 -42
- package/LineChart/LineHighlightElement.d.mts +0 -20
- package/LineChart/LineHighlightElement.d.ts +0 -20
- package/LineChart/LineHighlightElement.js +2 -39
- package/LineChart/LineHighlightElement.mjs +2 -39
- package/LineChart/LineHighlightPlot.js +2 -2
- package/LineChart/LineHighlightPlot.mjs +2 -2
- package/LineChart/MarkElement.d.mts +1 -1
- package/LineChart/MarkElement.d.ts +1 -1
- package/LineChart/MarkElement.js +10 -8
- package/LineChart/MarkElement.mjs +11 -9
- package/LineChart/MarkPlot.js +2 -2
- package/LineChart/MarkPlot.mjs +2 -2
- package/LineChart/index.d.mts +0 -2
- package/LineChart/index.d.ts +0 -2
- package/LineChart/index.js +0 -15
- package/LineChart/index.mjs +0 -1
- package/LineChart/seriesConfig/curveEvaluation.d.mts +11 -0
- package/LineChart/seriesConfig/curveEvaluation.d.ts +11 -0
- package/LineChart/seriesConfig/curveEvaluation.js +134 -0
- package/LineChart/seriesConfig/curveEvaluation.mjs +129 -0
- package/LineChart/seriesConfig/descriptionGetter.d.mts +3 -0
- package/LineChart/seriesConfig/descriptionGetter.d.ts +3 -0
- package/LineChart/seriesConfig/descriptionGetter.js +37 -0
- package/LineChart/seriesConfig/descriptionGetter.mjs +31 -0
- package/LineChart/seriesConfig/getItemAtPosition.d.mts +7 -0
- package/LineChart/seriesConfig/getItemAtPosition.d.ts +7 -0
- package/LineChart/seriesConfig/getItemAtPosition.js +356 -0
- package/LineChart/seriesConfig/getItemAtPosition.mjs +351 -0
- package/LineChart/seriesConfig/index.js +4 -0
- package/LineChart/seriesConfig/index.mjs +4 -0
- package/LineChart/seriesConfig/seriesProcessor.js +8 -5
- package/LineChart/seriesConfig/seriesProcessor.mjs +8 -5
- package/LineChart/useLineChartProps.d.mts +2 -2
- package/LineChart/useLineChartProps.d.ts +2 -2
- package/LineChart/useLineChartProps.js +2 -2
- package/LineChart/useLineChartProps.mjs +2 -2
- package/LineChart/useMarkPlotData.js +2 -2
- package/LineChart/useMarkPlotData.mjs +2 -2
- package/PieChart/FocusedPieArc.js +1 -4
- package/PieChart/FocusedPieArc.mjs +2 -4
- package/PieChart/PieArc.d.mts +0 -37
- package/PieChart/PieArc.d.ts +0 -37
- package/PieChart/PieArc.js +5 -45
- package/PieChart/PieArc.mjs +5 -45
- package/PieChart/PieArcLabel.d.mts +2 -43
- package/PieChart/PieArcLabel.d.ts +2 -43
- package/PieChart/PieArcLabel.js +3 -46
- package/PieChart/PieArcLabel.mjs +5 -48
- package/PieChart/PieArcLabelPlot.js +0 -2
- package/PieChart/PieArcLabelPlot.mjs +0 -2
- package/PieChart/PieChart.d.mts +2 -2
- package/PieChart/PieChart.d.ts +2 -2
- package/PieChart/PieChart.js +17 -5
- package/PieChart/PieChart.mjs +17 -5
- package/PieChart/index.d.mts +1 -1
- package/PieChart/index.d.ts +1 -1
- package/PieChart/seriesConfig/descriptionGetter.d.mts +3 -0
- package/PieChart/seriesConfig/descriptionGetter.d.ts +3 -0
- package/PieChart/seriesConfig/descriptionGetter.js +26 -0
- package/PieChart/seriesConfig/descriptionGetter.mjs +20 -0
- package/PieChart/seriesConfig/index.js +2 -0
- package/PieChart/seriesConfig/index.mjs +2 -0
- package/PieChart/seriesConfig/legend.js +0 -2
- package/PieChart/seriesConfig/legend.mjs +0 -2
- package/RadarChart/RadarAxis/RadarAxis.d.mts +6 -2
- package/RadarChart/RadarAxis/RadarAxis.d.ts +6 -2
- package/RadarChart/RadarAxis/RadarAxis.js +7 -5
- package/RadarChart/RadarAxis/RadarAxis.mjs +6 -4
- package/RadarChart/RadarAxis/index.d.mts +1 -2
- package/RadarChart/RadarAxis/index.d.ts +1 -2
- package/RadarChart/RadarAxis/index.js +1 -13
- package/RadarChart/RadarAxis/index.mjs +1 -2
- package/RadarChart/RadarAxis/useRadarAxis.js +2 -2
- package/RadarChart/RadarAxis/useRadarAxis.mjs +2 -2
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.mts +6 -2
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.d.ts +6 -2
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.js +9 -14
- package/RadarChart/RadarAxisHighlight/RadarAxisHighlight.mjs +8 -13
- package/RadarChart/RadarAxisHighlight/index.d.mts +1 -2
- package/RadarChart/RadarAxisHighlight/index.d.ts +1 -2
- package/RadarChart/RadarAxisHighlight/index.mjs +1 -2
- package/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.js +2 -2
- package/RadarChart/RadarAxisHighlight/useRadarAxisHighlight.mjs +2 -2
- package/RadarChart/RadarChart.js +15 -0
- package/RadarChart/RadarChart.mjs +15 -0
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.mts +2 -2
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +2 -2
- package/RadarChart/RadarDataProvider/RadarDataProvider.js +2 -2
- package/RadarChart/RadarDataProvider/RadarDataProvider.mjs +2 -2
- package/RadarChart/RadarGrid/CircularRadarGrid.js +2 -2
- package/RadarChart/RadarGrid/CircularRadarGrid.mjs +2 -2
- package/RadarChart/RadarGrid/CircularRadarStripes.js +1 -1
- package/RadarChart/RadarGrid/CircularRadarStripes.mjs +1 -1
- package/RadarChart/RadarGrid/RadarGrid.js +2 -2
- package/RadarChart/RadarGrid/RadarGrid.mjs +2 -2
- package/RadarChart/RadarGrid/RadarGrid.types.d.mts +6 -7
- package/RadarChart/RadarGrid/RadarGrid.types.d.ts +6 -7
- package/RadarChart/RadarGrid/SharpRadarGrid.js +2 -2
- package/RadarChart/RadarGrid/SharpRadarGrid.mjs +2 -2
- package/RadarChart/RadarGrid/SharpRadarStripes.js +1 -1
- package/RadarChart/RadarGrid/SharpRadarStripes.mjs +1 -1
- package/RadarChart/RadarGrid/index.d.mts +1 -2
- package/RadarChart/RadarGrid/index.d.ts +1 -2
- package/RadarChart/RadarGrid/useRadarGridData.js +2 -2
- package/RadarChart/RadarGrid/useRadarGridData.mjs +2 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.mts +2 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.d.ts +2 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.js +6 -6
- package/RadarChart/RadarSeriesPlot/RadarSeriesArea.mjs +6 -6
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.mts +13 -4
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.d.ts +13 -4
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.js +8 -6
- package/RadarChart/RadarSeriesPlot/RadarSeriesMarks.mjs +8 -6
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.js +5 -3
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.mjs +4 -2
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.mts +6 -4
- package/RadarChart/RadarSeriesPlot/RadarSeriesPlot.types.d.ts +6 -4
- package/RadarChart/RadarSeriesPlot/index.d.mts +1 -3
- package/RadarChart/RadarSeriesPlot/index.d.ts +1 -3
- package/RadarChart/RadarSeriesPlot/index.js +2 -10
- package/RadarChart/RadarSeriesPlot/index.mjs +1 -2
- package/RadarChart/RadarSeriesPlot/useInteractionAllItemProps.js +2 -2
- package/RadarChart/RadarSeriesPlot/useInteractionAllItemProps.mjs +2 -2
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.js +2 -2
- package/RadarChart/RadarSeriesPlot/useRadarSeriesData.mjs +2 -2
- package/RadarChart/index.d.mts +3 -1
- package/RadarChart/index.d.ts +3 -1
- package/RadarChart/index.js +9 -1
- package/RadarChart/index.mjs +2 -1
- package/RadarChart/radarClasses.d.mts +30 -0
- package/RadarChart/radarClasses.d.ts +30 -0
- package/RadarChart/radarClasses.js +33 -0
- package/RadarChart/radarClasses.mjs +24 -0
- package/RadarChart/seriesConfig/descriptionGetter.d.mts +3 -0
- package/RadarChart/seriesConfig/descriptionGetter.d.ts +3 -0
- package/RadarChart/seriesConfig/descriptionGetter.js +37 -0
- package/RadarChart/seriesConfig/descriptionGetter.mjs +31 -0
- package/RadarChart/seriesConfig/index.js +2 -0
- package/RadarChart/seriesConfig/index.mjs +2 -0
- package/RadarChart/seriesConfig/legend.js +2 -21
- package/RadarChart/seriesConfig/legend.mjs +2 -21
- package/ScatterChart/BatchScatter.js +3 -3
- package/ScatterChart/BatchScatter.mjs +3 -3
- package/ScatterChart/Scatter.js +3 -3
- package/ScatterChart/Scatter.mjs +3 -3
- package/ScatterChart/ScatterChart.d.mts +15 -3
- package/ScatterChart/ScatterChart.d.ts +15 -3
- package/ScatterChart/ScatterChart.js +73 -31
- package/ScatterChart/ScatterChart.mjs +73 -31
- package/ScatterChart/seriesConfig/descriptionGetter.d.mts +3 -0
- package/ScatterChart/seriesConfig/descriptionGetter.d.ts +3 -0
- package/ScatterChart/seriesConfig/descriptionGetter.js +34 -0
- package/ScatterChart/seriesConfig/descriptionGetter.mjs +28 -0
- package/ScatterChart/seriesConfig/index.js +2 -0
- package/ScatterChart/seriesConfig/index.mjs +2 -0
- package/ScatterChart/seriesConfig/legend.js +2 -21
- package/ScatterChart/seriesConfig/legend.mjs +2 -21
- package/ScatterChart/useScatterChartProps.d.mts +2 -2
- package/ScatterChart/useScatterChartProps.d.ts +2 -2
- package/ScatterChart/useScatterChartProps.js +9 -8
- package/ScatterChart/useScatterChartProps.mjs +9 -8
- package/SparkLineChart/SparkLineChart.d.mts +2 -2
- package/SparkLineChart/SparkLineChart.d.ts +2 -2
- package/SparkLineChart/SparkLineChart.js +60 -28
- package/SparkLineChart/SparkLineChart.mjs +60 -28
- package/constants/index.js +0 -2
- package/constants/index.mjs +0 -2
- package/context/useChartApiContext.d.mts +1 -1
- package/context/useChartApiContext.d.ts +1 -1
- package/context/useChartApiContext.js +3 -3
- package/context/useChartApiContext.mjs +3 -3
- package/hooks/animation/useAnimatePieArcLabel.d.mts +1 -10
- package/hooks/animation/useAnimatePieArcLabel.d.ts +1 -10
- package/hooks/animation/useAnimatePieArcLabel.js +6 -10
- package/hooks/animation/useAnimatePieArcLabel.mjs +6 -10
- package/hooks/useChartRootRef.js +2 -2
- package/hooks/useChartRootRef.mjs +2 -2
- package/hooks/useChartsLayerContainerRef.js +2 -2
- package/hooks/useChartsLayerContainerRef.mjs +2 -2
- package/hooks/useDataset.js +1 -1
- package/hooks/useDataset.mjs +2 -2
- package/hooks/useInteractionItemProps.d.mts +1 -1
- package/hooks/useInteractionItemProps.d.ts +1 -1
- package/hooks/useInteractionItemProps.js +5 -5
- package/hooks/useInteractionItemProps.mjs +5 -5
- package/hooks/useTicks.js +2 -2
- package/hooks/useTicks.mjs +2 -2
- package/index.d.mts +0 -3
- package/index.d.ts +0 -3
- package/index.js +2 -22
- package/index.mjs +1 -3
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.d.mts +5 -0
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.d.ts +5 -0
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.js +100 -0
- package/internals/components/ChartsAccessibilityProxy/ChartsAccessibilityProxy.mjs +96 -0
- package/internals/components/ChartsAccessibilityProxy/index.d.mts +1 -0
- package/internals/components/ChartsAccessibilityProxy/index.d.ts +1 -0
- package/internals/components/ChartsAccessibilityProxy/index.js +16 -0
- package/internals/components/ChartsAccessibilityProxy/index.mjs +1 -0
- package/internals/components/ChartsAccessibilityProxy/useDescription.d.mts +5 -0
- package/internals/components/ChartsAccessibilityProxy/useDescription.d.ts +5 -0
- package/internals/components/ChartsAccessibilityProxy/useDescription.js +71 -0
- package/internals/components/ChartsAccessibilityProxy/useDescription.mjs +66 -0
- package/internals/consumeSlots.d.mts +1 -1
- package/internals/consumeSlots.d.ts +1 -1
- package/internals/getChartPoint.js +18 -1
- package/internals/getChartPoint.mjs +18 -1
- package/internals/identifierCleaner.d.mts +5 -5
- package/internals/identifierCleaner.d.ts +5 -5
- package/internals/identifierCleaner.js +0 -1
- package/internals/identifierCleaner.mjs +0 -1
- package/internals/index.d.mts +2 -3
- package/internals/index.d.ts +2 -3
- package/internals/index.js +27 -36
- package/internals/index.mjs +2 -3
- package/internals/legendUtils.d.mts +11 -0
- package/internals/legendUtils.d.ts +11 -0
- package/internals/legendUtils.js +28 -0
- package/internals/legendUtils.mjs +22 -0
- package/internals/plugins/corePlugins/corePlugins.d.mts +2 -2
- package/internals/plugins/corePlugins/corePlugins.d.ts +2 -2
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +2 -2
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.mjs +2 -2
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.mts +2 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.ts +2 -1
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.mts +2 -4
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +2 -4
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +2 -4
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.mjs +1 -3
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.mts +19 -9
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +19 -9
- package/internals/plugins/corePlugins/useChartSeries/index.d.mts +2 -1
- package/internals/plugins/corePlugins/useChartSeries/index.d.ts +2 -1
- package/internals/plugins/corePlugins/useChartSeries/index.js +12 -0
- package/internals/plugins/corePlugins/useChartSeries/index.mjs +2 -1
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.mts +21 -6
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +21 -6
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +20 -9
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.mjs +20 -9
- package/internals/plugins/corePlugins/useChartSeries/useChartSeriesLayout.selectors.d.mts +8 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeriesLayout.selectors.d.ts +8 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeriesLayout.selectors.js +19 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeriesLayout.selectors.mjs +14 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/TooltipContent.types.d.mts +18 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/TooltipContent.types.d.ts +18 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/descriptionGetter.types.d.mts +5 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/descriptionGetter.types.d.ts +5 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/descriptionGetter.types.js +5 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/descriptionGetter.types.mjs +1 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.mts +3 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.d.ts +3 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.js +22 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/index.mjs +3 -1
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.mts +7 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/seriesConfig.types.d.ts +7 -0
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.mts +16 -37
- package/internals/plugins/corePlugins/useChartSeriesConfig/types/tooltipGetter.types.d.ts +16 -37
- package/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.d.mts +4 -10
- package/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.d.ts +4 -10
- package/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.js +30 -21
- package/internals/plugins/featurePlugins/shared/useRegisterPointerInteractions.mjs +30 -20
- package/internals/plugins/featurePlugins/useChartCartesianAxis/autoSizeConstants.d.mts +5 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/autoSizeConstants.d.ts +5 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/autoSizeConstants.js +11 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/autoSizeConstants.mjs +5 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisAutoSize.d.mts +33 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisAutoSize.d.ts +33 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisAutoSize.js +318 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisAutoSize.mjs +311 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.mts +5 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +63 -8
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.mjs +62 -8
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.js +12 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeAxis.mjs +12 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.d.mts +13 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.d.ts +13 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.js +32 -7
- package/internals/plugins/featurePlugins/useChartCartesianAxis/domain.mjs +31 -7
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.mts +3 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +3 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +22 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.mjs +3 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisAutoSize.selectors.d.mts +30 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisAutoSize.selectors.d.ts +30 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisAutoSize.selectors.js +96 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisAutoSize.selectors.mjs +91 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisDomains.selectors.d.mts +16 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisDomains.selectors.d.ts +16 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisDomains.selectors.js +36 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisDomains.selectors.mjs +31 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisExtrema.selectors.d.mts +15 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisExtrema.selectors.d.ts +15 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisExtrema.selectors.js +45 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisExtrema.selectors.mjs +39 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.mts +11 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +11 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.js +53 -11
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.mjs +52 -11
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.mts +4 -9
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +4 -9
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +20 -45
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.mjs +23 -48
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.mts +5 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianTooltip.selectors.d.mts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianTooltip.selectors.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianTooltip.selectors.js +20 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianTooltip.selectors.mjs +20 -2
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.js +13 -11
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.mjs +13 -11
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.mts +4 -9
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.ts +4 -9
- package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.d.mts +3 -3
- package/internals/plugins/featurePlugins/useChartItemClick/useChartItemClick.types.d.ts +3 -3
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +36 -30
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.mjs +36 -30
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.mts +8 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +8 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +9 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.mjs +9 -2
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.mts +6 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +6 -0
- package/internals/seriesSelectorOfType.d.mts +3 -3
- package/internals/seriesSelectorOfType.d.ts +3 -3
- package/internals/store/useCharts.d.mts +1 -1
- package/internals/store/useCharts.d.ts +1 -1
- package/internals/store/useStore.js +2 -2
- package/internals/store/useStore.mjs +2 -2
- package/locales/elGR.d.mts +80 -0
- package/locales/elGR.d.ts +80 -0
- package/locales/elGR.js +95 -0
- package/locales/elGR.mjs +95 -0
- package/locales/enUS.d.mts +80 -0
- package/locales/enUS.d.ts +80 -0
- package/locales/enUS.js +94 -1
- package/locales/enUS.mjs +94 -1
- package/locales/frFR.d.mts +80 -0
- package/locales/frFR.d.ts +80 -0
- package/locales/frFR.js +95 -1
- package/locales/frFR.mjs +95 -1
- package/locales/nbNO.d.mts +80 -0
- package/locales/nbNO.d.ts +80 -0
- package/locales/nbNO.js +95 -0
- package/locales/nbNO.mjs +95 -0
- package/locales/ptBR.d.mts +80 -0
- package/locales/ptBR.d.ts +80 -0
- package/locales/ptBR.js +95 -0
- package/locales/ptBR.mjs +95 -0
- package/locales/ptPT.d.mts +80 -0
- package/locales/ptPT.d.ts +80 -0
- package/locales/ptPT.js +191 -99
- package/locales/ptPT.mjs +191 -99
- package/locales/svSE.d.mts +80 -0
- package/locales/svSE.d.ts +80 -0
- package/locales/svSE.js +95 -0
- package/locales/svSE.mjs +95 -0
- package/locales/utils/chartsLocaleTextApi.d.mts +205 -0
- package/locales/utils/chartsLocaleTextApi.d.ts +205 -0
- package/locales/utils/getChartsLocalization.d.mts +80 -0
- package/locales/utils/getChartsLocalization.d.ts +80 -0
- package/models/axis.d.mts +15 -5
- package/models/axis.d.ts +15 -5
- package/models/seriesType/composition.d.mts +1 -1
- package/models/seriesType/composition.d.ts +1 -1
- package/models/seriesType/composition.js +1 -1
- package/models/seriesType/composition.mjs +1 -1
- package/models/seriesType/config.d.mts +29 -0
- package/models/seriesType/config.d.ts +29 -0
- package/models/seriesType/line.d.mts +2 -1
- package/models/seriesType/line.d.ts +2 -1
- package/models/seriesType/scatter.d.mts +0 -7
- package/models/seriesType/scatter.d.ts +0 -7
- package/package.json +3 -31
- package/themeAugmentation/components.d.mts +5 -25
- package/themeAugmentation/components.d.ts +5 -25
- package/themeAugmentation/overrides.d.mts +3 -15
- package/themeAugmentation/overrides.d.ts +3 -15
- package/themeAugmentation/props.d.mts +0 -2
- package/themeAugmentation/props.d.ts +0 -2
- package/BarChart/BarLabel/barLabelClasses.d.mts +0 -41
- package/BarChart/BarLabel/barLabelClasses.d.ts +0 -41
- package/BarChart/BarLabel/barLabelClasses.js +0 -49
- package/BarChart/BarLabel/barLabelClasses.mjs +0 -40
- package/BarChart/barElementClasses.d.mts +0 -40
- package/BarChart/barElementClasses.d.ts +0 -40
- package/BarChart/barElementClasses.js +0 -48
- package/BarChart/barElementClasses.mjs +0 -39
- package/ChartContainer/ChartContainer.d.mts +0 -22
- package/ChartContainer/ChartContainer.d.ts +0 -22
- package/ChartContainer/ChartContainer.js +0 -24
- package/ChartContainer/ChartContainer.mjs +0 -20
- package/ChartContainer/index.d.mts +0 -1
- package/ChartContainer/index.d.ts +0 -1
- package/ChartContainer/index.js +0 -16
- package/ChartContainer/index.mjs +0 -1
- package/ChartContainer/useChartContainerProps.d.mts +0 -13
- package/ChartContainer/useChartContainerProps.d.ts +0 -13
- package/ChartContainer/useChartContainerProps.js +0 -19
- package/ChartContainer/useChartContainerProps.mjs +0 -14
- package/ChartDataProvider/ChartDataProvider.d.mts +0 -20
- package/ChartDataProvider/ChartDataProvider.d.ts +0 -20
- package/ChartDataProvider/ChartDataProvider.js +0 -24
- package/ChartDataProvider/ChartDataProvider.mjs +0 -20
- package/ChartDataProvider/index.d.mts +0 -1
- package/ChartDataProvider/index.d.ts +0 -1
- package/ChartDataProvider/index.js +0 -16
- package/ChartDataProvider/index.mjs +0 -1
- package/ChartDataProvider/useChartDataProviderProps.d.mts +0 -10
- package/ChartDataProvider/useChartDataProviderProps.d.ts +0 -10
- package/ChartDataProvider/useChartDataProviderProps.js +0 -12
- package/ChartDataProvider/useChartDataProviderProps.mjs +0 -8
- package/LineChart/markElementClasses.d.mts +0 -42
- package/LineChart/markElementClasses.d.ts +0 -42
- package/LineChart/markElementClasses.js +0 -48
- package/LineChart/markElementClasses.mjs +0 -40
- package/RadarChart/RadarAxis/radarAxisClasses.d.mts +0 -12
- package/RadarChart/RadarAxis/radarAxisClasses.d.ts +0 -12
- package/RadarChart/RadarAxis/radarAxisClasses.js +0 -25
- package/RadarChart/RadarAxis/radarAxisClasses.mjs +0 -15
- package/RadarChart/RadarAxisHighlight/radarAxisHighlightClasses.d.mts +0 -11
- package/RadarChart/RadarAxisHighlight/radarAxisHighlightClasses.d.ts +0 -11
- package/RadarChart/RadarAxisHighlight/radarAxisHighlightClasses.js +0 -14
- package/RadarChart/RadarAxisHighlight/radarAxisHighlightClasses.mjs +0 -6
- package/RadarChart/RadarGrid/radarGridClasses.d.mts +0 -12
- package/RadarChart/RadarGrid/radarGridClasses.d.ts +0 -12
- package/RadarChart/RadarGrid/radarGridClasses.js +0 -25
- package/RadarChart/RadarGrid/radarGridClasses.mjs +0 -15
- package/RadarChart/RadarSeriesPlot/radarSeriesPlotClasses.d.mts +0 -22
- package/RadarChart/RadarSeriesPlot/radarSeriesPlotClasses.d.ts +0 -22
- package/RadarChart/RadarSeriesPlot/radarSeriesPlotClasses.js +0 -26
- package/RadarChart/RadarSeriesPlot/radarSeriesPlotClasses.mjs +0 -17
- package/context/ChartProvider/ChartContext.d.mts +0 -5
- package/context/ChartProvider/ChartContext.d.ts +0 -5
- package/context/ChartProvider/ChartContext.js +0 -13
- package/context/ChartProvider/ChartContext.mjs +0 -9
- package/context/ChartProvider/ChartProvider.d.mts +0 -5
- package/context/ChartProvider/ChartProvider.d.ts +0 -5
- package/context/ChartProvider/ChartProvider.js +0 -12
- package/context/ChartProvider/ChartProvider.mjs +0 -8
- package/context/ChartProvider/ChartProvider.types.d.mts +0 -15
- package/context/ChartProvider/ChartProvider.types.d.ts +0 -15
- package/context/ChartProvider/index.d.mts +0 -3
- package/context/ChartProvider/index.d.ts +0 -3
- package/context/ChartProvider/index.js +0 -38
- package/context/ChartProvider/index.mjs +0 -3
- package/context/ChartProvider/useChartContext.d.mts +0 -4
- package/context/ChartProvider/useChartContext.d.ts +0 -4
- package/context/ChartProvider/useChartContext.js +0 -12
- package/context/ChartProvider/useChartContext.mjs +0 -8
- package/tests/constants.js +0 -7
- package/tests/constants.mjs +0 -1
- /package/{context/ChartProvider/ChartProvider.types.js → internals/plugins/corePlugins/useChartSeriesConfig/types/TooltipContent.types.js} +0 -0
- /package/{context/ChartProvider/ChartProvider.types.mjs → internals/plugins/corePlugins/useChartSeriesConfig/types/TooltipContent.types.mjs} +0 -0
package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianTooltip.selectors.js
CHANGED
|
@@ -8,11 +8,23 @@ var _store = require("@mui/x-internals/store");
|
|
|
8
8
|
var _isDeepEqual = require("@mui/x-internals/isDeepEqual");
|
|
9
9
|
var _useChartCartesianAxisRendering = require("./useChartCartesianAxisRendering.selectors");
|
|
10
10
|
var _useChartInteraction = require("../useChartInteraction");
|
|
11
|
+
var _useChartInteraction2 = require("../useChartInteraction/useChartInteraction.selectors");
|
|
12
|
+
var _useChartKeyboardNavigation = require("../useChartKeyboardNavigation/useChartKeyboardNavigation.selectors");
|
|
11
13
|
var _getAxisValue = require("./getAxisValue");
|
|
12
14
|
var _getValueToPositionMapper = require("../../../../hooks/getValueToPositionMapper");
|
|
13
15
|
var _useChartDimensions = require("../../corePlugins/useChartDimensions/useChartDimensions.selectors");
|
|
14
16
|
const selectorChartControlledCartesianAxisTooltip = state => state.controlledCartesianAxisTooltip;
|
|
15
17
|
const EMPTY_ARRAY = [];
|
|
18
|
+
function getKeyboardAxisTooltip(keyboardIndex, axes) {
|
|
19
|
+
if (keyboardIndex === undefined) {
|
|
20
|
+
return EMPTY_ARRAY;
|
|
21
|
+
}
|
|
22
|
+
const axis = axes.axis[keyboardIndex.axisId];
|
|
23
|
+
if (!axis?.triggerTooltip) {
|
|
24
|
+
return EMPTY_ARRAY;
|
|
25
|
+
}
|
|
26
|
+
return [keyboardIndex];
|
|
27
|
+
}
|
|
16
28
|
|
|
17
29
|
/**
|
|
18
30
|
* Get x-axis ids and corresponding data index that should be display in the tooltip.
|
|
@@ -24,7 +36,7 @@ const selectorChartsInteractionTooltipXAxes = exports.selectorChartsInteractionT
|
|
|
24
36
|
// uses string/number as arguments.
|
|
25
37
|
resultEqualityCheck: _isDeepEqual.isDeepEqual
|
|
26
38
|
}
|
|
27
|
-
})(selectorChartControlledCartesianAxisTooltip, _useChartInteraction.selectorChartsInteractionPointerX, _useChartCartesianAxisRendering.selectorChartXAxis, (controlledValues, value, axes) => {
|
|
39
|
+
})(selectorChartControlledCartesianAxisTooltip, _useChartInteraction.selectorChartsInteractionPointerX, _useChartCartesianAxisRendering.selectorChartXAxis, _useChartInteraction2.selectorChartsLastInteraction, _useChartKeyboardNavigation.selectorChartsKeyboardXAxisIndex, (controlledValues, value, axes, lastInteraction, keyboardIndex) => {
|
|
28
40
|
if (controlledValues !== undefined) {
|
|
29
41
|
if (controlledValues.length === 0) {
|
|
30
42
|
return EMPTY_ARRAY;
|
|
@@ -35,6 +47,9 @@ const selectorChartsInteractionTooltipXAxes = exports.selectorChartsInteractionT
|
|
|
35
47
|
}) => ids.has(axisId));
|
|
36
48
|
return filteredArray.length === controlledValues.length ? controlledValues : filteredArray;
|
|
37
49
|
}
|
|
50
|
+
if (lastInteraction === 'keyboard') {
|
|
51
|
+
return getKeyboardAxisTooltip(keyboardIndex, axes);
|
|
52
|
+
}
|
|
38
53
|
if (value === null) {
|
|
39
54
|
return EMPTY_ARRAY;
|
|
40
55
|
}
|
|
@@ -56,7 +71,7 @@ const selectorChartsInteractionTooltipYAxes = exports.selectorChartsInteractionT
|
|
|
56
71
|
// uses string/number as arguments.
|
|
57
72
|
resultEqualityCheck: _isDeepEqual.isDeepEqual
|
|
58
73
|
}
|
|
59
|
-
})(selectorChartControlledCartesianAxisTooltip, _useChartInteraction.selectorChartsInteractionPointerY, _useChartCartesianAxisRendering.selectorChartYAxis, (controlledValues, value, axes) => {
|
|
74
|
+
})(selectorChartControlledCartesianAxisTooltip, _useChartInteraction.selectorChartsInteractionPointerY, _useChartCartesianAxisRendering.selectorChartYAxis, _useChartInteraction2.selectorChartsLastInteraction, _useChartKeyboardNavigation.selectorChartsKeyboardYAxisIndex, (controlledValues, value, axes, lastInteraction, keyboardIndex) => {
|
|
60
75
|
if (controlledValues !== undefined) {
|
|
61
76
|
if (controlledValues.length === 0) {
|
|
62
77
|
return EMPTY_ARRAY;
|
|
@@ -67,6 +82,9 @@ const selectorChartsInteractionTooltipYAxes = exports.selectorChartsInteractionT
|
|
|
67
82
|
}) => ids.has(axisId));
|
|
68
83
|
return filteredArray.length === controlledValues.length ? controlledValues : filteredArray;
|
|
69
84
|
}
|
|
85
|
+
if (lastInteraction === 'keyboard') {
|
|
86
|
+
return getKeyboardAxisTooltip(keyboardIndex, axes);
|
|
87
|
+
}
|
|
70
88
|
if (value === null) {
|
|
71
89
|
return EMPTY_ARRAY;
|
|
72
90
|
}
|
|
@@ -2,11 +2,23 @@ import { createSelector, createSelectorMemoized, createSelectorMemoizedWithOptio
|
|
|
2
2
|
import { isDeepEqual } from '@mui/x-internals/isDeepEqual';
|
|
3
3
|
import { selectorChartXAxis, selectorChartYAxis } from "./useChartCartesianAxisRendering.selectors.mjs";
|
|
4
4
|
import { selectorChartsInteractionPointerX, selectorChartsInteractionPointerY } from "../useChartInteraction/index.mjs";
|
|
5
|
+
import { selectorChartsLastInteraction } from "../useChartInteraction/useChartInteraction.selectors.mjs";
|
|
6
|
+
import { selectorChartsKeyboardXAxisIndex, selectorChartsKeyboardYAxisIndex } from "../useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.mjs";
|
|
5
7
|
import { getAxisIndex } from "./getAxisValue.mjs";
|
|
6
8
|
import { getValueToPositionMapper } from "../../../../hooks/getValueToPositionMapper.mjs";
|
|
7
9
|
import { selectorChartDrawingArea } from "../../corePlugins/useChartDimensions/useChartDimensions.selectors.mjs";
|
|
8
10
|
const selectorChartControlledCartesianAxisTooltip = state => state.controlledCartesianAxisTooltip;
|
|
9
11
|
const EMPTY_ARRAY = [];
|
|
12
|
+
function getKeyboardAxisTooltip(keyboardIndex, axes) {
|
|
13
|
+
if (keyboardIndex === undefined) {
|
|
14
|
+
return EMPTY_ARRAY;
|
|
15
|
+
}
|
|
16
|
+
const axis = axes.axis[keyboardIndex.axisId];
|
|
17
|
+
if (!axis?.triggerTooltip) {
|
|
18
|
+
return EMPTY_ARRAY;
|
|
19
|
+
}
|
|
20
|
+
return [keyboardIndex];
|
|
21
|
+
}
|
|
10
22
|
|
|
11
23
|
/**
|
|
12
24
|
* Get x-axis ids and corresponding data index that should be display in the tooltip.
|
|
@@ -18,7 +30,7 @@ export const selectorChartsInteractionTooltipXAxes = createSelectorMemoizedWithO
|
|
|
18
30
|
// uses string/number as arguments.
|
|
19
31
|
resultEqualityCheck: isDeepEqual
|
|
20
32
|
}
|
|
21
|
-
})(selectorChartControlledCartesianAxisTooltip, selectorChartsInteractionPointerX, selectorChartXAxis, (controlledValues, value, axes) => {
|
|
33
|
+
})(selectorChartControlledCartesianAxisTooltip, selectorChartsInteractionPointerX, selectorChartXAxis, selectorChartsLastInteraction, selectorChartsKeyboardXAxisIndex, (controlledValues, value, axes, lastInteraction, keyboardIndex) => {
|
|
22
34
|
if (controlledValues !== undefined) {
|
|
23
35
|
if (controlledValues.length === 0) {
|
|
24
36
|
return EMPTY_ARRAY;
|
|
@@ -29,6 +41,9 @@ export const selectorChartsInteractionTooltipXAxes = createSelectorMemoizedWithO
|
|
|
29
41
|
}) => ids.has(axisId));
|
|
30
42
|
return filteredArray.length === controlledValues.length ? controlledValues : filteredArray;
|
|
31
43
|
}
|
|
44
|
+
if (lastInteraction === 'keyboard') {
|
|
45
|
+
return getKeyboardAxisTooltip(keyboardIndex, axes);
|
|
46
|
+
}
|
|
32
47
|
if (value === null) {
|
|
33
48
|
return EMPTY_ARRAY;
|
|
34
49
|
}
|
|
@@ -50,7 +65,7 @@ export const selectorChartsInteractionTooltipYAxes = createSelectorMemoizedWithO
|
|
|
50
65
|
// uses string/number as arguments.
|
|
51
66
|
resultEqualityCheck: isDeepEqual
|
|
52
67
|
}
|
|
53
|
-
})(selectorChartControlledCartesianAxisTooltip, selectorChartsInteractionPointerY, selectorChartYAxis, (controlledValues, value, axes) => {
|
|
68
|
+
})(selectorChartControlledCartesianAxisTooltip, selectorChartsInteractionPointerY, selectorChartYAxis, selectorChartsLastInteraction, selectorChartsKeyboardYAxisIndex, (controlledValues, value, axes, lastInteraction, keyboardIndex) => {
|
|
54
69
|
if (controlledValues !== undefined) {
|
|
55
70
|
if (controlledValues.length === 0) {
|
|
56
71
|
return EMPTY_ARRAY;
|
|
@@ -61,6 +76,9 @@ export const selectorChartsInteractionTooltipYAxes = createSelectorMemoizedWithO
|
|
|
61
76
|
}) => ids.has(axisId));
|
|
62
77
|
return filteredArray.length === controlledValues.length ? controlledValues : filteredArray;
|
|
63
78
|
}
|
|
79
|
+
if (lastInteraction === 'keyboard') {
|
|
80
|
+
return getKeyboardAxisTooltip(keyboardIndex, axes);
|
|
81
|
+
}
|
|
64
82
|
if (value === null) {
|
|
65
83
|
return EMPTY_ARRAY;
|
|
66
84
|
}
|
|
@@ -24,10 +24,12 @@ const useChartClosestPoint = ({
|
|
|
24
24
|
chartsLayerContainerRef
|
|
25
25
|
} = instance;
|
|
26
26
|
const {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
disableHitArea,
|
|
28
|
+
hitAreaRadius,
|
|
29
29
|
onItemClick
|
|
30
30
|
} = params;
|
|
31
|
+
const resolvedDisableHitArea = disableHitArea;
|
|
32
|
+
const resolvedHitAreaRadius = hitAreaRadius;
|
|
31
33
|
const {
|
|
32
34
|
axis: xAxis,
|
|
33
35
|
axisIds: xAxisIds
|
|
@@ -46,11 +48,11 @@ const useChartClosestPoint = ({
|
|
|
46
48
|
const defaultYAxisId = yAxisIds[0];
|
|
47
49
|
(0, _useEnhancedEffect.default)(() => {
|
|
48
50
|
store.set('voronoi', {
|
|
49
|
-
isVoronoiEnabled: !
|
|
51
|
+
isVoronoiEnabled: !resolvedDisableHitArea
|
|
50
52
|
});
|
|
51
|
-
}, [store,
|
|
53
|
+
}, [store, resolvedDisableHitArea]);
|
|
52
54
|
React.useEffect(() => {
|
|
53
|
-
if (chartsLayerContainerRef.current === null ||
|
|
55
|
+
if (chartsLayerContainerRef.current === null || resolvedDisableHitArea) {
|
|
54
56
|
return undefined;
|
|
55
57
|
}
|
|
56
58
|
const element = chartsLayerContainerRef.current;
|
|
@@ -71,7 +73,7 @@ const useChartClosestPoint = ({
|
|
|
71
73
|
const yAxisId = aSeries.yAxisId ?? defaultYAxisId;
|
|
72
74
|
const xAxisZoom = (0, _useChartCartesianAxis.selectorChartAxisZoomData)(store.state, xAxisId);
|
|
73
75
|
const yAxisZoom = (0, _useChartCartesianAxis.selectorChartAxisZoomData)(store.state, yAxisId);
|
|
74
|
-
const maxRadius =
|
|
76
|
+
const maxRadius = resolvedHitAreaRadius === 'item' ? aSeries.markerSize : resolvedHitAreaRadius;
|
|
75
77
|
const xZoomStart = (xAxisZoom?.start ?? 0) / 100;
|
|
76
78
|
const xZoomEnd = (xAxisZoom?.end ?? 100) / 100;
|
|
77
79
|
const yZoomStart = (yAxisZoom?.start ?? 0) / 100;
|
|
@@ -181,7 +183,7 @@ const useChartClosestPoint = ({
|
|
|
181
183
|
pressHandler.cleanup();
|
|
182
184
|
pressEndHandler.cleanup();
|
|
183
185
|
};
|
|
184
|
-
}, [chartsLayerContainerRef, yAxis, xAxis,
|
|
186
|
+
}, [chartsLayerContainerRef, yAxis, xAxis, resolvedHitAreaRadius, onItemClick, resolvedDisableHitArea, instance, seriesOrder, series, flatbushMap, defaultXAxisId, defaultYAxisId, store]);
|
|
185
187
|
|
|
186
188
|
// Instance implementation
|
|
187
189
|
const enableVoronoiCallback = (0, _useEventCallback.default)(() => {
|
|
@@ -205,15 +207,15 @@ exports.useChartClosestPoint = useChartClosestPoint;
|
|
|
205
207
|
useChartClosestPoint.getDefaultizedParams = ({
|
|
206
208
|
params
|
|
207
209
|
}) => (0, _extends2.default)({}, params, {
|
|
208
|
-
|
|
210
|
+
disableHitArea: params.disableHitArea ?? !params.series.some(item => item.type === 'scatter')
|
|
209
211
|
});
|
|
210
212
|
useChartClosestPoint.getInitialState = params => ({
|
|
211
213
|
voronoi: {
|
|
212
|
-
isVoronoiEnabled: !params.
|
|
214
|
+
isVoronoiEnabled: !params.disableHitArea
|
|
213
215
|
}
|
|
214
216
|
});
|
|
215
217
|
useChartClosestPoint.params = {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
+
disableHitArea: true,
|
|
219
|
+
hitAreaRadius: true,
|
|
218
220
|
onItemClick: true
|
|
219
221
|
};
|
|
@@ -17,10 +17,12 @@ export const useChartClosestPoint = ({
|
|
|
17
17
|
chartsLayerContainerRef
|
|
18
18
|
} = instance;
|
|
19
19
|
const {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
disableHitArea,
|
|
21
|
+
hitAreaRadius,
|
|
22
22
|
onItemClick
|
|
23
23
|
} = params;
|
|
24
|
+
const resolvedDisableHitArea = disableHitArea;
|
|
25
|
+
const resolvedHitAreaRadius = hitAreaRadius;
|
|
24
26
|
const {
|
|
25
27
|
axis: xAxis,
|
|
26
28
|
axisIds: xAxisIds
|
|
@@ -39,11 +41,11 @@ export const useChartClosestPoint = ({
|
|
|
39
41
|
const defaultYAxisId = yAxisIds[0];
|
|
40
42
|
useEnhancedEffect(() => {
|
|
41
43
|
store.set('voronoi', {
|
|
42
|
-
isVoronoiEnabled: !
|
|
44
|
+
isVoronoiEnabled: !resolvedDisableHitArea
|
|
43
45
|
});
|
|
44
|
-
}, [store,
|
|
46
|
+
}, [store, resolvedDisableHitArea]);
|
|
45
47
|
React.useEffect(() => {
|
|
46
|
-
if (chartsLayerContainerRef.current === null ||
|
|
48
|
+
if (chartsLayerContainerRef.current === null || resolvedDisableHitArea) {
|
|
47
49
|
return undefined;
|
|
48
50
|
}
|
|
49
51
|
const element = chartsLayerContainerRef.current;
|
|
@@ -64,7 +66,7 @@ export const useChartClosestPoint = ({
|
|
|
64
66
|
const yAxisId = aSeries.yAxisId ?? defaultYAxisId;
|
|
65
67
|
const xAxisZoom = selectorChartAxisZoomData(store.state, xAxisId);
|
|
66
68
|
const yAxisZoom = selectorChartAxisZoomData(store.state, yAxisId);
|
|
67
|
-
const maxRadius =
|
|
69
|
+
const maxRadius = resolvedHitAreaRadius === 'item' ? aSeries.markerSize : resolvedHitAreaRadius;
|
|
68
70
|
const xZoomStart = (xAxisZoom?.start ?? 0) / 100;
|
|
69
71
|
const xZoomEnd = (xAxisZoom?.end ?? 100) / 100;
|
|
70
72
|
const yZoomStart = (yAxisZoom?.start ?? 0) / 100;
|
|
@@ -174,7 +176,7 @@ export const useChartClosestPoint = ({
|
|
|
174
176
|
pressHandler.cleanup();
|
|
175
177
|
pressEndHandler.cleanup();
|
|
176
178
|
};
|
|
177
|
-
}, [chartsLayerContainerRef, yAxis, xAxis,
|
|
179
|
+
}, [chartsLayerContainerRef, yAxis, xAxis, resolvedHitAreaRadius, onItemClick, resolvedDisableHitArea, instance, seriesOrder, series, flatbushMap, defaultXAxisId, defaultYAxisId, store]);
|
|
178
180
|
|
|
179
181
|
// Instance implementation
|
|
180
182
|
const enableVoronoiCallback = useEventCallback(() => {
|
|
@@ -197,15 +199,15 @@ export const useChartClosestPoint = ({
|
|
|
197
199
|
useChartClosestPoint.getDefaultizedParams = ({
|
|
198
200
|
params
|
|
199
201
|
}) => _extends({}, params, {
|
|
200
|
-
|
|
202
|
+
disableHitArea: params.disableHitArea ?? !params.series.some(item => item.type === 'scatter')
|
|
201
203
|
});
|
|
202
204
|
useChartClosestPoint.getInitialState = params => ({
|
|
203
205
|
voronoi: {
|
|
204
|
-
isVoronoiEnabled: !params.
|
|
206
|
+
isVoronoiEnabled: !params.disableHitArea
|
|
205
207
|
}
|
|
206
208
|
});
|
|
207
209
|
useChartClosestPoint.params = {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
+
disableHitArea: true,
|
|
211
|
+
hitAreaRadius: true,
|
|
210
212
|
onItemClick: true
|
|
211
213
|
};
|
package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.mts
CHANGED
|
@@ -27,15 +27,15 @@ export interface UseChartVoronoiState {
|
|
|
27
27
|
}
|
|
28
28
|
export interface UseChartVoronoiParameters {
|
|
29
29
|
/**
|
|
30
|
-
* If true, the
|
|
30
|
+
* If true, the hit area interaction is disabled and falls back to hover events.
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
disableHitArea?: boolean;
|
|
33
33
|
/**
|
|
34
34
|
* Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
|
|
35
35
|
* If set to `'item'`, the radius is the `markerSize`.
|
|
36
36
|
* If `undefined`, the radius is assumed to be infinite.
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
hitAreaRadius?: 'item' | number | undefined;
|
|
39
39
|
/**
|
|
40
40
|
* Callback fired when clicking close to an item.
|
|
41
41
|
* This is only available for scatter plot for now.
|
|
@@ -44,12 +44,7 @@ export interface UseChartVoronoiParameters {
|
|
|
44
44
|
*/
|
|
45
45
|
onItemClick?: (event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void;
|
|
46
46
|
}
|
|
47
|
-
export type UseChartVoronoiDefaultizedParameters = Pick<UseChartVoronoiParameters, '
|
|
48
|
-
/**
|
|
49
|
-
* If true, the voronoi plugin is disabled.
|
|
50
|
-
*/
|
|
51
|
-
disableVoronoi: boolean;
|
|
52
|
-
};
|
|
47
|
+
export type UseChartVoronoiDefaultizedParameters = Pick<UseChartVoronoiParameters, 'hitAreaRadius' | 'disableHitArea' | 'onItemClick'>;
|
|
53
48
|
export type UseChartClosestPointSignature<SeriesType extends ChartSeriesType = ChartSeriesType> = ChartPluginSignature<{
|
|
54
49
|
instance: UseChartVoronoiInstance;
|
|
55
50
|
state: UseChartVoronoiState;
|
package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.types.d.ts
CHANGED
|
@@ -27,15 +27,15 @@ export interface UseChartVoronoiState {
|
|
|
27
27
|
}
|
|
28
28
|
export interface UseChartVoronoiParameters {
|
|
29
29
|
/**
|
|
30
|
-
* If true, the
|
|
30
|
+
* If true, the hit area interaction is disabled and falls back to hover events.
|
|
31
31
|
*/
|
|
32
|
-
|
|
32
|
+
disableHitArea?: boolean;
|
|
33
33
|
/**
|
|
34
34
|
* Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
|
|
35
35
|
* If set to `'item'`, the radius is the `markerSize`.
|
|
36
36
|
* If `undefined`, the radius is assumed to be infinite.
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
hitAreaRadius?: 'item' | number | undefined;
|
|
39
39
|
/**
|
|
40
40
|
* Callback fired when clicking close to an item.
|
|
41
41
|
* This is only available for scatter plot for now.
|
|
@@ -44,12 +44,7 @@ export interface UseChartVoronoiParameters {
|
|
|
44
44
|
*/
|
|
45
45
|
onItemClick?: (event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void;
|
|
46
46
|
}
|
|
47
|
-
export type UseChartVoronoiDefaultizedParameters = Pick<UseChartVoronoiParameters, '
|
|
48
|
-
/**
|
|
49
|
-
* If true, the voronoi plugin is disabled.
|
|
50
|
-
*/
|
|
51
|
-
disableVoronoi: boolean;
|
|
52
|
-
};
|
|
47
|
+
export type UseChartVoronoiDefaultizedParameters = Pick<UseChartVoronoiParameters, 'hitAreaRadius' | 'disableHitArea' | 'onItemClick'>;
|
|
53
48
|
export type UseChartClosestPointSignature<SeriesType extends ChartSeriesType = ChartSeriesType> = ChartPluginSignature<{
|
|
54
49
|
instance: UseChartVoronoiInstance;
|
|
55
50
|
state: UseChartVoronoiState;
|
|
@@ -6,13 +6,13 @@ export interface UseChartItemClickParameters<SeriesType extends ChartSeriesType
|
|
|
6
6
|
/**
|
|
7
7
|
* The callback fired when an item is clicked.
|
|
8
8
|
*
|
|
9
|
-
* @param {React.MouseEvent<
|
|
9
|
+
* @param {React.MouseEvent<HTMLDivElement, MouseEvent>} event The click event.
|
|
10
10
|
* @param {SeriesItemIdentifierWithType<SeriesType>} item The clicked item.
|
|
11
11
|
*/
|
|
12
|
-
onItemClick?: (event: React.MouseEvent<
|
|
12
|
+
onItemClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>, item: SeriesItemIdentifierWithType<SeriesType>) => void;
|
|
13
13
|
}
|
|
14
14
|
export interface UseChartItemClickInstance {
|
|
15
|
-
handleClick?: (event: React.MouseEvent<
|
|
15
|
+
handleClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
16
16
|
}
|
|
17
17
|
export interface UseChartItemClickState {}
|
|
18
18
|
export type UseChartItemClickSignature<SeriesType extends ChartSeriesType = ChartSeriesType> = ChartPluginSignature<{
|
|
@@ -6,13 +6,13 @@ export interface UseChartItemClickParameters<SeriesType extends ChartSeriesType
|
|
|
6
6
|
/**
|
|
7
7
|
* The callback fired when an item is clicked.
|
|
8
8
|
*
|
|
9
|
-
* @param {React.MouseEvent<
|
|
9
|
+
* @param {React.MouseEvent<HTMLDivElement, MouseEvent>} event The click event.
|
|
10
10
|
* @param {SeriesItemIdentifierWithType<SeriesType>} item The clicked item.
|
|
11
11
|
*/
|
|
12
|
-
onItemClick?: (event: React.MouseEvent<
|
|
12
|
+
onItemClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>, item: SeriesItemIdentifierWithType<SeriesType>) => void;
|
|
13
13
|
}
|
|
14
14
|
export interface UseChartItemClickInstance {
|
|
15
|
-
handleClick?: (event: React.MouseEvent<
|
|
15
|
+
handleClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
16
16
|
}
|
|
17
17
|
export interface UseChartItemClickState {}
|
|
18
18
|
export type UseChartItemClickSignature<SeriesType extends ChartSeriesType = ChartSeriesType> = ChartPluginSignature<{
|
package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js
CHANGED
|
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.useChartKeyboardNavigation = void 0;
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
13
12
|
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
14
13
|
var _useChartSeries = require("../../corePlugins/useChartSeries/useChartSeries.selectors");
|
|
15
14
|
var _useChartSeriesConfig = require("../../corePlugins/useChartSeriesConfig");
|
|
@@ -21,35 +20,42 @@ const useChartKeyboardNavigation = ({
|
|
|
21
20
|
const {
|
|
22
21
|
chartsLayerContainerRef
|
|
23
22
|
} = instance;
|
|
24
|
-
const removeFocus = (0, _useEventCallback.default)(function removeFocus() {
|
|
25
|
-
if (store.state.keyboardNavigation.isFocused) {
|
|
26
|
-
store.set('keyboardNavigation', (0, _extends2.default)({}, store.state.keyboardNavigation, {
|
|
27
|
-
isFocused: false
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const restoreFocus = (0, _useEventCallback.default)(function restoreFocus() {
|
|
32
|
-
if (!store.state.keyboardNavigation.isFocused) {
|
|
33
|
-
store.update((0, _extends2.default)({}, store.state.highlight && {
|
|
34
|
-
highlight: (0, _extends2.default)({}, store.state.highlight, {
|
|
35
|
-
lastUpdate: 'keyboard'
|
|
36
|
-
})
|
|
37
|
-
}, store.state.interaction && {
|
|
38
|
-
interaction: (0, _extends2.default)({}, store.state.interaction, {
|
|
39
|
-
lastUpdate: 'keyboard'
|
|
40
|
-
})
|
|
41
|
-
}, {
|
|
42
|
-
keyboardNavigation: (0, _extends2.default)({}, store.state.keyboardNavigation, {
|
|
43
|
-
isFocused: true
|
|
44
|
-
})
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
23
|
React.useEffect(() => {
|
|
49
24
|
const element = chartsLayerContainerRef.current;
|
|
50
25
|
if (!element || params.disableKeyboardNavigation) {
|
|
51
26
|
return undefined;
|
|
52
27
|
}
|
|
28
|
+
function removeFocus(event) {
|
|
29
|
+
const root = event.currentTarget;
|
|
30
|
+
const next = event.relatedTarget;
|
|
31
|
+
|
|
32
|
+
// Avoid removing focus if we know it is moving to another children in the chart.
|
|
33
|
+
// This avoid extra computation ot remove/add focus at each keyboard pressed when navigating in the chart.
|
|
34
|
+
if (root && next instanceof Node && !root.contains(next)) {
|
|
35
|
+
if (store.state.keyboardNavigation.isFocused) {
|
|
36
|
+
store.set('keyboardNavigation', (0, _extends2.default)({}, store.state.keyboardNavigation, {
|
|
37
|
+
isFocused: false
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function restoreFocus() {
|
|
43
|
+
if (!store.state.keyboardNavigation.isFocused) {
|
|
44
|
+
store.update((0, _extends2.default)({}, store.state.highlight && {
|
|
45
|
+
highlight: (0, _extends2.default)({}, store.state.highlight, {
|
|
46
|
+
lastUpdate: 'keyboard'
|
|
47
|
+
})
|
|
48
|
+
}, store.state.interaction && {
|
|
49
|
+
interaction: (0, _extends2.default)({}, store.state.interaction, {
|
|
50
|
+
lastUpdate: 'keyboard'
|
|
51
|
+
})
|
|
52
|
+
}, {
|
|
53
|
+
keyboardNavigation: (0, _extends2.default)({}, store.state.keyboardNavigation, {
|
|
54
|
+
isFocused: true
|
|
55
|
+
})
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
53
59
|
function keyboardHandler(event) {
|
|
54
60
|
let newFocusedItem = store.state.keyboardNavigation.item;
|
|
55
61
|
const seriesConfig = (0, _useChartSeriesConfig.selectorChartSeriesConfig)(store.state);
|
|
@@ -83,14 +89,14 @@ const useChartKeyboardNavigation = ({
|
|
|
83
89
|
}
|
|
84
90
|
}
|
|
85
91
|
element.addEventListener('keydown', keyboardHandler);
|
|
86
|
-
element.addEventListener('
|
|
87
|
-
element.addEventListener('
|
|
92
|
+
element.addEventListener('focusout', removeFocus);
|
|
93
|
+
element.addEventListener('focusin', restoreFocus);
|
|
88
94
|
return () => {
|
|
89
95
|
element.removeEventListener('keydown', keyboardHandler);
|
|
90
|
-
element.removeEventListener('
|
|
91
|
-
element.removeEventListener('
|
|
96
|
+
element.removeEventListener('focusout', removeFocus);
|
|
97
|
+
element.removeEventListener('focusin', restoreFocus);
|
|
92
98
|
};
|
|
93
|
-
}, [chartsLayerContainerRef,
|
|
99
|
+
}, [chartsLayerContainerRef, params.disableKeyboardNavigation, store]);
|
|
94
100
|
(0, _useEnhancedEffect.default)(() => {
|
|
95
101
|
store.set('keyboardNavigation', (0, _extends2.default)({}, store.state.keyboardNavigation, {
|
|
96
102
|
enabled: !params.disableKeyboardNavigation
|
package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.mjs
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import useEventCallback from '@mui/utils/useEventCallback';
|
|
6
5
|
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
7
6
|
import { selectorChartDefaultizedSeries } from "../../corePlugins/useChartSeries/useChartSeries.selectors.mjs";
|
|
8
7
|
import { selectorChartSeriesConfig } from "../../corePlugins/useChartSeriesConfig/index.mjs";
|
|
@@ -14,35 +13,42 @@ export const useChartKeyboardNavigation = ({
|
|
|
14
13
|
const {
|
|
15
14
|
chartsLayerContainerRef
|
|
16
15
|
} = instance;
|
|
17
|
-
const removeFocus = useEventCallback(function removeFocus() {
|
|
18
|
-
if (store.state.keyboardNavigation.isFocused) {
|
|
19
|
-
store.set('keyboardNavigation', _extends({}, store.state.keyboardNavigation, {
|
|
20
|
-
isFocused: false
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
const restoreFocus = useEventCallback(function restoreFocus() {
|
|
25
|
-
if (!store.state.keyboardNavigation.isFocused) {
|
|
26
|
-
store.update(_extends({}, store.state.highlight && {
|
|
27
|
-
highlight: _extends({}, store.state.highlight, {
|
|
28
|
-
lastUpdate: 'keyboard'
|
|
29
|
-
})
|
|
30
|
-
}, store.state.interaction && {
|
|
31
|
-
interaction: _extends({}, store.state.interaction, {
|
|
32
|
-
lastUpdate: 'keyboard'
|
|
33
|
-
})
|
|
34
|
-
}, {
|
|
35
|
-
keyboardNavigation: _extends({}, store.state.keyboardNavigation, {
|
|
36
|
-
isFocused: true
|
|
37
|
-
})
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
16
|
React.useEffect(() => {
|
|
42
17
|
const element = chartsLayerContainerRef.current;
|
|
43
18
|
if (!element || params.disableKeyboardNavigation) {
|
|
44
19
|
return undefined;
|
|
45
20
|
}
|
|
21
|
+
function removeFocus(event) {
|
|
22
|
+
const root = event.currentTarget;
|
|
23
|
+
const next = event.relatedTarget;
|
|
24
|
+
|
|
25
|
+
// Avoid removing focus if we know it is moving to another children in the chart.
|
|
26
|
+
// This avoid extra computation ot remove/add focus at each keyboard pressed when navigating in the chart.
|
|
27
|
+
if (root && next instanceof Node && !root.contains(next)) {
|
|
28
|
+
if (store.state.keyboardNavigation.isFocused) {
|
|
29
|
+
store.set('keyboardNavigation', _extends({}, store.state.keyboardNavigation, {
|
|
30
|
+
isFocused: false
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function restoreFocus() {
|
|
36
|
+
if (!store.state.keyboardNavigation.isFocused) {
|
|
37
|
+
store.update(_extends({}, store.state.highlight && {
|
|
38
|
+
highlight: _extends({}, store.state.highlight, {
|
|
39
|
+
lastUpdate: 'keyboard'
|
|
40
|
+
})
|
|
41
|
+
}, store.state.interaction && {
|
|
42
|
+
interaction: _extends({}, store.state.interaction, {
|
|
43
|
+
lastUpdate: 'keyboard'
|
|
44
|
+
})
|
|
45
|
+
}, {
|
|
46
|
+
keyboardNavigation: _extends({}, store.state.keyboardNavigation, {
|
|
47
|
+
isFocused: true
|
|
48
|
+
})
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
46
52
|
function keyboardHandler(event) {
|
|
47
53
|
let newFocusedItem = store.state.keyboardNavigation.item;
|
|
48
54
|
const seriesConfig = selectorChartSeriesConfig(store.state);
|
|
@@ -76,14 +82,14 @@ export const useChartKeyboardNavigation = ({
|
|
|
76
82
|
}
|
|
77
83
|
}
|
|
78
84
|
element.addEventListener('keydown', keyboardHandler);
|
|
79
|
-
element.addEventListener('
|
|
80
|
-
element.addEventListener('
|
|
85
|
+
element.addEventListener('focusout', removeFocus);
|
|
86
|
+
element.addEventListener('focusin', restoreFocus);
|
|
81
87
|
return () => {
|
|
82
88
|
element.removeEventListener('keydown', keyboardHandler);
|
|
83
|
-
element.removeEventListener('
|
|
84
|
-
element.removeEventListener('
|
|
89
|
+
element.removeEventListener('focusout', removeFocus);
|
|
90
|
+
element.removeEventListener('focusin', restoreFocus);
|
|
85
91
|
};
|
|
86
|
-
}, [chartsLayerContainerRef,
|
|
92
|
+
}, [chartsLayerContainerRef, params.disableKeyboardNavigation, store]);
|
|
87
93
|
useEnhancedEffect(() => {
|
|
88
94
|
store.set('keyboardNavigation', _extends({}, store.state.keyboardNavigation, {
|
|
89
95
|
enabled: !params.disableKeyboardNavigation
|
|
@@ -9,6 +9,14 @@ export declare const selectorChartsHasFocusedItem: (args_0: import("../../corePl
|
|
|
9
9
|
export declare const selectorChartsFocusedItem: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("./useChartKeyboardNavigation.types.mjs").UseChartKeyboardNavigationState> & {
|
|
10
10
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
11
11
|
}) => FocusedItemIdentifier<keyof import("../../../index.mjs").ChartsSeriesConfig> | null;
|
|
12
|
+
/**
|
|
13
|
+
* The item that is either
|
|
14
|
+
* - currently focused
|
|
15
|
+
* - will be focused when user focuses the chart
|
|
16
|
+
*/
|
|
17
|
+
export declare const selectorChartsFocusedOrToFocusedItem: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("./useChartKeyboardNavigation.types.mjs").UseChartKeyboardNavigationState> & {
|
|
18
|
+
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
19
|
+
}) => FocusedItemIdentifier<keyof import("../../../index.mjs").ChartsSeriesConfig> | null;
|
|
12
20
|
export declare const selectorChartsIsKeyboardNavigationEnabled: (args_0: import("../../corePlugins/useChartId/useChartId.types.mjs").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.mjs").UseChartSeriesConfigState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.mjs").UseChartExperimentalFeaturesState & import("../../corePlugins/useChartDimensions/useChartDimensions.types.mjs").UseChartDimensionsState & import("../../corePlugins/useChartSeries/useChartSeries.types.mjs").UseChartSeriesState<keyof import("../../../index.mjs").ChartsSeriesConfig> & import("../../corePlugins/useChartAnimation/useChartAnimation.types.mjs").UseChartAnimationState & import("../../../index.mjs").UseChartInteractionListenerState & Partial<import("./useChartKeyboardNavigation.types.mjs").UseChartKeyboardNavigationState> & {
|
|
13
21
|
cacheKey: import("../../models/index.mjs").ChartStateCacheKey;
|
|
14
22
|
}) => boolean;
|
|
@@ -9,6 +9,14 @@ export declare const selectorChartsHasFocusedItem: (args_0: import("../../corePl
|
|
|
9
9
|
export declare const selectorChartsFocusedItem: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & 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> & {
|
|
10
10
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
11
11
|
}) => FocusedItemIdentifier<keyof import("../../../index.js").ChartsSeriesConfig> | null;
|
|
12
|
+
/**
|
|
13
|
+
* The item that is either
|
|
14
|
+
* - currently focused
|
|
15
|
+
* - will be focused when user focuses the chart
|
|
16
|
+
*/
|
|
17
|
+
export declare const selectorChartsFocusedOrToFocusedItem: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & 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> & {
|
|
18
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
19
|
+
}) => FocusedItemIdentifier<keyof import("../../../index.js").ChartsSeriesConfig> | null;
|
|
12
20
|
export declare const selectorChartsIsKeyboardNavigationEnabled: (args_0: import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & import("../../corePlugins/useChartSeriesConfig/useChartSeriesConfig.types.js").UseChartSeriesConfigState<keyof import("../../../index.js").ChartsSeriesConfig> & 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> & {
|
|
13
21
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
14
22
|
}) => boolean;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.selectorChartsKeyboardYAxisIndex = exports.selectorChartsKeyboardXAxisIndex = exports.selectorChartsKeyboardItem = exports.selectorChartsItemIsFocused = exports.selectorChartsIsKeyboardNavigationEnabled = exports.selectorChartsHasFocusedItem = exports.selectorChartsFocusedItem = void 0;
|
|
6
|
+
exports.selectorChartsKeyboardYAxisIndex = exports.selectorChartsKeyboardXAxisIndex = exports.selectorChartsKeyboardItem = exports.selectorChartsItemIsFocused = exports.selectorChartsIsKeyboardNavigationEnabled = exports.selectorChartsHasFocusedItem = exports.selectorChartsFocusedOrToFocusedItem = exports.selectorChartsFocusedItem = void 0;
|
|
7
7
|
var _store = require("@mui/x-internals/store");
|
|
8
8
|
var _fastObjectShallowCompare = require("@mui/x-internals/fastObjectShallowCompare");
|
|
9
9
|
var _useChartSeries = require("../../corePlugins/useChartSeries");
|
|
@@ -12,6 +12,13 @@ const selectKeyboardNavigation = state => state.keyboardNavigation;
|
|
|
12
12
|
const selectorChartsItemIsFocused = exports.selectorChartsItemIsFocused = (0, _store.createSelector)(selectKeyboardNavigation, (keyboardNavigationState, item) => keyboardNavigationState?.isFocused === true && keyboardNavigationState?.item != null && (0, _fastObjectShallowCompare.fastObjectShallowCompare)(keyboardNavigationState.item, item));
|
|
13
13
|
const selectorChartsHasFocusedItem = exports.selectorChartsHasFocusedItem = (0, _store.createSelector)(selectKeyboardNavigation, keyboardNavigationState => keyboardNavigationState?.isFocused === true && keyboardNavigationState?.item != null);
|
|
14
14
|
const selectorChartsFocusedItem = exports.selectorChartsFocusedItem = (0, _store.createSelector)(selectKeyboardNavigation, keyboardNavigationState => keyboardNavigationState?.isFocused === true ? keyboardNavigationState?.item ?? null : null);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The item that is either
|
|
18
|
+
* - currently focused
|
|
19
|
+
* - will be focused when user focuses the chart
|
|
20
|
+
*/
|
|
21
|
+
const selectorChartsFocusedOrToFocusedItem = exports.selectorChartsFocusedOrToFocusedItem = (0, _store.createSelector)(selectKeyboardNavigation, keyboardNavigationState => keyboardNavigationState?.item ?? null);
|
|
15
22
|
const selectorChartsIsKeyboardNavigationEnabled = exports.selectorChartsIsKeyboardNavigationEnabled = (0, _store.createSelector)(selectKeyboardNavigation, keyboardNavigationState => !!keyboardNavigationState?.enabled);
|
|
16
23
|
|
|
17
24
|
/**
|
|
@@ -37,7 +44,7 @@ const createSelectAxisHighlight = direction => (item, axis, series) => {
|
|
|
37
44
|
};
|
|
38
45
|
const selectorChartsKeyboardXAxisIndex = exports.selectorChartsKeyboardXAxisIndex = (0, _store.createSelector)(selectorChartsFocusedItem, _useChartCartesianAxisRendering.selectorChartXAxis, _useChartSeries.selectorChartSeriesProcessed, createSelectAxisHighlight('x'));
|
|
39
46
|
const selectorChartsKeyboardYAxisIndex = exports.selectorChartsKeyboardYAxisIndex = (0, _store.createSelector)(selectorChartsFocusedItem, _useChartCartesianAxisRendering.selectorChartYAxis, _useChartSeries.selectorChartSeriesProcessed, createSelectAxisHighlight('y'));
|
|
40
|
-
const selectorChartsKeyboardItem = exports.selectorChartsKeyboardItem = (0, _store.
|
|
47
|
+
const selectorChartsKeyboardItem = exports.selectorChartsKeyboardItem = (0, _store.createSelectorMemoized)(selectKeyboardNavigation, function selectorChartsKeyboardItem(keyboardState) {
|
|
41
48
|
if (keyboardState?.isFocused !== true || keyboardState?.item == null) {
|
|
42
49
|
return null;
|
|
43
50
|
}
|