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