linear.js 847 B

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var tslib_1 = require("tslib");
  4. var base_1 = require("./base");
  5. /**
  6. * 线性度量
  7. * @class
  8. */
  9. var Linear = /** @class */ (function (_super) {
  10. tslib_1.__extends(Linear, _super);
  11. function Linear() {
  12. var _this = _super !== null && _super.apply(this, arguments) || this;
  13. _this.type = 'linear';
  14. _this.isLinear = true;
  15. return _this;
  16. }
  17. Linear.prototype.invert = function (value) {
  18. var percent = this.getInvertPercent(value);
  19. return this.min + percent * (this.max - this.min);
  20. };
  21. Linear.prototype.initCfg = function () {
  22. this.tickMethod = 'wilkinson-extended';
  23. this.nice = false;
  24. };
  25. return Linear;
  26. }(base_1.default));
  27. exports.default = Linear;
  28. //# sourceMappingURL=linear.js.map