UNPKG

1.77 kBTypeScriptView Raw
1/**
2 * @fileOverview Reference Line
3 */
4import React, { ReactElement } from 'react';
5import { ImplicitLabelType } from '../component/Label';
6import { IfOverflow } from '../util/IfOverflowMatches';
7import { Props as RectangleProps } from '../shape/Rectangle';
8import { CartesianViewBox, D3Scale } from '../util/types';
9import { Props as XAxisProps } from './XAxis';
10import { Props as YAxisProps } from './YAxis';
11interface InternalReferenceAreaProps {
12 viewBox?: CartesianViewBox;
13 xAxis?: Omit<XAxisProps, 'scale'> & {
14 scale: D3Scale<string | number>;
15 };
16 yAxis?: Omit<YAxisProps, 'scale'> & {
17 scale: D3Scale<string | number>;
18 };
19 clipPathId?: number | string;
20}
21interface ReferenceAreaProps extends InternalReferenceAreaProps {
22 isFront?: boolean;
23 /** @deprecated use ifOverflow="extendDomain" */
24 alwaysShow?: boolean;
25 ifOverflow?: IfOverflow;
26 x1?: number | string;
27 x2?: number | string;
28 y1?: number | string;
29 y2?: number | string;
30 className?: number | string;
31 yAxisId?: number | string;
32 xAxisId?: number | string;
33 shape?: ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>);
34 label?: ImplicitLabelType;
35}
36export type Props = RectangleProps & ReferenceAreaProps;
37export declare class ReferenceArea extends React.Component<Props> {
38 static displayName: string;
39 static defaultProps: {
40 isFront: boolean;
41 ifOverflow: string;
42 xAxisId: number;
43 yAxisId: number;
44 r: number;
45 fill: string;
46 fillOpacity: number;
47 stroke: string;
48 strokeWidth: number;
49 };
50 static renderRect: (option: ReferenceAreaProps['shape'], props: any) => React.JSX.Element;
51 render(): React.JSX.Element;
52}
53export {};