@react-financial-charts/interactive
Version:
Interactive features for react-financial-charts
77 lines (76 loc) • 2.59 kB
TypeScript
import * as React from "react";
import { strokeDashTypes } from "@react-financial-charts/core";
export interface EachTrendLineProps {
readonly x1Value: any;
readonly x2Value: any;
readonly y1Value: any;
readonly y2Value: any;
readonly index?: number;
readonly type: "XLINE" | "RAY" | "LINE";
readonly onDrag: (e: React.MouseEvent, index: number | undefined, moreProps: any) => void;
readonly onEdge1Drag: any;
readonly onEdge2Drag: any;
readonly onDragComplete?: (e: React.MouseEvent, moreProps: any) => void;
readonly onSelect: (e: React.MouseEvent, interactives: any[], moreProps: any) => void;
readonly r: number;
readonly strokeOpacity: number;
readonly defaultClassName?: string;
readonly selected?: boolean;
readonly strokeStyle: string;
readonly strokeWidth: number;
readonly strokeDasharray: strokeDashTypes;
readonly edgeStrokeWidth: number;
readonly edgeStroke: string;
readonly edgeInteractiveCursor: string;
readonly lineInteractiveCursor: string;
readonly edgeFill: string;
readonly hoverText: {
readonly enable: boolean;
readonly fontFamily: string;
readonly fontSize: number;
readonly fill: string;
readonly text: string;
readonly selectedText: string;
readonly bgFill: string;
readonly bgOpacity: number;
readonly bgWidth: number | string;
readonly bgHeight: number | string;
};
}
interface EachTrendLineState {
anchor?: string;
hover?: any;
}
export declare class EachTrendLine extends React.Component<EachTrendLineProps, EachTrendLineState> {
static defaultProps: {
onDrag: () => void;
onEdge1Drag: () => void;
onEdge2Drag: () => void;
onSelect: () => void;
selected: boolean;
edgeStroke: string;
edgeFill: string;
edgeStrokeWidth: number;
r: number;
strokeWidth: number;
strokeDasharray: string;
hoverText: {
enable: boolean;
};
};
private dragStart;
private isHover;
private saveNodeType;
constructor(props: EachTrendLineProps);
render(): JSX.Element;
private readonly handleHover;
private readonly handleEdge2Drag;
private readonly handleEdge1Drag;
private readonly handleDragComplete;
private readonly handleEdge2DragStart;
private readonly handleEdge1DragStart;
private readonly handleLineDrag;
private readonly handleLineDragStart;
}
export declare function getNewXY(moreProps: any): any[];
export {};