Last active
January 15, 2024 16:26
-
-
Save craigarms/4b0bc047c1bb4ea162728e08f3e28792 to your computer and use it in GitHub Desktop.
Revisions
-
craigarms revised this gist
Jan 15, 2024 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,9 +6,9 @@ graph.attr(size='8,5') graph.node_attr.update(color='lightblue2', style='filled') graph.attr('node', shape='box', fontname="Arial", style='filled, rounded', fillcolor='#e2e2f0') graph.node('b_start', label='Bob') graph.node('b_0', label='', shape='point', height='0') graph.node('b_1', label='', shape='point', height='0') graph.node('b_2', label='', shape='point', height='0') graph.node('b_3', label='', shape='point', height='0') @@ -19,24 +19,24 @@ graph.edge('b_2', 'b_3', style='dashed', arrowhead='none') graph.edge('b_3', 'b_end', style='dashed', arrowhead='none') graph.node('a_start', label='Alice') graph.node('a_0', label='', shape='point', height='0') graph.node('a_1', label='', shape='point', height='0') graph.node('a_2', label='', shape='point', height='0') graph.node('a_3', label='', shape='point', height='0') graph.node('a_end', label='Alice') graph.edge('a_start', 'a_0', style='dashed', arrowhead='none') graph.edge('a_0', 'a_1', style='dashed', arrowhead='none') graph.edge('a_1', 'a_2', style='dashed', arrowhead='none') graph.edge('a_2', 'a_3', style='dashed', arrowhead='none') graph.edge('a_3', 'a_end', style='dashed', arrowhead='none') graph.node('c_start', label='Charlie') graph.node('c_0', label='', shape='point', height='0') graph.node('c_1', label='', shape='point', height='0') graph.node('c_2', label='', shape='point', height='0') graph.node('c_3', label='', shape='point', height='0') graph.node('c_end', label='Charlie') graph.edge('c_start', 'c_0', style='dashed', arrowhead='none') graph.edge('c_0', 'c_1', style='dashed', arrowhead='none') graph.edge('c_1', 'c_2', style='dashed', arrowhead='none') @@ -65,4 +65,4 @@ # Save the graph as an image graph.render('output_graph_3', format='png', cleanup=False) -
craigarms created this gist
Jan 15, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,68 @@ from graphviz import Digraph # Create a Digraph from the DOT content graph = Digraph(format='png') graph.attr(dpi='300') graph.attr(size='8,5') graph.node_attr.update(color='lightblue2', style='filled') graph.attr('node', shape='box', fontname="Arial", style='filled', fillcolor='#e2e2f0', rank="same") graph.node('b_start', label='Bob', group="1") graph.node('b_0', label='', shape='point', height='0', group="1") graph.node('b_1', label='', shape='point', height='0') graph.node('b_2', label='', shape='point', height='0') graph.node('b_3', label='', shape='point', height='0') graph.node('b_end', label='Bob') graph.edge('b_start', 'b_0', style='dashed', arrowhead='none') graph.edge('b_0', 'b_1', style='dashed', arrowhead='none') graph.edge('b_1', 'b_2', style='dashed', arrowhead='none') graph.edge('b_2', 'b_3', style='dashed', arrowhead='none') graph.edge('b_3', 'b_end', style='dashed', arrowhead='none') graph.node('a_start', label='Alice', group="1") graph.node('a_0', label='', shape='point', height='0', group="1") graph.node('a_1', label='', shape='point', height='0') graph.node('a_2', label='', shape='point', height='0') graph.node('a_3', label='', shape='point', height='0') graph.node('a_end', label='Alice', group="1") graph.edge('a_start', 'a_0', style='dashed', arrowhead='none') graph.edge('a_0', 'a_1', style='dashed', arrowhead='none') graph.edge('a_1', 'a_2', style='dashed', arrowhead='none') graph.edge('a_2', 'a_3', style='dashed', arrowhead='none') graph.edge('a_3', 'a_end', style='dashed', arrowhead='none') graph.node('c_start', label='Charlie', group="1") graph.node('c_0', label='', shape='point', height='0') graph.node('c_1', label='', shape='point', height='0') graph.node('c_2', label='', shape='point', height='0') graph.node('c_3', label='', shape='point', height='0') graph.node('c_end', label='Charlie', group="1") graph.edge('c_start', 'c_0', style='dashed', arrowhead='none') graph.edge('c_0', 'c_1', style='dashed', arrowhead='none') graph.edge('c_1', 'c_2', style='dashed', arrowhead='none') graph.edge('c_2', 'c_3', style='dashed', arrowhead='none') graph.edge('c_3', 'c_end', style='dashed', arrowhead='none') c = Digraph() c.attr(rank="same") c.edge('b_0', 'a_0', weight='0', arrowhead='vee', fontname='Arial', label='<<B>1 </B>Authentication Request>') graph.subgraph(c) c = Digraph() c.attr(rank="same") c.edge('a_1', 'c_1', weight='0', arrowhead='vee', fontname='Arial', label='<<B>2 </B>Authentication Validation>') graph.subgraph(c) c = Digraph() c.attr(rank="same") c.edge('c_2', 'a_2', weight='0', arrowhead='vee', fontname='Arial', label='<<B>3 </B>Authentication Valid>') graph.subgraph(c) c = Digraph() c.attr(rank="same") c.edge('a_3', 'b_3', weight='0', arrowhead='vee', fontname='Arial', label='<<B>4 </B>Authentication Response>') graph.subgraph(c) # Save the graph as an image graph.render('output_graph', format='png', cleanup=False)