Skip to content

Instantly share code, notes, and snippets.

@jhrcek
Created November 22, 2019 12:50
Show Gist options
  • Select an option

  • Save jhrcek/d2f62c029384a753b51b6ec04b82ac4d to your computer and use it in GitHub Desktop.

Select an option

Save jhrcek/d2f62c029384a753b51b6ec04b82ac4d to your computer and use it in GitHub Desktop.
Example of PlantUML-like diagram in graphviz
digraph G {
// External system
node [style=filled fillcolor="#999999" shape=rectangle, fontcolor=white]
externalSystem [ label=<
<table border="0" cellborder="0" cellspacing="1">
<tr><td><b>External System</b></td></tr>
<tr><td>&lt;&lt;qualtrics&gt;&gt;</td></tr>
</table>
>];
// External user
node [style=filled fillcolor="#686868" shape=rectangle]
externalUser [ label=<
<table border="0" cellborder="0" cellspacing="1">
<tr><td><b>External User</b></td></tr>
<tr><td>I'm not from GWI</td></tr>
</table>
>]
// GWI User
node [style=filled fillcolor="#08427B" shape=rectangle]
gwiUser [ label=<
<table border="0" cellborder="0" cellspacing="1">
<tr><td><b>GWI User</b></td></tr>
<tr><td>GWI employee</td></tr>
</table>
>]
// System
node [style=filled fillcolor="#1168BD" shape=rectangle]
system1 [ label=<
<table border="0" cellborder="0" cellspacing="1">
<tr><td><b>System1</b></td></tr>
<tr><td>&lt;&lt;myteam&gt;&gt;</td></tr>
<tr><td>Fancy app</td></tr>
</table>
>]
exampleSystem [label=<
<table border="0" cellborder="0" cellspacing="1">
<tr><td><b>Example System</b></td></tr>
<tr><td>&lt;&lt;myteam&gt;&gt;</td></tr>
<tr><td>A piece of spectacular<br/>engineering</td></tr>
</table>
>]
// GWI System
node [style=filled fillcolor="#d4007b" shape=rectangle]
gwiSystem [ label=<
<table border="0" cellborder="0" cellspacing="1">
<tr><td><b>GWI System</b></td></tr>
<tr><td>&lt;&lt;otherteam&gt;&gt;</td></tr>
<tr><td>Breathtaking</td></tr>
</table>
>]
gwiSystem -> exampleSystem [label="SoftRel\nexample system works\neven if GWI System is\ndown\n[pubsub]"]
externalUser -> system1 [label="[HTTP]"]
gwiUser -> exampleSystem [label="[HTTP]"]
system1 -> exampleSystem [label="[HTTP]"]
exampleSystem -> externalSystem [label="[HTTP]"]
{rank=same;gwiSystem exampleSystem; externalSystem }
// DB
node [style=filled fillcolor="#1168BD" shape=cylinder];
database [label=<
<table border="0" cellborder="0" cellspacing="1">
<tr><td><b>Ones and zeros</b></td></tr>
<tr><td>&lt;&lt;myteam&gt;&gt;</td></tr>
<tr><td>Occasional two</td></tr>
</table>
>]
exampleSystem -> database [label="HardRel\nBreaks when\nconnection doesn't\nwork\n[HTTP]"]
// GWI DB
node [style=filled fillcolor="#d4007b" shape=cylinder];
gwiDatabase [label=<
<table border="0" cellborder="0" cellspacing="1">
<tr><td><b>GWI Database</b></td></tr>
<tr><td>&lt;&lt;otherteam&gt;&gt;</td></tr>
<tr><td>placeholder</td></tr>
</table>
>]
exampleSystem -> gwiDatabase
}
@jhrcek
Copy link
Author

jhrcek commented Nov 22, 2019

The source code above can be rendered into SVG / PNG (or any other export format supported by graphviz) with a command like

$ dot -Tpng input.dot -o output.png

Which renders an image like this

output

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