Interactive graph visualisation

前端 未结 4 1104
故里飘歌
故里飘歌 2021-01-29 23:27

Situation

Similar to this question, I\'m looking for a way to create a GUI where users are able to see a graph (in the graph theory sense) and interact with it. Vehicl

相关标签:
4条回答
  • 2021-01-30 00:00

    You might also want to consider networkx_viewer: https://github.com/jsexauer/networkx_viewer

    0 讨论(0)
  • 2021-01-30 00:11

    I ended up finding that the visualisation libraries that I considered were not able to animate objects travelling along edges.

    I experimented with wxPython, and its floatcanvas, and found that fairly straight forward to use (substantially simpler than the OpenGL solution would have been). This gave me the freedom to animate as I needed, but didn't give me any wrappers around displaying connected nodes - I had to write that myself.

    This is quite an old question, so there may be other libraries out there now that fulfil this requirement, or it might be that the libraries I considered have advanced and can now do this. If I had to implement it from scratch today, I would be inclined to experiment with a web based UI, potentially utilising web sockets to keep up with the back end in terms of data rate. I don't know how well the animation would scale though - I've found Canvas and SVG get choppy when animating large numbers of things at once. Maybe WebGL would suit better.

    0 讨论(0)
  • 2021-01-30 00:13

    You might consider the JavaScript library d3. It has some fantastic interactive graph visualisations, and being written in JavaScript it's great for Web UI

    I'm uncertain of the live graph building capabilities, but presume simple node and edge addition/removal would be trivial to implement on top of your chosen visualisation type.

    Of course, you'd require something like pyjs to interface d3 with your python code, so it might not be suitable.

    Regarding nmichaels' answer: having used GraphViz extensively, I wouldn't recommend it for your purpose. It generates beautiful static diagrams but is strictly non-interactive.

    0 讨论(0)
  • 2021-01-30 00:19

    My gut says that using something like graphviz to render the graphs themselves and wx to deal with your UI is a good way to go. Reimplementing all the graph drawing bits in OpenGL seems like a huge waste of effort. pyGraphViz is very easy to use, so you could probably get something functional quickly and tune as necessary for performance.

    0 讨论(0)
提交回复
热议问题