Search code examples
graphviz

In Graphviz, how do I add a shape in the middle of an edge?


I have annotated the following drawing with red to illustrate the effect I'm trying to achieve:

graphviz_sample

Any idea on how I can achieve this in Graphviz?


Solution

  • You can imitate this behavior by finding a suitable unicode symbol, for example, in your case, and putting it into the right position using headlabel attribute:

    digraph {
        edge [arrowhead=none]
        Student [shape=rect]
        Faculty [shape=rect]
        o
        Player [shape=rect]
    
        Student -> o
        Faculty -> o
        o -> Player [
            headlabel="⋃"
            fontsize="25"
            labeldistance="1.7"
            labelangle=0
        ]
    }
    

    Result: