fybdp-d3-kg
Version:
Knowledge Graph using React and D3.js
68 lines (67 loc) • 2.78 kB
TypeScript
import { Component, ReactElement } from 'react';
import { ChartShallowDataShape, ChartInternalShallowDataShape, ChartDataTypes } from '../common/data';
import { LinearAxisProps, LinearAxis } from '../common/Axis';
import { ScatterSeries, ScatterSeriesProps } from './ScatterSeries';
import { GridlineSeries, GridlineSeriesProps } from '../common/Gridline';
import { ZoomPanChangeEvent, ChartZoomPanProps, ChartZoomPan } from '../common/ZoomPan';
import { ChartBrushProps, ChartBrush } from '../common/Brush';
import { ChartProps, ChartContainerChildProps } from '../common/containers/ChartContainer';
interface ScatterPlotProps extends ChartProps {
/**
* Data the chart will receive to render.
*/
data: ChartShallowDataShape[];
/**
* The series component that renders the scatter components.
*/
series: ReactElement<ScatterSeriesProps, typeof ScatterSeries>;
/**
* The linear axis component for the Y Axis of the chart.
*/
yAxis: ReactElement<LinearAxisProps, typeof LinearAxis>;
/**
* The linear axis component for the X Axis of the chart.
*/
xAxis: ReactElement<LinearAxisProps, typeof LinearAxis>;
/**
* The chart's background gridlines component.
*/
gridlines: ReactElement<GridlineSeriesProps, typeof GridlineSeries> | null;
/**
* The chart's brush component.
*/
brush: ReactElement<ChartBrushProps, typeof ChartBrush> | null;
/**
* The chart's zoom pan component.
*/
zoomPan: ReactElement<ChartZoomPanProps, typeof ChartZoomPan> | null;
/**
* Any secondary axis components. Useful for multi-axis charts.
*/
secondaryAxis?: ReactElement<LinearAxisProps, typeof LinearAxis>[];
}
interface ScatterPlotState {
zoomDomain?: [ChartDataTypes, ChartDataTypes];
isZoomed?: boolean;
preventAnimation?: boolean;
zoomControlled: boolean;
}
export declare class ScatterPlot extends Component<ScatterPlotProps, ScatterPlotState> {
static defaultProps: Partial<ScatterPlotProps>;
static getDerivedStateFromProps(props: ScatterPlotProps, state: ScatterPlotState): {
zoomDomain: [ChartDataTypes, ChartDataTypes] | undefined;
isZoomed: boolean;
} | null;
timeout: any;
constructor(props: ScatterPlotProps);
getData: (this: any, data: any) => ChartInternalShallowDataShape[];
getScales(data: ChartInternalShallowDataShape[], chartHeight: number, chartWidth: number): {
data: ChartInternalShallowDataShape[];
yScale: any;
xScale: any;
};
onZoomPan(event: ZoomPanChangeEvent): void;
renderChart(containerProps: ChartContainerChildProps): JSX.Element;
render(): JSX.Element;
}
export {};