Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dagre布局使用changeData添加数据后,节点位置发生对调 #1314

Closed
hujinbo opened this issue Mar 16, 2020 · 6 comments
Closed

dagre布局使用changeData添加数据后,节点位置发生对调 #1314

hujinbo opened this issue Mar 16, 2020 · 6 comments

Comments

@hujinbo
Copy link

hujinbo commented Mar 16, 2020

问题描述:dagre布局,使用changeData添加数据,两次渲染数据前面的节点/边顺序没有改变。第二次的数据是在第一次的基础上追加的(只添加了一个节点和一条边),但是重新渲染后,节点“图表1”和“图表2”的位置发生了对调。

@big-MuMu
Copy link

big-MuMu commented Apr 5, 2020

解决了吗

@hujinbo
Copy link
Author

hujinbo commented Apr 13, 2020

解决了吗

还没解决

@Yanyan-Wang
Copy link
Contributor

G6 的 dagre 依赖了外部库 https://github.com/dagrejs/dagre
这个库也有提这个问题但是大概是算法机制的原因始终没有解决:dagrejs/dagre#189

该算法会遍历数据生成树,可能是增加了节点之后生成树的遍历顺序有变化,导致了最终结果的差异。

@yingpengsha
Copy link

请问有替代方案吗🥺

@x-cold
Copy link

x-cold commented Sep 25, 2021

dagrejs/dagre#189 (comment)

@Yanyan-Wang
Copy link
Contributor

Yanyan-Wang commented Nov 24, 2022

新版本 G6 中的 dagre 布局已支持数据增量时尽可能保持原始顺序
3.x -> 4.x 升级指南
http://g6.antv.antgroup.com/manual/faq/upgradeguide
#2525

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants