From 1cf796fd2283d375e4e1532d211149444712d37c Mon Sep 17 00:00:00 2001 From: srinivas11789 Date: Wed, 8 May 2019 19:25:40 -0700 Subject: [PATCH] :construction: initial fix to #37 ( enrich graph ) --- Source/Module/plot_lan_network.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/Module/plot_lan_network.py b/Source/Module/plot_lan_network.py index 916c648..5758286 100644 --- a/Source/Module/plot_lan_network.py +++ b/Source/Module/plot_lan_network.py @@ -27,8 +27,10 @@ def __init__(self, filename, path, option="Tor"): 'fontsize': '16', 'fontcolor': 'black', 'bgcolor': 'grey', - 'rankdir': 'BT', - 'dpi':'1000' + 'rankdir': 'LR', # BT + 'dpi':'1000', + 'size': '10, 10', + 'overlap': 'scale' }, 'nodes': { 'fontname': 'Helvetica', @@ -72,8 +74,12 @@ def apply_custom_style(self, graph, color): return graph def draw_graph(self,option="All"): - f = Digraph('network_diagram - '+option, filename=self.filename, engine="dot", format="png") - f.attr(rankdir='LR', size='8,5') + #f = Digraph('network_diagram - '+option, filename=self.filename, engine="dot", format="png") + #f.attr(rankdir='LR', size='8,5') + if len(memory.lan_hosts) > 20: + f = Digraph('network_diagram - '+option, filename=self.filename, engine="circo", format="png") + else: + f = Digraph('network_diagram - '+option, filename=self.filename, engine="dot", format="png") f.attr('node', shape='doublecircle') #f.node('defaultGateway')