Onion Diagram (Nested Ellipses)

  • First let’s note that Graphviz is not well suited to producing Onion diagrams. Graphviz can produce many cool graphs, but Onion diagrams weren’t on the requirements list.

  • If you are only intending to produce one or two of these diagrams, a gui-based drawing program might be best.

  • If you want to automate the process, you might also look at dpic (Dpic distribution). A bit lower-level, but more explicit positioning commands.

  • If you are still interested in using Graphviz, here is a way to get nested ellipses:

    graph nest {
    // built by hand/eyeball
    node [shape=ellipse fixedsize=true]
    a [width=3 height=2.2 pos=“400,100” label=“first\n\n\n\n\n\n\n” ]
    b [width=2 height=1.4 pos=“400,75” label=“second\n\n\n\n\n” ]
    c [width=1 height=.8 pos=“400,60” label=“third” ]

    notes[shape=plaintext  pos="700,60" label=<
      <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
      <TR><TD PORT="p1">note 1</TD></TR>
      <TR><TD PORT="p2">note 3</TD></TR>
      <TR><TD PORT="p3">note 2</TD></TR>
      </TABLE>>  ]
    
    edge[style=dotted]
    a--notes:p1
    b--notes:p2
    c--notes:p3    
    

    }

Producing this:
nestedEllipse

Instead of using dot, this uses neato -n (see the FAQ FAQ | Graphviz)
The downside is that you have to provide all the positioning and sizing - a pain the first time, but pretty easy to automate