@mui/x-charts 8.5.2 → 8.6.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 +55 -40
- 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/CHANGELOG.md +203 -11
- package/ChartsLegend/ChartsLegend.d.ts +1 -0
- package/ChartsLegend/ChartsLegend.js +2 -0
- package/ChartsLegend/ContinuousColorLegend.d.ts +1 -0
- package/ChartsLegend/PiecewiseColorLegend.d.ts +1 -0
- package/ChartsLegend/chartsLegendClasses.d.ts +3 -1
- package/ChartsLegend/chartsLegendClasses.js +2 -1
- package/ChartsSurface/ChartsSurface.d.ts +1 -1
- 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/CircleMarkElement.js +4 -1
- package/LineChart/MarkElement.js +4 -1
- package/LineChart/MarkPlot.js +1 -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.d.ts +2 -0
- package/ScatterChart/Scatter.js +9 -1
- package/ScatterChart/index.d.ts +3 -1
- package/ScatterChart/index.js +16 -1
- package/ScatterChart/scatterClasses.d.ts +8 -0
- package/ScatterChart/scatterClasses.js +22 -0
- package/Toolbar/ToolbarButton.js +2 -0
- 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 +55 -40
- 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/ChartsLegend/ChartsLegend.d.ts +1 -0
- package/esm/ChartsLegend/ChartsLegend.js +2 -0
- package/esm/ChartsLegend/ContinuousColorLegend.d.ts +1 -0
- package/esm/ChartsLegend/PiecewiseColorLegend.d.ts +1 -0
- package/esm/ChartsLegend/chartsLegendClasses.d.ts +3 -1
- package/esm/ChartsLegend/chartsLegendClasses.js +2 -1
- package/esm/ChartsSurface/ChartsSurface.d.ts +1 -1
- 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/CircleMarkElement.js +4 -1
- package/esm/LineChart/MarkElement.js +4 -1
- package/esm/LineChart/MarkPlot.js +1 -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.d.ts +2 -0
- package/esm/ScatterChart/Scatter.js +9 -1
- package/esm/ScatterChart/index.d.ts +3 -1
- package/esm/ScatterChart/index.js +2 -1
- package/esm/ScatterChart/scatterClasses.d.ts +8 -0
- package/esm/ScatterChart/scatterClasses.js +13 -0
- package/esm/Toolbar/ToolbarButton.js +2 -0
- package/esm/hooks/useItemHighlighted.js +2 -2
- package/esm/index.js +1 -1
- package/esm/internals/components/NotRendered.d.ts +9 -0
- package/esm/internals/components/NotRendered.js +10 -0
- package/esm/internals/createSeriesSelectorOfType.js +2 -2
- package/esm/internals/index.d.ts +1 -0
- package/esm/internals/index.js +1 -0
- package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +3 -29
- package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.js +1 -1
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +30 -2
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +14 -724
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +10 -10
- package/esm/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +8 -2
- package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +3 -29
- package/esm/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +1 -1
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +6 -54
- package/esm/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +12 -208
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.d.ts +7 -66
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.js +2 -3
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +21 -6222
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +4 -6
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +50 -5
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +18 -622
- package/esm/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +3 -3
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +18 -230
- package/esm/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +6 -6
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +20 -4
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +17 -2012
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.js +2 -2
- package/esm/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +39 -4
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +3 -27
- package/esm/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +1 -1
- package/esm/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +5 -40
- package/esm/internals/plugins/utils/selectors.d.ts +18 -6
- package/esm/internals/plugins/utils/selectors.js +3 -3
- package/esm/internals/store/useSelector.d.ts +2 -2
- package/esm/internals/store/useSelector.js +2 -2
- 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/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/useItemHighlighted.js +2 -2
- package/index.js +1 -1
- package/internals/components/NotRendered.d.ts +9 -0
- package/internals/components/NotRendered.js +16 -0
- package/internals/createSeriesSelectorOfType.js +2 -2
- package/internals/index.d.ts +1 -0
- package/internals/index.js +12 -0
- package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts +3 -29
- package/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.js +1 -1
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.js +30 -2
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.d.ts +14 -724
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.selectors.js +11 -10
- package/internals/plugins/corePlugins/useChartDimensions/useChartDimensions.types.d.ts +8 -2
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.d.ts +3 -29
- package/internals/plugins/corePlugins/useChartId/useChartId.selectors.js +1 -1
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.d.ts +6 -54
- package/internals/plugins/corePlugins/useChartSeries/useChartSeries.selectors.js +2 -2
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartAxisSize.selectors.d.ts +12 -208
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.d.ts +7 -66
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisLayout.selectors.js +4 -3
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.d.ts +21 -6222
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianAxisRendering.selectors.js +4 -6
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.d.ts +50 -5
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.d.ts +18 -622
- package/internals/plugins/featurePlugins/useChartHighlight/useChartHighlight.selectors.js +3 -3
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.d.ts +18 -230
- package/internals/plugins/featurePlugins/useChartInteraction/useChartInteraction.selectors.js +6 -6
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.js +20 -4
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.d.ts +17 -2012
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarAxis.selectors.js +2 -2
- package/internals/plugins/featurePlugins/useChartPolarAxis/useChartPolarInteraction.selectors.d.ts +39 -4
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.d.ts +3 -27
- package/internals/plugins/featurePlugins/useChartVoronoi/useChartVoronoi.selectors.js +1 -1
- package/internals/plugins/featurePlugins/useChartZAxis/useChartZAxis.selectors.d.ts +5 -40
- package/internals/plugins/utils/selectors.d.ts +18 -6
- package/internals/plugins/utils/selectors.js +3 -3
- package/internals/store/useSelector.d.ts +2 -2
- package/internals/store/useSelector.js +2 -2
- 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/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 -3
|
@@ -14,8 +14,8 @@ import { selectorChartsIsFaded, selectorChartsIsHighlighted } from "../internals
|
|
|
14
14
|
*/
|
|
15
15
|
export function useItemHighlighted(item) {
|
|
16
16
|
const store = useStore();
|
|
17
|
-
const isHighlighted = useSelector(store, selectorChartsIsHighlighted, item);
|
|
18
|
-
const isFaded = useSelector(store, selectorChartsIsFaded, item);
|
|
17
|
+
const isHighlighted = useSelector(store, selectorChartsIsHighlighted, [item]);
|
|
18
|
+
const isFaded = useSelector(store, selectorChartsIsFaded, [item]);
|
|
19
19
|
return {
|
|
20
20
|
isHighlighted,
|
|
21
21
|
isFaded: !isHighlighted && isFaded
|
package/esm/index.js
CHANGED
|
@@ -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
|
+
}
|
|
@@ -31,11 +31,11 @@ export function createSeriesSelectorsOfType(seriesType) {
|
|
|
31
31
|
});
|
|
32
32
|
return ids => {
|
|
33
33
|
const store = useStore();
|
|
34
|
-
return useSelector(store, selectorSeriesWithIds, ids, fastArrayCompare);
|
|
34
|
+
return useSelector(store, selectorSeriesWithIds, [ids], fastArrayCompare);
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
export function createAllSeriesSelectorOfType(seriesType) {
|
|
38
|
-
const selectorSeries = createSelector(selectorChartSeriesProcessed, processedSeries => processedSeries[seriesType]);
|
|
38
|
+
const selectorSeries = createSelector([selectorChartSeriesProcessed], processedSeries => processedSeries[seriesType]);
|
|
39
39
|
return () => {
|
|
40
40
|
const store = useStore();
|
|
41
41
|
return useSelector(store, selectorSeries);
|
package/esm/internals/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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";
|
package/esm/internals/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
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";
|
package/esm/internals/plugins/corePlugins/useChartAnimation/useChartAnimation.selectors.d.ts
CHANGED
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import type { UseChartAnimationSignature } from "./useChartAnimation.types.js";
|
|
3
|
-
export declare const selectorChartSkipAnimation: ((state: 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 & Partial<{}> & {
|
|
4
2
|
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
5
|
-
}) => boolean) & {
|
|
6
|
-
clearCache: () => void;
|
|
7
|
-
resultsCount: () => number;
|
|
8
|
-
resetResultsCount: () => void;
|
|
9
3
|
} & {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
skipAnimationRequests: number;
|
|
13
|
-
}) => boolean;
|
|
14
|
-
memoizedResultFunc: ((resultFuncArgs_0: {
|
|
15
|
-
skip: boolean;
|
|
16
|
-
skipAnimationRequests: number;
|
|
17
|
-
}) => boolean) & {
|
|
18
|
-
clearCache: () => void;
|
|
19
|
-
resultsCount: () => number;
|
|
20
|
-
resetResultsCount: () => void;
|
|
21
|
-
};
|
|
22
|
-
lastResult: () => boolean;
|
|
23
|
-
dependencies: [ChartRootSelector<UseChartAnimationSignature>];
|
|
24
|
-
recomputations: () => number;
|
|
25
|
-
resetRecomputations: () => void;
|
|
26
|
-
dependencyRecomputations: () => number;
|
|
27
|
-
resetDependencyRecomputations: () => void;
|
|
28
|
-
} & {
|
|
29
|
-
memoize: typeof import("reselect").weakMapMemoize;
|
|
30
|
-
argsMemoize: typeof import("reselect").weakMapMemoize;
|
|
31
|
-
};
|
|
4
|
+
cacheKey: import("../../models/index.js").ChartStateCacheKey;
|
|
5
|
+
}, boolean, any[]>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createSelector } from "../../utils/selectors.js";
|
|
2
2
|
const selectorChartAnimationState = state => state.animation;
|
|
3
|
-
export const selectorChartSkipAnimation = createSelector(selectorChartAnimationState, state => state.skip || state.skipAnimationRequests > 0);
|
|
3
|
+
export const selectorChartSkipAnimation = createSelector([selectorChartAnimationState], state => state.skip || state.skipAnimationRequests > 0);
|
|
@@ -8,6 +8,7 @@ import { useSelector } from "../../../store/useSelector.js";
|
|
|
8
8
|
import { DEFAULT_MARGINS } from "../../../../constants/index.js";
|
|
9
9
|
import { selectorChartDrawingArea } from "./useChartDimensions.selectors.js";
|
|
10
10
|
import { defaultizeMargin } from "../../../defaultizeMargin.js";
|
|
11
|
+
import { getSVGPoint } from "../../../getSVGPoint.js";
|
|
11
12
|
const MAX_COMPUTE_RUN = 10;
|
|
12
13
|
export const useChartDimensions = ({
|
|
13
14
|
params,
|
|
@@ -149,16 +150,43 @@ export const useChartDimensions = ({
|
|
|
149
150
|
const isYInside = React.useCallback(y => y >= drawingArea.top - 1 && y <= drawingArea.top + drawingArea.height, [drawingArea.height, drawingArea.top]);
|
|
150
151
|
const isPointInside = React.useCallback((x, y, targetElement) => {
|
|
151
152
|
// 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]')) {
|
|
153
|
+
if (targetElement && 'closest' in targetElement && targetElement.closest('[data-drawing-container]')) {
|
|
153
154
|
return true;
|
|
154
155
|
}
|
|
155
156
|
return isXInside(x) && isYInside(y);
|
|
156
157
|
}, [isXInside, isYInside]);
|
|
158
|
+
const isElementInside = React.useCallback(element => {
|
|
159
|
+
const svgElement = svgRef.current;
|
|
160
|
+
if (!element || !(element instanceof Element) || !svgElement) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
// For element allowed to overflow, wrapping them in <g data-drawing-container /> make them fully part of the drawing area.
|
|
164
|
+
if (element.closest('[data-drawing-container]')) {
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
const rect = element.getBoundingClientRect();
|
|
168
|
+
const {
|
|
169
|
+
x: left,
|
|
170
|
+
y: top
|
|
171
|
+
} = getSVGPoint(svgElement, {
|
|
172
|
+
clientX: rect.left,
|
|
173
|
+
clientY: rect.top
|
|
174
|
+
});
|
|
175
|
+
const {
|
|
176
|
+
x: right,
|
|
177
|
+
y: bottom
|
|
178
|
+
} = getSVGPoint(svgElement, {
|
|
179
|
+
clientX: rect.right,
|
|
180
|
+
clientY: rect.bottom
|
|
181
|
+
});
|
|
182
|
+
return isXInside(left) && isXInside(right) && isYInside(top) && isYInside(bottom);
|
|
183
|
+
}, [isXInside, isYInside, svgRef]);
|
|
157
184
|
return {
|
|
158
185
|
instance: {
|
|
159
186
|
isPointInside,
|
|
160
187
|
isXInside,
|
|
161
|
-
isYInside
|
|
188
|
+
isYInside,
|
|
189
|
+
isElementInside
|
|
162
190
|
}
|
|
163
191
|
};
|
|
164
192
|
};
|