@mui/x-charts 8.5.3 → 8.7.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/AnimatedBarElement.js +3 -1
- package/BarChart/BarLabel/BarLabelPlot.d.ts +2 -2
- package/BarChart/BarLabel/BarLabelPlot.js +33 -25
- package/BarChart/BarPlot.js +59 -183
- package/BarChart/barClasses.d.ts +12 -0
- package/BarChart/barClasses.js +25 -0
- package/BarChart/index.d.ts +3 -1
- package/BarChart/index.js +23 -1
- package/BarChart/types.d.ts +5 -1
- package/BarChart/useBarPlotData.d.ts +8 -0
- package/BarChart/useBarPlotData.js +146 -0
- package/CHANGELOG.md +210 -0
- package/ChartContainer/ChartContainer.d.ts +1 -21
- package/ChartContainer/ChartContainer.js +0 -8
- package/ChartContainer/index.d.ts +8 -1
- package/ChartsLegend/ChartsLegend.js +1 -0
- 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/ChartsXAxis/ChartsXAxis.js +4 -108
- package/ChartsXAxis/getVisibleLabels.d.ts +14 -0
- package/ChartsXAxis/getVisibleLabels.js +71 -0
- package/ChartsXAxis/shortenLabels.d.ts +4 -0
- package/ChartsXAxis/shortenLabels.js +48 -0
- package/ChartsYAxis/ChartsYAxis.js +2 -39
- package/ChartsYAxis/shortenLabels.d.ts +4 -0
- package/ChartsYAxis/shortenLabels.js +46 -0
- package/LineChart/AnimatedArea.js +4 -1
- package/LineChart/AnimatedLine.js +4 -1
- package/LineChart/AreaPlot.js +5 -115
- package/LineChart/CircleMarkElement.js +4 -1
- package/LineChart/LinePlot.js +5 -99
- package/LineChart/MarkElement.js +4 -1
- package/LineChart/MarkPlot.js +1 -0
- package/LineChart/useAreaPlotData.d.ts +12 -0
- package/LineChart/useAreaPlotData.js +125 -0
- package/LineChart/useLinePlotData.d.ts +11 -0
- package/LineChart/useLinePlotData.js +108 -0
- package/PieChart/PieArc.js +3 -1
- package/PieChart/PiePlot.js +6 -0
- package/PieChart/index.d.ts +3 -1
- package/PieChart/index.js +18 -1
- package/PieChart/pieClasses.d.ts +12 -0
- package/PieChart/pieClasses.js +24 -0
- package/ScatterChart/Scatter.js +22 -48
- package/ScatterChart/useScatterPlotData.d.ts +8 -0
- package/ScatterChart/useScatterPlotData.js +33 -0
- package/Toolbar/ToolbarButton.js +2 -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/AnimatedBarElement.js +3 -1
- package/esm/BarChart/BarLabel/BarLabelPlot.d.ts +2 -2
- package/esm/BarChart/BarLabel/BarLabelPlot.js +33 -25
- package/esm/BarChart/BarPlot.js +60 -185
- package/esm/BarChart/barClasses.d.ts +12 -0
- package/esm/BarChart/barClasses.js +15 -0
- package/esm/BarChart/index.d.ts +3 -1
- package/esm/BarChart/index.js +2 -1
- package/esm/BarChart/types.d.ts +5 -1
- 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 +0 -8
- package/esm/ChartContainer/index.d.ts +8 -1
- package/esm/ChartContainer/index.js +6 -1
- package/esm/ChartsLegend/ChartsLegend.js +1 -0
- 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/ChartsXAxis/ChartsXAxis.js +2 -106
- package/esm/ChartsXAxis/getVisibleLabels.d.ts +14 -0
- package/esm/ChartsXAxis/getVisibleLabels.js +67 -0
- package/esm/ChartsXAxis/shortenLabels.d.ts +4 -0
- package/esm/ChartsXAxis/shortenLabels.js +42 -0
- package/esm/ChartsYAxis/ChartsYAxis.js +1 -38
- package/esm/ChartsYAxis/shortenLabels.d.ts +4 -0
- package/esm/ChartsYAxis/shortenLabels.js +41 -0
- package/esm/LineChart/AnimatedArea.js +4 -1
- package/esm/LineChart/AnimatedLine.js +4 -1
- package/esm/LineChart/AreaPlot.js +5 -115
- package/esm/LineChart/CircleMarkElement.js +4 -1
- package/esm/LineChart/LinePlot.js +5 -99
- package/esm/LineChart/MarkElement.js +4 -1
- package/esm/LineChart/MarkPlot.js +1 -0
- package/esm/LineChart/useAreaPlotData.d.ts +12 -0
- package/esm/LineChart/useAreaPlotData.js +118 -0
- package/esm/LineChart/useLinePlotData.d.ts +11 -0
- package/esm/LineChart/useLinePlotData.js +101 -0
- package/esm/PieChart/PieArc.js +3 -1
- package/esm/PieChart/PiePlot.js +6 -0
- package/esm/PieChart/index.d.ts +3 -1
- package/esm/PieChart/index.js +2 -1
- package/esm/PieChart/pieClasses.d.ts +12 -0
- package/esm/PieChart/pieClasses.js +15 -0
- package/esm/ScatterChart/Scatter.js +23 -49
- package/esm/ScatterChart/useScatterPlotData.d.ts +8 -0
- package/esm/ScatterChart/useScatterPlotData.js +26 -0
- package/esm/Toolbar/ToolbarButton.js +2 -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/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/components/NotRendered.d.ts +9 -0
- package/esm/internals/components/NotRendered.js +10 -0
- package/esm/internals/index.d.ts +6 -0
- package/esm/internals/index.js +6 -0
- package/esm/internals/plugins/corePlugins/corePlugins.d.ts +3 -2
- package/esm/internals/plugins/corePlugins/corePlugins.js +2 -1
- package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -1
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +2 -2
- 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/useChartAxisSize.selectors.d.ts +4 -4
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +44 -33
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +5 -5
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +7 -7
- 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 +52 -36
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +6 -6
- 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/store/useCharts.d.ts +1 -1
- package/esm/locales/elGR.d.ts +19 -0
- package/esm/locales/elGR.js +15 -0
- package/esm/locales/enUS.d.ts +3 -0
- package/esm/locales/enUS.js +8 -2
- package/esm/locales/frFR.d.ts +3 -0
- package/esm/locales/frFR.js +7 -0
- package/esm/locales/index.d.ts +1 -0
- package/esm/locales/index.js +1 -0
- package/esm/locales/ptBR.d.ts +3 -0
- package/esm/locales/ptBR.js +7 -1
- package/esm/locales/ptPT.d.ts +3 -0
- package/esm/locales/ptPT.js +7 -1
- package/esm/locales/utils/chartsLocaleTextApi.d.ts +17 -0
- package/esm/locales/utils/getChartsLocalization.d.ts +3 -0
- package/esm/locales/utils/imageMimeTypes.d.ts +2 -0
- package/esm/locales/utils/imageMimeTypes.js +5 -0
- package/esm/models/slots/chartsBaseSlotProps.d.ts +4 -0
- 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/components/NotRendered.d.ts +9 -0
- package/internals/components/NotRendered.js +16 -0
- package/internals/index.d.ts +6 -0
- package/internals/index.js +56 -0
- package/internals/plugins/corePlugins/corePlugins.d.ts +3 -2
- package/internals/plugins/corePlugins/corePlugins.js +2 -1
- package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +1 -1
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +1 -1
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +3 -3
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +2 -2
- 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/useChartAxisSize.selectors.d.ts +4 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxis.js +44 -33
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +7 -7
- 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 +52 -36
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +5 -5
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +6 -6
- 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/store/useCharts.d.ts +1 -1
- package/locales/elGR.d.ts +19 -0
- package/locales/elGR.js +21 -0
- package/locales/enUS.d.ts +3 -0
- package/locales/enUS.js +8 -2
- package/locales/frFR.d.ts +3 -0
- package/locales/frFR.js +7 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +11 -0
- package/locales/ptBR.d.ts +3 -0
- package/locales/ptBR.js +7 -1
- package/locales/ptPT.d.ts +3 -0
- package/locales/ptPT.js +7 -1
- package/locales/utils/chartsLocaleTextApi.d.ts +17 -0
- package/locales/utils/getChartsLocalization.d.ts +3 -0
- package/locales/utils/imageMimeTypes.d.ts +2 -0
- package/locales/utils/imageMimeTypes.js +11 -0
- package/models/slots/chartsBaseSlotProps.d.ts +4 -0
- package/package.json +3 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { MoveEvent, PanEvent, PinchEvent, PressEvent, TapEvent, TurnWheelEvent } from '@mui/x-internal-gestures/core';
|
|
2
|
+
import { ChartPluginSignature } from "../../models/index.js";
|
|
3
|
+
export type ChartInteraction = 'pan' | 'panStart' | 'panEnd' | 'pinch' | 'pinchStart' | 'pinchEnd' | 'move' | 'moveStart' | 'moveEnd' | 'quickPress' | 'quickPressEnd' | 'turnWheel' | 'tap';
|
|
4
|
+
export type InteractionListenerResult = {
|
|
5
|
+
cleanup: () => void;
|
|
6
|
+
};
|
|
7
|
+
export type AddInteractionListener = {
|
|
8
|
+
<CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'pan' | 'panStart' | 'panEnd', callback: (event: PanEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
|
|
9
|
+
<CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'pinch' | 'pinchStart' | 'pinchEnd', callback: (event: PinchEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
|
|
10
|
+
<CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'turnWheel', callback: (event: TurnWheelEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
|
|
11
|
+
<CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'move' | 'moveStart' | 'moveEnd', callback: (event: MoveEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
|
|
12
|
+
<CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'tap', callback: (event: TapEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
|
|
13
|
+
<CustomData extends Record<string, unknown> = Record<string, unknown>>(interaction: 'quickPress' | 'quickPressEnd', callback: (event: PressEvent<CustomData>) => void, options?: boolean | AddEventListenerOptions): InteractionListenerResult;
|
|
14
|
+
};
|
|
15
|
+
export interface UseChartInteractionListenerParameters {}
|
|
16
|
+
export interface UseChartInteractionListenerState {}
|
|
17
|
+
export interface UseChartInteractionListenerInstance {
|
|
18
|
+
/**
|
|
19
|
+
* Adds an interaction listener to the SVG element.
|
|
20
|
+
*
|
|
21
|
+
* @param interaction The interaction to listen to.
|
|
22
|
+
* @param callback The callback to call when the interaction occurs.
|
|
23
|
+
*/
|
|
24
|
+
addInteractionListener: AddInteractionListener;
|
|
25
|
+
}
|
|
26
|
+
export type UseChartInteractionListenerSignature = ChartPluginSignature<{
|
|
27
|
+
params: UseChartInteractionListenerParameters;
|
|
28
|
+
defaultizedParams: UseChartInteractionListenerParameters;
|
|
29
|
+
state: UseChartInteractionListenerState;
|
|
30
|
+
instance: UseChartInteractionListenerInstance;
|
|
31
|
+
}>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ChartRootSelector } from "../../utils/selectors.js";
|
|
2
2
|
import { UseChartSeriesSignature } from "./useChartSeries.types.js";
|
|
3
3
|
export declare const selectorChartSeriesState: ChartRootSelector<UseChartSeriesSignature>;
|
|
4
|
-
export declare const selectorChartSeriesProcessed: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
4
|
+
export declare const selectorChartSeriesProcessed: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
5
5
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
6
6
|
} & {
|
|
7
7
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
8
|
}, import("./useChartSeries.types.js").ProcessedSeries<keyof import("../../../index.js").ChartsSeriesConfig>, any[]>;
|
|
9
|
-
export declare const selectorChartSeriesConfig: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
9
|
+
export declare const selectorChartSeriesConfig: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("./useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
10
10
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
11
11
|
} & {
|
|
12
12
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
package/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/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/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/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/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;
|
|
@@ -69,39 +69,52 @@ const useChartCartesianAxis = ({
|
|
|
69
69
|
const usedYAxis = yAxisIds[0];
|
|
70
70
|
React.useEffect(() => {
|
|
71
71
|
const element = svgRef.current;
|
|
72
|
-
if (!isInteractionEnabled || element
|
|
72
|
+
if (!isInteractionEnabled || !element || params.disableAxisListener) {
|
|
73
73
|
return () => {};
|
|
74
74
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const target = 'targetTouches' in event ? event.targetTouches[0] : event;
|
|
80
|
-
const svgPoint = (0, _getSVGPoint.getSVGPoint)(element, target);
|
|
81
|
-
if (!instance.isPointInside(svgPoint.x, svgPoint.y, event.target)) {
|
|
75
|
+
|
|
76
|
+
// Clean the interaction when the mouse leaves the chart.
|
|
77
|
+
const moveEndHandler = instance.addInteractionListener('moveEnd', event => {
|
|
78
|
+
if (!event.detail.activeGestures.pan) {
|
|
82
79
|
instance.cleanInteraction?.();
|
|
83
|
-
return;
|
|
84
80
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (!target) {
|
|
90
|
-
return;
|
|
81
|
+
});
|
|
82
|
+
const panEndHandler = instance.addInteractionListener('panEnd', event => {
|
|
83
|
+
if (!event.detail.activeGestures.move) {
|
|
84
|
+
instance.cleanInteraction?.();
|
|
91
85
|
}
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
});
|
|
87
|
+
const pressEndHandler = instance.addInteractionListener('quickPressEnd', event => {
|
|
88
|
+
if (!event.detail.activeGestures.move && !event.detail.activeGestures.pan) {
|
|
89
|
+
instance.cleanInteraction?.();
|
|
94
90
|
}
|
|
91
|
+
});
|
|
92
|
+
const gestureHandler = event => {
|
|
93
|
+
const srvEvent = event.detail.srcEvent;
|
|
94
|
+
const target = event.detail.target;
|
|
95
|
+
const svgPoint = (0, _getSVGPoint.getSVGPoint)(element, srvEvent);
|
|
96
|
+
|
|
97
|
+
// Release the pointer capture if we are panning, as this would cause the tooltip to
|
|
98
|
+
// be locked to the first "section" it touches.
|
|
99
|
+
if (event.detail.srcEvent.buttons >= 1 && target?.hasPointerCapture(event.detail.srcEvent.pointerId) && !target?.closest('[data-charts-zoom-slider]')) {
|
|
100
|
+
target?.releasePointerCapture(event.detail.srcEvent.pointerId);
|
|
101
|
+
}
|
|
102
|
+
if (!instance.isPointInside(svgPoint.x, svgPoint.y, target)) {
|
|
103
|
+
instance.cleanInteraction?.();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
instance.setPointerCoordinate?.(svgPoint);
|
|
95
107
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
element.addEventListener('pointerleave', handleOut);
|
|
108
|
+
const moveHandler = instance.addInteractionListener('move', gestureHandler);
|
|
109
|
+
const panHandler = instance.addInteractionListener('pan', gestureHandler);
|
|
110
|
+
const pressHandler = instance.addInteractionListener('quickPress', gestureHandler);
|
|
100
111
|
return () => {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
112
|
+
moveHandler.cleanup();
|
|
113
|
+
moveEndHandler.cleanup();
|
|
114
|
+
panHandler.cleanup();
|
|
115
|
+
panEndHandler.cleanup();
|
|
116
|
+
pressHandler.cleanup();
|
|
117
|
+
pressEndHandler.cleanup();
|
|
105
118
|
};
|
|
106
119
|
}, [svgRef, store, xAxisWithScale, usedXAxis, yAxisWithScale, usedYAxis, instance, params.disableAxisListener, isInteractionEnabled]);
|
|
107
120
|
React.useEffect(() => {
|
|
@@ -110,11 +123,10 @@ const useChartCartesianAxis = ({
|
|
|
110
123
|
if (element === null || !onAxisClick) {
|
|
111
124
|
return () => {};
|
|
112
125
|
}
|
|
113
|
-
const
|
|
114
|
-
event.preventDefault();
|
|
126
|
+
const axisClickHandler = instance.addInteractionListener('tap', event => {
|
|
115
127
|
let dataIndex = null;
|
|
116
128
|
let isXAxis = false;
|
|
117
|
-
const svgPoint = (0, _getSVGPoint.getSVGPoint)(element, event);
|
|
129
|
+
const svgPoint = (0, _getSVGPoint.getSVGPoint)(element, event.detail.srcEvent);
|
|
118
130
|
const xIndex = (0, _getAxisValue.getAxisIndex)(xAxisWithScale[usedXAxis], svgPoint.x);
|
|
119
131
|
isXAxis = xIndex !== -1;
|
|
120
132
|
dataIndex = isXAxis ? xIndex : (0, _getAxisValue.getAxisIndex)(yAxisWithScale[usedYAxis], svgPoint.y);
|
|
@@ -137,17 +149,16 @@ const useChartCartesianAxis = ({
|
|
|
137
149
|
}
|
|
138
150
|
});
|
|
139
151
|
});
|
|
140
|
-
onAxisClick(event, {
|
|
152
|
+
onAxisClick(event.detail.srcEvent, {
|
|
141
153
|
dataIndex,
|
|
142
154
|
axisValue,
|
|
143
155
|
seriesValues
|
|
144
156
|
});
|
|
145
|
-
};
|
|
146
|
-
element.addEventListener('click', handleMouseClick);
|
|
157
|
+
});
|
|
147
158
|
return () => {
|
|
148
|
-
|
|
159
|
+
axisClickHandler.cleanup();
|
|
149
160
|
};
|
|
150
|
-
}, [params.onAxisClick, processedSeries, svgRef, xAxisWithScale, xAxisIds, yAxisWithScale, yAxisIds, usedXAxis, usedYAxis]);
|
|
161
|
+
}, [params.onAxisClick, processedSeries, svgRef, xAxisWithScale, xAxisIds, yAxisWithScale, yAxisIds, usedXAxis, usedYAxis, instance]);
|
|
151
162
|
return {};
|
|
152
163
|
};
|
|
153
164
|
exports.useChartCartesianAxis = useChartCartesianAxis;
|
|
@@ -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/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/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/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;
|
|
@@ -26,12 +26,12 @@ export declare const selectorChartAxisZoomOptionsLookup: import("reselect").Sele
|
|
|
26
26
|
/**
|
|
27
27
|
* The only interesting selectors that merge axis data and zoom if provided.
|
|
28
28
|
*/
|
|
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> & {
|
|
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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
30
30
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
31
31
|
} & Partial<{}> & {
|
|
32
32
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
33
33
|
}, 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> & {
|
|
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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & {
|
|
35
35
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
36
36
|
} & Partial<{}> & {
|
|
37
37
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AxisId } from "../../../../models/axis.js";
|
|
2
|
-
export declare const selectorChartsInteractionXAxisIndex: 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("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
2
|
+
export declare const selectorChartsInteractionXAxisIndex: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
3
3
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
4
4
|
} & {
|
|
5
5
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
6
6
|
} & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}>, number | null, [id?: AxisId | undefined]>;
|
|
7
|
-
export declare const selectorChartsInteractionYAxisIndex: 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("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
7
|
+
export declare const selectorChartsInteractionYAxisIndex: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
8
8
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
9
9
|
} & {
|
|
10
10
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -13,12 +13,12 @@ export declare const selectorChartsInteractionYAxisIndex: import("reselect").Sel
|
|
|
13
13
|
* Get interaction values
|
|
14
14
|
*/
|
|
15
15
|
type Value = number | Date | null;
|
|
16
|
-
export declare const selectorChartsInteractionXAxisValue: 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("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
16
|
+
export declare const selectorChartsInteractionXAxisValue: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
17
17
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
18
18
|
} & {
|
|
19
19
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
20
20
|
} & Partial<import("./useChartCartesianAxis.types.js").UseChartCartesianAxisState> & Partial<{}>, Value, [id?: AxisId | undefined]>;
|
|
21
|
-
export declare const selectorChartsInteractionYAxisValue: 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("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
21
|
+
export declare const selectorChartsInteractionYAxisValue: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
22
22
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
23
23
|
} & {
|
|
24
24
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -26,7 +26,7 @@ export declare const selectorChartsInteractionYAxisValue: import("reselect").Sel
|
|
|
26
26
|
/**
|
|
27
27
|
* Get x-axis ids and corresponding data index that should be display in the tooltip.
|
|
28
28
|
*/
|
|
29
|
-
export declare const selectorChartsInteractionTooltipXAxes: 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("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
29
|
+
export declare const selectorChartsInteractionTooltipXAxes: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
30
30
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
31
31
|
} & {
|
|
32
32
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -34,7 +34,7 @@ export declare const selectorChartsInteractionTooltipXAxes: import("reselect").S
|
|
|
34
34
|
/**
|
|
35
35
|
* Get y-axis ids and corresponding data index that should be display in the tooltip.
|
|
36
36
|
*/
|
|
37
|
-
export declare const selectorChartsInteractionTooltipYAxes: 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("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
37
|
+
export declare const selectorChartsInteractionTooltipYAxes: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
38
38
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
39
39
|
} & {
|
|
40
40
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -42,7 +42,7 @@ export declare const selectorChartsInteractionTooltipYAxes: import("reselect").S
|
|
|
42
42
|
/**
|
|
43
43
|
* Return `true` if the axis tooltip has something to display.
|
|
44
44
|
*/
|
|
45
|
-
export declare const selectorChartsInteractionAxisTooltip: 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("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
45
|
+
export declare const selectorChartsInteractionAxisTooltip: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("../useChartInteraction/useChartInteraction.types.js").UseChartInteractionState> & {
|
|
46
46
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
47
47
|
} & {
|
|
48
48
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { SeriesId } from "../../../../models/seriesType/common.js";
|
|
2
2
|
import { HighlightItemData } from "./useChartHighlight.types.js";
|
|
3
3
|
import { HighlightScope } from "./highlightConfig.types.js";
|
|
4
|
-
export declare const selectorChartsHighlightScopePerSeriesId: 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<{}> & {
|
|
4
|
+
export declare const selectorChartsHighlightScopePerSeriesId: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
5
5
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
6
6
|
} & {
|
|
7
7
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
8
|
}, Map<SeriesId, Partial<HighlightScope> | undefined>, any[]>;
|
|
9
|
-
export declare const selectorChartsHighlightedItem: 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 & import("./useChartHighlight.types.js").UseChartHighlightState & Partial<{}> & {
|
|
9
|
+
export declare const selectorChartsHighlightedItem: 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 & import("../../../index.js").UseChartInteractionListenerState & import("./useChartHighlight.types.js").UseChartHighlightState & Partial<{}> & {
|
|
10
10
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
11
11
|
} & {
|
|
12
12
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
13
13
|
}, HighlightItemData | null, any[]>;
|
|
14
|
-
export declare const selectorChartsHighlightScope: 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<{}> & {
|
|
14
|
+
export declare const selectorChartsHighlightScope: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
15
15
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
16
16
|
} & {
|
|
17
17
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
18
18
|
} & import("./useChartHighlight.types.js").UseChartHighlightState, Partial<HighlightScope> | null, any[]>;
|
|
19
|
-
export declare const selectorChartsIsHighlightedCallback: 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<{}> & {
|
|
19
|
+
export declare const selectorChartsIsHighlightedCallback: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
20
20
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
21
21
|
} & {
|
|
22
22
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
23
23
|
} & import("./useChartHighlight.types.js").UseChartHighlightState, (item: HighlightItemData | null) => boolean, any[]>;
|
|
24
|
-
export declare const selectorChartsIsFadedCallback: 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<{}> & {
|
|
24
|
+
export declare const selectorChartsIsFadedCallback: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
25
25
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
26
26
|
} & {
|
|
27
27
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export declare const selectorChartsInteractionIsInitialized: 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("./useChartInteraction.types.js").UseChartInteractionState> & {
|
|
1
|
+
export declare const selectorChartsInteractionIsInitialized: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartInteraction.types.js").UseChartInteractionState> & {
|
|
2
2
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
3
3
|
} & {
|
|
4
4
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
5
5
|
}, boolean, any[]>;
|
|
6
|
-
export declare const selectorChartsInteractionItem: 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("./useChartInteraction.types.js").UseChartInteractionState> & {
|
|
6
|
+
export declare const selectorChartsInteractionItem: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartInteraction.types.js").UseChartInteractionState> & {
|
|
7
7
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
8
|
} & {
|
|
9
9
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
10
10
|
}, import("../../../../index.js").ScatterItemIdentifier | import("../../../../index.js").LineItemIdentifier | import("../../../../index.js").BarItemIdentifier | import("../../../../index.js").PieItemIdentifier | import("../../../../index.js").RadarItemIdentifier | null, any[]>;
|
|
11
|
-
export declare const selectorChartsInteractionPointer: 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("./useChartInteraction.types.js").UseChartInteractionState> & {
|
|
11
|
+
export declare const selectorChartsInteractionPointer: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartInteraction.types.js").UseChartInteractionState> & {
|
|
12
12
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
13
13
|
} & {
|
|
14
14
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
15
15
|
}, import("./useChartInteraction.types.js").Coordinate | null, any[]>;
|
|
16
|
-
export declare const selectorChartsInteractionPointerX: 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("./useChartInteraction.types.js").UseChartInteractionState> & {
|
|
16
|
+
export declare const selectorChartsInteractionPointerX: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartInteraction.types.js").UseChartInteractionState> & {
|
|
17
17
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
18
18
|
} & {
|
|
19
19
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
20
20
|
}, number | null, any[]>;
|
|
21
|
-
export declare const selectorChartsInteractionPointerY: 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("./useChartInteraction.types.js").UseChartInteractionState> & {
|
|
21
|
+
export declare const selectorChartsInteractionPointerY: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartInteraction.types.js").UseChartInteractionState> & {
|
|
22
22
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
23
23
|
} & {
|
|
24
24
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
25
25
|
}, number | null, any[]>;
|
|
26
|
-
export declare const selectorChartsInteractionItemIsDefined: 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("./useChartInteraction.types.js").UseChartInteractionState> & {
|
|
26
|
+
export declare const selectorChartsInteractionItemIsDefined: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartInteraction.types.js").UseChartInteractionState> & {
|
|
27
27
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
28
28
|
} & {
|
|
29
29
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -80,31 +80,57 @@ const useChartPolarAxis = ({
|
|
|
80
80
|
|
|
81
81
|
// Use a ref to avoid rerendering on every mousemove event.
|
|
82
82
|
const mousePosition = React.useRef({
|
|
83
|
-
isInChart: false
|
|
84
|
-
x: -1,
|
|
85
|
-
y: -1
|
|
83
|
+
isInChart: false
|
|
86
84
|
});
|
|
87
85
|
React.useEffect(() => {
|
|
88
86
|
const element = svgRef.current;
|
|
89
87
|
if (!isInteractionEnabled || element === null || params.disableAxisListener) {
|
|
90
88
|
return () => {};
|
|
91
89
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
};
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
90
|
+
|
|
91
|
+
// Clean the interaction when the mouse leaves the chart.
|
|
92
|
+
const moveEndHandler = instance.addInteractionListener('moveEnd', event => {
|
|
93
|
+
if (!event.detail.activeGestures.pan) {
|
|
94
|
+
mousePosition.current.isInChart = false;
|
|
95
|
+
instance.cleanInteraction();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
const panEndHandler = instance.addInteractionListener('panEnd', event => {
|
|
99
|
+
if (!event.detail.activeGestures.move) {
|
|
100
|
+
mousePosition.current.isInChart = false;
|
|
101
|
+
instance.cleanInteraction();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
const pressEndHandler = instance.addInteractionListener('quickPressEnd', event => {
|
|
105
|
+
if (!event.detail.activeGestures.move && !event.detail.activeGestures.pan) {
|
|
106
|
+
mousePosition.current.isInChart = false;
|
|
107
|
+
instance.cleanInteraction();
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
const gestureHandler = event => {
|
|
111
|
+
const srcEvent = event.detail.srcEvent;
|
|
112
|
+
|
|
113
|
+
// On touch, we want to allow user to interact with the entire svg area in
|
|
114
|
+
// order to better display the tooltip.
|
|
115
|
+
if (event.detail.srcEvent.pointerType === 'touch') {
|
|
116
|
+
const svgRect = element.getBoundingClientRect();
|
|
117
|
+
if (srcEvent.clientX < svgRect.left || srcEvent.clientX > svgRect.right || srcEvent.clientY < svgRect.top || srcEvent.clientY > svgRect.bottom) {
|
|
118
|
+
mousePosition.current.isInChart = false;
|
|
119
|
+
instance.cleanInteraction();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const svgPoint = (0, _getSVGPoint.getSVGPoint)(element, srcEvent);
|
|
123
|
+
mousePosition.current.isInChart = true;
|
|
124
|
+
instance.setPointerCoordinate(svgPoint);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// On mouse, we want to restrict the interaction to the drawing area and radar circle.
|
|
129
|
+
|
|
130
|
+
const svgPoint = (0, _getSVGPoint.getSVGPoint)(element, srcEvent);
|
|
105
131
|
|
|
106
132
|
// Test if it's in the drawing area
|
|
107
|
-
if (!instance.isPointInside(svgPoint.x, svgPoint.y, event.target)) {
|
|
133
|
+
if (!instance.isPointInside(svgPoint.x, svgPoint.y, event.detail.target)) {
|
|
108
134
|
if (mousePosition.current.isInChart) {
|
|
109
135
|
instance?.cleanInteraction();
|
|
110
136
|
mousePosition.current.isInChart = false;
|
|
@@ -125,26 +151,16 @@ const useChartPolarAxis = ({
|
|
|
125
151
|
mousePosition.current.isInChart = true;
|
|
126
152
|
instance.setPointerCoordinate?.(svgPoint);
|
|
127
153
|
};
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
if ('hasPointerCapture' in target && target.hasPointerCapture(event.pointerId)) {
|
|
134
|
-
target.releasePointerCapture(event.pointerId);
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
element.addEventListener('pointerdown', handleDown);
|
|
138
|
-
element.addEventListener('pointermove', handleMove);
|
|
139
|
-
element.addEventListener('pointerout', handleOut);
|
|
140
|
-
element.addEventListener('pointercancel', handleOut);
|
|
141
|
-
element.addEventListener('pointerleave', handleOut);
|
|
154
|
+
const moveHandler = instance.addInteractionListener('move', gestureHandler);
|
|
155
|
+
const panHandler = instance.addInteractionListener('pan', gestureHandler);
|
|
156
|
+
const pressHandler = instance.addInteractionListener('quickPress', gestureHandler);
|
|
142
157
|
return () => {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
158
|
+
moveHandler.cleanup();
|
|
159
|
+
moveEndHandler.cleanup();
|
|
160
|
+
panHandler.cleanup();
|
|
161
|
+
panEndHandler.cleanup();
|
|
162
|
+
pressHandler.cleanup();
|
|
163
|
+
pressEndHandler.cleanup();
|
|
148
164
|
};
|
|
149
165
|
}, [svgRef, store, center, radiusAxisWithScale, usedRadiusAxisId, rotationAxisWithScale, usedRotationAxisId, instance, params.disableAxisListener, isInteractionEnabled, svg2rotation]);
|
|
150
166
|
return {
|
|
@@ -4,12 +4,12 @@ export declare const selectorChartPolarAxisState: (state: ChartState<[], [UseCha
|
|
|
4
4
|
rotation: import("../../../index.js").AxisConfig<import("../../../index.js").ScaleName, any, import("../../../index.js").ChartsRotationAxisProps>[];
|
|
5
5
|
radius: import("../../../index.js").AxisConfig<"linear", any, import("../../../index.js").ChartsRadiusAxisProps>[];
|
|
6
6
|
} | undefined;
|
|
7
|
-
export declare const selectorChartRawRotationAxis: 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("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
7
|
+
export declare const selectorChartRawRotationAxis: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
8
8
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
9
9
|
} & {
|
|
10
10
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
11
11
|
}, import("../../../index.js").AxisConfig<keyof import("../../../index.js").AxisScaleConfig, any, import("../../../index.js").ChartsRotationAxisProps>[] | undefined, []>;
|
|
12
|
-
export declare const selectorChartRawRadiusAxis: 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("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
12
|
+
export declare const selectorChartRawRadiusAxis: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
13
13
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
14
14
|
} & {
|
|
15
15
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -17,17 +17,17 @@ export declare const selectorChartRawRadiusAxis: import("reselect").Selector<imp
|
|
|
17
17
|
/**
|
|
18
18
|
* The only interesting selectors that merge axis data and zoom if provided.
|
|
19
19
|
*/
|
|
20
|
-
export declare const selectorChartRotationAxis: 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("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
20
|
+
export declare const selectorChartRotationAxis: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
21
21
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
22
22
|
} & {
|
|
23
23
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
24
24
|
} & Partial<{}> & Partial<import("../useChartCartesianAxis/index.js").UseChartCartesianAxisState>, import("./computeAxisValue.js").ComputeResult<import("../../../index.js").ChartsRotationAxisProps>, []>;
|
|
25
|
-
export declare const selectorChartRadiusAxis: 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("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
25
|
+
export declare const selectorChartRadiusAxis: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<import("./useChartPolarAxis.types.js").UseChartPolarAxisState> & {
|
|
26
26
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
27
27
|
} & {
|
|
28
28
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
29
29
|
} & Partial<{}> & Partial<import("../useChartCartesianAxis/index.js").UseChartCartesianAxisState>, import("./computeAxisValue.js").ComputeResult<import("../../../index.js").ChartsRadiusAxisProps>, []>;
|
|
30
|
-
export declare const selectorChartPolarCenter: 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<{}> & {
|
|
30
|
+
export declare const selectorChartPolarCenter: 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 & import("../../../index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
31
31
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
32
32
|
} & Partial<import("../useChartCartesianAxis/index.js").UseChartCartesianAxisState> & {
|
|
33
33
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|