cione-comp-lib
Version:
`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`
37 lines (36 loc) • 1.23 kB
JavaScript
import { __extends } from "../../../../tslib/tslib.es6.mjs";
import Axis from "../Axis.mjs";
var Axis2D = function(_super) {
__extends(Axis2D2, _super);
function Axis2D2(dim, scale, coordExtent, axisType, position) {
var _this = _super.call(this, dim, scale, coordExtent) || this;
_this.index = 0;
_this.type = axisType || "value";
_this.position = position || "bottom";
return _this;
}
Axis2D2.prototype.isHorizontal = function() {
var position = this.position;
return position === "top" || position === "bottom";
};
Axis2D2.prototype.getGlobalExtent = function(asc) {
var ret = this.getExtent();
ret[0] = this.toGlobalCoord(ret[0]);
ret[1] = this.toGlobalCoord(ret[1]);
asc && ret[0] > ret[1] && ret.reverse();
return ret;
};
Axis2D2.prototype.pointToData = function(point, clamp) {
return this.coordToData(this.toLocalCoord(point[this.dim === "x" ? 0 : 1]), clamp);
};
Axis2D2.prototype.setCategorySortInfo = function(info) {
if (this.type !== "category") {
return false;
}
this.model.option.categorySortInfo = info;
this.scale.setSortInfo(info);
};
return Axis2D2;
}(Axis);
var Axis2D$1 = Axis2D;
export { Axis2D$1 as default };