Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tool to create a python GUI for graph construction

I need to create a GUI for graph construction ("graph" as an abstract representation of a set of objects, not a visual representation of data). The interface will provide a choice of ~5 vertex types and of ~5 edge types. Each vertex will have two data fields: a text label and a file name, which need to be easily editable.

I'm familiar with igraph and have a lot of code written in it. I will use igraph to manipulate the graphs created with this GUI.

Since this will be my first GUI, I'm completely ignorant of what tools are available. Can you please suggest a free library, knowing that eventually the program will need to work on Windows?

EDIT

it seems from the answers I get that I wasn't clear enough. I'm not looking for a way to visualize a graph, but rather for a way to visually create one. By visually, I mean not needing to manually create text files or writing code.

like image 299
Boris Gorelik Avatar asked Dec 11 '25 23:12

Boris Gorelik


2 Answers

Take a look at xdot.py.

From the homepage

xdot.py is an interactive viewer for graphs written in Graphviz's dot language.

It uses internally the graphviz's xdot output format as an intermediate format, and PyGTK and Cairo for rendering.

xdot.py can be used either as a standalone application from command line, or as a library embedded in your python application.

like image 174
midtiby Avatar answered Dec 14 '25 14:12

midtiby


I like networkx,

from networkx import draw, Graph
from pylab import show

g = Graph()
g.add_edges_from([(1,2),(1,3),(2,4),(2,5)])
draw(g)
show()

which gives,

Sample output from networkx

The only quirk is the requirement for matplotlib to get builtin plotting to work.

like image 20
lafras Avatar answered Dec 14 '25 14:12

lafras