graphvizdot

Graphviz: automatic variables?


Suppose I define a node:

"somenode" [xlabel="somenode"]

Is there an automatic variable, as in make such that I can write, for example (in pseudo code) something like:

"somenode" [xlabel=$@]

Solution

  • You can use graphviz-py to make a variable.

    Code

    digraph g {
    {{ some_node_name = "somenode" }}
    
    "{{= some_node_name }}" [xlabel="{{= some_node_name }}"]
    
    }
    

    Output

    Output