specify output file name and renderer INSIDE dot file?

I am currently mapping out a complex system, and Graphviz is helping me quite a bit.

The problem that I am running into is that gvedit does not remember where I saved a file last, what the output format was, or which renderer I used. Some parts of the graphs look better with one engine, others look better with another, and because exploring the system is an iterative process I come back and modify my graphs from time to time...

One way to avoid this, would be to specify the output filename, format and renderer inside the dot file itself. I spent a few hours already looking for a solution to this, but have not gotten anything to work yet.

Best I could come up with is a simple dot file like this:

digraph test {
directory="D:\Work\Projects\IsoMetrix Study\gv";
a -> b;

It parses, ie: it gives me a graph when I run it in gvedit, but it completely ignores the arguments for output file...

Is this supported and I am just doing something wrong?

The only supported attribute

The only supported attribute you want is layout (instead of engine) by which a file can specify how the graph should be laid out. If you could run dot from the command line, it would be simple to write a small script that extracted the output filename and format info from the file and used these for the -T and -o flags. gvedit is built using Qt. I'm not sure, but maybe it is possible to reset the defaults for the format and file. It would certainly be a reasonable feature for gvedit to remember your previous settings.

gvedit features..

Hi there! Thanks for the reply, and the information on layout. It will certainly help.

Unfortunately, the machine that I am doing most of my work on is supplied by my employer, and HAS to be windows. Scripting on Windows is like being poked in the eye, which is why I am using gvedit in the first place. I have adapted my workflow to work around gvedit's quirks.

The biggest issue is that it seems to support multiple files being open at the same time, but it does not remember each file's output settings. When you open a valid gvedit file, it renders that file, using the output settings of the previous file's render, and clobbers the finely crafted image from the other open file.

Currently I just open gvedit, edit the file I want, let it clobber the default png file, and once I am happy with the output change the output format and directory to the file that I want, and then close gvedit to reset it's settings.

The layout feature that is supported will already remove one step from the process, so it's a boon.

Thanks again for the help.


Recent comments