How does one define double-lines for edge and node shapes in graphviz dot?

Judge Maygarden picture Judge Maygarden · Jun 2, 2011 · Viewed 8.8k times · Source

How can edges and nodes be styled using graphviz dot with doubled lines as shown the in the "LEGAL" and "TAX DISC" nodes of the following diagram?

ER Diagram

Answer

marnir picture marnir · Jun 2, 2011

Doubled shapes can be done by using [peripheries=2] on the node

Doubled edges can be done by specifying more than one colour for the edge, separated by a colon. In this case use the same colour twice: [color="black:black"] (or, to separate them slightly more, do [color="black:invis:black"])

I got there eventually! Sorry for the "evolutionary" nature of this answer :-)

So for example

graph G {
    Foo [peripheries=2]
    Foo -- Bar [color="black:white:black"]
}