G-Base
可视化的绘图引擎的接口定义和抽象实现
安装下载
tnpm i --save @antv/g-base
import { Base } from '@antv/g-base';
class MyClass extends Base {}
API 文档
G-Base 中定义了绘图引擎的接口、抽象类和工具方法
接口定义
IBase
事件接口定义
on(eventName: string, callback: Function);
off();
off(eventName: string);
off(eventName: string, callback: Function);
emit(eventName: string, eventObject: object);
emit(eventName: string, eventObject: object);
属性接口定义
get(name: string): any;
set(name: string, value: any);
destroyed: boolean;
destroy();
IElement
IGroup
IShape
ICanvas
抽象类定义
Base
AbstractShape
AbstractGroup
AbstractCanvas
其他公用类
GraphEvent
EventController