1 | import Component from '../../base/component';
|
2 | import { ChartChildProps } from '../../chart';
|
3 | import { Scale } from '@antv/scale';
|
4 | export type ZoomRange = [number, number];
|
5 | export type ScaleValues = number[] | string[];
|
6 | export interface ZoomProps extends ChartChildProps {
|
7 | panSensitive?: number;
|
8 | pinchSensitive?: number;
|
9 | |
10 |
|
11 |
|
12 | mode?: 'x' | 'y' | ['x', 'y'] | null;
|
13 | |
14 |
|
15 |
|
16 | range?: ZoomRange;
|
17 | |
18 |
|
19 |
|
20 | pan?: boolean;
|
21 | |
22 |
|
23 |
|
24 | pinch?: boolean;
|
25 | |
26 |
|
27 |
|
28 | swipe?: boolean;
|
29 | |
30 |
|
31 |
|
32 | onPanStart?: Function;
|
33 | onPinchStart?: Function;
|
34 | onPan?: Function;
|
35 | onPinch?: Function;
|
36 | onPanEnd?: Function;
|
37 | onPinchEnd?: Function;
|
38 | onInit?: Function;
|
39 | |
40 |
|
41 |
|
42 | autoFit?: boolean;
|
43 | |
44 |
|
45 |
|
46 | minCount?: number;
|
47 | }
|
48 | export interface ZoomState {
|
49 | range: {
|
50 | x?: ZoomRange;
|
51 | y?: ZoomRange;
|
52 | };
|
53 | }
|
54 | declare class Zoom<P extends ZoomProps = ZoomProps, S extends ZoomState = ZoomState> extends Component<P, S> {
|
55 | startRange: {
|
56 | x?: ZoomRange;
|
57 | y?: ZoomRange;
|
58 | };
|
59 | scale: {};
|
60 | originScale: {};
|
61 | minScale: number;
|
62 | dims: Array<String>;
|
63 | swipeEnd: {
|
64 | startX: number;
|
65 | startY: number;
|
66 | endX: number;
|
67 | endY: number;
|
68 | };
|
69 | loop: any;
|
70 | constructor(props: P);
|
71 | didMount(): void;
|
72 | willReceiveProps(nextProps: P): void;
|
73 | willMount(): void;
|
74 | didUnmount(): void;
|
75 | onStart: () => void;
|
76 | onPan: (ev: any) => void;
|
77 | update(): void;
|
78 | onSwipe: (ev: any) => void;
|
79 | onPinch: (ev: any) => void;
|
80 | onEnd: () => void;
|
81 | _doXPan(ev: any): ZoomRange;
|
82 | _doYPan(ev: any): ZoomRange;
|
83 | _doPan(ratio: number, dim: string): ZoomRange;
|
84 | _doXPinch(ev: any): any;
|
85 | _doYPinch(ev: any): any;
|
86 | _doPinch(startRatio: number, endRatio: number, zoom: number, dim: string): any;
|
87 | updateRange(originalRange: ZoomRange, dim: any): ZoomRange;
|
88 | updateFollow(scales: Scale[], mainScale: Scale, data: any[]): void;
|
89 | _getScale(dim: any): any;
|
90 | _getFollowScales(dim: any): any[];
|
91 | _bindEvents(): void;
|
92 | _clearEvents(): void;
|
93 | }
|
94 | export default Zoom;
|