antvis/G6

How to arrange child nodes under the same node from left to right #6573

zhoulingz posted onGitHub

Describe the bug / 问题描述

How to arrange child nodes under the same node from left to right instead of having large intervals as shown in the picture Uploading 微信截图_20241128163959.png…

No response

Steps to Reproduce the Bug or Issue / 重现步骤

No response

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome

Additional context / 补充说明

No response


posted by yvonneyx 5 months ago

Please provide more information, or use the standard format, otherwise we will not process this issue. Reference document:


请提供更多信息,或者使用规范的格式,否则我们不会处理这个 issue。 参考文档:

posted by github-actions[bot] 5 months ago

I have uploaded an example. Could you please take a look demo img-1

posted by zhoulingz 5 months ago

I have uploaded an example. Could you please take a look demo img-1

404😭

posted by yvonneyx 5 months ago

Can you see the image? If you can see the image, you can directly create a node based on the current data to take a look

posted by zhoulingz 5 months ago

如果反馈的问题是节点之间的间隔过大,这是由于 dagre 布局在生成布局时优先考虑了树的平衡性,对节点的 x 坐标进行了调整。要解决这个问题,需要自定义布局。

posted by yvonneyx 5 months ago

如果说是为了考虑树的平衡性,那为什么删除右侧节点的子节点,前面子节点就可以从左向右布局呢?

img-2

posted by zhoulingz 5 months ago

可以去看一下 dagre 实现的源码来定位问题。 https://github.com/dagrejs/dagre

posted by yvonneyx 5 months ago

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information. | 由于该 issue 缺少关键信息且已闲置 7 天,现已自动关闭。如需重新打开此问题,请提供所缺失的信息。。

posted by github-actions[bot] 4 months ago

Fund this Issue

$0.00
Funded

Pull requests