'How to style graphviz terminal nodes only?
I use the targetIncludes goal of the depgraph-maven-plugin to produce a dot file, and generate a graph.
When I configure the "dot" layout engine its obvious where the terminal nodes are - at the bottom of the diagram. But if I switch to the "fdp" layout its difficult to make them out.
How can I style/color these terminal nodes differently during the generation of the dot file? (obviously I could edit the dot file afterwards)
Solution 1:[1]
(I don't know about depgraph-maven capabilities).
The Graphviz language does not include any conditionals, however it includes a pre-processor/post-processor language - gvpr (https://www.graphviz.org/pdf/gvpr.1.pdf) that can easily color terminal nodes.
If you can produce output with format = canon or dot (https://graphviz.org/docs/outputs/canon/) then run that file through gvpr like so:
gvpr -c 'N{if($.indegree=="0"||$.outdegree=="0"){$.style="filled";$.color="red";};}' myoutputfile
Then run that file thru fdp, neato, dot, or whatever engine you like.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | sroush |
