Hi all, while preparing a talk for EuroPython.org and chatting with Christian Tismer I remembered that PyPy had a nice PyGame GUI for browsing GraphViz .dot files. So I wanted to play with it and made a new SVN checkout (very funky Mandelbrot sets during compilation, BTW... ;-) Then it occured to me that I don't need PyPy to run dotviewer (great, because it's still compiling). So I throwed a few of my .dot files at dotviewer and got slightly surprised to see a few ra- ther basic things not quite working as I'd expect (like rec- tangular and record-like node shapes. I've created the follow- ing sample files to illustrate my findings: http://python.net/~gherman/tmp/sample.dot http://python.net/~gherman/tmp/sample.pdf http://python.net/~gherman/tmp/sample.sample-dotviewer.jpg I'm running PyGame 1.8.0rc5 on Mac OS X 10.5.3, BTW. So, am I running dotviewer in some wrong fashion? Do I need to run it on a different PyGame version or another OS? Or is there some documentation for docviewer and its capabilities, that I haven't found yet? In fact, what I hoped to find in dotviewer is a browser for dot files in which I can fold individual parts of a graph in and out (while GraphViz is, perhaps, recalculating the layout). If dotviewer cannot do that, maybe somebody knows of another browser which can? Thanks and regards, Dinu
On 25/06/2008, at 19:05, Dinu Gherman wrote:
So I throwed a few of my .dot files at dotviewer and got slightly surprised to see a few ra- ther basic things not quite working as I'd expect (like rec- tangular and record-like node shapes. I've created the follow- ing sample files to illustrate my findings:
http://python.net/~gherman/tmp/sample.dot http://python.net/~gherman/tmp/sample.pdf http://python.net/~gherman/tmp/sample.sample-dotviewer.jpg
I'm running PyGame 1.8.0rc5 on Mac OS X 10.5.3, BTW.
So, am I running dotviewer in some wrong fashion? Do I need to run it on a different PyGame version or another OS? Or is there some documentation for docviewer and its capabilities, that I haven't found yet?
In fact, what I hoped to find in dotviewer is a browser for dot files in which I can fold individual parts of a graph in and out (while GraphViz is, perhaps, recalculating the layout). If dotviewer cannot do that, maybe somebody knows of another browser which can?
I think the dotviewer only has support for the features needed by pypy graphs, so it only supports the features used there and nothing more. I know pypy.rlib.parsing also uses it but what it draws is the same kind of nodes that pypy translator generates. Unfortunately I don't know of any other dot viewers out there (I know omnigraffle opens dot files maybe you should try) but extending the viewer is probably not too hard. -- Leonardo Santagada
On Wed, Jun 25, 2008 at 07:36:59PM -0300, Leonardo Santagada wrote:
Unfortunately I don't know of any other dot viewers out there (I know omnigraffle opens dot files maybe you should try) but extending the viewer is probably not too hard.
There's http://code.google.com/p/jrfonseca/wiki/XDot, which barfed on my .dot files that tried to use HSV colours. It also links to http://zvtm.sourceforge.net/zgrviewer.html which I've never tried. <reminiscence> My introduction to PyGame was hacking PyPy's dot viewer during the Vilnius sprint... Ahh, those were the times. </reminiscence> Marius Gedminas -- Unix is the answer, but only if you phrase the question very carefully. -- Belinda Asbell
Hi Dinu, Dinu Gherman wrote:
while preparing a talk for EuroPython.org and chatting with Christian Tismer I remembered that PyPy had a nice PyGame GUI for browsing GraphViz .dot files.
So I wanted to play with it and made a new SVN checkout (very funky Mandelbrot sets during compilation, BTW... ;-) Then it occured to me that I don't need PyPy to run dotviewer (great, because it's still compiling). So I throwed a few of my .dot files at dotviewer and got slightly surprised to see a few ra- ther basic things not quite working as I'd expect (like rec- tangular and record-like node shapes. I've created the follow- ing sample files to illustrate my findings:
http://python.net/~gherman/tmp/sample.dot http://python.net/~gherman/tmp/sample.pdf http://python.net/~gherman/tmp/sample.sample-dotviewer.jpg
The PyPy dot viewer isn't working well for records, since PyPy hasn't used them so far. I guess adding support would maybe be easy. Apart from the fact that the borders of the record boxes are missing, what else do you think is wrong with the jpg above? It looks very similar to the pdf.
I'm running PyGame 1.8.0rc5 on Mac OS X 10.5.3, BTW.
So, am I running dotviewer in some wrong fashion? Do I need to run it on a different PyGame version or another OS? Or is there some documentation for docviewer and its capabilities, that I haven't found yet?
In fact, what I hoped to find in dotviewer is a browser for dot files in which I can fold individual parts of a graph in and out (while GraphViz is, perhaps, recalculating the layout). If dotviewer cannot do that, maybe somebody knows of another browser which can?
The dotviewer is a browser for large dot files. However, it does not support folding on arbitrary graphs, only zooming and navigation (by clicking on nodes, links etc). If you need folding, you need some customization of the dotviewer, which is possible as well. There are even examples of doing that somewhere in PyPy, but I don't remember where :-). Grepping might help. Cheers, Carl Friedrich
Carl Friedrich Bolz:
http://python.net/~gherman/tmp/sample.dot http://python.net/~gherman/tmp/sample.pdf http://python.net/~gherman/tmp/sample.sample-dotviewer.jpg
Sorry, as you probably found out, the last link must be: http://python.net/~gherman/tmp/sample-dotviewer.jpg
The PyPy dot viewer isn't working well for records, since PyPy hasn't used them so far. I guess adding support would maybe be easy. Apart from the fact that the borders of the record boxes are missing, what else do you think is wrong with the jpg above? It looks very similar to the pdf.
I understand and I didn't expect records to work, but I thought that rectangles were common enough to support them. ;-) A quick code review shows that GraphRenderer.draw_node_commands() in drawgraph.py ignores the "rect" node shape, hmm... Funny, but the GraphViz docs don't mention a "rect" shape although it seems to work with dot/neato etc. But ok, after changing my stuff to use "box" instead of "rect" dotviewer renders them happily as rects... Marius Gedminas:
There's http://code.google.com/p/jrfonseca/wiki/XDot, which barfed on my .dot files that tried to use HSV colours. It also links to http://zvtm.sourceforge.net/zgrviewer.html which I've never tried.
The first is too heavy to install for me on OS X now (PyGTK) and the seconds looks promising (although very javaish) and very capa- ble of zooming, but not of folding/unfolding.
<reminiscence> My introduction to PyGame was hacking PyPy's dot viewer during the Vilnius sprint... Ahh, those were the times. </reminiscence>
Be prepared for a few questions in Vilnius, then! ;-) I think this folding would be a great feature to have, also for PyPy. Does that look like a sprint topic? Thanks, Dinu
On Thu, Jun 26, 2008 at 11:19 AM, Dinu Gherman <gherman@darwin.in-berlin.de> wrote:
Carl Friedrich Bolz:
http://python.net/~gherman/tmp/sample.dot
http://python.net/~gherman/tmp/sample.pdf
http://python.net/~gherman/tmp/sample.sample-dotviewer.jpg
Sorry, as you probably found out, the last link must be: http://python.net/~gherman/tmp/sample-dotviewer.jpg
The PyPy dot viewer isn't working well for records, since PyPy hasn't used them so far. I guess adding support would maybe be easy. Apart from the fact that the borders of the record boxes are missing, what else do you think is wrong with the jpg above? It looks very similar to the pdf.
I understand and I didn't expect records to work, but I thought that rectangles were common enough to support them. ;-) A quick code review shows that GraphRenderer.draw_node_commands() in drawgraph.py ignores the "rect" node shape, hmm... Funny, but the GraphViz docs don't mention a "rect" shape although it seems to work with dot/neato etc. But ok, after changing my stuff to use "box" instead of "rect" dotviewer renders them happily as rects... Marius Gedminas:
There's http://code.google.com/p/jrfonseca/wiki/XDot, which barfed on my .dot files that tried to use HSV colours. It also links to http://zvtm.sourceforge.net/zgrviewer.html which I've never tried.
The first is too heavy to install for me on OS X now (PyGTK) and the seconds looks promising (although very javaish) and very capa- ble of zooming, but not of folding/unfolding.
<reminiscence> My introduction to PyGame was hacking PyPy's dot viewer during the Vilnius sprint... Ahh, those were the times. </reminiscence>
Be prepared for a few questions in Vilnius, then! ;-) I think this folding would be a great feature to have, also for PyPy. Does that look like a sprint topic? Thanks, Dinu
Absolutely.
participants (5)
-
Carl Friedrich Bolz
-
Dinu Gherman
-
Leonardo Santagada
-
Maciej Fijalkowski
-
Marius Gedminas