1 | import React, { PureComponent } from 'react';
|
2 | import { Props as TrapezoidProps } from '../shape/Trapezoid';
|
3 | import { LegendType, TooltipType, AnimationTiming, ChartOffset, DataKey, PresentationAttributesAdaptChildEvent, AnimationDuration, ActiveShape } from '../util/types';
|
4 | export interface FunnelTrapezoidItem extends TrapezoidProps {
|
5 | value?: number | string;
|
6 | payload?: any;
|
7 | isActive: boolean;
|
8 | }
|
9 | interface InternalFunnelProps {
|
10 | className?: string;
|
11 | dataKey: DataKey<any>;
|
12 | nameKey?: DataKey<any>;
|
13 | data?: any[];
|
14 | hide?: boolean;
|
15 | shape?: ActiveShape<FunnelTrapezoidItem, SVGPathElement>;
|
16 | activeShape?: ActiveShape<FunnelTrapezoidItem, SVGPathElement>;
|
17 | legendType?: LegendType;
|
18 | tooltipType?: TooltipType;
|
19 | activeIndex?: number | number[];
|
20 | lastShapeType?: 'triangle' | 'rectangle';
|
21 | reversed?: boolean;
|
22 | onAnimationStart?: () => void;
|
23 | onAnimationEnd?: () => void;
|
24 | isAnimationActive?: boolean;
|
25 | animateNewValues?: boolean;
|
26 | animationBegin?: number;
|
27 | animationDuration?: AnimationDuration;
|
28 | animationEasing?: AnimationTiming;
|
29 | id?: string;
|
30 | trapezoids?: FunnelTrapezoidItem[];
|
31 | animationId?: number;
|
32 | }
|
33 | export type FunnelProps = PresentationAttributesAdaptChildEvent<any, SVGElement> & TrapezoidProps & InternalFunnelProps;
|
34 | interface State {
|
35 | readonly prevTrapezoids?: FunnelTrapezoidItem[];
|
36 | readonly curTrapezoids?: FunnelTrapezoidItem[];
|
37 | readonly prevAnimationId?: number;
|
38 | readonly isAnimationFinished?: boolean;
|
39 | }
|
40 | export declare class Funnel extends PureComponent<FunnelProps, State> {
|
41 | static displayName: string;
|
42 | static defaultProps: {
|
43 | stroke: string;
|
44 | fill: string;
|
45 | legendType: string;
|
46 | labelLine: boolean;
|
47 | hide: boolean;
|
48 | isAnimationActive: boolean;
|
49 | animationBegin: number;
|
50 | animationDuration: number;
|
51 | animationEasing: string;
|
52 | nameKey: string;
|
53 | lastShapeType: string;
|
54 | };
|
55 | static getRealFunnelData: (item: Funnel) => any[];
|
56 | static getRealWidthHeight: (item: Funnel, offset: ChartOffset) => {
|
57 | realWidth: number;
|
58 | realHeight: number;
|
59 | offsetX: number;
|
60 | offsetY: number;
|
61 | };
|
62 | static getComposedData: ({ item, offset }: {
|
63 | item: Funnel;
|
64 | offset: ChartOffset;
|
65 | }) => {
|
66 | trapezoids: {
|
67 | payload: any;
|
68 | parentViewBox: {
|
69 | x: number;
|
70 | y: number;
|
71 | width: number;
|
72 | height: number;
|
73 | };
|
74 | labelViewBox: {
|
75 | x: number;
|
76 | y: number;
|
77 | width: number;
|
78 | height: number;
|
79 | };
|
80 | x: number;
|
81 | y: number;
|
82 | width: number;
|
83 | upperWidth: number;
|
84 | lowerWidth: number;
|
85 | height: number;
|
86 | name: any;
|
87 | val: any;
|
88 | tooltipPayload: {
|
89 | name: any;
|
90 | value: any;
|
91 | payload: any;
|
92 | dataKey: DataKey<any>;
|
93 | type: "none";
|
94 | }[];
|
95 | tooltipPosition: {
|
96 | x: number;
|
97 | y: number;
|
98 | };
|
99 | }[];
|
100 | data: any[];
|
101 | };
|
102 | state: State;
|
103 | static getDerivedStateFromProps(nextProps: FunnelProps, prevState: State): State;
|
104 | handleAnimationEnd: () => void;
|
105 | handleAnimationStart: () => void;
|
106 | isActiveIndex(i: number): boolean;
|
107 | renderTrapezoidsStatically(trapezoids: FunnelTrapezoidItem[]): React.JSX.Element[];
|
108 | renderTrapezoidsWithAnimation(): React.JSX.Element;
|
109 | renderTrapezoids(): React.JSX.Element | React.JSX.Element[];
|
110 | render(): React.JSX.Element;
|
111 | }
|
112 | export {};
|