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

feat: built-in snake layout #6587

Merged
merged 6 commits into from
Dec 3, 2024
Merged

feat: built-in snake layout #6587

merged 6 commits into from
Dec 3, 2024

Conversation

yvonneyx
Copy link
Contributor

@yvonneyx yvonneyx commented Dec 2, 2024

  • built-in snake layout
  • unit tests
  • site demos

蛇形布局(Snake Layout)是一种特殊的图形布局方式,能够在较小的空间内更有效地展示长链结构。需要注意的是,其图数据需要确保节点按照从源节点到汇节点的顺序进行线性排列,形成一条明确的路径。

节点按 S 字型排列,第一个节点位于第一行的起始位置,接下来的节点在第一行向右排列,直到行末尾。到达行末尾后,下一行的节点从右向左反向排列。这个过程重复进行,直到所有节点排列完毕。


The Snake layout is a special way of graph layout that can more effectively display long chain structures in a smaller space. It should be noted that the graph data needs to meet the constraints of linear arrangement.

The nodes are arranged in an S-shaped pattern, with the first node at the beginning of the first row, and the following nodes arranged to the right until the end of the row. After reaching the end of the row, the nodes in the next row are arranged in reverse from right to left. This process is repeated until all nodes are arranged.

image

@hustcc
Copy link
Member

hustcc commented Dec 2, 2024

可以评估布局代码是否放到 layout 仓库中。

@Aarebecca
Copy link
Contributor

可以评估布局代码是否放到 layout 仓库中。

layout 仓库目前接口设计不太合理,可以考虑后期调整之后再放进去

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

这个是箭头吗

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的

@yvonneyx yvonneyx merged commit ba9ddfd into v5 Dec 3, 2024
2 checks passed
@yvonneyx yvonneyx deleted the layout-snake branch December 3, 2024 08:12
@hustcc
Copy link
Member

hustcc commented Dec 3, 2024

layout 仓库目前接口设计不太合理,可以考虑后期调整之后再放进去

啥时候调整?

另外这个布局的图似乎也可以往 ADC 里面放,之前的流程图太长,看起来很不方便。

@yvonneyx
Copy link
Contributor Author

yvonneyx commented Dec 3, 2024 via email

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

Successfully merging this pull request may close these issues.

3 participants