linear.js 759 B

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