Render network map graph horizontally. Makes much more efficient use of space.

This commit is contained in:
Robert Chacón 2023-04-15 10:29:49 -06:00 committed by GitHub
parent 286c2a4931
commit ffda0a08f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -418,7 +418,7 @@ class NetworkGraph:
import graphviz
dot = graphviz.Digraph(
'network', comment="Network Graph", engine="dot")
'network', comment="Network Graph", engine="dot", graph_attr={'rankdir':'LR'})
for (i, node) in enumerate(self.nodes):
if ((node.type != NodeType.client and node.type != NodeType.device) or showClients):
@ -436,6 +436,6 @@ class NetworkGraph:
if child != i:
if (self.nodes[child].type != NodeType.client and self.nodes[child].type != NodeType.device) or showClients:
dot.edge("N" + str(i), "N" + str(child))
dot = dot.unflatten(stagger=3)#, fanout=True)
dot.render("network")