interval.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. "use strict";
  2. exports.__esModule = true;
  3. exports["default"] = void 0;
  4. var _base = _interopRequireDefault(require("./base"));
  5. var _common = require("../util/common");
  6. var _size = _interopRequireDefault(require("./mixin/size"));
  7. require("./shape/interval");
  8. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
  9. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  10. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  11. var Interval = /*#__PURE__*/function (_Geom) {
  12. _inheritsLoose(Interval, _Geom);
  13. var _proto = Interval.prototype;
  14. _proto.getDefaultCfg = function getDefaultCfg() {
  15. var cfg = _Geom.prototype.getDefaultCfg.call(this);
  16. cfg.type = 'interval';
  17. cfg.shapeType = 'interval';
  18. cfg.generatePoints = true;
  19. return cfg;
  20. };
  21. function Interval(cfg) {
  22. var _this;
  23. _this = _Geom.call(this, cfg) || this;
  24. (0, _common.mix)(_assertThisInitialized(_this), _size["default"]);
  25. return _this;
  26. }
  27. _proto.init = function init() {
  28. _Geom.prototype.init.call(this); // 绑定事件
  29. this.initEvent();
  30. };
  31. _proto.createShapePointsCfg = function createShapePointsCfg(obj) {
  32. var cfg = _Geom.prototype.createShapePointsCfg.call(this, obj);
  33. cfg.size = this.getNormalizedSize(obj);
  34. return cfg;
  35. };
  36. _proto.clearInner = function clearInner() {
  37. _Geom.prototype.clearInner.call(this);
  38. this.set('defaultSize', null);
  39. };
  40. return Interval;
  41. }(_base["default"]);
  42. _base["default"].Interval = Interval;
  43. var _default = Interval;
  44. exports["default"] = _default;