简体   繁体   English

如何在python GUI中包括交互式图形可视化?

[英]What should I use to include interactive graph visualization in a python GUI?

I want to make a GUI for a program I am writing, and I would like the program to have an interactive graph (graph here meaning a network of nodes and edges). 我想为我正在编写的程序制作GUI,并且我希望该程序具有交互式图形(此处的图形表示节点和边的网络)。 I would like users to use the GUI to create nodes and alter their properties, and run calculations on the graph (with the code I have written). 我希望用户使用GUI创建节点并更改其属性,并在图形上运行计算(使用我编写的代码)。 I also want different clusters of nodes to be expandable and collapsible when you click on them, or maybe take you to a different window where you can see node substructure. 我还希望单击节点时不同的节点集群是可扩展和可折叠的,或者可能将您带到另一个可以查看节点子结构的窗口。 It would also be nice if clicking on a node also let you alter its properties. 如果单击节点也可以更改其属性,那也很好。 Any recommendations on how to use this would be greatly appreciated. 任何有关如何使用此功能的建议将不胜感激。

There is no programs/libraries for Python that allow you to do everything you want. 没有适用于Python的程序/库允许您执行所需的所有操作。

You can check these libraries: 您可以检查以下库:

  • bokeh : 散景
    • Has good interactive visualizations 具有良好的交互式可视化
    • Built on top of D3.js 建立在D3.js之上
    • It is only visualization library so it has nearly no tools to manipulate the graph 它只是可视化库,因此几乎没有工具可以操作图形
  • networkx : networkx
    • Incredibly large amount of different algorithms 大量的不同算法
    • Has pretty good non-interactive visualization 具有非常好的非交互式可视化
    • Pure Python-written so rather slow 纯Python编写,因此相当慢
  • igraph : igraph
    • Has good amount of algorithms 有大量的算法
    • The core is written on C so it is really fast 核心是用C编写的,因此速度非常快
    • Has an average non-interactive visualization 具有平均的非交互式可视化

Python has no stable popular libraries that can allow you to create nodes and manipulate the graph in the interactive GUI. Python没有稳定的流行类库,该类库允许您创建节点并在交互式GUI中操作图形。 Things you want need very complex software and Python just has no this software. 您想要的东西需要非常复杂的软件,而Python却没有此软件。

But there is good news - most things you need can be done with Gephi software (written on Java). 但是有个好消息-您需要用Gephi软件(用Java编写)完成大多数事情。 You can also check Cytoscape software - maybe it can fit you a bit more than Gephi. 您还可以检查Cytoscape软件-也许它比Gephi更适合您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM