Hi
Can I get graphviz to color the edges in a way that identifies the direction? For example, the part of the edge near its source node might be blue and then it gradually shades away to red as it nears the target node. Or are there any other graphing tools (like graphviz) that can do this?
Any help in this regard would be much appreciated.
Well, i don't know anything about your current dot file, so i'll have to make a couple of assumptions. To deal with the easy case first, distinguishing the the direction of an edge is the job of the arrowhead (points to) and arrowtail (points from). Your graph is only going to render those if your graph type is a directed graph, which you set at the top of your dot file, e.g.,
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've already crated a directed graph but for some reason you want an additional indicator to show edge direction, then the only relevant edge attributes i can think of are the headlabel and taillabel attributes, which allows you to specify which end of an edge a label is placed. The small dot file above will render this graph:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With