clip.js 780 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * @fileoverview clip
  3. * @author dengfuping_develop@163.com
  4. */
  5. import { uniqueId } from '@antv/util';
  6. import { createSVGElement } from '../util/dom';
  7. var Clip = /** @class */ (function () {
  8. function Clip(cfg) {
  9. this.type = 'clip';
  10. this.cfg = {};
  11. var el = createSVGElement('clipPath');
  12. this.el = el;
  13. this.id = uniqueId('clip_');
  14. el.id = this.id;
  15. var shapeEl = cfg.cfg.el;
  16. el.appendChild(shapeEl);
  17. this.cfg = cfg;
  18. return this;
  19. }
  20. Clip.prototype.match = function () {
  21. return false;
  22. };
  23. Clip.prototype.remove = function () {
  24. var el = this.el;
  25. el.parentNode.removeChild(el);
  26. };
  27. return Clip;
  28. }());
  29. export default Clip;
  30. //# sourceMappingURL=clip.js.map