cione-comp-lib
Version:
`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`
32 lines (31 loc) • 894 B
JavaScript
import { map, filter } from "../../../../zrender/lib/core/util.mjs";
var Cartesian = function() {
function Cartesian2(name) {
this.type = "cartesian";
this._dimList = [];
this._axes = {};
this.name = name || "";
}
Cartesian2.prototype.getAxis = function(dim) {
return this._axes[dim];
};
Cartesian2.prototype.getAxes = function() {
return map(this._dimList, function(dim) {
return this._axes[dim];
}, this);
};
Cartesian2.prototype.getAxesByScale = function(scaleType) {
scaleType = scaleType.toLowerCase();
return filter(this.getAxes(), function(axis) {
return axis.scale.type === scaleType;
});
};
Cartesian2.prototype.addAxis = function(axis) {
var dim = axis.dim;
this._axes[dim] = axis;
this._dimList.push(dim);
};
return Cartesian2;
}();
var Cartesian$1 = Cartesian;
export { Cartesian$1 as default };