Skip to content

Instantly share code, notes, and snippets.

@cstorey
Last active December 13, 2016 10:58
Show Gist options
  • Save cstorey/38d2ba04f661a7ed727d76cd47d6b40e to your computer and use it in GitHub Desktop.
Save cstorey/38d2ba04f661a7ed727d76cd47d6b40e to your computer and use it in GitHub Desktop.
Graphviz lamport diagrams (borrowed from palvaro's molly)
digraph spacetime {
rankdir=TD
splines=line
// outputorder=nodesfirst
subgraph cluster_proc_nodes {
label="";
proc_a [label="Process a",group="a"];
proc_b [label="Process b",group="b"];
}
node_a_1[label="1", group="a"];
node_a_2[label="2", group="a", shape="point"];
node_a_3[label="3", group="a", shape="point"];
node_a_4[label="4", group="a"];
node_b_1[label="1", group="b", shape="point"];
node_b_2[label="2", group="b"];
node_b_3[label="3", group="b"];
node_b_4[label="4", group="b", shape="point"];
node_a_1 ->node_b_2[constraint=false, label="req"];
node_b_3 ->node_a_4[constraint=false, label="res"];
edge[weight=2, arrowhead=none, color=gray75, fillcolor=gray75];
proc_a -> node_a_1 -> node_a_2 -> node_a_3 -> node_a_4 ;
edge[weight=2, arrowhead=none, color=gray75, fillcolor=gray75];
proc_b -> node_b_1 -> node_b_2 -> node_b_3 -> node_b_4 ;
}
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.38.0 (20140413.2041)
-->
<!-- Title: spacetime Pages: 1 -->
<svg width="234pt" height="380pt"
viewBox="0.00 0.00 234.00 380.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 376)">
<title>spacetime</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-376 230,-376 230,4 -4,4"/>
<g id="clust1" class="cluster"><title>cluster_proc_nodes</title>
<polygon fill="none" stroke="black" points="8,-312 8,-364 218,-364 218,-312 8,-312"/>
</g>
<!-- proc_a -->
<g id="node1" class="node"><title>proc_a</title>
<ellipse fill="none" stroke="black" cx="60" cy="-338" rx="44.393" ry="18"/>
<text text-anchor="middle" x="60" y="-334.3" font-family="Times,serif" font-size="14.00">Process a</text>
</g>
<!-- node_a_1 -->
<g id="node3" class="node"><title>node_a_1</title>
<ellipse fill="none" stroke="black" cx="60" cy="-265" rx="27" ry="18"/>
<text text-anchor="middle" x="60" y="-261.3" font-family="Times,serif" font-size="14.00">1</text>
</g>
<!-- proc_a&#45;&gt;node_a_1 -->
<g id="edge3" class="edge"><title>proc_a&#45;&gt;node_a_1</title>
<path fill="none" stroke="#bfbfbf" d="M60,-319.813C60,-308.65 60,-294.16 60,-283.029"/>
</g>
<!-- proc_b -->
<g id="node2" class="node"><title>proc_b</title>
<ellipse fill="none" stroke="black" cx="166" cy="-338" rx="44.393" ry="18"/>
<text text-anchor="middle" x="166" y="-334.3" font-family="Times,serif" font-size="14.00">Process b</text>
</g>
<!-- node_b_1 -->
<g id="node7" class="node"><title>node_b_1</title>
<ellipse fill="black" stroke="black" cx="166" cy="-265" rx="1.8" ry="1.8"/>
</g>
<!-- proc_b&#45;&gt;node_b_1 -->
<g id="edge7" class="edge"><title>proc_b&#45;&gt;node_b_1</title>
<path fill="none" stroke="#bfbfbf" d="M166,-319.813C166,-300.77 166,-272.046 166,-266.828"/>
</g>
<!-- node_a_2 -->
<g id="node4" class="node"><title>node_a_2</title>
<ellipse fill="black" stroke="black" cx="60" cy="-178" rx="1.8" ry="1.8"/>
</g>
<!-- node_a_1&#45;&gt;node_a_2 -->
<g id="edge4" class="edge"><title>node_a_1&#45;&gt;node_a_2</title>
<path fill="none" stroke="#bfbfbf" d="M60,-246.799C60,-224.29 60,-186.896 60,-180.082"/>
</g>
<!-- node_b_2 -->
<g id="node8" class="node"><title>node_b_2</title>
<ellipse fill="none" stroke="black" cx="166" cy="-178" rx="27" ry="18"/>
<text text-anchor="middle" x="166" y="-174.3" font-family="Times,serif" font-size="14.00">2</text>
</g>
<!-- node_a_1&#45;&gt;node_b_2 -->
<g id="edge1" class="edge"><title>node_a_1&#45;&gt;node_b_2</title>
<path fill="none" stroke="black" d="M76.5625,-250.719C93.8852,-236.828 121.273,-214.866 141.181,-198.902"/>
<polygon fill="black" stroke="black" points="143.592,-201.455 149.204,-192.469 139.213,-195.994 143.592,-201.455"/>
<text text-anchor="middle" x="128" y="-217.8" font-family="Times,serif" font-size="14.00">req</text>
</g>
<!-- node_a_3 -->
<g id="node5" class="node"><title>node_a_3</title>
<ellipse fill="black" stroke="black" cx="60" cy="-105" rx="1.8" ry="1.8"/>
</g>
<!-- node_a_2&#45;&gt;node_a_3 -->
<g id="edge5" class="edge"><title>node_a_2&#45;&gt;node_a_3</title>
<path fill="none" stroke="#bfbfbf" d="M60,-175.996C60,-168.041 60,-115.267 60,-107.069"/>
</g>
<!-- node_a_4 -->
<g id="node6" class="node"><title>node_a_4</title>
<ellipse fill="none" stroke="black" cx="60" cy="-18" rx="27" ry="18"/>
<text text-anchor="middle" x="60" y="-14.3" font-family="Times,serif" font-size="14.00">4</text>
</g>
<!-- node_a_3&#45;&gt;node_a_4 -->
<g id="edge6" class="edge"><title>node_a_3&#45;&gt;node_a_4</title>
<path fill="none" stroke="#bfbfbf" d="M60,-103.045C60,-96.5888 60,-58.8832 60,-36.2266"/>
</g>
<!-- node_b_1&#45;&gt;node_b_2 -->
<g id="edge8" class="edge"><title>node_b_1&#45;&gt;node_b_2</title>
<path fill="none" stroke="#bfbfbf" d="M166,-263.045C166,-256.589 166,-218.883 166,-196.227"/>
</g>
<!-- node_b_3 -->
<g id="node9" class="node"><title>node_b_3</title>
<ellipse fill="none" stroke="black" cx="166" cy="-105" rx="27" ry="18"/>
<text text-anchor="middle" x="166" y="-101.3" font-family="Times,serif" font-size="14.00">3</text>
</g>
<!-- node_b_2&#45;&gt;node_b_3 -->
<g id="edge9" class="edge"><title>node_b_2&#45;&gt;node_b_3</title>
<path fill="none" stroke="#bfbfbf" d="M166,-159.813C166,-148.65 166,-134.16 166,-123.029"/>
</g>
<!-- node_b_3&#45;&gt;node_a_4 -->
<g id="edge2" class="edge"><title>node_b_3&#45;&gt;node_a_4</title>
<path fill="none" stroke="black" d="M149.438,-90.7188C132.115,-76.8279 104.727,-54.8657 84.8188,-38.9019"/>
<polygon fill="black" stroke="black" points="86.7871,-35.9939 76.796,-32.4685 82.408,-41.455 86.7871,-35.9939"/>
<text text-anchor="middle" x="127" y="-57.8" font-family="Times,serif" font-size="14.00">res</text>
</g>
<!-- node_b_4 -->
<g id="node10" class="node"><title>node_b_4</title>
<ellipse fill="black" stroke="black" cx="166" cy="-18" rx="1.8" ry="1.8"/>
</g>
<!-- node_b_3&#45;&gt;node_b_4 -->
<g id="edge10" class="edge"><title>node_b_3&#45;&gt;node_b_4</title>
<path fill="none" stroke="#bfbfbf" d="M166,-86.799C166,-64.2902 166,-26.896 166,-20.0824"/>
</g>
</g>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment