UNPKG

1.42 kBTypeScriptView Raw
1import React, { SVGProps } from 'react';
2import { Props as XAxisProps } from './XAxis';
3import { Props as YAxisProps } from './YAxis';
4import { D3Scale, DataKey } from '../util/types';
5import { BarRectangleItem } from './Bar';
6import { LinePointItem } from './Line';
7import { ScatterPointItem } from './Scatter';
8export interface ErrorBarDataItem {
9 x: number;
10 y: number;
11 value: number;
12 errorVal?: number[] | number;
13}
14export type ErrorBarDataPointFormatter = (entry: BarRectangleItem | LinePointItem | ScatterPointItem, dataKey: DataKey<any>) => ErrorBarDataItem;
15interface InternalErrorBarProps {
16 xAxis?: Omit<XAxisProps, 'scale'> & {
17 scale: D3Scale<string | number>;
18 };
19 yAxis?: Omit<YAxisProps, 'scale'> & {
20 scale: D3Scale<string | number>;
21 };
22 data?: any[];
23 layout?: 'horizontal' | 'vertical';
24 dataPointFormatter?: ErrorBarDataPointFormatter;
25 offset?: number;
26}
27interface ErrorBarProps extends InternalErrorBarProps {
28 dataKey: DataKey<any>;
29 width?: number;
30 direction?: 'x' | 'y';
31}
32export type Props = SVGProps<SVGLineElement> & ErrorBarProps;
33export declare function ErrorBar(props: Props): React.JSX.Element;
34export declare namespace ErrorBar {
35 var defaultProps: {
36 stroke: string;
37 strokeWidth: number;
38 width: number;
39 offset: number;
40 layout: string;
41 };
42 var displayName: string;
43}
44export {};