UNPKG

3.46 kBTypeScriptView Raw
1import React, { PureComponent, ReactElement } from 'react';
2import { Props as SectorProps } from '../shape/Sector';
3import { ImplicitLabelListType } from '../component/LabelList';
4import { LegendType, TooltipType, AnimationTiming, TickItem, PresentationAttributesAdaptChildEvent, AnimationDuration, ActiveShape } from '../util/types';
5type RadialBarDataItem = SectorProps & {
6 value?: any;
7 payload?: any;
8 background?: SectorProps;
9};
10type RadialBarBackground = ActiveShape<SectorProps>;
11interface InternalRadialBarProps {
12 animationId?: string | number;
13 className?: string;
14 angleAxisId?: string | number;
15 radiusAxisId?: string | number;
16 startAngle?: number;
17 endAngle?: number;
18 shape?: ActiveShape<SectorProps, SVGPathElement>;
19 activeShape?: ActiveShape<SectorProps, SVGPathElement>;
20 activeIndex?: number;
21 dataKey: string | number | ((obj: any) => any);
22 cornerRadius?: string | number;
23 forceCornerRadius?: boolean;
24 cornerIsExternal?: boolean;
25 minPointSize?: number;
26 maxBarSize?: number;
27 data?: RadialBarDataItem[];
28 legendType?: LegendType;
29 tooltipType?: TooltipType;
30 hide?: boolean;
31 label?: ImplicitLabelListType<any>;
32 stackId?: string | number;
33 background?: RadialBarBackground;
34 onAnimationStart?: () => void;
35 onAnimationEnd?: () => void;
36 isAnimationActive?: boolean;
37 animationBegin?: number;
38 animationDuration?: AnimationDuration;
39 animationEasing?: AnimationTiming;
40}
41export type RadialBarProps = PresentationAttributesAdaptChildEvent<any, SVGElement> & InternalRadialBarProps;
42interface State {
43 readonly isAnimationFinished?: boolean;
44 readonly prevData?: RadialBarDataItem[];
45 readonly curData?: RadialBarDataItem[];
46 readonly prevAnimationId?: string | number;
47}
48export declare class RadialBar extends PureComponent<RadialBarProps, State> {
49 static displayName: string;
50 static defaultProps: {
51 angleAxisId: number;
52 radiusAxisId: number;
53 minPointSize: number;
54 hide: boolean;
55 legendType: string;
56 data: RadialBarDataItem[];
57 isAnimationActive: boolean;
58 animationBegin: number;
59 animationDuration: number;
60 animationEasing: string;
61 forceCornerRadius: boolean;
62 cornerIsExternal: boolean;
63 };
64 static getComposedData: ({ item, props, radiusAxis, radiusAxisTicks, angleAxis, angleAxisTicks, displayedData, dataKey, stackedData, barPosition, bandSize, dataStartIndex, }: {
65 item: ReactElement;
66 props: any;
67 radiusAxis: any;
68 radiusAxisTicks: Array<TickItem>;
69 angleAxis: any;
70 angleAxisTicks: Array<TickItem>;
71 displayedData: any[];
72 dataKey: RadialBarProps['dataKey'];
73 stackedData?: any[];
74 barPosition?: any[];
75 bandSize?: number;
76 dataStartIndex: number;
77 }) => {
78 data: any[];
79 layout: any;
80 };
81 state: State;
82 static getDerivedStateFromProps(nextProps: RadialBarProps, prevState: State): State;
83 getDeltaAngle(): number;
84 handleAnimationEnd: () => void;
85 handleAnimationStart: () => void;
86 renderSectorsStatically(sectors: SectorProps[]): React.JSX.Element[];
87 renderSectorsWithAnimation(): React.JSX.Element;
88 renderSectors(): React.JSX.Element | React.JSX.Element[];
89 renderBackground(sectors?: RadialBarDataItem[]): React.JSX.Element[];
90 render(): React.JSX.Element;
91}
92export {};