Graphviz: edge direction in color

Hello
Can I get graphviz to color the edges in such a way as to determine the direction? For example, the part of the edge next to its source node may be blue, and then it is gradually discarded to red when it approaches the target node. Or are there other graphical display tools (e.g. graphviz) that can do this?

Any help in this regard would be greatly appreciated.

+4
source share
2 answers

Well, I don't know anything about your current point file, so I will have to make a couple of assumptions. First of all, in order to cope with an easy case, to distinguish the direction of the edge is the task of the arrow (points to) and the arrow (points from). Your graph will only display them if your graph type is a directional graph that you set at the top of your point file, for example,

digraph G { node[style=filled, color=cornflowerblue, fontcolor=white, fontsize=10, fontname='Helvetica'] edge[arrowhead=vee, arrowtail=inv, arrowsize=.7, color=maroon, fontsize=10, fontcolor=navy] a1 -> a2; a2 -> a4 [taillabel="TL "]; a2 -> a5 [headlabel=" HL"]; a4 -> a6 [label=" ordinary edge label"] } 

If you have already processed the directed graph, but for some reason you want the additional indicator to show the direction of the edge, then only the corresponding edge attributes that I can think of are headlabel and taillabel , which allows you to indicate which end of the edge is placed label. The small dot file above displays this graph:

alt text

+6
source

Starting in 2012 and 2.30.0, Graphviz has supported the gradient color="blue:red" : color="blue:red" .

+2
source

All Articles