G6 icon indicating copy to clipboard operation
G6 copied to clipboard

请问批量hideItem后的graph(dagre布局)怎么及时触发对已显示的节点(visible=true)的重新布局?

Open Laochake96 opened this issue 2 years ago • 2 comments

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

隐藏子节点后需要对显示的节点重新布局

What does the proposed API look like?

Laochake96 avatar Aug 12 '21 11:08 Laochake96

在不调用graph.layout的前提下,因为调用了layout后之前的节点也都换了位置了

Laochake96 avatar Aug 12 '21 11:08 Laochake96

遇到同样的问题了! 试试能否维护一份隐藏后的data,然后graph.changeData(data)更新数据

duanxiaohui avatar May 31 '22 09:05 duanxiaohui

需要 graph.layout 才能触发重新布局,因为相当于参与布局的数据变更了,重新布局一定会导致节点位置的变更呀。如果是 dagre 布局的话,目前支持在重新布局时尽可能保持当前顺序。如果不是这个问题,请提供一下描述问题的 demo,再重新开 issue 哈,谢谢

Yanyan-Wang avatar Nov 25 '22 07:11 Yanyan-Wang