Animated graphs / wxPython

Duncan Smith buzzard at urubu.freeserve.co.uk
Sat Feb 9 20:04:01 CET 2002


I need to frequently redraw a graph (ie. nodes and edges) to a wxPython
panel.  ie. I remove and/or add edges to the graph and then redraw it.  I am
currently using wxPython ellipses and lines for drawing the nodes and edges.
The problems are the speed of redrawing and the flickering as the window is
redrawn.  SetClippingRegion() doesn't help a great deal as the clipping
region is usually nearly as large as the full graph.  I am currently using a
workaround whereby I draw edges in the background colour in order to remove
them.  But after a number of redraws the graph starts to get noticeably
whited out by drawing over existing nodes and edges.

Does anyone know of a better approach?  Ideally I would like to be able to
simply remove and add edges and send them to the back of the nodes rather
than redrawing the relevant nodes each time I add an edge.  I have looked at
a number of packages, but none seem to be able to do what I want.
Essentially I want an animated graph that will show a user what the graph
algorithms are up to.  (Gato won't do the job.)  Thanks in advance.

Duncan





More information about the Python-list mailing list