fybdp-d3-kg
Version:
Knowledge Graph using React and D3.js
95 lines (94 loc) • 3.16 kB
TypeScript
import { Component, ReactElement } from 'react';
import { PointSeries, PointSeriesProps } from './PointSeries';
import { Area, AreaProps } from './Area';
import { MarkLine, MarkLineProps } from '../../common/MarkLine';
import { ChartInternalDataShape, ChartInternalNestedDataShape, ChartInternalShallowDataShape } from '../../common/data';
import { TooltipArea, TooltipAreaProps, TooltipAreaEvent } from '../../common/Tooltip';
import { Line, LineProps } from './Line';
import { InterpolationTypes } from '../../common/utils/interpolation';
import { ColorSchemeType } from '../../common/color';
export declare type AreaChartTypes = 'standard' | 'grouped' | 'stacked' | 'stackedNormalized';
export interface AreaSeriesProps {
/**
* Id set internally by `AreaChart`.
*/
id: string;
/**
* D3 scale for X Axis. Set internally by `AreaChart`.
*/
xScale: any;
/**
* D3 scale for Y Axis. Set internally by `AreaChart`.
*/
yScale: any;
/**
* Parsed data shape. Set internally by `AreaChart`.
*/
data: ChartInternalDataShape[];
/**
* Height of the chart. Set internally by `AreaChart`.
*/
height: number;
/**
* Width of the chart. Set internally by `AreaChart`.
*/
width: number;
/**
* Whether to animate the enter/update/exit.
*/
animated: boolean;
/**
* Type of area chart to render.
*/
type: AreaChartTypes;
/**
* Interpolation type for the area/line.
*/
interpolation: InterpolationTypes;
/**
* Tooltip for the chart area.
*/
tooltip: ReactElement<TooltipAreaProps, typeof TooltipArea>;
/**
* Markline for the chart.
*/
markLine: ReactElement<MarkLineProps, typeof MarkLine> | null;
/**
* Symbols used to show points.
*/
symbols: ReactElement<PointSeriesProps, typeof PointSeries> | null;
/**
* Line that is rendered.
*/
line: ReactElement<LineProps, typeof Line> | null;
/**
* Area that is rendered.
*/
area: ReactElement<AreaProps, typeof Area> | null;
/**
* Color scheme for the series.
*/
colorScheme: ColorSchemeType;
/**
* Whether the chart has been zoomed or not. Set internally by `AreaChart`.
*/
isZoomed: boolean;
}
interface AreaSeriesState {
activeValues?: any;
activePoint?: number;
}
export declare class AreaSeries extends Component<AreaSeriesProps, AreaSeriesState> {
static defaultProps: Partial<AreaSeriesProps>;
state: AreaSeriesState;
getColor(point: any, index: any): any;
onValueEnter(event: TooltipAreaEvent): void;
onValueLeave(): void;
renderArea(data: ChartInternalShallowDataShape[], index?: number): JSX.Element;
renderSymbols(data: ChartInternalShallowDataShape[], index?: number): JSX.Element;
renderMarkLine(): JSX.Element;
renderSingleSeries(data: ChartInternalShallowDataShape[]): JSX.Element;
renderMultiSeries(data: ChartInternalNestedDataShape[]): JSX.Element;
render(): JSX.Element;
}
export {};