Package Exports
- @antv/g-base
- @antv/g-base/lib/bbox/index
- @antv/g-base/lib/event/event-contoller
- @antv/g-base/lib/event/graph-event
- @antv/g-base/lib/interfaces
- @antv/g-base/lib/types
- @antv/g-base/lib/util/matrix
- @antv/g-base/lib/util/offscreen
- @antv/g-base/lib/util/text
- @antv/g-base/lib/util/util
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@antv/g-base) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
G-Base
可视化的绘图引擎的接口定义和抽象实现
安装下载
tnpm i --save @antv/g-base
import { Base } from '@antv/g-base';
class MyClass extends Base {
}
API 文档
G-Base 中定义了绘图引擎的接口、抽象类和工具方法
接口定义
IBase
事件接口定义
/**
* 绑定事件
* @param {string} eventName 事件名
* @param {Function} callback 回调函数
*/
on(eventName: string, callback: Function);
/**
* 移除事件
*/
off();
/**
* 移除事件
* @param {string} eventName 事件名
*/
off(eventName: string);
/**
* 移除事件
* @param {string} eventName 事件名
* @param {Function} callback 回调函数
*/
off(eventName: string, callback: Function);
/**
* 触发事件, trigger 的别名函数
* @param {string} eventName 事件名称
* @param {object} args 参数
*/
emit(eventName: string, eventObject: object);
/**
* 触发事件
* @param {string} eventName 事件名称
* @param {object} args 参数
*/
emit(eventName: string, eventObject: object);属性接口定义
/**
* 获取属性值
* @param {string} name 属性名
* @return {any} 属性值
*/
get(name: string): any;
/**
* 设置属性值
* @param {string} name 属性名称
* @param {any} value 属性值
*/
set(name: string, value: any);
/**
* 是否销毁
* @type {boolean}
*/
destroyed: boolean;
/**
* 销毁对象
*/
destroy();