@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 @@
|
|
|
1
|
+
export {};
|
package/esm/context/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export type { HighlightScope, FadeOptions, HighlightItemData, HighlightOptions } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
2
|
-
export * from "./useChartApiContext.js";
|
|
2
|
+
export * from "./useChartApiContext.js";
|
|
3
|
+
export type { ChartApi } from "./ChartApi.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ChartApi } from "
|
|
2
|
+
import { ChartApi } from "./ChartApi.js";
|
|
3
3
|
/**
|
|
4
4
|
* The `useChartApiContext` hook provides access to the chart API.
|
|
5
5
|
* This is only available when the chart is rendered within a chart or a `ChartDataProvider` component.
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SeriesItemIdentifier } from "../models/index.js";
|
|
3
|
+
import { UseChartHighlightSignature } from "../internals/plugins/featurePlugins/useChartHighlight/index.js";
|
|
4
|
+
import { UseChartInteractionSignature } from "../internals/plugins/featurePlugins/useChartInteraction/index.js";
|
|
5
|
+
import { ChartItemIdentifier, ChartSeriesType } from "../models/seriesType/config.js";
|
|
6
|
+
import { ChartInstance } from "../internals/plugins/models/index.js";
|
|
3
7
|
export declare const useInteractionItemProps: (data: SeriesItemIdentifier, skip?: boolean) => {
|
|
4
8
|
onPointerEnter?: () => void;
|
|
5
9
|
onPointerLeave?: () => void;
|
|
6
10
|
onPointerDown?: (event: React.PointerEvent) => void;
|
|
7
11
|
};
|
|
8
|
-
export declare const useInteractionAllItemProps: (data: SeriesItemIdentifier[], skip?: boolean) =>
|
|
9
|
-
onPointerEnter?:
|
|
10
|
-
onPointerLeave?:
|
|
11
|
-
onPointerDown?:
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
export declare const useInteractionAllItemProps: (data: SeriesItemIdentifier[], skip?: boolean) => {
|
|
13
|
+
onPointerEnter?: () => void;
|
|
14
|
+
onPointerLeave?: () => void;
|
|
15
|
+
onPointerDown?: (event: React.PointerEvent) => void;
|
|
16
|
+
}[];
|
|
17
|
+
export declare function getInteractionItemProps(instance: ChartInstance<[UseChartInteractionSignature, UseChartHighlightSignature]>, item: ChartItemIdentifier<ChartSeriesType>): {
|
|
18
|
+
onPointerEnter?: () => void;
|
|
19
|
+
onPointerLeave?: () => void;
|
|
20
|
+
onPointerDown?: (event: React.PointerEvent) => void;
|
|
21
|
+
};
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useChartContext } from "../context/ChartProvider/index.js";
|
|
5
|
-
|
|
5
|
+
function onPointerDown(event) {
|
|
6
6
|
if ('hasPointerCapture' in event.currentTarget && event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
7
7
|
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
8
8
|
}
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
10
|
export const useInteractionItemProps = (data, skip) => {
|
|
11
11
|
const {
|
|
12
12
|
instance
|
|
@@ -56,32 +56,32 @@ export const useInteractionAllItemProps = (data, skip) => {
|
|
|
56
56
|
} = useChartContext();
|
|
57
57
|
const results = React.useMemo(() => {
|
|
58
58
|
return data.map(item => {
|
|
59
|
-
|
|
60
|
-
return {};
|
|
61
|
-
}
|
|
62
|
-
const onPointerEnter = () => {
|
|
63
|
-
if (!item) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
instance.setItemInteraction(item);
|
|
67
|
-
instance.setHighlight({
|
|
68
|
-
seriesId: item.seriesId,
|
|
69
|
-
dataIndex: item.dataIndex
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
const onPointerLeave = () => {
|
|
73
|
-
if (!item) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
instance.removeItemInteraction(item);
|
|
77
|
-
instance.clearHighlight();
|
|
78
|
-
};
|
|
79
|
-
return {
|
|
80
|
-
onPointerEnter,
|
|
81
|
-
onPointerLeave,
|
|
82
|
-
onPointerDown
|
|
83
|
-
};
|
|
59
|
+
return skip ? {} : getInteractionItemProps(instance, item);
|
|
84
60
|
});
|
|
85
61
|
}, [data, instance, skip]);
|
|
86
62
|
return results;
|
|
87
|
-
};
|
|
63
|
+
};
|
|
64
|
+
export function getInteractionItemProps(instance, item) {
|
|
65
|
+
function onPointerEnter() {
|
|
66
|
+
if (!item) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
instance.setItemInteraction(item);
|
|
70
|
+
instance.setHighlight({
|
|
71
|
+
seriesId: item.seriesId,
|
|
72
|
+
dataIndex: item.dataIndex
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function onPointerLeave() {
|
|
76
|
+
if (!item) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
instance.removeItemInteraction(item);
|
|
80
|
+
instance.clearHighlight();
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
onPointerEnter,
|
|
84
|
+
onPointerLeave,
|
|
85
|
+
onPointerDown
|
|
86
|
+
};
|
|
87
|
+
}
|
package/esm/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from "./SparkLineChart/index.js";
|
|
|
23
23
|
export * from "./Gauge/index.js";
|
|
24
24
|
export * from "./RadarChart/index.js";
|
|
25
25
|
export * from "./ChartsSurface/index.js";
|
|
26
|
-
export
|
|
26
|
+
export { ChartContainer } from "./ChartContainer/index.js";
|
|
27
|
+
export type { ChartContainerProps } from "./ChartContainer/index.js";
|
|
27
28
|
export * from "./ChartDataProvider/index.js";
|
|
28
29
|
export * from "./Toolbar/index.js";
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-charts v8.
|
|
2
|
+
* @mui/x-charts v8.7.0
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -30,6 +30,6 @@ export * from "./SparkLineChart/index.js";
|
|
|
30
30
|
export * from "./Gauge/index.js";
|
|
31
31
|
export * from "./RadarChart/index.js";
|
|
32
32
|
export * from "./ChartsSurface/index.js";
|
|
33
|
-
export
|
|
33
|
+
export { ChartContainer } from "./ChartContainer/index.js";
|
|
34
34
|
export * from "./ChartDataProvider/index.js";
|
|
35
35
|
export * from "./Toolbar/index.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* This component is used to assert that a certain component should not be rendered.
|
|
4
|
+
* It is used in cases where we want to apply styles to a component that is not rendered because we use the `as` prop (introduced by `styled`) to replace the rendered component.
|
|
5
|
+
* We need it because we don't know the component that will be rendered at the time of writing the styles.
|
|
6
|
+
*
|
|
7
|
+
* @param _props Not used
|
|
8
|
+
*/
|
|
9
|
+
export declare function NotRendered<T>(_props: T): React.ReactNode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This component is used to assert that a certain component should not be rendered.
|
|
3
|
+
* It is used in cases where we want to apply styles to a component that is not rendered because we use the `as` prop (introduced by `styled`) to replace the rendered component.
|
|
4
|
+
* We need it because we don't know the component that will be rendered at the time of writing the styles.
|
|
5
|
+
*
|
|
6
|
+
* @param _props Not used
|
|
7
|
+
*/
|
|
8
|
+
export function NotRendered(_props) {
|
|
9
|
+
throw new Error('Failed assertion: should not be rendered');
|
|
10
|
+
}
|
package/esm/internals/index.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
export * from "./components/ChartsAxesGradients/index.js";
|
|
2
2
|
export * from "./components/ChartsWrapper/index.js";
|
|
3
3
|
export * from "../ChartsLabel/ChartsLabelMark.js";
|
|
4
|
+
export * from "./components/NotRendered.js";
|
|
4
5
|
export { useSeries } from "../hooks/useSeries.js";
|
|
5
6
|
export { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
6
7
|
export { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
7
8
|
export { useScatterChartProps } from "../ScatterChart/useScatterChartProps.js";
|
|
9
|
+
export { useScatterPlotData } from "../ScatterChart/useScatterPlotData.js";
|
|
8
10
|
export { useLineChartProps } from "../LineChart/useLineChartProps.js";
|
|
11
|
+
export { useAreaPlotData } from "../LineChart/useAreaPlotData.js";
|
|
12
|
+
export { useLinePlotData } from "../LineChart/useLinePlotData.js";
|
|
9
13
|
export { useBarChartProps } from "../BarChart/useBarChartProps.js";
|
|
14
|
+
export { useBarPlotData } from "../BarChart/useBarPlotData.js";
|
|
10
15
|
export { useRadarChartProps } from "../RadarChart/useRadarChartProps.js";
|
|
11
16
|
export * from "../ChartContainer/useChartContainerProps.js";
|
|
12
17
|
export * from "../ChartDataProvider/useChartDataProviderProps.js";
|
|
@@ -14,6 +19,7 @@ export * from "./createSeriesSelectorOfType.js";
|
|
|
14
19
|
export * from "./plugins/corePlugins/useChartId/index.js";
|
|
15
20
|
export * from "./plugins/corePlugins/useChartSeries/index.js";
|
|
16
21
|
export * from "./plugins/corePlugins/useChartDimensions/index.js";
|
|
22
|
+
export * from "./plugins/corePlugins/useChartInteractionListener/index.js";
|
|
17
23
|
export * from "./plugins/featurePlugins/useChartZAxis/index.js";
|
|
18
24
|
export * from "./plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
19
25
|
export * from "./plugins/featurePlugins/useChartPolarAxis/index.js";
|
package/esm/internals/index.js
CHANGED
|
@@ -2,14 +2,19 @@
|
|
|
2
2
|
export * from "./components/ChartsAxesGradients/index.js";
|
|
3
3
|
export * from "./components/ChartsWrapper/index.js";
|
|
4
4
|
export * from "../ChartsLabel/ChartsLabelMark.js";
|
|
5
|
+
export * from "./components/NotRendered.js";
|
|
5
6
|
|
|
6
7
|
// hooks
|
|
7
8
|
export { useSeries } from "../hooks/useSeries.js";
|
|
8
9
|
export { useInteractionItemProps } from "../hooks/useInteractionItemProps.js";
|
|
9
10
|
export { useDrawingArea } from "../hooks/useDrawingArea.js";
|
|
10
11
|
export { useScatterChartProps } from "../ScatterChart/useScatterChartProps.js";
|
|
12
|
+
export { useScatterPlotData } from "../ScatterChart/useScatterPlotData.js";
|
|
11
13
|
export { useLineChartProps } from "../LineChart/useLineChartProps.js";
|
|
14
|
+
export { useAreaPlotData } from "../LineChart/useAreaPlotData.js";
|
|
15
|
+
export { useLinePlotData } from "../LineChart/useLinePlotData.js";
|
|
12
16
|
export { useBarChartProps } from "../BarChart/useBarChartProps.js";
|
|
17
|
+
export { useBarPlotData } from "../BarChart/useBarPlotData.js";
|
|
13
18
|
export { useRadarChartProps } from "../RadarChart/useRadarChartProps.js";
|
|
14
19
|
export * from "../ChartContainer/useChartContainerProps.js";
|
|
15
20
|
export * from "../ChartDataProvider/useChartDataProviderProps.js";
|
|
@@ -19,6 +24,7 @@ export * from "./createSeriesSelectorOfType.js";
|
|
|
19
24
|
export * from "./plugins/corePlugins/useChartId/index.js";
|
|
20
25
|
export * from "./plugins/corePlugins/useChartSeries/index.js";
|
|
21
26
|
export * from "./plugins/corePlugins/useChartDimensions/index.js";
|
|
27
|
+
export * from "./plugins/corePlugins/useChartInteractionListener/index.js";
|
|
22
28
|
export * from "./plugins/featurePlugins/useChartZAxis/index.js";
|
|
23
29
|
export * from "./plugins/featurePlugins/useChartCartesianAxis/index.js";
|
|
24
30
|
export * from "./plugins/featurePlugins/useChartPolarAxis/index.js";
|
|
@@ -2,10 +2,11 @@ import { type UseChartAnimationSignature } from "./useChartAnimation/index.js";
|
|
|
2
2
|
import { type UseChartDimensionsSignature } from "./useChartDimensions/index.js";
|
|
3
3
|
import { type UseChartIdSignature, UseChartIdParameters } from "./useChartId/index.js";
|
|
4
4
|
import { type UseChartSeriesSignature } from "./useChartSeries/index.js";
|
|
5
|
+
import { type UseChartInteractionListenerSignature } from "./useChartInteractionListener/index.js";
|
|
5
6
|
/**
|
|
6
7
|
* Internal plugins that create the tools used by the other plugins.
|
|
7
8
|
* These plugins are used by the Charts components.
|
|
8
9
|
*/
|
|
9
|
-
export declare const CHART_CORE_PLUGINS: readonly [import("../models/index.js").ChartPlugin<UseChartIdSignature>, import("../models/index.js").ChartPlugin<UseChartDimensionsSignature>, import("../models/index.js").ChartPlugin<UseChartSeriesSignature>, import("../models/index.js").ChartPlugin<UseChartAnimationSignature>];
|
|
10
|
-
export type ChartCorePluginSignatures = [UseChartIdSignature, UseChartDimensionsSignature, UseChartSeriesSignature, UseChartAnimationSignature];
|
|
10
|
+
export declare const CHART_CORE_PLUGINS: readonly [import("../models/index.js").ChartPlugin<UseChartIdSignature>, import("../models/index.js").ChartPlugin<UseChartDimensionsSignature>, import("../models/index.js").ChartPlugin<UseChartSeriesSignature>, import("../models/index.js").ChartPlugin<UseChartInteractionListenerSignature>, import("../models/index.js").ChartPlugin<UseChartAnimationSignature>];
|
|
11
|
+
export type ChartCorePluginSignatures = [UseChartIdSignature, UseChartDimensionsSignature, UseChartSeriesSignature, UseChartAnimationSignature, UseChartInteractionListenerSignature];
|
|
11
12
|
export interface ChartCorePluginParameters extends UseChartIdParameters {}
|
|
@@ -2,9 +2,10 @@ import { useChartAnimation } from "./useChartAnimation/index.js";
|
|
|
2
2
|
import { useChartDimensions } from "./useChartDimensions/index.js";
|
|
3
3
|
import { useChartId } from "./useChartId/index.js";
|
|
4
4
|
import { useChartSeries } from "./useChartSeries/index.js";
|
|
5
|
+
import { useChartInteractionListener } from "./useChartInteractionListener/index.js";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal plugins that create the tools used by the other plugins.
|
|
8
9
|
* These plugins are used by the Charts components.
|
|
9
10
|
*/
|
|
10
|
-
export const CHART_CORE_PLUGINS = [useChartId, useChartDimensions, useChartSeries, useChartAnimation];
|
|
11
|
+
export const CHART_CORE_PLUGINS = [useChartId, useChartDimensions, useChartSeries, useChartInteractionListener, useChartAnimation];
|
package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const selectorChartSkipAnimation: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("./useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
1
|
+
export declare const selectorChartSkipAnimation: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("./useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
2
2
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
3
3
|
} & {
|
|
4
4
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -149,7 +149,7 @@ export const useChartDimensions = ({
|
|
|
149
149
|
const isYInside = React.useCallback(y => y >= drawingArea.top - 1 && y <= drawingArea.top + drawingArea.height, [drawingArea.height, drawingArea.top]);
|
|
150
150
|
const isPointInside = React.useCallback((x, y, targetElement) => {
|
|
151
151
|
// For element allowed to overflow, wrapping them in <g data-drawing-container /> make them fully part of the drawing area.
|
|
152
|
-
if (targetElement && targetElement.closest('[data-drawing-container]')) {
|
|
152
|
+
if (targetElement && 'closest' in targetElement && targetElement.closest('[data-drawing-container]')) {
|
|
153
153
|
return true;
|
|
154
154
|
}
|
|
155
155
|
return isXInside(x) && isYInside(y);
|
package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { UseChartDimensionsSignature } from "./useChartDimensions.types.js"
|
|
|
3
3
|
import { ChartState } from "../../models/chart.js";
|
|
4
4
|
export declare const selectorChartDimensionsState: ChartRootSelector<UseChartDimensionsSignature>;
|
|
5
5
|
export declare const selectorChartMargin: (state: ChartState<[UseChartDimensionsSignature]>) => import("./useChartDimensions.types.js").ChartMargin;
|
|
6
|
-
export declare const selectorChartDrawingArea: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
6
|
+
export declare const selectorChartDrawingArea: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
7
7
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
8
|
} & Partial<import("../../../index.js").UseChartCartesianAxisState> & {
|
|
9
9
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -15,7 +15,7 @@ export declare const selectorChartDrawingArea: import("reselect").Selector<impor
|
|
|
15
15
|
top: number;
|
|
16
16
|
bottom: number;
|
|
17
17
|
}, []>;
|
|
18
|
-
export declare const selectorChartPropsSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
18
|
+
export declare const selectorChartPropsSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
19
19
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
20
20
|
} & {
|
|
21
21
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -23,7 +23,7 @@ export declare const selectorChartPropsSize: import("reselect").Selector<import(
|
|
|
23
23
|
width: number | undefined;
|
|
24
24
|
height: number | undefined;
|
|
25
25
|
}, any[]>;
|
|
26
|
-
export declare const selectorChartContainerSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
26
|
+
export declare const selectorChartContainerSize: import("reselect").Selector<import("../useChartId/useChartId.types.js").UseChartIdState & import("./useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
27
27
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
28
28
|
} & {
|
|
29
29
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -67,10 +67,10 @@ export interface UseChartDimensionsInstance {
|
|
|
67
67
|
* Checks if a point is inside the drawing area.
|
|
68
68
|
* @param {number} x The x coordinate of the point.
|
|
69
69
|
* @param {number} y The y coordinate of the point.
|
|
70
|
-
* @param {Element} targetElement The element to check if it is allowed to overflow the drawing area.
|
|
70
|
+
* @param {Element | EventTarget | null} targetElement The element to check if it is allowed to overflow the drawing area.
|
|
71
71
|
* @returns {boolean} `true` if the point is inside the drawing area, `false` otherwise.
|
|
72
72
|
*/
|
|
73
|
-
isPointInside: (x: number, y: number, targetElement?: Element) => boolean;
|
|
73
|
+
isPointInside: (x: number, y: number, targetElement?: Element | EventTarget | null) => boolean;
|
|
74
74
|
/**
|
|
75
75
|
* Checks if the x coordinate is inside the drawing area.
|
|
76
76
|
* @param {number} x The x coordinate of the point.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @param {ChartState<[UseChartIdSignature]>} state The state of the chart.
|
|
4
4
|
* @returns {string} The id attribute of the chart.
|
|
5
5
|
*/
|
|
6
|
-
export declare const selectorChartId: import("reselect").Selector<import("./useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & Partial<{}> & {
|
|
6
|
+
export declare const selectorChartId: import("reselect").Selector<import("./useChartId.types.js").UseChartIdState & import("../useChartDimensions/useChartDimensions.types.js").UseChartDimensionsState & import("../useChartSeries/useChartSeries.types.js").UseChartSeriesState<keyof import("../../../index.js").ChartsSeriesConfig> & import("../useChartAnimation/useChartAnimation.types.js").UseChartAnimationState & import("../useChartInteractionListener/index.js").UseChartInteractionListenerState & Partial<{}> & {
|
|
7
7
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
8
8
|
} & {
|
|
9
9
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { useChartInteractionListener } from "./useChartInteractionListener.js";
|
|
2
|
+
export type { UseChartInteractionListenerParameters, UseChartInteractionListenerState, UseChartInteractionListenerInstance, UseChartInteractionListenerSignature, ChartInteraction } from "./useChartInteractionListener.types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useChartInteractionListener } from "./useChartInteractionListener.js";
|
package/esm/internals/plugins/corePlugins/useChartInteractionListener/useChartInteractionListener.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { GestureManager, MoveGesture, PanGesture, PinchGesture, PressGesture, TapGesture, TurnWheelGesture } from '@mui/x-internal-gestures/core';
|
|
5
|
+
const preventDefault = event => event.preventDefault();
|
|
6
|
+
export const useChartInteractionListener = ({
|
|
7
|
+
svgRef
|
|
8
|
+
}) => {
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
const svg = svgRef.current;
|
|
11
|
+
if (!svg) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
const gestureManager = new GestureManager({
|
|
15
|
+
gestures: [new PanGesture({
|
|
16
|
+
name: 'pan',
|
|
17
|
+
threshold: 0,
|
|
18
|
+
maxPointers: 1
|
|
19
|
+
}), new MoveGesture({
|
|
20
|
+
name: 'move',
|
|
21
|
+
preventIf: ['pan', 'pinch'] // Prevent move gesture when pan is active
|
|
22
|
+
}), new PinchGesture({
|
|
23
|
+
name: 'pinch',
|
|
24
|
+
threshold: 5,
|
|
25
|
+
preventIf: ['pan']
|
|
26
|
+
}), new TurnWheelGesture({
|
|
27
|
+
name: 'turnWheel',
|
|
28
|
+
sensitivity: 0.01,
|
|
29
|
+
initialDelta: 1
|
|
30
|
+
}), new TapGesture({
|
|
31
|
+
name: 'tap',
|
|
32
|
+
maxDistance: 10,
|
|
33
|
+
preventIf: ['pan', 'pinch']
|
|
34
|
+
}), new PressGesture({
|
|
35
|
+
name: 'quickPress',
|
|
36
|
+
duration: 50,
|
|
37
|
+
maxDistance: 10
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
gestureManager.registerElement(['pan', 'move', 'pinch', 'turnWheel', 'tap', 'quickPress'], svg);
|
|
41
|
+
return () => {
|
|
42
|
+
// Cleanup gesture manager
|
|
43
|
+
gestureManager.destroy();
|
|
44
|
+
};
|
|
45
|
+
}, [svgRef]);
|
|
46
|
+
const addInteractionListener = React.useCallback((interaction, callback, options) => {
|
|
47
|
+
// Forcefully cast the svgRef to any, it is annoying to fix the types.
|
|
48
|
+
const svg = svgRef.current;
|
|
49
|
+
svg?.addEventListener(interaction, callback, options);
|
|
50
|
+
return {
|
|
51
|
+
cleanup: () => svg?.removeEventListener(interaction, callback)
|
|
52
|
+
};
|
|
53
|
+
}, [svgRef]);
|
|
54
|
+
React.useEffect(() => {
|
|
55
|
+
const svg = svgRef.current;
|
|
56
|
+
|
|
57
|
+
// Disable gesture on safari
|
|
58
|
+
// https://use-gesture.netlify.app/docs/gestures/#about-the-pinch-gesture
|
|
59
|
+
svg?.addEventListener('gesturestart', preventDefault);
|
|
60
|
+
svg?.addEventListener('gesturechange', preventDefault);
|
|
61
|
+
svg?.addEventListener('gestureend', preventDefault);
|
|
62
|
+
return () => {
|
|
63
|
+
svg?.removeEventListener('gesturestart', preventDefault);
|
|
64
|
+
svg?.removeEventListener('gesturechange', preventDefault);
|
|
65
|
+
svg?.removeEventListener('gestureend', preventDefault);
|
|
66
|
+
};
|
|
67
|
+
}, [svgRef]);
|
|
68
|
+
return {
|
|
69
|
+
instance: {
|
|
70
|
+
addInteractionListener
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
useChartInteractionListener.params = {};
|
|
75
|
+
useChartInteractionListener.getInitialState = () => {
|
|
76
|
+
return {};
|
|
77
|
+
};
|
|
@@ -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
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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/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/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;
|