cione-comp-lib
Version:
`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`
68 lines (67 loc) • 2.43 kB
JavaScript
import { __extends } from "../../../../tslib/tslib.es6.mjs";
import { merge, each, filter } from "../../../../zrender/lib/core/util.mjs";
import ComponentModel from "../../model/Component.mjs";
var ParallelModel = function(_super) {
__extends(ParallelModel2, _super);
function ParallelModel2() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.type = ParallelModel2.type;
return _this;
}
ParallelModel2.prototype.init = function() {
_super.prototype.init.apply(this, arguments);
this.mergeOption({});
};
ParallelModel2.prototype.mergeOption = function(newOption) {
var thisOption = this.option;
newOption && merge(thisOption, newOption, true);
this._initDimensions();
};
ParallelModel2.prototype.contains = function(model, ecModel) {
var parallelIndex = model.get("parallelIndex");
return parallelIndex != null && ecModel.getComponent("parallel", parallelIndex) === this;
};
ParallelModel2.prototype.setAxisExpand = function(opt) {
each(["axisExpandable", "axisExpandCenter", "axisExpandCount", "axisExpandWidth", "axisExpandWindow"], function(name) {
if (opt.hasOwnProperty(name)) {
this.option[name] = opt[name];
}
}, this);
};
ParallelModel2.prototype._initDimensions = function() {
var dimensions = this.dimensions = [];
var parallelAxisIndex = this.parallelAxisIndex = [];
var axisModels = filter(this.ecModel.queryComponents({
mainType: "parallelAxis"
}), function(axisModel) {
return (axisModel.get("parallelIndex") || 0) === this.componentIndex;
}, this);
each(axisModels, function(axisModel) {
dimensions.push("dim" + axisModel.get("dim"));
parallelAxisIndex.push(axisModel.componentIndex);
});
};
ParallelModel2.type = "parallel";
ParallelModel2.dependencies = ["parallelAxis"];
ParallelModel2.layoutMode = "box";
ParallelModel2.defaultOption = {
z: 0,
left: 80,
top: 60,
right: 80,
bottom: 60,
layout: "horizontal",
axisExpandable: false,
axisExpandCenter: null,
axisExpandCount: 0,
axisExpandWidth: 50,
axisExpandRate: 17,
axisExpandDebounce: 50,
axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],
axisExpandTriggerOn: "click",
parallelAxisDefault: null
};
return ParallelModel2;
}(ComponentModel);
var ParallelModel$1 = ParallelModel;
export { ParallelModel$1 as default };