antvis/G6


The issue has been closed
[V5]运行graph.getCanvas().transient.removeChild(line);删除line时,没有生效 #5892
k644606347 posted onGitHub
Describe the bug / 问题描述
我正在为V5版本,制作一个叫snapline的插件,用于在节点间生成对齐线,简单的demo,遇到了一些问题:
当节点间相互远离时,我会运行graph.getCanvas().transient.removeChild(line);删除对齐线,但没有生效;
<img width="1713" alt="image" src="https://github.com/antvis/G6/assets/6951527/5705ed09-c891-43b4-bf59-76243f7558e7">
我需要获取到所有node的size,或者上下左右4个点位的坐标,来更精确的布局对齐线(比如在node左右侧位置设置对齐线),但通过graph.getNodeData()[0].style.size没有获取到,不知道有什么方法吗;
<img width="810" alt="image" src="https://github.com/antvis/G6/assets/6951527/7b664c32-809a-4f08-9773-677b241385d4">
Reproduction link / 重现链接
No response
Steps to Reproduce the Bug or Issue / 重现步骤
No response
G6 Version / G6 版本
🆕 5.x
Operating System / 操作系统
macOS
Browser / 浏览器
Chrome
Additional context / 补充说明
No response