react-financial-charts
Version:
React charts specific to finance.
83 lines (82 loc) • 2.51 kB
TypeScript
import * as React from "react";
import { strokeDashTypes } from "../../utils";
interface StraightLineProps {
readonly x1Value: any;
readonly x2Value: any;
readonly y1Value: any;
readonly y2Value: any;
readonly interactiveCursorClass?: string;
readonly stroke: string;
readonly strokeWidth: number;
readonly strokeOpacity: number;
readonly strokeDasharray: strokeDashTypes;
readonly type: "XLINE" | // extends from -Infinity to +Infinity
"RAY" | // extends to +/-Infinity in one direction
"LINE";
readonly onEdge1Drag: any;
readonly onEdge2Drag: any;
readonly onDragStart: any;
readonly onDrag: any;
readonly onDragComplete: any;
readonly onHover?: any;
readonly onUnHover?: any;
readonly defaultClassName?: string;
readonly r: number;
readonly edgeFill: string;
readonly edgeStroke: string;
readonly edgeStrokeWidth: number;
readonly withEdge: boolean;
readonly children: any;
readonly tolerance: number;
readonly selected: boolean;
}
declare class StraightLine extends React.Component<StraightLineProps> {
static defaultProps: {
onEdge1Drag: () => void;
onEdge2Drag: () => void;
onDragStart: () => void;
onDrag: () => void;
onDragComplete: () => void;
edgeStrokeWidth: number;
edgeStroke: string;
edgeFill: string;
r: number;
withEdge: boolean;
strokeWidth: number;
strokeDasharray: string;
children: () => void;
tolerance: number;
selected: boolean;
};
render(): JSX.Element;
private readonly isHover;
private readonly renderSVG;
private readonly drawOnCanvas;
}
export declare function isHovering2(start: any, end: any, [mouseX, mouseY]: [any, any], tolerance: any): boolean;
export declare function isHovering({ x1Value, y1Value, x2Value, y2Value, mouseXY, type, tolerance, xScale, yScale, }: {
x1Value: any;
y1Value: any;
x2Value: any;
y2Value: any;
mouseXY: any;
type: any;
tolerance: any;
xScale: any;
yScale: any;
}): boolean;
export declare function getSlope(start: any, end: any): number | undefined;
export declare function getYIntercept(m: any, end: any): any;
export declare function generateLine({ type, start, end, xScale, yScale, }: {
type: any;
start: any;
end: any;
xScale: any;
yScale: any;
}): {
x1: any;
y1: any;
x2: any;
y2: any;
};
export default StraightLine;