graphvizneato

Is there a way to make edge length start from the nodes' borders?


If I have a simple graph with no node decoration, then len works fine:

digraph {
    A -> { B1,B2,B3 } [len=3]
} 

enter image description here

However, if I start adding decorations and titles, then the node in the left has a very short edge

digraph {
    node [ style="filled, rounded" fontname="Lato" margin=0.2 ]
    A [ label="Ban điều hành" shape="doubleoctagon" fillcolor="#f4f1de" fontcolor="#000000" ]
    node [ shape="plaintext " fillcolor="#81b29a" fontcolor="#000000" ]
    B1 [ label="Phát triển cộng đồng" ]
    B2 [ label="Nội dung" ]
    B3 [ label="Quản lý hệ thống" ]
    
    A -> { B1,B2,B3 } [len=3]
}

enter image description here

I guess it's because the edge length start from the nodes' centers, not their borders.

Is there a way to make them start from the nodes' borders?

I opened this on GraphViz's GitLab


Solution

  • I don't think there is a way so specify "border-to-border" (you might request this here: https://gitlab.com/graphviz/graphviz/-/issues)
    But you can increase the len value on the short edge.