Does the DOT language support variables / aliases?

You can define default values in order to avoid repetition:

digraph g{
   node[fillcolor=red];
   barn;
   house;
   ...
   node[fillcolor=green];
   farm;
   ...

   edge[color=red];
   barn -> house;
   edge[color=green];
   barn --> farm;
   house --> farm;
}

Real variables are not supported.


A more complex workaround would be to use gvprgraph pattern scanning and processing language.

gvpr reads and outputs graph and allows to add and modify graphs, nodes and attributes.

You could for example store custom information in the comment attribute and have your script act based on the content of this attribute.

This and this SO answer contain examples of gvpr scripts.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)