From dcc47a81c0763c8a9bd23f68a69fd15d9fb85c0d Mon Sep 17 00:00:00 2001 From: Ariyan Eghbal Date: Mon, 25 Jul 2022 01:54:25 +0430 Subject: [PATCH] feat: save dotfile if graphviz is available This tries to save a graphviz dotfile is the pygraphviz library is installed (optional) --- utils/vis.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/vis.py b/utils/vis.py index ae21384..42d8815 100755 --- a/utils/vis.py +++ b/utils/vis.py @@ -262,6 +262,11 @@ def save_measurement_graph(graph_name, attach_jscss): graph_name = graph_name[:-5] graph_path = graph_name + ".html" net_vis.save_graph(graph_path) + try: + import pygraphviz + nx.nx_agraph.write_dot(multi_directed_graph, graph_name + ".dot") + except ImportError: + pass print("saved: " + graph_path)