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

edge路由如何智能的布局 #2639

Closed
donghuizhou opened this issue Sep 7, 2022 · 6 comments
Closed

edge路由如何智能的布局 #2639

donghuizhou opened this issue Sep 7, 2022 · 6 comments
Labels
type: feature 新功能 Feature/enhancement requests

Comments

@donghuizhou
Copy link

问题描述

image
上图中左侧部分节点使用dagre布局,edge路由使用 【manhattan】,但是edge连线并非想要的,希望效果是上图右侧部分(PS.手绘糙了点,实际应该是水平垂直的连线)

重现链接

none

重现步骤

none

预期行为

none

平台

none

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@x6-bot
Copy link
Contributor

x6-bot bot commented Sep 7, 2022

👋 @donghuizhou

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

@lloydzhou
Copy link
Contributor

试试使用port,每个节点只有上下两个port,这样再布局出来的结构或许就和你画的一样了。

@donghuizhou
Copy link
Author

但是如果设定port的话,现在有nodeA和nodeB,nodeA的右port指向 nodeB 的左port,如果我把nodeA拖拽到nodeB的右侧,那nodeA的右port出来的线就会绕一大圈,指向nodeB的左port。有没有更加智能的方法规划node之间的连线

试试使用port,每个节点只有上下两个port,这样再布局出来的结构或许就和你画的一样了。

@NewByVector
Copy link
Contributor

NewByVector commented Sep 14, 2022

@donghuizhou 可以使用 targetAnchor 将连线的目标连接点固定在节点上方。targetAnchor 的配置参考 https://x6.antv.vision/zh/docs/api/registry/node-anchor

@NewByVector NewByVector added the type: discussion 讨论 Usage questions, guidance, and other discussions label Sep 14, 2022
@donghuizhou
Copy link
Author

@donghuizhou 可以使用 targetAnchor 将连线的目标连接点固定在节点上方。targetAnchor 的配置参考 https://x6.antv.vision/zh/docs/api/registry/node-anchor

这里是知道了我图上节点是这样排列的,所以可以设置targetNode的anchor。但实际情况下,比如下图中,如果targetNodes在SourceNode下面,并且他们离sourceNode分的比较开,x6默认将会是下面这样连线
image
像这种情况,是不是就要去判断targetNodes是否都在sourceNode下面,然后再指定从sourceNode的下面出线,从targetNodes的上面进线?
PS. 我们业务场景支持用户任意拖动node并且连线,没有强制从左往右布局或者从上到下布局,所以像图上的情况我们只能通过代码去判断sourceNode和targetNode的位置关系,再去确定连线怎么进怎么出。这种方式是否合理,有没有更好的方式?

@NewByVector NewByVector added type: feature 新功能 Feature/enhancement requests and removed type: discussion 讨论 Usage questions, guidance, and other discussions labels Feb 1, 2023
@x6-bot
Copy link
Contributor

x6-bot bot commented Oct 13, 2024

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators Oct 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature 新功能 Feature/enhancement requests
Projects
None yet
Development

No branches or pull requests

3 participants