Add a grid to your graphs

addGrid.gvpr - a postprocessor that will add a grid to your Graphviz graph.
unix.Ranks
Find it here
It can do horizontal, vertical, or both; edge styles, (multiple) colors, fixed increment or centered on ranks.
Mostly a toy, but probably useful on larger graphs.
Example command line:

dot myFile.gv | gvpr -a 'size=rank Gcolor=green,purple,red grid=horizontal' -cf addGrid.gvpr |neato -n2 ...

Enjoy

1 Like

Hi Steve,

this is pretty impressive and it made me think.

I even had a look at the manual: gvpr | Graphviz
but I don’t think it provided the answer to this question: what is the output of gvpr?
I thought it was a tool dot → dot, but these lines aren’t part of the dot language afaik.
So, what is the outcome? Or which tool is the output formatter?

Cheers,
Klaus

Simple answer: the output of gvpr is the Graphviz / dot language. The grid lines are a result of adding new nodes around the periphery of the graph and then adding (straight) edges connecting the nodes.

More complete answer: gvpr is a complete language and could probably be used to write a (very simple) compiler. (Not on my TODO list). Here is a lint program written in GVPR. No dot output, just text.

For an example of the breadth of gvpr, here is a radial layout engine written in gvpr. Legal dot input and legal dot output.

1 Like

I needed to come back and read this again. Impressive. Well done!
Do you have somewhere a list of “documented” gvpr use cases? I see it here mentioned every now and then. But do you have a systematic list of examples?

Nope, nothing systematic about any of my efforts. I am slowly working on documenting the more interesting programs, if I can figure out what they do.
Note that some are posted here.