UNPKG

1.24 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}
22declare class Canvas extends Component<ChartProps> {
23 canvas: GCanvas;
24 container: GCanvas;
25 animation?: Animation;
26 layout: Layout;
27 theme: any;
28 private _ee;
29 constructor(props: ChartProps);
30 renderComponents(components: Component[]): void;
31 update(nextProps: ChartProps): void;
32 resize(width?: any, height?: any): void;
33 updateLayout(props: any): void;
34 draw(): void;
35 play(): void;
36 render(): any;
37 destroy(): void;
38 on(type: string, listener: any): void;
39 emit(type: string, event?: any): void;
40 off(type: string, listener?: any): void;
41}
42export default Canvas;