C++ 中的强制导向布局实现
您是否知道用于 GUI 的 C++ 中力导向布局的开源实现? 最好是 BSD/MIT/Apache 或其他(非 GPL)许可证。
Are you aware of an open source implementation of force-directed layout in C++ used for GUIs? Preferably BSD/MIT/Apache or other (non-GPL) license.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
优秀的 Boost.Graph 库提供了广泛的一系列算法,其中有一些布局算法。 我建议使用 Kamada-Kawai 弹簧布局 或 Fruchterman-Reingold 强制导向布局。
Boost 许可证 非常宽松,所以不用担心。
The excellent Boost.Graph library provides a wide range of algorithms, among which a few layout algorithms. I'd recommend using either Kamada-Kawai spring layout or Fruchterman-Reingold force-directed layout.
Boost licence is very permissive so don't worry about that.
第一个 Google 结果是 VTK。 另一个带我到 vtkGraphLayoutView。
The first Google result is VTK. Another takes me to vtkGraphLayoutView.
您是否看过 neato 来自 graphviz。 这个指南甚至详细介绍了如何使用 graphviz 作为库。 指南包括使用 fdp 布局算法,这似乎正是您想要的。 所有 graphviz 均受通用公共许可证管辖。
Have you looked at neato from graphviz. This guide even goes into detail for using graphviz as a library. The guide includes using the fdp layout algorithm, which appears to be exactly what you want. All of graphviz falls under the Common Public License.
概览
https://www.kitware.com/InfovisWiki/index.php/Main_Page
如果您想要此应用程序,有一些安装步骤,所有信息都在该 wiki 上。 它是一个基于VTK构建的应用程序。 OverView 的具体功能是能够以二维方式表示信息图(不一定是几何图形)。
正如 dirkgently 所指出的,VTK 有一个力导向的图形布局。 使用 OverView 之类的好处是,您可以轻松地为 OverView 创建自定义插件,您可以使用该插件来读取数据并使用力定向布局策略来显示数据。
如果您不想依赖 OverView,则可以很容易地提取插件代码并仅引用 OverView,因为所有渲染都是在插件外部处理的。
OverView
https://www.kitware.com/InfovisWiki/index.php/Main_Page
There are some installation steps if you want this application, all of the info is on that wiki. It is an application built on VTK. The specific function OverView has is the ability to represent a graph of information (not necessarily geometric) in 2 dimensions.
As pointed out by dirkgently, VTK has a force directed graph layout. The benefit of using something like OverView is that you can easily make a custom plug-in for OverView, which you would make to read your data and display it using the force directed layout strategy.
If you don't want to depend on OverView it is very easy to extract your plug-in code and only reference OverView since all of the rendering is handled outside of your plug-in.