@react-financial-charts/interactive
Version:
Interactive features for react-financial-charts
78 lines (77 loc) • 2.64 kB
TypeScript
import * as React from "react";
import { strokeDashTypes } from "@react-financial-charts/core";
export interface TrendLineProps {
readonly snap: boolean;
readonly enabled: boolean;
readonly snapTo?: (datum: any) => number | number[];
readonly shouldDisableSnap?: (e: React.MouseEvent) => boolean;
readonly onStart: (e: React.MouseEvent, moreProps: any) => void;
readonly onComplete?: (e: React.MouseEvent, newTrends: any[], moreProps: any) => void;
readonly onSelect?: (e: React.MouseEvent, interactives: any[], moreProps: any) => void;
readonly currentPositionStroke?: string;
readonly currentPositionStrokeWidth?: number;
readonly currentPositionstrokeOpacity?: number;
readonly currentPositionRadius?: number;
readonly type: "XLINE" | "RAY" | "LINE";
readonly hoverText: object;
readonly trends: any[];
readonly appearance: {
readonly strokeStyle: string;
readonly strokeWidth: number;
readonly strokeDasharray: strokeDashTypes;
readonly edgeStrokeWidth: number;
readonly edgeFill: string;
readonly edgeStroke: string;
};
}
interface TrendLineState {
current?: any;
override?: any;
trends?: any;
}
export declare class TrendLine extends React.Component<TrendLineProps, TrendLineState> {
static defaultProps: {
type: string;
onStart: () => void;
onSelect: () => void;
currentPositionStroke: string;
currentPositionstrokeOpacity: number;
currentPositionStrokeWidth: number;
currentPositionRadius: number;
shouldDisableSnap: (e: React.MouseEvent) => boolean;
hoverText: {
enable: boolean;
bgHeight: string;
bgWidth: string;
text: string;
selectedText: string;
fontFamily: string;
fontSize: number;
fill: string;
bgFill: string;
bgOpacity: number;
};
trends: never[];
appearance: {
strokeStyle: string;
strokeWidth: number;
strokeDasharray: string;
edgeStrokeWidth: number;
edgeFill: string;
edgeStroke: string;
r: number;
};
};
private getSelectionState;
private mouseMoved;
private saveNodeType;
private terminate;
constructor(props: TrendLineProps);
render(): JSX.Element;
private readonly handleEnd;
private readonly handleStart;
private readonly handleDrawLine;
private readonly handleDragLineComplete;
private readonly handleDragLine;
}
export {};