Graph (cyclic kind, not pretty picture kind) rendering algorithm?
robin at jessikat.fsnet.co.uk
Mon Feb 12 05:11:03 EST 2001
In article <3A87A0EC.BA802E3E at student.gu.edu.au>,
s713221 at student.gu.edu.au writes
>> Python for Pyros:
>> Click here, then scoot down about 2 pages:
>> On the left we see a Graph (a math object describing vertices connected by
>> edges), and on the right's the same graph drawn with all the lengths of the
>> lines balanced.
>> Is there a Python library out there that can draw a graph like that? Or
>> which can take a graph as an input and return XY coordinates telling where
>> to place each vertice and each line?
>I don't know of any, but I'd be interested if anyone else could direct
>us to one, I need exactly this for a chem editor I'm building at the
Well you translate the java demo code to do this. There was also some
stuff in Dr Dobbs (in 1999 I think) on the spring/charge model for
A starting place for such efforts might be the demo/guido/tkinter/electr
ons.py file. Which shows how to put the nodes onto a canvas.
More information about the Python-list