schema.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  2. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  3. var Geom = require('./base');
  4. var Util = require('../util/common');
  5. var SizeMixin = require('./mixin/size');
  6. require('./shape/schema');
  7. var Schema =
  8. /*#__PURE__*/
  9. function (_Geom) {
  10. _inheritsLoose(Schema, _Geom);
  11. var _proto = Schema.prototype;
  12. _proto.getDefaultCfg = function getDefaultCfg() {
  13. var cfg = _Geom.prototype.getDefaultCfg.call(this);
  14. cfg.type = 'schema';
  15. cfg.shapeType = 'schema';
  16. cfg.generatePoints = true;
  17. return cfg;
  18. };
  19. function Schema(cfg) {
  20. var _this;
  21. _this = _Geom.call(this, cfg) || this;
  22. Util.mix(_assertThisInitialized(_assertThisInitialized(_this)), SizeMixin);
  23. return _this;
  24. }
  25. _proto.createShapePointsCfg = function createShapePointsCfg(obj) {
  26. var cfg = _Geom.prototype.createShapePointsCfg.call(this, obj);
  27. cfg.size = this.getNormalizedSize(obj);
  28. return cfg;
  29. };
  30. _proto.clearInner = function clearInner() {
  31. _Geom.prototype.clearInner.call(this);
  32. this.set('defaultSize', null);
  33. };
  34. return Schema;
  35. }(Geom);
  36. Geom.Schema = Schema;
  37. module.exports = Schema;