1 | import React, { ReactElement, SVGProps } from 'react';
|
2 | import { ImplicitLabelType } from '../component/Label';
|
3 | import { IfOverflow } from '../util/IfOverflowMatches';
|
4 | import { CartesianViewBox, D3Scale } from '../util/types';
|
5 | import { Props as XAxisProps } from './XAxis';
|
6 | import { Props as YAxisProps } from './YAxis';
|
7 | interface InternalReferenceLineProps {
|
8 | viewBox?: CartesianViewBox;
|
9 | xAxis?: Omit<XAxisProps, 'scale'> & {
|
10 | scale: D3Scale<string | number>;
|
11 | };
|
12 | yAxis?: Omit<YAxisProps, 'scale'> & {
|
13 | scale: D3Scale<string | number>;
|
14 | };
|
15 | clipPathId?: number | string;
|
16 | }
|
17 | export type Segment = {
|
18 | x?: number | string;
|
19 | y?: number | string;
|
20 | };
|
21 | export type ReferenceLinePosition = 'middle' | 'start' | 'end';
|
22 | interface ReferenceLineProps extends InternalReferenceLineProps {
|
23 | isFront?: boolean;
|
24 | alwaysShow?: boolean;
|
25 | ifOverflow?: IfOverflow;
|
26 | x?: number | string;
|
27 | y?: number | string;
|
28 | segment?: ReadonlyArray<Segment>;
|
29 | position?: ReferenceLinePosition;
|
30 | className?: number | string;
|
31 | yAxisId?: number | string;
|
32 | xAxisId?: number | string;
|
33 | shape?: ReactElement<SVGElement> | ((props: any) => ReactElement<SVGElement>);
|
34 | label?: ImplicitLabelType;
|
35 | }
|
36 | export type Props = Omit<SVGProps<SVGLineElement>, 'viewBox'> & ReferenceLineProps;
|
37 | type EndPointsPropsSubset = {
|
38 | alwaysShow?: boolean;
|
39 | ifOverflow?: IfOverflow;
|
40 | segment?: ReadonlyArray<Segment>;
|
41 | x?: number | string;
|
42 | y?: number | string;
|
43 | };
|
44 | export declare const getEndPoints: (scales: any, isFixedX: boolean, isFixedY: boolean, isSegment: boolean, viewBox: CartesianViewBox, position: Props['position'], xAxisOrientation: XAxisProps['orientation'], yAxisOrientation: YAxisProps['orientation'], props: EndPointsPropsSubset) => any[];
|
45 | export declare function ReferenceLine(props: Props): React.JSX.Element;
|
46 | export declare namespace ReferenceLine {
|
47 | var displayName: string;
|
48 | var defaultProps: {
|
49 | isFront: boolean;
|
50 | ifOverflow: string;
|
51 | xAxisId: number;
|
52 | yAxisId: number;
|
53 | fill: string;
|
54 | stroke: string;
|
55 | fillOpacity: number;
|
56 | strokeWidth: number;
|
57 | position: string;
|
58 | };
|
59 | }
|
60 | export {};
|