UNPKG

reaviz

Version:

Data Visualization using React

102 lines (101 loc) 2.89 kB
import { ReactElement, FC } from 'react'; import { PointSeries, PointSeriesProps } from './PointSeries'; import { Area, AreaProps } from './Area'; import { MarkLine, MarkLineProps } from '../../common/MarkLine'; import { ChartInternalDataShape } from '../../common/data'; import { TooltipArea, TooltipAreaProps } from '../../common/Tooltip'; import { Line, LineProps } from './Line'; import { InterpolationTypes } from '../../common/utils/interpolation'; import { ColorSchemeType } from '../../common/color'; import { LinearValueMarker, LinearValueMarkerProps } from '../../common'; export 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. * * @default true */ animated: boolean; /** * Type of area chart to render. * * @default 'standard' */ type: AreaChartTypes; /** * Interpolation type for the area/line. * * @default 'linear' */ interpolation: InterpolationTypes; /** * Tooltip for the chart area. * * @default `<TooltipArea />` */ tooltip: ReactElement<TooltipAreaProps, typeof TooltipArea>; /** * Markline for the chart. * * @default `<MarkLine />` */ markLine: ReactElement<MarkLineProps, typeof MarkLine> | null; /** * Symbols used to show points. * * @default `<PointSeries />` */ symbols: ReactElement<PointSeriesProps, typeof PointSeries> | null; /** * Line that is rendered. * * @default `<Line />` */ line: ReactElement<LineProps, typeof Line> | null; /** * Area that is rendered. * * @default `<Area />` */ area: ReactElement<AreaProps, typeof Area> | null; /** * Color scheme for the series. * * @default 'cybertron' */ colorScheme: ColorSchemeType; /** * Whether the chart has been zoomed or not. Set internally by `AreaChart`. */ isZoomed: boolean; /** * Value markers line for the chart. */ valueMarkers: ReactElement<LinearValueMarkerProps, typeof LinearValueMarker>[] | null; } export declare const AreaSeries: FC<Partial<AreaSeriesProps>>; export declare const AREA_SERIES_DEFAULT_PROPS: Partial<AreaSeriesProps>;