Writing huge graphs in Graphviz is tedious. One day I will write my graphs in a custom format, which I will then transform into DOT format, but currently I want to find out the ways to write DOT files manually as succinctly as possible. I currently know of only one syntax shortcut: a -- {b c};
is equivalent to a -- b; a -- c;
. In the DOT file currently there are many repeating patterns, for example many edges have the same label. Can I write something like:
// something that expands -m> into [label=meaning]
"English/cat" -m> "Meaning/cat_(Felidae)";
"English/cat" -m> "Meaning/domestic_cat";
"English/cat" -m> "Meaning/catfish";
"English/cat" -m> "Meaning/jazz_player";
"English/cat" -m> "Meaning/cat_(nautical)";
So that it would be equivalent to the below:
"English/cat" -> "Meaning/cat_(Felidae)" [label=meaning];
"English/cat" -> "Meaning/domestic_cat" [label=meaning];
"English/cat" -> "Meaning/catfish" [label=meaning];
"English/cat" -> "Meaning/jazz_player" [label=meaning];
"English/cat" -> "Meaning/cat_(nautical)" [label=meaning];
Is this possible? Are there any other possible syntax shortcuts in Graphviz that would make DOT files simpler and shorter? I would be happy if you could compile all such methods in the answers.