highlight.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { __extends } from "tslib";
  2. import { getActionClass } from '@antv/g2';
  3. import { placeElementsOrdered } from '../util';
  4. var ElementHighlightAction = getActionClass('element-highlight');
  5. var VennElementHighlight = /** @class */ (function (_super) {
  6. __extends(VennElementHighlight, _super);
  7. function VennElementHighlight() {
  8. return _super !== null && _super.apply(this, arguments) || this;
  9. }
  10. /**
  11. * 同步所有元素的位置
  12. */
  13. VennElementHighlight.prototype.syncElementsPos = function () {
  14. placeElementsOrdered(this.context.view);
  15. };
  16. /** 高亮图形元素 */
  17. VennElementHighlight.prototype.highlight = function () {
  18. _super.prototype.highlight.call(this);
  19. this.syncElementsPos();
  20. };
  21. /** toggle 图形元素高亮状态 */
  22. VennElementHighlight.prototype.toggle = function () {
  23. _super.prototype.toggle.call(this);
  24. this.syncElementsPos();
  25. };
  26. /** 清楚 */
  27. VennElementHighlight.prototype.clear = function () {
  28. _super.prototype.clear.call(this);
  29. this.syncElementsPos();
  30. };
  31. /** 重置 */
  32. VennElementHighlight.prototype.reset = function () {
  33. _super.prototype.reset.call(this);
  34. this.syncElementsPos();
  35. };
  36. return VennElementHighlight;
  37. }(ElementHighlightAction));
  38. export { VennElementHighlight };
  39. //# sourceMappingURL=highlight.js.map