Display image from Graphviz without creating an intermediate file?

I would like to display a graph without first writing the file.

Suppose I have a foo command that produces this on standard output:

 digraph foogrph { a -> b; a -> c; } 

What I would like to do is pipe foo to dot , and then pass the results to a command that displays the image in a graphical environment.

 foo | dot -Tpng | <display command> 

I found a workaround that includes temporary files. On OSX, I can do the following:

 foo | dot -Tpng > temp && open temp 

But I still need to delete the file from the file system.

How can I display an image that is being written to standard?

+7
source share
2 answers

Using the ImageMagick display command, they work with Ubuntu 12.10 (and most likely with other OSs):

 dot abac.dot -Tsvg | display dot abac.dot -Tpng | display 

SVG has the advantage of smoothly scaling with the window (if that's what you want).

+4
source

On Linux, you can also just use -Tx11:cairo to display the direct X11 window.

0
source

All Articles