Skip to content

Instantly share code, notes, and snippets.

@mxswd
Created September 21, 2011 01:13
Show Gist options
  • Save mxswd/1230922 to your computer and use it in GitHub Desktop.
Save mxswd/1230922 to your computer and use it in GitHub Desktop.
Class Diagram / ERD Graphviz example. Compile with `dot -Tpdf diagram.gv > diagram.pdf`
digraph models_diagram {
graph[overlap=false, splines=true]
"Venue" [shape=record, label="{\
Venue|name :string\l\
}"]
"User" [shape=record, label="{User|\
email :string\l\
password :string\l\
}"]
"Order" [shape=record, label="{Order|\
name :string\l\
}"]
{ rank=same; "User" "Venue" }
"User" -> "Order" [arrowtail=odot, arrowhead=crow, dir=both, label="request"]
"User" -> "Venue" [arrowtail=odot, arrowhead=crow, dir=both, label=agent]
}
@einarmagnus
Copy link

For anybody finding this and wondering why it doesn't compile it is because of line 16.

Line 19 says User -> Venue so they can impossibly be the same rank.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment