clip.js 858 B

1234567891011121314151617181920212223242526272829303132
  1. "use strict";
  2. /**
  3. * @fileoverview clip
  4. * @author dengfuping_develop@163.com
  5. */
  6. Object.defineProperty(exports, "__esModule", { value: true });
  7. var util_1 = require("@antv/util");
  8. var dom_1 = require("../util/dom");
  9. var Clip = /** @class */ (function () {
  10. function Clip(cfg) {
  11. this.type = 'clip';
  12. this.cfg = {};
  13. var el = dom_1.createSVGElement('clipPath');
  14. this.el = el;
  15. this.id = util_1.uniqueId('clip_');
  16. el.id = this.id;
  17. var shapeEl = cfg.cfg.el;
  18. el.appendChild(shapeEl);
  19. this.cfg = cfg;
  20. return this;
  21. }
  22. Clip.prototype.match = function () {
  23. return false;
  24. };
  25. Clip.prototype.remove = function () {
  26. var el = this.el;
  27. el.parentNode.removeChild(el);
  28. };
  29. return Clip;
  30. }());
  31. exports.default = Clip;
  32. //# sourceMappingURL=clip.js.map