recharts
Version:
React charts
29 lines (28 loc) • 1.07 kB
TypeScript
import * as React from 'react';
import { AxisId } from '../state/cartesianAxisSlice';
import { CartesianViewBoxRequired } from '../util/types';
type GraphicalItemClipPathProps = {
xAxisId: AxisId;
yAxisId: AxisId;
clipPathId: string;
};
export declare function useNeedsClip(xAxisId: AxisId, yAxisId: AxisId): {
needClip: boolean;
needClipX: boolean;
needClipY: boolean;
};
/**
* The area that a graphical item is clipped to.
* In a dimension that is not clipped (`isXClipped` or `isYClipped` is false),
* the area reaches past the plot area on both sides.
*/
export type GraphicalItemClipArea = CartesianViewBoxRequired & {
isXClipped: boolean;
isYClipped: boolean;
};
/**
* @returns the area that the graphical item is clipped to, or undefined if it is not clipped
*/
export declare function useGraphicalItemClipArea(xAxisId: AxisId, yAxisId: AxisId): GraphicalItemClipArea | undefined;
export declare function GraphicalItemClipPath({ xAxisId, yAxisId, clipPathId }: GraphicalItemClipPathProps): React.JSX.Element | null;
export {};