UNPKG

1.29 kBTypeScriptView Raw
1import { Canvas as GCanvas } from '@antv/f2-graphic';
2import Component from '../base/component';
3import Layout from '../base/layout';
4import Animation from './animation';
5export interface ChartProps {
6 context?: CanvasRenderingContext2D;
7 pixelRatio?: number;
8 width?: number | string;
9 height?: number | string;
10 padding?: number | string | (number | string)[];
11 animate?: boolean;
12 children?: any;
13 px2hd?: any;
14 theme?: any;
15 style?: any;
16 createImage?: () => HTMLImageElement;
17 /**
18 * 是否横屏
19 */
20 landscape?: boolean;
21 /**
22 * @title 每次绘制完成后的回调
23 */
24 onAfterDraw?: () => void;
25}
26declare class Canvas extends Component<ChartProps> {
27 canvas: GCanvas;
28 container: GCanvas;
29 animation?: Animation;
30 layout: Layout;
31 theme: any;
32 private _ee;
33 constructor(props: ChartProps);
34 renderComponents(components: Component[]): void;
35 update(nextProps: ChartProps): void;
36 resize(width?: any, height?: any): void;
37 updateLayout(props: any): void;
38 draw(): void;
39 play(): void;
40 render(): any;
41 destroy(): void;
42 on(type: string, listener: any): void;
43 emit(type: string, event?: any): void;
44 off(type: string, listener?: any): void;
45}
46export default Canvas;