UNPKG

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