用正交线绘制层次树(HV-Drawing – 二叉树)

发布于 2024-09-02 22:15:50 字数 310 浏览 3 评论 0原文

我需要绘制一个分层树结构(HV-Drawing – 二叉树),在根和子节点之间使用正交线(直矩形连接线)(如下所示: http://lab.kapit.fr/display/visualizationlayouts/Hierarchical+Tree+布局 )。 我想知道是否有类似绘制树的算法的开源示例,以便我可以在 ActionScript 中实现相同的算法。 谢谢 帕拉什

I need to work on drawing a hierarchical tree structure (HV-Drawing – Binary Tree) with orthogonal lines(straight rectangular connecting lines) between root and children ( like the following:
http://lab.kapit.fr/display/visualizationlayouts/Hierarchical+Tree+layout
).
I want to know if there are any open source examples of the algorithm of drawing trees like that so that I can implement the same algorithm in actionscript.
Thanks
Palash

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

说谎友 2024-09-09 22:15:50

我做了一个 C# 版本并将代码放在 CodeProject 上。它位于:

http://www.codeproject.com/KB/WPF/LayeredTreeDraw.aspx< /a>

有一个通用部分,它给出了所有节点的位置,还有一个 WPF 特定实现,它实际上使用您正在寻找的直线或正交线来绘制所有内容。

I did a C# version and put the code up on CodeProject. It's at:

http://www.codeproject.com/KB/WPF/LayeredTreeDraw.aspx

There's a generic part which gives the positions of all the nodes and a WPF specific implementation which actually draws everything using either straight lines or the orthogonal lines you're looking for.

述情 2024-09-09 22:15:50

这是我的 Python 3 实现:GitLab (这是内部项目,需要注册 GitLab)。

该程序仅包含一个文件,因此安装非常简单(克隆存储库并使用必要的参数运行 hv-drawing.py)。
该存储库还包含一些用于绘制的图表示例。

该代码有很好的注释,因此您可以了解其实现的算法。

Here is my Python 3 realization: GitLab (this is internal project, GitLab registration required).

The program consists of only one file, so the installation is very simple (clone the repository and run hv-drawing.py with necessary arguments).
Also the repository contents some examples of graphs for drawing.

The code is well-commented, so you can learn the algorithm on its realization.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文