-
Notifications
You must be signed in to change notification settings - Fork 33
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
紧凑树计算位置出错 #16
Comments
我对这个项目也非常感兴趣,如果有解决方案的话可以让我来修改并提 PR |
在紧凑树布局算法中,separate 方法中对于dist 的处理中,只处理了 dist 大于 0 的情况(就是节点有重合的时候,需要将节点的偏移)但是没有处理 dist 小于 0 的情况(节点未重合的情况),因此会出现子节点将父节点的间距撑开的情况。如果需要解决这个问题可以将下面代码中的 if 判断去除,在所有情况下都处理一下节点位置,即可以解决这个问题。 hierarchy/src/layout/non-layered-tidy.js Lines 134 to 137 in 0e9e4dd
// if (dist > 0) {
mscl += dist;
moveSubtree(t, i, ih.index, dist);
//} |
如果为了确保兼容性,是否可以增加一个配置来启用这个类型的“紧凑”布局? |
This was referenced Feb 18, 2024
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
如下图所示,在第 3 列中绿色卡片与白色卡片并未相交, 但由于第 5 列太宽了,绿色卡片就与白色卡片间出现了间隙。
我 fork 了你的代码,demo 中是造好的数据,你可以下载下来快速查看。链接点我
希望得到您的帮助,谢谢!
The text was updated successfully, but these errors were encountered: