@mui/x-charts 8.6.0 → 8.8.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 +1 -1
- package/BarChart/BarChart.js +16 -0
- package/BarChart/BarPlot.js +11 -150
- package/BarChart/useBarPlotData.d.ts +8 -0
- package/BarChart/useBarPlotData.js +146 -0
- package/CHANGELOG.md +202 -1
- package/ChartContainer/ChartContainer.d.ts +1 -21
- package/ChartContainer/ChartContainer.js +22 -8
- package/ChartContainer/index.d.ts +8 -1
- package/ChartContainer/useChartContainerProps.js +8 -2
- package/ChartDataProvider/ChartDataProvider.js +6 -0
- package/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/ChartDataProvider/useChartDataProviderProps.js +6 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +34 -24
- package/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -1
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +34 -24
- package/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +3 -0
- package/ChartsReferenceLine/ChartsXReferenceLine.js +48 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +3 -0
- package/ChartsReferenceLine/ChartsYReferenceLine.js +48 -1
- package/ChartsReferenceLine/index.d.ts +3 -1
- package/ChartsSurface/ChartsSurface.js +2 -1
- package/ChartsTooltip/ChartsTooltipContainer.js +6 -3
- package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
- package/ChartsTooltip/utils.js +18 -29
- package/Gauge/GaugeContainer.d.ts +1 -1
- package/LineChart/AreaPlot.js +5 -115
- package/LineChart/LineChart.js +22 -0
- package/LineChart/LineHighlightPlot.js +10 -4
- package/LineChart/LinePlot.js +5 -99
- package/LineChart/MarkPlot.js +17 -3
- package/LineChart/useAreaPlotData.d.ts +12 -0
- package/LineChart/useAreaPlotData.js +126 -0
- package/LineChart/useLinePlotData.d.ts +11 -0
- package/LineChart/useLinePlotData.js +108 -0
- package/PieChart/PieChart.d.ts +1 -1
- package/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +1 -1
- package/ScatterChart/Scatter.js +22 -48
- package/ScatterChart/ScatterChart.d.ts +1 -1
- package/ScatterChart/ScatterPlot.js +2 -2
- package/ScatterChart/seriesConfig/seriesProcessor.js +3 -0
- package/ScatterChart/useScatterPlotData.d.ts +8 -0
- package/ScatterChart/useScatterPlotData.js +33 -0
- package/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/SparkLineChart/SparkLineChart.js +16 -0
- package/context/ChartApi.d.ts +22 -0
- package/context/ChartApi.js +5 -0
- package/context/ChartProvider/ChartContext.js +1 -0
- package/context/index.d.ts +2 -1
- package/context/useChartApiContext.d.ts +1 -1
- package/esm/BarChart/BarChart.d.ts +1 -1
- package/esm/BarChart/BarChart.js +16 -0
- package/esm/BarChart/BarPlot.js +12 -152
- package/esm/BarChart/useBarPlotData.d.ts +8 -0
- package/esm/BarChart/useBarPlotData.js +139 -0
- package/esm/ChartContainer/ChartContainer.d.ts +1 -21
- package/esm/ChartContainer/ChartContainer.js +22 -8
- package/esm/ChartContainer/index.d.ts +8 -1
- package/esm/ChartContainer/index.js +6 -1
- package/esm/ChartContainer/useChartContainerProps.js +8 -2
- package/esm/ChartDataProvider/ChartDataProvider.js +6 -0
- package/esm/ChartDataProvider/useChartDataProviderProps.d.ts +1 -1
- package/esm/ChartDataProvider/useChartDataProviderProps.js +7 -2
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.d.ts +1 -1
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +36 -26
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.d.ts +1 -1
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +36 -26
- package/esm/ChartsReferenceLine/ChartsReferenceLine.d.ts +1 -1
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.d.ts +3 -0
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.js +47 -0
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.d.ts +3 -0
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.js +47 -0
- package/esm/ChartsReferenceLine/index.d.ts +3 -1
- package/esm/ChartsReferenceLine/index.js +2 -1
- package/esm/ChartsSurface/ChartsSurface.js +2 -1
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +6 -3
- package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
- package/esm/ChartsTooltip/utils.js +18 -29
- package/esm/Gauge/GaugeContainer.d.ts +1 -1
- package/esm/LineChart/AreaPlot.js +5 -115
- package/esm/LineChart/LineChart.js +22 -0
- package/esm/LineChart/LineHighlightPlot.js +11 -5
- package/esm/LineChart/LinePlot.js +5 -99
- package/esm/LineChart/MarkPlot.js +17 -3
- package/esm/LineChart/useAreaPlotData.d.ts +12 -0
- package/esm/LineChart/useAreaPlotData.js +119 -0
- package/esm/LineChart/useLinePlotData.d.ts +11 -0
- package/esm/LineChart/useLinePlotData.js +101 -0
- package/esm/PieChart/PieChart.d.ts +1 -1
- package/esm/RadarChart/RadarDataProvider/RadarDataProvider.d.ts +1 -1
- package/esm/ScatterChart/Scatter.js +23 -49
- package/esm/ScatterChart/ScatterChart.d.ts +1 -1
- package/esm/ScatterChart/ScatterPlot.js +2 -2
- package/esm/ScatterChart/seriesConfig/seriesProcessor.js +3 -0
- package/esm/ScatterChart/useScatterPlotData.d.ts +8 -0
- package/esm/ScatterChart/useScatterPlotData.js +26 -0
- package/esm/SparkLineChart/SparkLineChart.d.ts +1 -1
- package/esm/SparkLineChart/SparkLineChart.js +16 -0
- package/esm/context/ChartApi.d.ts +22 -0
- package/esm/context/ChartApi.js +1 -0
- package/esm/context/ChartProvider/ChartContext.js +2 -0
- package/esm/context/index.d.ts +2 -1
- package/esm/context/useChartApiContext.d.ts +1 -1
- package/esm/hooks/useAxis.d.ts +2 -2
- package/esm/hooks/useInteractionItemProps.d.ts +14 -9
- package/esm/hooks/useInteractionItemProps.js +28 -28
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -2
- package/esm/internals/constants.d.ts +3 -0
- package/esm/internals/constants.js +4 -0
- package/esm/internals/getLabel.d.ts +1 -1
- package/esm/internals/index.d.ts +6 -0
- package/esm/internals/index.js +6 -0
- package/esm/internals/plugins/corePlugins/corePlugins.d.ts +4 -2
- package/esm/internals/plugins/corePlugins/corePlugins.js +3 -1
- package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -29
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +0 -6
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/index.d.ts +3 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/index.js +2 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.ts +3 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +27 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +8 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +3 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +21 -0
- package/esm/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js +1 -0
- package/esm/internals/plugins/corePlugins/useChartId/useChartId.js +2 -0
- package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/index.d.ts +2 -0
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/index.js +1 -0
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.d.ts +3 -0
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +77 -0
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +31 -0
- package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.js +1 -0
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +1 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +5 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +7 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.js +14 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +2 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +90 -36
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +18 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +76 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +8 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +47 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +48 -0
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +18 -12
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +16 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +6 -1
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +5 -5
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +34 -34
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +7 -8
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +47 -30
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
- package/esm/internals/plugins/utils/useLazySelectorEffect.d.ts +7 -0
- package/esm/internals/plugins/utils/useLazySelectorEffect.js +70 -0
- package/esm/internals/store/useCharts.d.ts +1 -1
- package/esm/locales/elGR.d.ts +19 -0
- package/esm/locales/elGR.js +15 -0
- package/esm/locales/index.d.ts +1 -0
- package/esm/locales/index.js +1 -0
- package/esm/models/axis.d.ts +15 -0
- package/esm/models/axis.js +4 -0
- package/esm/models/index.d.ts +1 -1
- package/esm/models/seriesType/scatter.d.ts +11 -2
- package/esm/themeAugmentation/components.d.ts +3 -0
- package/esm/themeAugmentation/props.d.ts +2 -0
- package/hooks/useAxis.d.ts +2 -2
- package/hooks/useInteractionItemProps.d.ts +14 -9
- package/hooks/useInteractionItemProps.js +29 -28
- package/index.d.ts +2 -1
- package/index.js +37 -11
- package/internals/constants.d.ts +3 -0
- package/internals/constants.js +5 -1
- package/internals/getLabel.d.ts +1 -1
- package/internals/index.d.ts +6 -0
- package/internals/index.js +52 -0
- package/internals/plugins/corePlugins/corePlugins.d.ts +4 -2
- package/internals/plugins/corePlugins/corePlugins.js +3 -1
- package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -29
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +0 -6
- package/internals/plugins/corePlugins/useChartExperimentalFeature/index.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/index.js +27 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.js +34 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.d.ts +8 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.selectors.js +10 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.d.ts +21 -0
- package/internals/plugins/corePlugins/useChartExperimentalFeature/useChartExperimentalFeature.types.js +5 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.js +1 -0
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartInteractionListener/index.d.ts +2 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/index.js +12 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.d.ts +3 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js +84 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.d.ts +31 -0
- package/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.types.js +5 -0
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.d.ts +5 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/computeAxisValue.js +4 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.d.ts +1 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/defaultizeZoom.js +4 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.d.ts +7 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisDomainLimit.js +21 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.d.ts +2 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/index.js +24 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +4 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +90 -36
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts +18 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.d.ts +3 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisPreview.selectors.js +82 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +10 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +9 -6
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.d.ts +47 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianHighlight.selectors.js +55 -0
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +18 -12
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +18 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/zoom.types.d.ts +6 -1
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +6 -6
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +34 -34
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +7 -8
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.js +46 -30
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +1 -1
- package/internals/plugins/utils/useLazySelectorEffect.d.ts +7 -0
- package/internals/plugins/utils/useLazySelectorEffect.js +77 -0
- package/internals/store/useCharts.d.ts +1 -1
- package/locales/elGR.d.ts +19 -0
- package/locales/elGR.js +21 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +11 -0
- package/models/axis.d.ts +15 -0
- package/models/axis.js +4 -0
- package/models/index.d.ts +1 -1
- package/models/seriesType/scatter.d.ts +11 -2
- package/package.json +4 -3
- package/themeAugmentation/components.d.ts +3 -0
- package/themeAugmentation/props.d.ts +2 -0
package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export declare const selectorChartLeftAxisSize: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & 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 & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
1
|
+
export declare const selectorChartLeftAxisSize: 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> & {
|
|
2
2
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
3
3
|
} & {
|
|
4
4
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
5
5
|
}, number, []>;
|
|
6
|
-
export declare const selectorChartRightAxisSize: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & 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 & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
6
|
+
export declare const selectorChartRightAxisSize: 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> & {
|
|
7
7
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
8
|
} & {
|
|
9
9
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
10
10
|
}, number, []>;
|
|
11
|
-
export declare const selectorChartTopAxisSize: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & 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 & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
11
|
+
export declare const selectorChartTopAxisSize: 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> & {
|
|
12
12
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
13
13
|
} & {
|
|
14
14
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
15
15
|
}, number, []>;
|
|
16
|
-
export declare const selectorChartBottomAxisSize: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & 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 & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
16
|
+
export declare const selectorChartBottomAxisSize: 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> & {
|
|
17
17
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
18
18
|
} & {
|
|
19
19
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
|
+
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
|
6
|
+
import { useAssertModelConsistency } from '@mui/x-internals/useAssertModelConsistency';
|
|
5
7
|
import { warnOnce } from '@mui/x-internals/warning';
|
|
6
8
|
import { rainbowSurgePalette } from "../../../../colorPalettes/index.js";
|
|
7
9
|
import { useSelector } from "../../../store/useSelector.js";
|
|
@@ -12,6 +14,8 @@ import { selectorChartXAxis, selectorChartYAxis } from "./useChartCartesianAxisR
|
|
|
12
14
|
import { getAxisIndex } from "./getAxisValue.js";
|
|
13
15
|
import { getSVGPoint } from "../../../getSVGPoint.js";
|
|
14
16
|
import { selectorChartsInteractionIsInitialized } from "../useChartInteraction/index.js";
|
|
17
|
+
import { selectorChartAxisInteraction } from "./useChartCartesianInteraction.selectors.js";
|
|
18
|
+
import { useLazySelectorEffect } from "../../utils/useLazySelectorEffect.js";
|
|
15
19
|
export const useChartCartesianAxis = ({
|
|
16
20
|
params,
|
|
17
21
|
store,
|
|
@@ -22,7 +26,8 @@ export const useChartCartesianAxis = ({
|
|
|
22
26
|
const {
|
|
23
27
|
xAxis,
|
|
24
28
|
yAxis,
|
|
25
|
-
dataset
|
|
29
|
+
dataset,
|
|
30
|
+
onHighlightedAxisChange
|
|
26
31
|
} = params;
|
|
27
32
|
if (process.env.NODE_ENV !== 'production') {
|
|
28
33
|
const ids = [...(xAxis ?? []), ...(yAxis ?? [])].filter(axis => axis.id).map(axis => axis.id);
|
|
@@ -42,6 +47,25 @@ export const useChartCartesianAxis = ({
|
|
|
42
47
|
axis: yAxisWithScale,
|
|
43
48
|
axisIds: yAxisIds
|
|
44
49
|
} = useSelector(store, selectorChartYAxis);
|
|
50
|
+
useAssertModelConsistency({
|
|
51
|
+
warningPrefix: 'MUI X Charts',
|
|
52
|
+
componentName: 'Chart',
|
|
53
|
+
propName: 'highlightedAxis',
|
|
54
|
+
controlled: params.highlightedAxis,
|
|
55
|
+
defaultValue: undefined
|
|
56
|
+
});
|
|
57
|
+
useEnhancedEffect(() => {
|
|
58
|
+
if (params.highlightedAxis !== undefined) {
|
|
59
|
+
store.update(prevState => {
|
|
60
|
+
if (prevState.controlledCartesianAxisHighlight === params.highlightedAxis) {
|
|
61
|
+
return prevState;
|
|
62
|
+
}
|
|
63
|
+
return _extends({}, prevState, {
|
|
64
|
+
controlledCartesianAxisHighlight: params.highlightedAxis
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}, [store, params.highlightedAxis]);
|
|
45
69
|
|
|
46
70
|
// The effect do not track any value defined synchronously during the 1st render by hooks called after `useChartCartesianAxis`
|
|
47
71
|
// As a consequence, the state generated by the 1st run of this useEffect will always be equal to the initialization one
|
|
@@ -60,41 +84,69 @@ export const useChartCartesianAxis = ({
|
|
|
60
84
|
}, [seriesConfig, drawingArea, xAxis, yAxis, dataset, store]);
|
|
61
85
|
const usedXAxis = xAxisIds[0];
|
|
62
86
|
const usedYAxis = yAxisIds[0];
|
|
87
|
+
useLazySelectorEffect(store, selectorChartAxisInteraction, (prevAxisInteraction, nextAxisInteraction) => {
|
|
88
|
+
if (Object.is(prevAxisInteraction, nextAxisInteraction)) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (prevAxisInteraction.length !== nextAxisInteraction.length) {
|
|
92
|
+
onHighlightedAxisChange(nextAxisInteraction);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (prevAxisInteraction?.some(({
|
|
96
|
+
axisId,
|
|
97
|
+
dataIndex
|
|
98
|
+
}, itemIndex) => nextAxisInteraction[itemIndex].axisId !== axisId || nextAxisInteraction[itemIndex].dataIndex !== dataIndex)) {
|
|
99
|
+
onHighlightedAxisChange(nextAxisInteraction);
|
|
100
|
+
}
|
|
101
|
+
}, !onHighlightedAxisChange);
|
|
63
102
|
React.useEffect(() => {
|
|
64
103
|
const element = svgRef.current;
|
|
65
|
-
if (!isInteractionEnabled || element
|
|
104
|
+
if (!isInteractionEnabled || !element || params.disableAxisListener) {
|
|
66
105
|
return () => {};
|
|
67
106
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const target = 'targetTouches' in event ? event.targetTouches[0] : event;
|
|
73
|
-
const svgPoint = getSVGPoint(element, target);
|
|
74
|
-
if (!instance.isPointInside(svgPoint.x, svgPoint.y, event.target)) {
|
|
107
|
+
|
|
108
|
+
// Clean the interaction when the mouse leaves the chart.
|
|
109
|
+
const moveEndHandler = instance.addInteractionListener('moveEnd', event => {
|
|
110
|
+
if (!event.detail.activeGestures.pan) {
|
|
75
111
|
instance.cleanInteraction?.();
|
|
76
|
-
return;
|
|
77
112
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
113
|
+
});
|
|
114
|
+
const panEndHandler = instance.addInteractionListener('panEnd', event => {
|
|
115
|
+
if (!event.detail.activeGestures.move) {
|
|
116
|
+
instance.cleanInteraction?.();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
const pressEndHandler = instance.addInteractionListener('quickPressEnd', event => {
|
|
120
|
+
if (!event.detail.activeGestures.move && !event.detail.activeGestures.pan) {
|
|
121
|
+
instance.cleanInteraction?.();
|
|
84
122
|
}
|
|
85
|
-
|
|
86
|
-
|
|
123
|
+
});
|
|
124
|
+
const gestureHandler = event => {
|
|
125
|
+
const srvEvent = event.detail.srcEvent;
|
|
126
|
+
const target = event.detail.target;
|
|
127
|
+
const svgPoint = getSVGPoint(element, srvEvent);
|
|
128
|
+
|
|
129
|
+
// Release the pointer capture if we are panning, as this would cause the tooltip to
|
|
130
|
+
// be locked to the first "section" it touches.
|
|
131
|
+
if (event.detail.srcEvent.buttons >= 1 && target?.hasPointerCapture(event.detail.srcEvent.pointerId) && !target?.closest('[data-charts-zoom-slider]')) {
|
|
132
|
+
target?.releasePointerCapture(event.detail.srcEvent.pointerId);
|
|
133
|
+
}
|
|
134
|
+
if (!instance.isPointInside(svgPoint.x, svgPoint.y, target)) {
|
|
135
|
+
instance.cleanInteraction?.();
|
|
136
|
+
return;
|
|
87
137
|
}
|
|
138
|
+
instance.setPointerCoordinate?.(svgPoint);
|
|
88
139
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
element.addEventListener('pointerleave', handleOut);
|
|
140
|
+
const moveHandler = instance.addInteractionListener('move', gestureHandler);
|
|
141
|
+
const panHandler = instance.addInteractionListener('pan', gestureHandler);
|
|
142
|
+
const pressHandler = instance.addInteractionListener('quickPress', gestureHandler);
|
|
93
143
|
return () => {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
144
|
+
moveHandler.cleanup();
|
|
145
|
+
moveEndHandler.cleanup();
|
|
146
|
+
panHandler.cleanup();
|
|
147
|
+
panEndHandler.cleanup();
|
|
148
|
+
pressHandler.cleanup();
|
|
149
|
+
pressEndHandler.cleanup();
|
|
98
150
|
};
|
|
99
151
|
}, [svgRef, store, xAxisWithScale, usedXAxis, yAxisWithScale, usedYAxis, instance, params.disableAxisListener, isInteractionEnabled]);
|
|
100
152
|
React.useEffect(() => {
|
|
@@ -103,11 +155,10 @@ export const useChartCartesianAxis = ({
|
|
|
103
155
|
if (element === null || !onAxisClick) {
|
|
104
156
|
return () => {};
|
|
105
157
|
}
|
|
106
|
-
const
|
|
107
|
-
event.preventDefault();
|
|
158
|
+
const axisClickHandler = instance.addInteractionListener('tap', event => {
|
|
108
159
|
let dataIndex = null;
|
|
109
160
|
let isXAxis = false;
|
|
110
|
-
const svgPoint = getSVGPoint(element, event);
|
|
161
|
+
const svgPoint = getSVGPoint(element, event.detail.srcEvent);
|
|
111
162
|
const xIndex = getAxisIndex(xAxisWithScale[usedXAxis], svgPoint.x);
|
|
112
163
|
isXAxis = xIndex !== -1;
|
|
113
164
|
dataIndex = isXAxis ? xIndex : getAxisIndex(yAxisWithScale[usedYAxis], svgPoint.y);
|
|
@@ -130,17 +181,16 @@ export const useChartCartesianAxis = ({
|
|
|
130
181
|
}
|
|
131
182
|
});
|
|
132
183
|
});
|
|
133
|
-
onAxisClick(event, {
|
|
184
|
+
onAxisClick(event.detail.srcEvent, {
|
|
134
185
|
dataIndex,
|
|
135
186
|
axisValue,
|
|
136
187
|
seriesValues
|
|
137
188
|
});
|
|
138
|
-
};
|
|
139
|
-
element.addEventListener('click', handleMouseClick);
|
|
189
|
+
});
|
|
140
190
|
return () => {
|
|
141
|
-
|
|
191
|
+
axisClickHandler.cleanup();
|
|
142
192
|
};
|
|
143
|
-
}, [params.onAxisClick, processedSeries, svgRef, xAxisWithScale, xAxisIds, yAxisWithScale, yAxisIds, usedXAxis, usedYAxis]);
|
|
193
|
+
}, [params.onAxisClick, processedSeries, svgRef, xAxisWithScale, xAxisIds, yAxisWithScale, yAxisIds, usedXAxis, usedYAxis, instance]);
|
|
144
194
|
return {};
|
|
145
195
|
};
|
|
146
196
|
useChartCartesianAxis.params = {
|
|
@@ -148,7 +198,9 @@ useChartCartesianAxis.params = {
|
|
|
148
198
|
yAxis: true,
|
|
149
199
|
dataset: true,
|
|
150
200
|
onAxisClick: true,
|
|
151
|
-
disableAxisListener: true
|
|
201
|
+
disableAxisListener: true,
|
|
202
|
+
onHighlightedAxisChange: true,
|
|
203
|
+
highlightedAxis: true
|
|
152
204
|
};
|
|
153
205
|
useChartCartesianAxis.getDefaultizedParams = ({
|
|
154
206
|
params
|
|
@@ -160,9 +212,11 @@ useChartCartesianAxis.getDefaultizedParams = ({
|
|
|
160
212
|
defaultizedYAxis: defaultizeYAxis(params.yAxis, params.dataset)
|
|
161
213
|
});
|
|
162
214
|
};
|
|
163
|
-
useChartCartesianAxis.getInitialState = params => ({
|
|
215
|
+
useChartCartesianAxis.getInitialState = params => _extends({
|
|
164
216
|
cartesianAxis: {
|
|
165
217
|
x: params.defaultizedXAxis,
|
|
166
218
|
y: params.defaultizedYAxis
|
|
167
219
|
}
|
|
220
|
+
}, params.highlightedAxis === undefined ? {} : {
|
|
221
|
+
controlledCartesianAxisHighlight: params.highlightedAxis
|
|
168
222
|
});
|
package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChartPluginSignature } from "../../models/index.js";
|
|
2
2
|
import type { ChartSeriesType, DatasetType } from "../../../../models/seriesType/config.js";
|
|
3
|
-
import type { ComputedAxis, ScaleName, AxisId, ChartsAxisData, YAxis, XAxis, DefaultedXAxis, DefaultedYAxis } from "../../../../models/axis.js";
|
|
3
|
+
import type { ComputedAxis, ScaleName, AxisId, ChartsAxisData, YAxis, XAxis, DefaultedXAxis, DefaultedYAxis, AxisItemIdentifier } from "../../../../models/axis.js";
|
|
4
4
|
import type { UseChartSeriesSignature } from "../../corePlugins/useChartSeries/index.js";
|
|
5
5
|
import type { ZoomData, ZoomOptions, ZoomSliderShowTooltip } from "./zoom.types.js";
|
|
6
6
|
import type { UseChartInteractionSignature } from "../useChartInteraction/index.js";
|
|
@@ -36,6 +36,19 @@ export interface UseChartCartesianAxisParameters<S extends ScaleName = ScaleName
|
|
|
36
36
|
* @param {null | ChartsAxisData} data The data about the clicked axis and items associated with it.
|
|
37
37
|
*/
|
|
38
38
|
onAxisClick?: (event: MouseEvent, data: null | ChartsAxisData) => void;
|
|
39
|
+
/**
|
|
40
|
+
* The function called when the pointer position corresponds to a new axis data item.
|
|
41
|
+
* This update can either be caused by a pointer movement, or an axis update.
|
|
42
|
+
* In case of multiple axes, the function is called if at least one axis is updated.
|
|
43
|
+
* The argument contains the identifier for all axes with a `data` property.
|
|
44
|
+
* @param {AxisItemIdentifier[]} axisItems The array of axes item identifiers.
|
|
45
|
+
*/
|
|
46
|
+
onHighlightedAxisChange?: (axisItems: AxisItemIdentifier[]) => void;
|
|
47
|
+
/**
|
|
48
|
+
* The controlled axis highlight.
|
|
49
|
+
* Identified by the axis id, and data index.
|
|
50
|
+
*/
|
|
51
|
+
highlightedAxis?: AxisItemIdentifier[];
|
|
39
52
|
/**
|
|
40
53
|
* If `true`, the charts will not listen to the mouse move event.
|
|
41
54
|
* It might break interactive features, but will improve performance.
|
|
@@ -67,6 +80,10 @@ export interface UseChartCartesianAxisState {
|
|
|
67
80
|
x: DefaultedXAxis[];
|
|
68
81
|
y: DefaultedYAxis[];
|
|
69
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* The controlled axis item highlighted.
|
|
85
|
+
*/
|
|
86
|
+
controlledCartesianAxisHighlight?: AxisItemIdentifier[];
|
|
70
87
|
}
|
|
71
88
|
export type ExtremumFilter = (value: {
|
|
72
89
|
x: number | Date | string | null;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AxisId } from "../../../../models/axis.js";
|
|
2
|
+
export declare const selectorChartPreviewComputedXAxis: import("reselect").Selector<any, import("./useChartCartesianAxis.types.js").ComputedAxisConfig<import("../../../index.js").ChartsXAxisProps>, [axisId: AxisId]>;
|
|
3
|
+
export declare const selectorChartPreviewComputedYAxis: import("reselect").Selector<any, import("./useChartCartesianAxis.types.js").ComputedAxisConfig<import("../../../index.js").ChartsYAxisProps>, [axisId: AxisId]>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { createSelector } from "../../utils/selectors.js";
|
|
2
|
+
import { selectorChartRawXAxis, selectorChartRawYAxis } from "./useChartCartesianAxisLayout.selectors.js";
|
|
3
|
+
import { selectorChartSeriesConfig, selectorChartSeriesProcessed } from "../../corePlugins/useChartSeries/index.js";
|
|
4
|
+
import { computeAxisValue } from "./computeAxisValue.js";
|
|
5
|
+
import { selectorChartZoomAxisFilters, selectorChartZoomOptionsLookup } from "./useChartCartesianAxisRendering.selectors.js";
|
|
6
|
+
import { selectorChartDrawingArea } from "../../corePlugins/useChartDimensions/index.js";
|
|
7
|
+
import { ZOOM_SLIDER_PREVIEW_SIZE } from "../../../constants.js";
|
|
8
|
+
function createPreviewDrawingArea(axisDirection, mainChartDrawingArea) {
|
|
9
|
+
return axisDirection === 'x' ? {
|
|
10
|
+
left: 0,
|
|
11
|
+
top: 0,
|
|
12
|
+
width: mainChartDrawingArea.width,
|
|
13
|
+
height: ZOOM_SLIDER_PREVIEW_SIZE,
|
|
14
|
+
right: mainChartDrawingArea.width,
|
|
15
|
+
bottom: ZOOM_SLIDER_PREVIEW_SIZE
|
|
16
|
+
} : {
|
|
17
|
+
left: 0,
|
|
18
|
+
top: 0,
|
|
19
|
+
width: ZOOM_SLIDER_PREVIEW_SIZE,
|
|
20
|
+
height: mainChartDrawingArea.height,
|
|
21
|
+
right: ZOOM_SLIDER_PREVIEW_SIZE,
|
|
22
|
+
bottom: mainChartDrawingArea.height
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export const selectorChartPreviewComputedXAxis = createSelector([selectorChartRawXAxis, selectorChartSeriesProcessed, selectorChartSeriesConfig, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters, selectorChartDrawingArea, (_, axisId) => axisId], (xAxes, formattedSeries, seriesConfig, zoomOptions, getFilters, chartDrawingArea, axisId) => {
|
|
26
|
+
const hasAxis = xAxes?.some(axis => axis.id === axisId);
|
|
27
|
+
const drawingArea = createPreviewDrawingArea(hasAxis ? 'x' : 'y', chartDrawingArea);
|
|
28
|
+
const options = zoomOptions[axisId];
|
|
29
|
+
const zoomMap = new Map([[axisId, {
|
|
30
|
+
axisId,
|
|
31
|
+
start: options.minStart,
|
|
32
|
+
end: options.maxEnd
|
|
33
|
+
}]]);
|
|
34
|
+
const computedAxes = computeAxisValue({
|
|
35
|
+
drawingArea,
|
|
36
|
+
formattedSeries,
|
|
37
|
+
axis: xAxes,
|
|
38
|
+
seriesConfig,
|
|
39
|
+
axisDirection: 'x',
|
|
40
|
+
zoomMap,
|
|
41
|
+
zoomOptions,
|
|
42
|
+
getFilters
|
|
43
|
+
});
|
|
44
|
+
if (computedAxes.axis[axisId]) {
|
|
45
|
+
return {
|
|
46
|
+
[axisId]: computedAxes.axis[axisId]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return computedAxes.axis;
|
|
50
|
+
});
|
|
51
|
+
export const selectorChartPreviewComputedYAxis = createSelector([selectorChartRawYAxis, selectorChartSeriesProcessed, selectorChartSeriesConfig, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters, selectorChartDrawingArea, (_, axisId) => axisId], (yAxes, formattedSeries, seriesConfig, zoomOptions, getFilters, chartDrawingArea, axisId) => {
|
|
52
|
+
const hasAxis = yAxes?.some(axis => axis.id === axisId);
|
|
53
|
+
const drawingArea = createPreviewDrawingArea(hasAxis ? 'y' : 'x', chartDrawingArea);
|
|
54
|
+
const options = zoomOptions[axisId];
|
|
55
|
+
const zoomMap = new Map([[axisId, {
|
|
56
|
+
axisId,
|
|
57
|
+
start: options.minStart,
|
|
58
|
+
end: options.maxEnd
|
|
59
|
+
}]]);
|
|
60
|
+
const computedAxes = computeAxisValue({
|
|
61
|
+
drawingArea,
|
|
62
|
+
formattedSeries,
|
|
63
|
+
axis: yAxes,
|
|
64
|
+
seriesConfig,
|
|
65
|
+
axisDirection: 'y',
|
|
66
|
+
zoomMap,
|
|
67
|
+
zoomOptions,
|
|
68
|
+
getFilters
|
|
69
|
+
});
|
|
70
|
+
if (computedAxes.axis[axisId]) {
|
|
71
|
+
return {
|
|
72
|
+
[axisId]: computedAxes.axis[axisId]
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return computedAxes.axis;
|
|
76
|
+
});
|
|
@@ -4,17 +4,17 @@ export declare const createZoomMap: (zoom: readonly ZoomData[]) => Map<AxisId, Z
|
|
|
4
4
|
/**
|
|
5
5
|
* Following selectors are not exported because they exist in the MIT chart only to ba able to reuse the Zoom state from the pro.
|
|
6
6
|
*/
|
|
7
|
-
export declare const selectorChartZoomIsInteracting: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & 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 & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
7
|
+
export declare const selectorChartZoomIsInteracting: 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> & {
|
|
8
8
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
9
9
|
} & {
|
|
10
10
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
11
11
|
}, boolean | undefined, []>;
|
|
12
|
-
export declare const selectorChartZoomMap: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & 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 & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
12
|
+
export declare const selectorChartZoomMap: 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> & {
|
|
13
13
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
14
14
|
} & {
|
|
15
15
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
16
16
|
}, Map<AxisId, ZoomData> | undefined, []>;
|
|
17
|
-
export declare const selectorChartZoomOptionsLookup: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & 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 & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
17
|
+
export declare const selectorChartZoomOptionsLookup: 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> & {
|
|
18
18
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
19
19
|
} & {
|
|
20
20
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -23,15 +23,20 @@ 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 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
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
28
|
+
} & {
|
|
29
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
30
|
+
} & Partial<{}>, import("./zoom.types.js").GetZoomAxisFilters | undefined, []>;
|
|
26
31
|
/**
|
|
27
32
|
* The only interesting selectors that merge axis data and zoom if provided.
|
|
28
33
|
*/
|
|
29
|
-
export declare const selectorChartXAxis: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & 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 & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
34
|
+
export declare const selectorChartXAxis: 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> & {
|
|
30
35
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
31
36
|
} & Partial<{}> & {
|
|
32
37
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
33
38
|
}, import("./computeAxisValue.js").ComputeResult<import("../../../index.js").ChartsXAxisProps>, []>;
|
|
34
|
-
export declare const selectorChartYAxis: import("reselect").Selector<import("../../corePlugins/useChartId/useChartId.types.js").UseChartIdState & 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 & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
39
|
+
export declare const selectorChartYAxis: 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> & {
|
|
35
40
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
36
41
|
} & Partial<{}> & {
|
|
37
42
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -6,6 +6,7 @@ import { computeAxisValue } from "./computeAxisValue.js";
|
|
|
6
6
|
import { createAxisFilterMapper, createGetAxisFilters } from "./createAxisFilterMapper.js";
|
|
7
7
|
import { createZoomLookup } from "./createZoomLookup.js";
|
|
8
8
|
import { selectorChartRawXAxis, selectorChartRawYAxis } from "./useChartCartesianAxisLayout.selectors.js";
|
|
9
|
+
import { selectorPreferStrictDomainInLineCharts } from "../../corePlugins/useChartExperimentalFeature/index.js";
|
|
9
10
|
export const createZoomMap = zoom => {
|
|
10
11
|
const zoomItemMap = new Map();
|
|
11
12
|
zoom.forEach(zoomItem => {
|
|
@@ -37,7 +38,7 @@ const selectorChartYFilter = createSelector([selectorChartZoomMap, selectorChart
|
|
|
37
38
|
formattedSeries,
|
|
38
39
|
direction: 'y'
|
|
39
40
|
}));
|
|
40
|
-
const selectorChartZoomAxisFilters = createSelector([selectorChartXFilter, selectorChartYFilter, selectorChartRawXAxis, selectorChartRawYAxis], (xMapper, yMapper, xAxis, yAxis) => {
|
|
41
|
+
export const selectorChartZoomAxisFilters = createSelector([selectorChartXFilter, selectorChartYFilter, selectorChartRawXAxis, selectorChartRawYAxis], (xMapper, yMapper, xAxis, yAxis) => {
|
|
41
42
|
if (xMapper === undefined || yMapper === undefined) {
|
|
42
43
|
// Early return if there is no zoom.
|
|
43
44
|
return undefined;
|
|
@@ -66,7 +67,7 @@ const selectorChartZoomAxisFilters = createSelector([selectorChartXFilter, selec
|
|
|
66
67
|
* The only interesting selectors that merge axis data and zoom if provided.
|
|
67
68
|
*/
|
|
68
69
|
|
|
69
|
-
export const selectorChartXAxis = createSelector([selectorChartRawXAxis, selectorChartDrawingArea, selectorChartSeriesProcessed, selectorChartSeriesConfig, selectorChartZoomMap, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters], (axis, drawingArea, formattedSeries, seriesConfig, zoomMap, zoomOptions, getFilters) => computeAxisValue({
|
|
70
|
+
export const selectorChartXAxis = createSelector([selectorChartRawXAxis, selectorChartDrawingArea, selectorChartSeriesProcessed, selectorChartSeriesConfig, selectorChartZoomMap, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters, selectorPreferStrictDomainInLineCharts], (axis, drawingArea, formattedSeries, seriesConfig, zoomMap, zoomOptions, getFilters, preferStrictDomainInLineCharts) => computeAxisValue({
|
|
70
71
|
drawingArea,
|
|
71
72
|
formattedSeries,
|
|
72
73
|
axis,
|
|
@@ -74,9 +75,10 @@ export const selectorChartXAxis = createSelector([selectorChartRawXAxis, selecto
|
|
|
74
75
|
axisDirection: 'x',
|
|
75
76
|
zoomMap,
|
|
76
77
|
zoomOptions,
|
|
77
|
-
getFilters
|
|
78
|
+
getFilters,
|
|
79
|
+
preferStrictDomainInLineCharts
|
|
78
80
|
}));
|
|
79
|
-
export const selectorChartYAxis = createSelector([selectorChartRawYAxis, selectorChartDrawingArea, selectorChartSeriesProcessed, selectorChartSeriesConfig, selectorChartZoomMap, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters], (axis, drawingArea, formattedSeries, seriesConfig, zoomMap, zoomOptions, getFilters) => computeAxisValue({
|
|
81
|
+
export const selectorChartYAxis = createSelector([selectorChartRawYAxis, selectorChartDrawingArea, selectorChartSeriesProcessed, selectorChartSeriesConfig, selectorChartZoomMap, selectorChartZoomOptionsLookup, selectorChartZoomAxisFilters, selectorPreferStrictDomainInLineCharts], (axis, drawingArea, formattedSeries, seriesConfig, zoomMap, zoomOptions, getFilters, preferStrictDomainInLineCharts) => computeAxisValue({
|
|
80
82
|
drawingArea,
|
|
81
83
|
formattedSeries,
|
|
82
84
|
axis,
|
|
@@ -84,7 +86,8 @@ export const selectorChartYAxis = createSelector([selectorChartRawYAxis, selecto
|
|
|
84
86
|
axisDirection: 'y',
|
|
85
87
|
zoomMap,
|
|
86
88
|
zoomOptions,
|
|
87
|
-
getFilters
|
|
89
|
+
getFilters,
|
|
90
|
+
preferStrictDomainInLineCharts
|
|
88
91
|
}));
|
|
89
92
|
export const selectorChartAxis = createSelector([selectorChartXAxis, selectorChartYAxis, (_, axisId) => axisId], (xAxes, yAxes, axisId) => xAxes?.axis[axisId] ?? yAxes?.axis[axisId]);
|
|
90
93
|
export const selectorChartRawAxis = createSelector([selectorChartRawXAxis, selectorChartRawYAxis, (state, axisId) => axisId], (xAxes, yAxes, axisId) => {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AxisItemIdentifier, ChartsAxisProps } from "../../../../models/axis.js";
|
|
2
|
+
export declare const selectorChartsHighlightXAxisIndex: 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("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
3
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
4
|
+
} & {
|
|
5
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
6
|
+
} & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}>, AxisItemIdentifier[], [id?: import("../../../index.js").AxisId | undefined]>;
|
|
7
|
+
export declare const selectorChartsHighlightYAxisIndex: 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("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
8
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
9
|
+
} & {
|
|
10
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
11
|
+
} & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}>, AxisItemIdentifier[], [id?: import("../../../index.js").AxisId | undefined]>;
|
|
12
|
+
export declare const selectorChartsHighlightXAxisValue: 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("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
13
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
14
|
+
} & {
|
|
15
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
16
|
+
} & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}>, {
|
|
17
|
+
value: any;
|
|
18
|
+
axisId: import("../../../index.js").AxisId;
|
|
19
|
+
dataIndex: number;
|
|
20
|
+
}[] | {
|
|
21
|
+
axisId: import("../../../index.js").AxisId;
|
|
22
|
+
dataIndex: number | null;
|
|
23
|
+
value: number | Date;
|
|
24
|
+
}[], [id?: import("../../../index.js").AxisId | undefined]>;
|
|
25
|
+
export declare const selectorChartsHighlightYAxisValue: 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("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
26
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
27
|
+
} & {
|
|
28
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
29
|
+
} & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}>, {
|
|
30
|
+
value: any;
|
|
31
|
+
axisId: import("../../../index.js").AxisId;
|
|
32
|
+
dataIndex: number;
|
|
33
|
+
}[] | {
|
|
34
|
+
axisId: import("../../../index.js").AxisId;
|
|
35
|
+
dataIndex: number | null;
|
|
36
|
+
value: number | Date;
|
|
37
|
+
}[], [id?: import("../../../index.js").AxisId | undefined]>;
|
|
38
|
+
export declare const selectorChartsHighlightXAxis: 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> & {
|
|
39
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
40
|
+
} & Partial<{}> & {
|
|
41
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
42
|
+
}, import("../../../index.js").ComputedAxis<keyof import("../../../index.js").AxisScaleConfig, any, ChartsAxisProps>[], []>;
|
|
43
|
+
export declare const selectorChartsHighlightYAxis: 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> & {
|
|
44
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
45
|
+
} & Partial<{}> & {
|
|
46
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
47
|
+
}, import("../../../index.js").ComputedAxis<keyof import("../../../index.js").AxisScaleConfig, any, ChartsAxisProps>[], []>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { createSelector } from "../../utils/selectors.js";
|
|
3
|
+
import { selectorChartXAxis, selectorChartYAxis } from "./useChartCartesianAxisRendering.selectors.js";
|
|
4
|
+
import { selectorChartsInteractionXAxisIndex, selectorChartsInteractionXAxisValue, selectorChartsInteractionYAxisIndex, selectorChartsInteractionYAxisValue } from "./useChartCartesianInteraction.selectors.js";
|
|
5
|
+
const selectorChartControlledCartesianAxisHighlight = state => state.controlledCartesianAxisHighlight;
|
|
6
|
+
const selectAxisHighlight = (computedIndex, axis, axisItems) => {
|
|
7
|
+
if (axisItems !== undefined) {
|
|
8
|
+
return axisItems.filter(item => axis.axis[item.axisId] !== undefined).map(item => item);
|
|
9
|
+
}
|
|
10
|
+
return computedIndex === null ? [] : [{
|
|
11
|
+
axisId: axis.axisIds[0],
|
|
12
|
+
dataIndex: computedIndex
|
|
13
|
+
}];
|
|
14
|
+
};
|
|
15
|
+
export const selectorChartsHighlightXAxisIndex = createSelector([selectorChartsInteractionXAxisIndex, selectorChartXAxis, selectorChartControlledCartesianAxisHighlight], selectAxisHighlight);
|
|
16
|
+
export const selectorChartsHighlightYAxisIndex = createSelector([selectorChartsInteractionYAxisIndex, selectorChartYAxis, selectorChartControlledCartesianAxisHighlight], selectAxisHighlight);
|
|
17
|
+
const selectAxisHighlightWithValue = (computedIndex, computedValue, axis, axisItems) => {
|
|
18
|
+
if (axisItems !== undefined) {
|
|
19
|
+
return axisItems.map(item => _extends({}, item, {
|
|
20
|
+
value: axis.axis[item.axisId]?.data?.[item.dataIndex]
|
|
21
|
+
})).filter(({
|
|
22
|
+
value
|
|
23
|
+
}) => value !== undefined);
|
|
24
|
+
}
|
|
25
|
+
return computedValue === null ? [] : [{
|
|
26
|
+
axisId: axis.axisIds[0],
|
|
27
|
+
dataIndex: computedIndex,
|
|
28
|
+
value: computedValue
|
|
29
|
+
}];
|
|
30
|
+
};
|
|
31
|
+
export const selectorChartsHighlightXAxisValue = createSelector([selectorChartsInteractionXAxisIndex, selectorChartsInteractionXAxisValue, selectorChartXAxis, selectorChartControlledCartesianAxisHighlight], selectAxisHighlightWithValue);
|
|
32
|
+
export const selectorChartsHighlightYAxisValue = createSelector([selectorChartsInteractionYAxisIndex, selectorChartsInteractionYAxisValue, selectorChartYAxis, selectorChartControlledCartesianAxisHighlight], selectAxisHighlightWithValue);
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get the scale of the axis with highlight if controlled. The default axis otherwise.
|
|
36
|
+
* @param controlledItem The controlled value of highlightedAxis
|
|
37
|
+
* @param axis The axis state after all the processing
|
|
38
|
+
* @returns axis state
|
|
39
|
+
*/
|
|
40
|
+
const selectAxis = (axisItems, axis) => {
|
|
41
|
+
if (axisItems === undefined) {
|
|
42
|
+
return [axis.axis[axis.axisIds[0]]];
|
|
43
|
+
}
|
|
44
|
+
const filteredAxes = axisItems.map(item => axis.axis[item.axisId] ?? null).filter(item => item !== null);
|
|
45
|
+
return filteredAxes;
|
|
46
|
+
};
|
|
47
|
+
export const selectorChartsHighlightXAxis = createSelector([selectorChartControlledCartesianAxisHighlight, selectorChartXAxis], selectAxis);
|
|
48
|
+
export const selectorChartsHighlightYAxis = createSelector([selectorChartControlledCartesianAxisHighlight, selectorChartYAxis], selectAxis);
|