Is there an interactive GUI library for python

I am looking for an interactive GUI library for Python.

In the " graph " section, I meant a set of nodes connected by many vertices (not a graph of values ​​along the xy axis, nor a grid of pixels).

By “interactive,” I meant that I can drag and drop nodes around, and I need to be able to click nodes / vertices and pass the nodes / vertices to my callbacks library, which can add / remove nodes / vertices or the displayed information (I cannot load the full the graph at startup, since the data set is too large / complex, instead I will only load the necessary pieces of data depending on user inputs).

In Python, I was referring to the Python programming language , the graphic display library must have a CPython binding. I have Python 2.7 and Python 3.1, but you can downgrade to 2.6 if necessary. This language requirement is because the dataset I'm working with has only Python bindings.

The graphic display library must support oriented graphics and be able to automatically assemble nodes. I need to put labels on the nodes.

Preferably, the layout algorithm should place adjacent nodes next to each other. It should be able to handle from 100-1000 nodes and about 300-4000 vertices reasonably in my 4 year old laptop (I usually start with about 100 nodes, but the number can expand depending on user input). Preferably, it should be a library with not too many dependencies (except perhaps for Gnome). Open Source Preferred.

I already wrote a simple prototype of my program using Tkinter Canvas, but to expand the program I need a more serious GUI library. I looked at graphviz and matplotlib, but apparently they are only for working with static graphs and, apparently, it will require significant work for interactive manipulations (correct me if I am wrong, I just looked at them briefly), I also tried create a graph in an SVG file and use Inkscape to view it, but it is too slow and takes up too much memory, and due to the large number of vertices it becomes a confused mess.

+49
python graph interactive
Apr 22 2018-11-21T00:
source share
3 answers

It looks like Nodebox might be what you want:

http://nodebox.net/code/index.php/Graph Mac OSX

http://www.cityinabottle.org/nodebox/ Windows (using OpenGL)

Nodebox screenshot

The graph object has functionality for interacting with the mouse, complete in the graph.events object. It has the following properties:

  • graph.events.hovered : None or node that the mouse cursor is over.
  • graph.events.pressed : None or node where the mouse is located by clicking down.
  • graph.events.dragged : None or node.
  • graph.events.clicked : None or the last node clicked.
  • graph.events.popup : if True , a popup will appear above the freezing node.



In addition, Gephi appeared on the screen, it looks like you might have functionality.

http://gephi.org/ Windows , Linux, and Mac OSX

Gephi is an interactive visualization and exploration platform for all types of networks and complex systems, dynamic and hierarchical graphs.

gephi screenshot

+26
Apr 28 '11 at 12:17
source share

If you haven’t done this, you should definitely see igraph .

This is a powerful library that can handle large graphics and various layout styles. It can also be used for oriented graphs and for interactive and non-interactive visualizations in 2D and 3D according to the list of features . There is also a tutorial .

Update: Another well-known NetworkX library for which Python packages exist here . Please note that the software Nodebox for Mac / Windows recommended by Acorn uses NetworkX algorithms.

+7
Apr 22 2018-11-21T00:
source share

I have the same problem. In the end, I think nodebox opengl seems to do the trick. Do not try to use the chart library at the following link.

http://nodebox.net/code/index.php/Graph

open source node. It does not work that the graph library is only compatible with the Mac OSX host node. But in any case, this is normal, because you do not need it.

See for example the following question:

Adding a label to the edge of the graph in nodebox opnegl

It shows an example code that works for me, the code can be changed, so clicking on a node not only allows you to move the node, but also allows you to change the graph.

Just uninstall

 label = "Placeholder" 

from the code and it works.

EDIT:

Here I give a more detailed code example: Nodebox open GL Graph, size function not recognized. (Ubuntu)

+2
Jan 16 '15 at 16:35
source share



All Articles