react-financial-charts
Version:
React charts specific to finance.
50 lines (49 loc) • 1.67 kB
TypeScript
import * as PropTypes from "prop-types";
import * as React from "react";
import { PureComponent } from "./utils/PureComponent";
interface ChartProps {
readonly height?: number;
readonly origin?: number[] | ((width: number, height: number) => number[]);
readonly id: number | string;
readonly yExtents?: number[] | ((data: any) => number | number[]);
readonly yExtentsCalculator?: any;
readonly onContextMenu?: (props: any, event: React.MouseEvent) => void;
readonly yScale?: any;
readonly flipYScale?: boolean;
readonly padding?: number | {
top: number;
bottom: number;
};
}
export declare class Chart extends PureComponent<ChartProps> {
static defaultProps: {
id: number;
origin: number[];
padding: number;
yScale: import("d3-scale").ScaleLinear<number, number>;
flipYScale: boolean;
yPan: boolean;
yPanEnabled: boolean;
onContextMenu: () => void;
};
static contextTypes: {
chartConfig: PropTypes.Requireable<any[]>;
subscribe: PropTypes.Validator<(...args: any[]) => any>;
unsubscribe: PropTypes.Validator<(...args: any[]) => any>;
};
static childContextTypes: {
chartConfig: PropTypes.Validator<object>;
chartId: PropTypes.Validator<string | number>;
};
constructor(props: ChartProps, context: any);
componentDidMount(): void;
componentWillUnmount(): void;
listener(type: any, moreProps: any, state: any, e: any): void;
yScale(): any;
getChildContext(): {
chartId: string | number;
chartConfig: any;
};
render(): JSX.Element;
}
export {};