forked from Gitlink/forgeplus-react
83 lines
2.0 KiB
JavaScript
83 lines
2.0 KiB
JavaScript
|
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
|
|||
|
|
|
|||
|
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|||
|
|
|
|||
|
|
var Base = require('./base');
|
|||
|
|
|
|||
|
|
var Component = /*#__PURE__*/function (_Base) {
|
|||
|
|
_inheritsLoose(Component, _Base);
|
|||
|
|
|
|||
|
|
function Component() {
|
|||
|
|
return _Base.apply(this, arguments) || this;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var _proto = Component.prototype;
|
|||
|
|
|
|||
|
|
// 配置
|
|||
|
|
_proto.getDefaultCfg = function getDefaultCfg() {
|
|||
|
|
return {
|
|||
|
|
// 顶层标志位
|
|||
|
|
_id: null,
|
|||
|
|
// 用于动画
|
|||
|
|
// 容器
|
|||
|
|
canvas: null,
|
|||
|
|
container: null,
|
|||
|
|
// html,可选
|
|||
|
|
group: null,
|
|||
|
|
// G Group,可选
|
|||
|
|
// 交互属性
|
|||
|
|
capture: false,
|
|||
|
|
// props
|
|||
|
|
coord: null,
|
|||
|
|
offset: [0, 0],
|
|||
|
|
plotRange: null,
|
|||
|
|
// BBox
|
|||
|
|
position: [0, 0],
|
|||
|
|
visible: true,
|
|||
|
|
zIndex: 1
|
|||
|
|
};
|
|||
|
|
} // 基础生命周期
|
|||
|
|
;
|
|||
|
|
|
|||
|
|
_proto._init = function _init() {};
|
|||
|
|
|
|||
|
|
_proto.clear = function clear() {};
|
|||
|
|
|
|||
|
|
_proto.destroy = function destroy() {
|
|||
|
|
// 之前未指定销毁
|
|||
|
|
_Base.prototype.destroy.call(this);
|
|||
|
|
} // 绘图
|
|||
|
|
;
|
|||
|
|
|
|||
|
|
_proto.beforeRender = function beforeRender() {};
|
|||
|
|
|
|||
|
|
_proto.render = function render() {} // 初始化、绑事件和绘图
|
|||
|
|
;
|
|||
|
|
|
|||
|
|
_proto.afterRender = function afterRender() {};
|
|||
|
|
|
|||
|
|
_proto.beforeDraw = function beforeDraw() {};
|
|||
|
|
|
|||
|
|
_proto.draw = function draw() {} // 单纯更新视图
|
|||
|
|
;
|
|||
|
|
|
|||
|
|
_proto.afterDraw = function afterDraw() {} // visibility
|
|||
|
|
;
|
|||
|
|
|
|||
|
|
_proto.show = function show() {};
|
|||
|
|
|
|||
|
|
_proto.hide = function hide() {} // props operating syntactic sugar
|
|||
|
|
;
|
|||
|
|
|
|||
|
|
_proto.setOffset = function setOffset() {};
|
|||
|
|
|
|||
|
|
_proto.setPosition = function setPosition() {};
|
|||
|
|
|
|||
|
|
_proto.setVisible = function setVisible() {};
|
|||
|
|
|
|||
|
|
_proto.setZIndex = function setZIndex() {};
|
|||
|
|
|
|||
|
|
return Component;
|
|||
|
|
}(Base);
|
|||
|
|
|
|||
|
|
module.exports = Component;
|