@mui/x-charts 8.11.3 → 8.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BarChart/BarChart.d.ts +2 -2
- package/BarChart/BarChart.js +1 -0
- package/BarChart/BarChart.plugins.d.ts +3 -2
- package/BarChart/BarChart.plugins.js +2 -1
- package/BarChart/BarElement.js +10 -2
- package/BarChart/index.d.ts +1 -0
- package/BarChart/index.js +12 -0
- package/BarChart/useBarChartProps.d.ts +2 -2
- package/CHANGELOG.md +296 -6
- package/ChartContainer/ChartContainer.js +4 -2
- package/ChartContainer/useChartContainerProps.js +4 -2
- package/ChartsLegend/ContinuousColorLegend.js +1 -0
- package/ChartsLegend/PiecewiseColorLegend.js +1 -0
- package/ChartsSurface/ChartsSurface.js +23 -3
- package/ChartsWrapper/ChartsWrapper.d.ts +2 -1
- package/ChartsWrapper/ChartsWrapper.js +49 -46
- package/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
- package/ChartsYAxis/useAxisTicksProps.d.ts +3 -3
- package/LineChart/FocusedMark.d.ts +2 -0
- package/LineChart/FocusedMark.js +44 -0
- package/LineChart/LineChart.d.ts +2 -2
- package/LineChart/LineChart.js +3 -1
- package/LineChart/LineChart.plugins.d.ts +3 -2
- package/LineChart/LineChart.plugins.js +2 -1
- package/LineChart/index.d.ts +1 -0
- package/LineChart/index.js +12 -0
- package/LineChart/useLineChartProps.d.ts +2 -2
- package/PieChart/PieArc.d.ts +4 -0
- package/PieChart/PieArc.js +16 -11
- package/PieChart/PieArcPlot.js +28 -3
- package/PieChart/PieChart.js +1 -0
- package/PieChart/PieChart.plugins.d.ts +2 -1
- package/PieChart/PieChart.plugins.js +2 -1
- package/PieChart/dataTransform/useTransformData.d.ts +1 -0
- package/PieChart/dataTransform/useTransformData.js +9 -1
- package/PieChart/index.d.ts +1 -0
- package/PieChart/index.js +12 -0
- package/RadarChart/RadarChart.plugins.d.ts +1 -1
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -3
- package/RadarChart/index.d.ts +2 -1
- package/RadarChart/index.js +12 -0
- package/RadarChart/useRadarChartProps.d.ts +2 -2
- package/ScatterChart/BatchScatter.d.ts +32 -0
- package/ScatterChart/BatchScatter.js +171 -0
- package/ScatterChart/Scatter.js +13 -5
- package/ScatterChart/ScatterChart.d.ts +4 -4
- package/ScatterChart/ScatterChart.js +13 -2
- package/ScatterChart/ScatterChart.plugins.d.ts +4 -3
- package/ScatterChart/ScatterChart.plugins.js +3 -2
- package/ScatterChart/ScatterPlot.d.ts +10 -0
- package/ScatterChart/ScatterPlot.js +14 -2
- package/ScatterChart/index.d.ts +1 -0
- package/ScatterChart/index.js +12 -0
- package/ScatterChart/useScatterChartProps.d.ts +2 -2
- package/ScatterChart/useScatterChartProps.js +8 -5
- package/SparkLineChart/SparkLineChart.js +10 -5
- package/Toolbar/Toolbar.js +1 -2
- package/colorPalettes/types.d.ts +1 -1
- package/context/ChartApi.d.ts +6 -6
- package/esm/BarChart/BarChart.d.ts +2 -2
- package/esm/BarChart/BarChart.js +1 -0
- package/esm/BarChart/BarChart.plugins.d.ts +3 -2
- package/esm/BarChart/BarChart.plugins.js +2 -1
- package/esm/BarChart/BarElement.js +10 -2
- package/esm/BarChart/index.d.ts +1 -0
- package/esm/BarChart/index.js +1 -0
- package/esm/BarChart/useBarChartProps.d.ts +2 -2
- package/esm/ChartContainer/ChartContainer.js +4 -2
- package/esm/ChartContainer/useChartContainerProps.js +4 -2
- package/esm/ChartsLegend/ContinuousColorLegend.js +1 -0
- package/esm/ChartsLegend/PiecewiseColorLegend.js +1 -0
- package/esm/ChartsSurface/ChartsSurface.js +23 -3
- package/esm/ChartsWrapper/ChartsWrapper.d.ts +2 -1
- package/esm/ChartsWrapper/ChartsWrapper.js +49 -46
- package/esm/ChartsXAxis/useAxisTicksProps.d.ts +3 -3
- package/esm/ChartsYAxis/useAxisTicksProps.d.ts +3 -3
- package/esm/LineChart/FocusedMark.d.ts +2 -0
- package/esm/LineChart/FocusedMark.js +38 -0
- package/esm/LineChart/LineChart.d.ts +2 -2
- package/esm/LineChart/LineChart.js +3 -1
- package/esm/LineChart/LineChart.plugins.d.ts +3 -2
- package/esm/LineChart/LineChart.plugins.js +2 -1
- package/esm/LineChart/index.d.ts +1 -0
- package/esm/LineChart/index.js +1 -0
- package/esm/LineChart/useLineChartProps.d.ts +2 -2
- package/esm/PieChart/PieArc.d.ts +4 -0
- package/esm/PieChart/PieArc.js +17 -12
- package/esm/PieChart/PieArcPlot.js +30 -5
- package/esm/PieChart/PieChart.js +1 -0
- package/esm/PieChart/PieChart.plugins.d.ts +2 -1
- package/esm/PieChart/PieChart.plugins.js +2 -1
- package/esm/PieChart/dataTransform/useTransformData.d.ts +1 -0
- package/esm/PieChart/dataTransform/useTransformData.js +9 -1
- package/esm/PieChart/index.d.ts +1 -0
- package/esm/PieChart/index.js +1 -0
- package/esm/RadarChart/RadarChart.plugins.d.ts +1 -1
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +3 -3
- package/esm/RadarChart/index.d.ts +2 -1
- package/esm/RadarChart/index.js +2 -1
- package/esm/RadarChart/useRadarChartProps.d.ts +2 -2
- package/esm/ScatterChart/BatchScatter.d.ts +32 -0
- package/esm/ScatterChart/BatchScatter.js +165 -0
- package/esm/ScatterChart/Scatter.js +13 -5
- package/esm/ScatterChart/ScatterChart.d.ts +4 -4
- package/esm/ScatterChart/ScatterChart.js +13 -2
- package/esm/ScatterChart/ScatterChart.plugins.d.ts +4 -3
- package/esm/ScatterChart/ScatterChart.plugins.js +3 -2
- package/esm/ScatterChart/ScatterPlot.d.ts +10 -0
- package/esm/ScatterChart/ScatterPlot.js +14 -2
- package/esm/ScatterChart/index.d.ts +1 -0
- package/esm/ScatterChart/index.js +1 -0
- package/esm/ScatterChart/useScatterChartProps.d.ts +2 -2
- package/esm/ScatterChart/useScatterChartProps.js +8 -5
- package/esm/SparkLineChart/SparkLineChart.js +10 -5
- package/esm/Toolbar/Toolbar.js +1 -2
- package/esm/colorPalettes/types.d.ts +1 -1
- package/esm/context/ChartApi.d.ts +6 -6
- package/esm/hooks/useAxis.d.ts +5 -5
- package/esm/hooks/useDrawingArea.d.ts +20 -2
- package/esm/hooks/useFocusedItem.d.ts +15 -0
- package/esm/hooks/useFocusedItem.js +20 -0
- package/esm/hooks/useIsItemFocused.d.ts +12 -0
- package/esm/hooks/useIsItemFocused.js +15 -0
- package/esm/hooks/useIsItemFocusedGetter.d.ts +8 -0
- package/esm/hooks/useIsItemFocusedGetter.js +14 -0
- package/esm/hooks/useScale.js +6 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/internals/animation/Transition.js +1 -3
- package/esm/internals/index.d.ts +3 -2
- package/esm/internals/index.js +3 -2
- package/esm/internals/plugins/allPlugins.d.ts +5 -4
- package/esm/internals/plugins/allPlugins.js +3 -2
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +60 -32
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +19 -5
- package/esm/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +66 -72
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -19
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +10 -18
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/{getAxisExtremum.d.ts → getAxisExtrema.d.ts} +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +24 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +66 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +121 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +8 -6
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +49 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +20 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +41 -21
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +2 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +30 -7
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/index.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/index.js +2 -0
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.js → useChartClosestPoint/useChartClosestPoint.js} +9 -7
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +5 -0
- package/esm/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +3 -0
- package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.d.ts → useChartClosestPoint/useChartClosestPoint.types.d.ts} +8 -4
- package/esm/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.ts +16 -0
- package/esm/internals/plugins/featurePlugins/useChartHighlight/highlightStates.js +32 -0
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -0
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +5 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.js +3 -0
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +6 -4
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -1
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +2 -1
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +6 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +2 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +20 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +88 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +170 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +37 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +33 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +36 -0
- package/esm/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +1 -0
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +2 -5
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +10 -8
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +2 -1
- package/esm/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +1 -1
- package/esm/internals/scaleGuards.d.ts +7 -0
- package/esm/internals/scaleGuards.js +6 -0
- package/esm/internals/ticks.d.ts +3 -5
- package/esm/internals/ticks.js +6 -5
- package/esm/locales/elGR.d.ts +96 -0
- package/esm/locales/elGR.js +100 -0
- package/esm/locales/enUS.d.ts +96 -0
- package/esm/locales/enUS.js +99 -1
- package/esm/locales/frFR.d.ts +96 -0
- package/esm/locales/frFR.js +100 -2
- package/esm/locales/ptBR.d.ts +96 -0
- package/esm/locales/ptBR.js +100 -0
- package/esm/locales/ptPT.d.ts +96 -0
- package/esm/locales/ptPT.js +100 -0
- package/esm/locales/svSE.d.ts +97 -1
- package/esm/locales/svSE.js +100 -0
- package/esm/locales/utils/chartsLocaleTextApi.d.ts +384 -0
- package/esm/locales/utils/getChartsLocalization.d.ts +96 -0
- package/esm/plugins/index.d.ts +6 -0
- package/esm/plugins/index.js +12 -0
- package/hooks/useAxis.d.ts +5 -5
- package/hooks/useDrawingArea.d.ts +20 -2
- package/hooks/useFocusedItem.d.ts +15 -0
- package/hooks/useFocusedItem.js +26 -0
- package/hooks/useIsItemFocused.d.ts +12 -0
- package/hooks/useIsItemFocused.js +20 -0
- package/hooks/useIsItemFocusedGetter.d.ts +8 -0
- package/hooks/useIsItemFocusedGetter.js +18 -0
- package/hooks/useScale.js +6 -0
- package/index.d.ts +1 -0
- package/index.js +13 -1
- package/internals/animation/Transition.js +0 -2
- package/internals/index.d.ts +3 -2
- package/internals/index.js +20 -8
- package/internals/plugins/allPlugins.d.ts +5 -4
- package/internals/plugins/allPlugins.js +3 -2
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +59 -31
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +19 -5
- package/internals/plugins/corePlugins/useChartSeries/processSeries.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +63 -69
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -19
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +10 -18
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/{getAxisExtremum.d.ts → getAxisExtrema.d.ts} +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtrema.js +30 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.d.ts +66 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisScale.js +131 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +8 -6
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +49 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +20 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +42 -22
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +30 -7
- package/internals/plugins/featurePlugins/useChartClosestPoint/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartClosestPoint/index.js +27 -0
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.d.ts +3 -0
- package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.js → useChartClosestPoint/useChartClosestPoint.js} +11 -9
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts +5 -0
- package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js +9 -0
- package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.d.ts → useChartClosestPoint/useChartClosestPoint.types.d.ts} +8 -4
- package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.d.ts +16 -0
- package/internals/plugins/featurePlugins/useChartHighlight/highlightStates.js +41 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +4 -0
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +6 -1
- package/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartInteraction/checkHasInteractionPlugin.js +9 -0
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.js +6 -4
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -1
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +3 -2
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.types.d.ts +6 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/index.js +27 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.d.ts +20 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.helpers.js +96 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.js +178 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.d.ts +37 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.selectors.js +39 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.d.ts +36 -0
- package/internals/plugins/featurePlugins/useChartKeyboardNavigation/useChartKeyboardNavigation.types.js +5 -0
- package/internals/plugins/featurePlugins/useChartPolarAxis/computeAxisValue.js +1 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +10 -8
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.types.d.ts +2 -1
- package/internals/plugins/models/seriesConfig/getSeriesWithDefaultValues.types.d.ts +1 -1
- package/internals/scaleGuards.d.ts +7 -0
- package/internals/scaleGuards.js +8 -0
- package/internals/ticks.d.ts +3 -5
- package/internals/ticks.js +7 -5
- package/locales/elGR.d.ts +96 -0
- package/locales/elGR.js +100 -0
- package/locales/enUS.d.ts +96 -0
- package/locales/enUS.js +99 -1
- package/locales/frFR.d.ts +96 -0
- package/locales/frFR.js +100 -2
- package/locales/ptBR.d.ts +96 -0
- package/locales/ptBR.js +100 -0
- package/locales/ptPT.d.ts +96 -0
- package/locales/ptPT.js +100 -0
- package/locales/svSE.d.ts +97 -1
- package/locales/svSE.js +100 -0
- package/locales/utils/chartsLocaleTextApi.d.ts +384 -0
- package/locales/utils/getChartsLocalization.d.ts +96 -0
- package/package.json +5 -5
- package/plugins/index.d.ts +6 -0
- package/plugins/index.js +47 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +0 -22
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/index.d.ts +0 -3
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/index.js +0 -2
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.d.ts +0 -3
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +0 -5
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +0 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.js +0 -29
- package/internals/plugins/featurePlugins/useChartVoronoi/index.d.ts +0 -3
- package/internals/plugins/featurePlugins/useChartVoronoi/index.js +0 -27
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.d.ts +0 -3
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +0 -5
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +0 -9
- /package/esm/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.js → useChartClosestPoint/useChartClosestPoint.types.js} +0 -0
- /package/internals/plugins/featurePlugins/{useChartVoronoi/useChartVoronoi.types.js → useChartClosestPoint/useChartClosestPoint.types.js} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.selectorChartPreviewComputedYAxis = exports.selectorChartPreviewComputedXAxis = void 0;
|
|
6
|
+
exports.selectorChartPreviewYScales = exports.selectorChartPreviewXScales = exports.selectorChartPreviewComputedYAxis = exports.selectorChartPreviewComputedXAxis = void 0;
|
|
7
7
|
var _selectors = require("../../utils/selectors");
|
|
8
8
|
var _useChartCartesianAxisLayout = require("./useChartCartesianAxisLayout.selectors");
|
|
9
9
|
var _useChartSeries = require("../../corePlugins/useChartSeries");
|
|
@@ -11,6 +11,8 @@ var _computeAxisValue = require("./computeAxisValue");
|
|
|
11
11
|
var _useChartCartesianAxisRendering = require("./useChartCartesianAxisRendering.selectors");
|
|
12
12
|
var _useChartDimensions = require("../../corePlugins/useChartDimensions");
|
|
13
13
|
var _constants = require("../../../constants");
|
|
14
|
+
var _useChartExperimentalFeature = require("../../corePlugins/useChartExperimentalFeature");
|
|
15
|
+
var _getAxisScale = require("./getAxisScale");
|
|
14
16
|
function createPreviewDrawingArea(axisDirection, mainChartDrawingArea) {
|
|
15
17
|
return axisDirection === 'x' ? {
|
|
16
18
|
left: 0,
|
|
@@ -28,7 +30,26 @@ function createPreviewDrawingArea(axisDirection, mainChartDrawingArea) {
|
|
|
28
30
|
bottom: mainChartDrawingArea.height
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
|
-
const
|
|
33
|
+
const selectorChartPreviewXScales = exports.selectorChartPreviewXScales = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, _useChartCartesianAxisRendering.selectorChartZoomOptionsLookup, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, _useChartCartesianAxisRendering.selectorDefaultXAxisTickNumber, (_, axisId) => axisId], function selectorChartPreviewXScales(xAxes, chartDrawingArea, formattedSeries, seriesConfig, zoomOptions, preferStrictDomainInLineCharts, defaultTickNumber, axisId) {
|
|
34
|
+
const hasAxis = xAxes?.some(axis => axis.id === axisId);
|
|
35
|
+
const drawingArea = createPreviewDrawingArea(hasAxis ? 'x' : 'y', chartDrawingArea);
|
|
36
|
+
const options = zoomOptions[axisId];
|
|
37
|
+
const zoomMap = new Map([[axisId, {
|
|
38
|
+
axisId,
|
|
39
|
+
start: options.minStart,
|
|
40
|
+
end: options.maxEnd
|
|
41
|
+
}]]);
|
|
42
|
+
return (0, _getAxisScale.getXAxesScales)({
|
|
43
|
+
drawingArea,
|
|
44
|
+
formattedSeries,
|
|
45
|
+
axis: xAxes,
|
|
46
|
+
seriesConfig,
|
|
47
|
+
zoomMap,
|
|
48
|
+
preferStrictDomainInLineCharts,
|
|
49
|
+
defaultTickNumber
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
const selectorChartPreviewComputedXAxis = exports.selectorChartPreviewComputedXAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, _useChartCartesianAxisRendering.selectorChartZoomOptionsLookup, _useChartCartesianAxisRendering.selectorChartZoomAxisFilters, _useChartDimensions.selectorChartDrawingArea, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, selectorChartPreviewXScales, (_, axisId) => axisId], (xAxes, formattedSeries, seriesConfig, zoomOptions, getFilters, chartDrawingArea, preferStrictDomainInLineCharts, scales, axisId) => {
|
|
32
53
|
const hasAxis = xAxes?.some(axis => axis.id === axisId);
|
|
33
54
|
const drawingArea = createPreviewDrawingArea(hasAxis ? 'x' : 'y', chartDrawingArea);
|
|
34
55
|
const options = zoomOptions[axisId];
|
|
@@ -38,6 +59,7 @@ const selectorChartPreviewComputedXAxis = exports.selectorChartPreviewComputedXA
|
|
|
38
59
|
end: options.maxEnd
|
|
39
60
|
}]]);
|
|
40
61
|
const computedAxes = (0, _computeAxisValue.computeAxisValue)({
|
|
62
|
+
scales,
|
|
41
63
|
drawingArea,
|
|
42
64
|
formattedSeries,
|
|
43
65
|
axis: xAxes,
|
|
@@ -45,7 +67,8 @@ const selectorChartPreviewComputedXAxis = exports.selectorChartPreviewComputedXA
|
|
|
45
67
|
axisDirection: 'x',
|
|
46
68
|
zoomMap,
|
|
47
69
|
zoomOptions,
|
|
48
|
-
getFilters
|
|
70
|
+
getFilters,
|
|
71
|
+
preferStrictDomainInLineCharts
|
|
49
72
|
});
|
|
50
73
|
if (computedAxes.axis[axisId]) {
|
|
51
74
|
return {
|
|
@@ -54,7 +77,26 @@ const selectorChartPreviewComputedXAxis = exports.selectorChartPreviewComputedXA
|
|
|
54
77
|
}
|
|
55
78
|
return computedAxes.axis;
|
|
56
79
|
});
|
|
57
|
-
const
|
|
80
|
+
const selectorChartPreviewYScales = exports.selectorChartPreviewYScales = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawYAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, _useChartCartesianAxisRendering.selectorChartZoomOptionsLookup, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, _useChartCartesianAxisRendering.selectorDefaultYAxisTickNumber, (_, axisId) => axisId], function selectorChartPreviewYScales(yAxes, chartDrawingArea, formattedSeries, seriesConfig, zoomOptions, preferStrictDomainInLineCharts, defaultTickNumber, axisId) {
|
|
81
|
+
const hasAxis = yAxes?.some(axis => axis.id === axisId);
|
|
82
|
+
const drawingArea = createPreviewDrawingArea(hasAxis ? 'y' : 'x', chartDrawingArea);
|
|
83
|
+
const options = zoomOptions[axisId];
|
|
84
|
+
const zoomMap = new Map([[axisId, {
|
|
85
|
+
axisId,
|
|
86
|
+
start: options.minStart,
|
|
87
|
+
end: options.maxEnd
|
|
88
|
+
}]]);
|
|
89
|
+
return (0, _getAxisScale.getYAxesScales)({
|
|
90
|
+
drawingArea,
|
|
91
|
+
formattedSeries,
|
|
92
|
+
axis: yAxes,
|
|
93
|
+
seriesConfig,
|
|
94
|
+
zoomMap,
|
|
95
|
+
preferStrictDomainInLineCharts,
|
|
96
|
+
defaultTickNumber
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
const selectorChartPreviewComputedYAxis = exports.selectorChartPreviewComputedYAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawYAxis, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, _useChartCartesianAxisRendering.selectorChartZoomOptionsLookup, _useChartCartesianAxisRendering.selectorChartZoomAxisFilters, _useChartDimensions.selectorChartDrawingArea, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, selectorChartPreviewYScales, (_, axisId) => axisId], (yAxes, formattedSeries, seriesConfig, zoomOptions, getFilters, chartDrawingArea, preferStrictDomainInLineCharts, scales, axisId) => {
|
|
58
100
|
const hasAxis = yAxes?.some(axis => axis.id === axisId);
|
|
59
101
|
const drawingArea = createPreviewDrawingArea(hasAxis ? 'y' : 'x', chartDrawingArea);
|
|
60
102
|
const options = zoomOptions[axisId];
|
|
@@ -64,6 +106,7 @@ const selectorChartPreviewComputedYAxis = exports.selectorChartPreviewComputedYA
|
|
|
64
106
|
end: options.maxEnd
|
|
65
107
|
}]]);
|
|
66
108
|
const computedAxes = (0, _computeAxisValue.computeAxisValue)({
|
|
109
|
+
scales,
|
|
67
110
|
drawingArea,
|
|
68
111
|
formattedSeries,
|
|
69
112
|
axis: yAxes,
|
|
@@ -71,7 +114,8 @@ const selectorChartPreviewComputedYAxis = exports.selectorChartPreviewComputedYA
|
|
|
71
114
|
axisDirection: 'y',
|
|
72
115
|
zoomMap,
|
|
73
116
|
zoomOptions,
|
|
74
|
-
getFilters
|
|
117
|
+
getFilters,
|
|
118
|
+
preferStrictDomainInLineCharts
|
|
75
119
|
});
|
|
76
120
|
if (computedAxes.axis[axisId]) {
|
|
77
121
|
return {
|
|
@@ -23,6 +23,26 @@ export declare const selectorChartZoomOptionsLookup: import("reselect").Selector
|
|
|
23
23
|
[x: number]: import("./useChartCartesianAxis.types.js").DefaultizedZoomOptions;
|
|
24
24
|
}, []>;
|
|
25
25
|
export declare const selectorChartAxisZoomOptionsLookup: import("reselect").Selector<any, import("./useChartCartesianAxis.types.js").DefaultizedZoomOptions, [axisId: AxisId]>;
|
|
26
|
+
export declare const selectorDefaultXAxisTickNumber: 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<{}> & {
|
|
27
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
28
|
+
} & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
29
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
30
|
+
}, number, []>;
|
|
31
|
+
export declare const selectorDefaultYAxisTickNumber: 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<{}> & {
|
|
32
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
33
|
+
} & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
34
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
35
|
+
}, number, []>;
|
|
36
|
+
export declare const selectorChartXScales: 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("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
37
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
38
|
+
} & Partial<{}> & {
|
|
39
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
40
|
+
}, Record<AxisId, import("./getAxisScale.js").ScaleDefinition>, []>;
|
|
41
|
+
export declare const selectorChartYScales: 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("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
42
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
43
|
+
} & Partial<{}> & {
|
|
44
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
45
|
+
}, Record<AxisId, import("./getAxisScale.js").ScaleDefinition>, []>;
|
|
26
46
|
export declare const selectorChartZoomAxisFilters: 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("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
27
47
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
28
48
|
} & {
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.selectorChartZoomOptionsLookup = exports.selectorChartZoomMap = exports.selectorChartZoomIsInteracting = exports.selectorChartZoomAxisFilters = exports.selectorChartYAxis = exports.selectorChartXAxis = exports.selectorChartRawAxis = exports.selectorChartAxisZoomOptionsLookup = exports.selectorChartAxis = exports.createZoomMap = void 0;
|
|
7
|
+
exports.selectorDefaultYAxisTickNumber = exports.selectorDefaultXAxisTickNumber = exports.selectorChartZoomOptionsLookup = exports.selectorChartZoomMap = exports.selectorChartZoomIsInteracting = exports.selectorChartZoomAxisFilters = exports.selectorChartYScales = exports.selectorChartYAxis = exports.selectorChartXScales = exports.selectorChartXAxis = exports.selectorChartRawAxis = exports.selectorChartAxisZoomOptionsLookup = exports.selectorChartAxis = exports.createZoomMap = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _useChartDimensions = require("../../corePlugins/useChartDimensions");
|
|
10
10
|
var _useChartSeries = require("../../corePlugins/useChartSeries");
|
|
@@ -14,6 +14,8 @@ var _createAxisFilterMapper = require("./createAxisFilterMapper");
|
|
|
14
14
|
var _createZoomLookup = require("./createZoomLookup");
|
|
15
15
|
var _useChartCartesianAxisLayout = require("./useChartCartesianAxisLayout.selectors");
|
|
16
16
|
var _useChartExperimentalFeature = require("../../corePlugins/useChartExperimentalFeature");
|
|
17
|
+
var _getAxisScale = require("./getAxisScale");
|
|
18
|
+
var _ticks = require("../../../ticks");
|
|
17
19
|
const createZoomMap = zoom => {
|
|
18
20
|
const zoomItemMap = new Map();
|
|
19
21
|
zoom.forEach(zoomItem => {
|
|
@@ -32,34 +34,50 @@ const selectorChartZoomIsInteracting = exports.selectorChartZoomIsInteracting =
|
|
|
32
34
|
const selectorChartZoomMap = exports.selectorChartZoomMap = (0, _selectors.createSelector)([selectorChartZoomState], zoom => zoom?.zoomData && createZoomMap(zoom?.zoomData));
|
|
33
35
|
const selectorChartZoomOptionsLookup = exports.selectorChartZoomOptionsLookup = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartCartesianAxisLayout.selectorChartRawYAxis], (xAxis, yAxis) => (0, _extends2.default)({}, (0, _createZoomLookup.createZoomLookup)('x')(xAxis), (0, _createZoomLookup.createZoomLookup)('y')(yAxis)));
|
|
34
36
|
const selectorChartAxisZoomOptionsLookup = exports.selectorChartAxisZoomOptionsLookup = (0, _selectors.createSelector)([selectorChartZoomOptionsLookup, (_, axisId) => axisId], (axisLookup, axisId) => axisLookup[axisId]);
|
|
35
|
-
const selectorChartXFilter = (0, _selectors.createSelector)([selectorChartZoomMap, selectorChartZoomOptionsLookup
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
const selectorChartXFilter = (0, _selectors.createSelector)([selectorChartZoomMap, selectorChartZoomOptionsLookup], (zoomMap, zoomOptions) => zoomMap && zoomOptions && (0, _createAxisFilterMapper.createAxisFilterMapper)(zoomMap, zoomOptions, 'x'));
|
|
38
|
+
const selectorChartYFilter = (0, _selectors.createSelector)([selectorChartZoomMap, selectorChartZoomOptionsLookup], (zoomMap, zoomOptions) => zoomMap && zoomOptions && (0, _createAxisFilterMapper.createAxisFilterMapper)(zoomMap, zoomOptions, 'y'));
|
|
39
|
+
const selectorDefaultXAxisTickNumber = exports.selectorDefaultXAxisTickNumber = (0, _selectors.createSelector)([_useChartDimensions.selectorChartDrawingArea], function selectorDefaultXAxisTickNumber(drawingArea) {
|
|
40
|
+
return (0, _ticks.getDefaultTickNumber)(drawingArea.width);
|
|
41
|
+
});
|
|
42
|
+
const selectorDefaultYAxisTickNumber = exports.selectorDefaultYAxisTickNumber = (0, _selectors.createSelector)([_useChartDimensions.selectorChartDrawingArea], function selectorDefaultYAxisTickNumber(drawingArea) {
|
|
43
|
+
return (0, _ticks.getDefaultTickNumber)(drawingArea.height);
|
|
44
|
+
});
|
|
45
|
+
const selectorChartXScales = exports.selectorChartXScales = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, selectorChartZoomMap, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, selectorDefaultXAxisTickNumber], function selectorChartXScales(axis, drawingArea, formattedSeries, seriesConfig, zoomMap, preferStrictDomainInLineCharts, defaultTickNumber) {
|
|
46
|
+
return (0, _getAxisScale.getXAxesScales)({
|
|
47
|
+
drawingArea,
|
|
48
|
+
formattedSeries,
|
|
49
|
+
axis,
|
|
50
|
+
seriesConfig,
|
|
51
|
+
zoomMap,
|
|
52
|
+
preferStrictDomainInLineCharts,
|
|
53
|
+
defaultTickNumber
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
const selectorChartYScales = exports.selectorChartYScales = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawYAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, selectorChartZoomMap, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, selectorDefaultYAxisTickNumber], function selectorChartYScales(axis, drawingArea, formattedSeries, seriesConfig, zoomMap, preferStrictDomainInLineCharts, defaultTickNumber) {
|
|
57
|
+
return (0, _getAxisScale.getYAxesScales)({
|
|
58
|
+
drawingArea,
|
|
59
|
+
formattedSeries,
|
|
60
|
+
axis,
|
|
61
|
+
seriesConfig,
|
|
62
|
+
zoomMap,
|
|
63
|
+
preferStrictDomainInLineCharts,
|
|
64
|
+
defaultTickNumber
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
const selectorChartZoomAxisFilters = exports.selectorChartZoomAxisFilters = (0, _selectors.createSelector)([selectorChartXFilter, selectorChartYFilter, _useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartCartesianAxisLayout.selectorChartRawYAxis, selectorChartXScales, selectorChartYScales], (xMapper, yMapper, xAxis, yAxis, xScales, yScales) => {
|
|
50
68
|
if (xMapper === undefined || yMapper === undefined) {
|
|
51
69
|
// Early return if there is no zoom.
|
|
52
70
|
return undefined;
|
|
53
71
|
}
|
|
54
|
-
const xFilters = xAxis?.reduce((acc, axis
|
|
55
|
-
const filter = xMapper(axis,
|
|
72
|
+
const xFilters = xAxis?.reduce((acc, axis) => {
|
|
73
|
+
const filter = xMapper(axis.id, axis.data, xScales[axis.id].scale);
|
|
56
74
|
if (filter !== null) {
|
|
57
75
|
acc[axis.id] = filter;
|
|
58
76
|
}
|
|
59
77
|
return acc;
|
|
60
78
|
}, {});
|
|
61
|
-
const yFilters = yAxis?.reduce((acc, axis
|
|
62
|
-
const filter = yMapper(axis,
|
|
79
|
+
const yFilters = yAxis?.reduce((acc, axis) => {
|
|
80
|
+
const filter = yMapper(axis.id, axis.data, yScales[axis.id].scale);
|
|
63
81
|
if (filter !== null) {
|
|
64
82
|
acc[axis.id] = filter;
|
|
65
83
|
}
|
|
@@ -75,7 +93,8 @@ const selectorChartZoomAxisFilters = exports.selectorChartZoomAxisFilters = (0,
|
|
|
75
93
|
* The only interesting selectors that merge axis data and zoom if provided.
|
|
76
94
|
*/
|
|
77
95
|
|
|
78
|
-
const selectorChartXAxis = exports.selectorChartXAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, selectorChartZoomMap, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts], (axis, drawingArea, formattedSeries, seriesConfig, zoomMap, zoomOptions, getFilters, preferStrictDomainInLineCharts) => (0, _computeAxisValue.computeAxisValue)({
|
|
96
|
+
const selectorChartXAxis = exports.selectorChartXAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawXAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, selectorChartZoomMap, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, selectorChartXScales], (axis, drawingArea, formattedSeries, seriesConfig, zoomMap, zoomOptions, getFilters, preferStrictDomainInLineCharts, scales) => (0, _computeAxisValue.computeAxisValue)({
|
|
97
|
+
scales,
|
|
79
98
|
drawingArea,
|
|
80
99
|
formattedSeries,
|
|
81
100
|
axis,
|
|
@@ -86,7 +105,8 @@ const selectorChartXAxis = exports.selectorChartXAxis = (0, _selectors.createSel
|
|
|
86
105
|
getFilters,
|
|
87
106
|
preferStrictDomainInLineCharts
|
|
88
107
|
}));
|
|
89
|
-
const selectorChartYAxis = exports.selectorChartYAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawYAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, selectorChartZoomMap, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts], (axis, drawingArea, formattedSeries, seriesConfig, zoomMap, zoomOptions, getFilters, preferStrictDomainInLineCharts) => (0, _computeAxisValue.computeAxisValue)({
|
|
108
|
+
const selectorChartYAxis = exports.selectorChartYAxis = (0, _selectors.createSelector)([_useChartCartesianAxisLayout.selectorChartRawYAxis, _useChartDimensions.selectorChartDrawingArea, _useChartSeries.selectorChartSeriesProcessed, _useChartSeries.selectorChartSeriesConfig, selectorChartZoomMap, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters, _useChartExperimentalFeature.selectorPreferStrictDomainInLineCharts, selectorChartYScales], (axis, drawingArea, formattedSeries, seriesConfig, zoomMap, zoomOptions, getFilters, preferStrictDomainInLineCharts, scales) => (0, _computeAxisValue.computeAxisValue)({
|
|
109
|
+
scales,
|
|
90
110
|
drawingArea,
|
|
91
111
|
formattedSeries,
|
|
92
112
|
axis,
|
|
@@ -13,7 +13,7 @@ export declare const selectorChartsHighlightXAxisValue: import("reselect").Selec
|
|
|
13
13
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
14
14
|
} & {
|
|
15
15
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
16
|
-
} & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}>, {
|
|
16
|
+
} & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}> & Partial<import("../useChartKeyboardNavigation/useChartKeyboardNavigation.types.js").UseChartKeyboardNavigationState>, {
|
|
17
17
|
value: any;
|
|
18
18
|
axisId: import("../../../index.js").AxisId;
|
|
19
19
|
dataIndex: number;
|
|
@@ -26,7 +26,7 @@ export declare const selectorChartsHighlightYAxisValue: import("reselect").Selec
|
|
|
26
26
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
27
27
|
} & {
|
|
28
28
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
29
|
-
} & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}>, {
|
|
29
|
+
} & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}> & Partial<import("../useChartKeyboardNavigation/useChartKeyboardNavigation.types.js").UseChartKeyboardNavigationState>, {
|
|
30
30
|
value: any;
|
|
31
31
|
axisId: import("../../../index.js").AxisId;
|
|
32
32
|
dataIndex: number;
|
|
@@ -9,6 +9,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
9
|
var _selectors = require("../../utils/selectors");
|
|
10
10
|
var _useChartCartesianAxisRendering = require("./useChartCartesianAxisRendering.selectors");
|
|
11
11
|
var _useChartCartesianInteraction = require("./useChartCartesianInteraction.selectors");
|
|
12
|
+
var _useChartKeyboardNavigation = require("../useChartKeyboardNavigation/useChartKeyboardNavigation.selectors");
|
|
13
|
+
var _useChartInteraction = require("../useChartInteraction/useChartInteraction.selectors");
|
|
12
14
|
const selectorChartControlledCartesianAxisHighlight = state => state.controlledCartesianAxisHighlight;
|
|
13
15
|
const selectAxisHighlight = (computedIndex, axis, axisItems) => {
|
|
14
16
|
if (axisItems !== undefined) {
|
|
@@ -21,22 +23,43 @@ const selectAxisHighlight = (computedIndex, axis, axisItems) => {
|
|
|
21
23
|
};
|
|
22
24
|
const selectorChartsHighlightXAxisIndex = exports.selectorChartsHighlightXAxisIndex = (0, _selectors.createSelector)([_useChartCartesianInteraction.selectorChartsInteractionXAxisIndex, _useChartCartesianAxisRendering.selectorChartXAxis, selectorChartControlledCartesianAxisHighlight], selectAxisHighlight);
|
|
23
25
|
const selectorChartsHighlightYAxisIndex = exports.selectorChartsHighlightYAxisIndex = (0, _selectors.createSelector)([_useChartCartesianInteraction.selectorChartsInteractionYAxisIndex, _useChartCartesianAxisRendering.selectorChartYAxis, selectorChartControlledCartesianAxisHighlight], selectAxisHighlight);
|
|
24
|
-
const selectAxisHighlightWithValue = (computedIndex, computedValue, axis,
|
|
25
|
-
if (
|
|
26
|
-
return
|
|
26
|
+
const selectAxisHighlightWithValue = (computedIndex, computedValue, axis, controlledAxisItems, keyboardAxisItem, lastInteractionUpdate) => {
|
|
27
|
+
if (controlledAxisItems !== undefined) {
|
|
28
|
+
return controlledAxisItems.map(item => (0, _extends2.default)({}, item, {
|
|
27
29
|
value: axis.axis[item.axisId]?.data?.[item.dataIndex]
|
|
28
30
|
})).filter(({
|
|
29
31
|
value
|
|
30
32
|
}) => value !== undefined);
|
|
31
33
|
}
|
|
32
|
-
|
|
34
|
+
const pointerHighlight = computedValue !== null && {
|
|
33
35
|
axisId: axis.axisIds[0],
|
|
34
36
|
dataIndex: computedIndex,
|
|
35
37
|
value: computedValue
|
|
36
|
-
}
|
|
38
|
+
};
|
|
39
|
+
const keyboardValue = keyboardAxisItem && axis.axis[keyboardAxisItem.axisId]?.data?.[keyboardAxisItem.dataIndex];
|
|
40
|
+
const keyboardHighlight = keyboardAxisItem && keyboardValue != null && (0, _extends2.default)({}, keyboardAxisItem, {
|
|
41
|
+
value: keyboardValue
|
|
42
|
+
});
|
|
43
|
+
if (lastInteractionUpdate === 'pointer') {
|
|
44
|
+
if (pointerHighlight) {
|
|
45
|
+
return [pointerHighlight];
|
|
46
|
+
}
|
|
47
|
+
if (keyboardHighlight) {
|
|
48
|
+
return [keyboardHighlight];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (lastInteractionUpdate === 'keyboard') {
|
|
52
|
+
if (keyboardHighlight) {
|
|
53
|
+
return [keyboardHighlight];
|
|
54
|
+
}
|
|
55
|
+
if (pointerHighlight) {
|
|
56
|
+
return [pointerHighlight];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return [];
|
|
37
60
|
};
|
|
38
|
-
const selectorChartsHighlightXAxisValue = exports.selectorChartsHighlightXAxisValue = (0, _selectors.createSelector)([_useChartCartesianInteraction.selectorChartsInteractionXAxisIndex, _useChartCartesianInteraction.selectorChartsInteractionXAxisValue, _useChartCartesianAxisRendering.selectorChartXAxis, selectorChartControlledCartesianAxisHighlight], selectAxisHighlightWithValue);
|
|
39
|
-
const selectorChartsHighlightYAxisValue = exports.selectorChartsHighlightYAxisValue = (0, _selectors.createSelector)([_useChartCartesianInteraction.selectorChartsInteractionYAxisIndex, _useChartCartesianInteraction.selectorChartsInteractionYAxisValue, _useChartCartesianAxisRendering.selectorChartYAxis, selectorChartControlledCartesianAxisHighlight], selectAxisHighlightWithValue);
|
|
61
|
+
const selectorChartsHighlightXAxisValue = exports.selectorChartsHighlightXAxisValue = (0, _selectors.createSelector)([_useChartCartesianInteraction.selectorChartsInteractionXAxisIndex, _useChartCartesianInteraction.selectorChartsInteractionXAxisValue, _useChartCartesianAxisRendering.selectorChartXAxis, selectorChartControlledCartesianAxisHighlight, _useChartKeyboardNavigation.selectorChartsKeyboardXAxisIndex, _useChartInteraction.selectorChartsLastInteraction], selectAxisHighlightWithValue);
|
|
62
|
+
const selectorChartsHighlightYAxisValue = exports.selectorChartsHighlightYAxisValue = (0, _selectors.createSelector)([_useChartCartesianInteraction.selectorChartsInteractionYAxisIndex, _useChartCartesianInteraction.selectorChartsInteractionYAxisValue, _useChartCartesianAxisRendering.selectorChartYAxis, selectorChartControlledCartesianAxisHighlight, _useChartKeyboardNavigation.selectorChartsKeyboardYAxisIndex, _useChartInteraction.selectorChartsLastInteraction], selectAxisHighlightWithValue);
|
|
40
63
|
|
|
41
64
|
/**
|
|
42
65
|
* Get the scale of the axis with highlight if controlled. The default axis otherwise.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
useChartClosestPoint: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "useChartClosestPoint", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _useChartClosestPoint.useChartClosestPoint;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var _useChartClosestPoint = require("./useChartClosestPoint");
|
|
16
|
+
var _useChartClosestPoint2 = require("./useChartClosestPoint.selectors");
|
|
17
|
+
Object.keys(_useChartClosestPoint2).forEach(function (key) {
|
|
18
|
+
if (key === "default" || key === "__esModule") return;
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
20
|
+
if (key in exports && exports[key] === _useChartClosestPoint2[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _useChartClosestPoint2[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -6,7 +6,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
value: true
|
|
8
8
|
});
|
|
9
|
-
exports.
|
|
9
|
+
exports.useChartClosestPoint = void 0;
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _useEnhancedEffect = _interopRequireDefault(require("@mui/utils/useEnhancedEffect"));
|
|
@@ -18,7 +18,7 @@ var _useSelector = require("../../../store/useSelector");
|
|
|
18
18
|
var _useChartCartesianAxis = require("../useChartCartesianAxis");
|
|
19
19
|
var _useChartSeries = require("../../corePlugins/useChartSeries/useChartSeries.selectors");
|
|
20
20
|
var _useChartDimensions = require("../../corePlugins/useChartDimensions");
|
|
21
|
-
const
|
|
21
|
+
const useChartClosestPoint = ({
|
|
22
22
|
svgRef,
|
|
23
23
|
params,
|
|
24
24
|
store,
|
|
@@ -93,7 +93,8 @@ const useChartVoronoi = ({
|
|
|
93
93
|
seriesId,
|
|
94
94
|
seriesIndexes,
|
|
95
95
|
startIndex: points.length,
|
|
96
|
-
endIndex: points.length + seriesPoints.length
|
|
96
|
+
endIndex: points.length + seriesPoints.length,
|
|
97
|
+
markerSize: series[seriesId].markerSize
|
|
97
98
|
};
|
|
98
99
|
points = points.concat(seriesPoints);
|
|
99
100
|
});
|
|
@@ -130,11 +131,12 @@ const useChartVoronoi = ({
|
|
|
130
131
|
// The point index in the series with id=closestSeries.seriesId.
|
|
131
132
|
const seriesPointIndex = (2 * closestPointIndex - voronoiRef.current[closestSeries.seriesId].startIndex) / 2;
|
|
132
133
|
const dataIndex = voronoiRef.current[closestSeries.seriesId].seriesIndexes[seriesPointIndex];
|
|
133
|
-
|
|
134
|
+
const maxRadius = voronoiMaxRadius === 'item' ? closestSeries.markerSize : voronoiMaxRadius;
|
|
135
|
+
if (maxRadius !== undefined) {
|
|
134
136
|
const pointX = delauneyRef.current.points[2 * closestPointIndex];
|
|
135
137
|
const pointY = delauneyRef.current.points[2 * closestPointIndex + 1];
|
|
136
138
|
const dist2 = (pointX - svgPoint.x) ** 2 + (pointY - svgPoint.y) ** 2;
|
|
137
|
-
if (dist2 >
|
|
139
|
+
if (dist2 > maxRadius ** 2) {
|
|
138
140
|
// The closest point is too far to be considered.
|
|
139
141
|
return 'outside-voronoi-max-radius';
|
|
140
142
|
}
|
|
@@ -240,18 +242,18 @@ const useChartVoronoi = ({
|
|
|
240
242
|
}
|
|
241
243
|
};
|
|
242
244
|
};
|
|
243
|
-
exports.
|
|
244
|
-
|
|
245
|
+
exports.useChartClosestPoint = useChartClosestPoint;
|
|
246
|
+
useChartClosestPoint.getDefaultizedParams = ({
|
|
245
247
|
params
|
|
246
248
|
}) => (0, _extends2.default)({}, params, {
|
|
247
249
|
disableVoronoi: params.disableVoronoi ?? !params.series.some(item => item.type === 'scatter')
|
|
248
250
|
});
|
|
249
|
-
|
|
251
|
+
useChartClosestPoint.getInitialState = params => ({
|
|
250
252
|
voronoi: {
|
|
251
253
|
isVoronoiEnabled: !params.disableVoronoi
|
|
252
254
|
}
|
|
253
255
|
});
|
|
254
|
-
|
|
256
|
+
useChartClosestPoint.params = {
|
|
255
257
|
disableVoronoi: true,
|
|
256
258
|
voronoiMaxRadius: true,
|
|
257
259
|
onItemClick: true
|
package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const selectorChartsIsVoronoiEnabled: 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 & import("./useChartClosestPoint.types.js").UseChartVoronoiState & Partial<{}> & {
|
|
2
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
3
|
+
} & {
|
|
4
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
5
|
+
}, boolean | undefined, any[]>;
|
package/internals/plugins/featurePlugins/useChartClosestPoint/useChartClosestPoint.selectors.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.selectorChartsIsVoronoiEnabled = void 0;
|
|
7
|
+
var _selectors = require("../../utils/selectors");
|
|
8
|
+
const selectVoronoi = state => state.voronoi;
|
|
9
|
+
const selectorChartsIsVoronoiEnabled = exports.selectorChartsIsVoronoiEnabled = (0, _selectors.createSelector)([selectVoronoi], voronoi => voronoi?.isVoronoiEnabled);
|
|
@@ -29,10 +29,11 @@ export interface UseChartVoronoiParameters {
|
|
|
29
29
|
*/
|
|
30
30
|
disableVoronoi?: boolean;
|
|
31
31
|
/**
|
|
32
|
-
* Defines the
|
|
32
|
+
* Defines the maximum distance between a scatter point and the pointer that triggers the interaction.
|
|
33
|
+
* If set to `'item'`, the radius is the `markerSize`.
|
|
33
34
|
* If `undefined`, the radius is assumed to be infinite.
|
|
34
35
|
*/
|
|
35
|
-
voronoiMaxRadius?: number | undefined;
|
|
36
|
+
voronoiMaxRadius?: 'item' | number | undefined;
|
|
36
37
|
/**
|
|
37
38
|
* Callback fired when clicking close to an item.
|
|
38
39
|
* This is only available for scatter plot for now.
|
|
@@ -41,10 +42,13 @@ export interface UseChartVoronoiParameters {
|
|
|
41
42
|
*/
|
|
42
43
|
onItemClick?: (event: MouseEvent, scatterItemIdentifier: ScatterItemIdentifier) => void;
|
|
43
44
|
}
|
|
44
|
-
export type UseChartVoronoiDefaultizedParameters = UseChartVoronoiParameters & {
|
|
45
|
+
export type UseChartVoronoiDefaultizedParameters = Pick<UseChartVoronoiParameters, 'voronoiMaxRadius' | 'onItemClick'> & {
|
|
46
|
+
/**
|
|
47
|
+
* If true, the voronoi plugin is disabled.
|
|
48
|
+
*/
|
|
45
49
|
disableVoronoi: boolean;
|
|
46
50
|
};
|
|
47
|
-
export type
|
|
51
|
+
export type UseChartClosestPointSignature = ChartPluginSignature<{
|
|
48
52
|
instance: UseChartVoronoiInstance;
|
|
49
53
|
state: UseChartVoronoiState;
|
|
50
54
|
params: UseChartVoronoiParameters;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HighlightItemData } from "./useChartHighlight.types.js";
|
|
2
|
+
import { HighlightScope } from "./highlightConfig.types.js";
|
|
3
|
+
import { SeriesId } from "../../../../models/seriesType/common.js";
|
|
4
|
+
export declare function isSeriesHighlighted(scope: Partial<HighlightScope> | null, item: HighlightItemData | null, seriesId: SeriesId): boolean;
|
|
5
|
+
export declare function isSeriesFaded(scope: Partial<HighlightScope> | null, item: HighlightItemData | null, seriesId: SeriesId): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the data index of the highlighted item for a specific series.
|
|
8
|
+
* If the item is not highlighted, it returns `null`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getSeriesHighlightedItem(scope: Partial<HighlightScope> | null, item: HighlightItemData | null, seriesId: SeriesId): number | null | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the data index of the "unfaded item" for a specific series.
|
|
13
|
+
* An "unfaded item" is the only item of a faded series that shouldn't be faded.
|
|
14
|
+
* If the series is not faded or if there is no highlighted item, it returns `null`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getSeriesUnfadedItem(scope: Partial<HighlightScope> | null, item: HighlightItemData | null, seriesId: SeriesId): number | null | undefined;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getSeriesHighlightedItem = getSeriesHighlightedItem;
|
|
7
|
+
exports.getSeriesUnfadedItem = getSeriesUnfadedItem;
|
|
8
|
+
exports.isSeriesFaded = isSeriesFaded;
|
|
9
|
+
exports.isSeriesHighlighted = isSeriesHighlighted;
|
|
10
|
+
function isSeriesHighlighted(scope, item, seriesId) {
|
|
11
|
+
return scope?.highlight === 'series' && item?.seriesId === seriesId;
|
|
12
|
+
}
|
|
13
|
+
function isSeriesFaded(scope, item, seriesId) {
|
|
14
|
+
if (isSeriesHighlighted(scope, item, seriesId)) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
return scope?.fade === 'global' && item != null || scope?.fade === 'series' && item?.seriesId === seriesId;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns the data index of the highlighted item for a specific series.
|
|
22
|
+
* If the item is not highlighted, it returns `null`.
|
|
23
|
+
*/
|
|
24
|
+
function getSeriesHighlightedItem(scope, item, seriesId) {
|
|
25
|
+
return scope?.highlight === 'item' && item?.seriesId === seriesId ? item.dataIndex : null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Returns the data index of the "unfaded item" for a specific series.
|
|
30
|
+
* An "unfaded item" is the only item of a faded series that shouldn't be faded.
|
|
31
|
+
* If the series is not faded or if there is no highlighted item, it returns `null`.
|
|
32
|
+
*/
|
|
33
|
+
function getSeriesUnfadedItem(scope, item, seriesId) {
|
|
34
|
+
if (isSeriesHighlighted(scope, item, seriesId)) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
if (getSeriesHighlightedItem(scope, item, seriesId) === item?.dataIndex) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return (scope?.fade === 'series' || scope?.fade === 'global') && item?.seriesId === seriesId ? item.dataIndex : null;
|
|
41
|
+
}
|
|
@@ -27,4 +27,8 @@ export declare const selectorChartsIsFadedCallback: import("reselect").Selector<
|
|
|
27
27
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
28
28
|
} & import("./useChartHighlight.types.js").UseChartHighlightState, (item: HighlightItemData | null) => boolean, any[]>;
|
|
29
29
|
export declare const selectorChartsIsHighlighted: import("reselect").Selector<any, boolean, [item: HighlightItemData | null]>;
|
|
30
|
+
export declare const selectorChartIsSeriesHighlighted: import("reselect").Selector<any, boolean, [seriesId: SeriesId]>;
|
|
31
|
+
export declare const selectorChartIsSeriesFaded: import("reselect").Selector<any, boolean, [seriesId: SeriesId]>;
|
|
32
|
+
export declare const selectorChartSeriesUnfadedItem: import("reselect").Selector<any, number | null | undefined, [seriesId: SeriesId]>;
|
|
33
|
+
export declare const selectorChartSeriesHighlightedItem: import("reselect").Selector<any, number | null | undefined, [seriesId: SeriesId]>;
|
|
30
34
|
export declare const selectorChartsIsFaded: import("reselect").Selector<any, boolean, [item: HighlightItemData | null]>;
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.selectorChartsIsHighlightedCallback = exports.selectorChartsIsHighlighted = exports.selectorChartsIsFadedCallback = exports.selectorChartsIsFaded = exports.selectorChartsHighlightedItem = exports.selectorChartsHighlightScopePerSeriesId = exports.selectorChartsHighlightScope = void 0;
|
|
6
|
+
exports.selectorChartsIsHighlightedCallback = exports.selectorChartsIsHighlighted = exports.selectorChartsIsFadedCallback = exports.selectorChartsIsFaded = exports.selectorChartsHighlightedItem = exports.selectorChartsHighlightScopePerSeriesId = exports.selectorChartsHighlightScope = exports.selectorChartSeriesUnfadedItem = exports.selectorChartSeriesHighlightedItem = exports.selectorChartIsSeriesHighlighted = exports.selectorChartIsSeriesFaded = void 0;
|
|
7
7
|
var _selectors = require("../../utils/selectors");
|
|
8
8
|
var _createIsHighlighted = require("./createIsHighlighted");
|
|
9
9
|
var _createIsFaded = require("./createIsFaded");
|
|
10
|
+
var _highlightStates = require("./highlightStates");
|
|
10
11
|
const selectHighlight = state => state.highlight;
|
|
11
12
|
const selectSeries = state => state.series;
|
|
12
13
|
const selectorChartsHighlightScopePerSeriesId = exports.selectorChartsHighlightScopePerSeriesId = (0, _selectors.createSelector)([selectSeries], series => {
|
|
@@ -38,6 +39,10 @@ const selectorChartsIsFadedCallback = exports.selectorChartsIsFadedCallback = (0
|
|
|
38
39
|
const selectorChartsIsHighlighted = exports.selectorChartsIsHighlighted = (0, _selectors.createSelector)([selectorChartsHighlightScope, selectorChartsHighlightedItem, (_, item) => item], function selectorChartsIsHighlighted(highlightScope, highlightedItem, item) {
|
|
39
40
|
return (0, _createIsHighlighted.createIsHighlighted)(highlightScope, highlightedItem)(item);
|
|
40
41
|
});
|
|
42
|
+
const selectorChartIsSeriesHighlighted = exports.selectorChartIsSeriesHighlighted = (0, _selectors.createSelector)([selectorChartsHighlightScope, selectorChartsHighlightedItem, (_, seriesId) => seriesId], _highlightStates.isSeriesHighlighted);
|
|
43
|
+
const selectorChartIsSeriesFaded = exports.selectorChartIsSeriesFaded = (0, _selectors.createSelector)([selectorChartsHighlightScope, selectorChartsHighlightedItem, (_, seriesId) => seriesId], _highlightStates.isSeriesFaded);
|
|
44
|
+
const selectorChartSeriesUnfadedItem = exports.selectorChartSeriesUnfadedItem = (0, _selectors.createSelector)([selectorChartsHighlightScope, selectorChartsHighlightedItem, (_, seriesId) => seriesId], _highlightStates.getSeriesUnfadedItem);
|
|
45
|
+
const selectorChartSeriesHighlightedItem = exports.selectorChartSeriesHighlightedItem = (0, _selectors.createSelector)([selectorChartsHighlightScope, selectorChartsHighlightedItem, (_, seriesId) => seriesId], _highlightStates.getSeriesHighlightedItem);
|
|
41
46
|
const selectorChartsIsFaded = exports.selectorChartsIsFaded = (0, _selectors.createSelector)([selectorChartsHighlightScope, selectorChartsHighlightedItem, (_, item) => item], function selectorChartsIsFaded(highlightScope, highlightedItem, item) {
|
|
42
47
|
return (0, _createIsFaded.createIsFaded)(highlightScope, highlightedItem)(item);
|
|
43
48
|
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ChartAnyPluginSignature, ChartUsedInstance } from "../../models/plugin.js";
|
|
2
|
+
import { UseChartInteractionInstance } from "./useChartInteraction.types.js";
|
|
3
|
+
export declare function checkHasInteractionPlugin<T extends ChartAnyPluginSignature>(instance: ChartUsedInstance<T>): instance is ChartUsedInstance<T> & UseChartInteractionInstance;
|