From 7fd66987f58186d195c4f3108ed40c7c38206b24 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Fri, 6 Apr 2018 14:56:25 +0200 Subject: [PATCH] improve doc graphs display --- doc/generate_graph_data.py | 29 ++++++++++++++++++++----- doc/generate_modules_data_flow_graph.sh | 4 ++-- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/doc/generate_graph_data.py b/doc/generate_graph_data.py index 230bd6b3..843fe110 100755 --- a/doc/generate_graph_data.py +++ b/doc/generate_graph_data.py @@ -28,6 +28,10 @@ def main(): 1: data graph''', choices=[0, 1], action='store') + parser.add_argument('spline', type=str, default="ortho", + help='''The graph splines type, spline:default , ortho: orthogonal''', + choices=["ortho", "spline"], action='store') + args = parser.parse_args() with open(path, 'r') as f: @@ -63,6 +67,8 @@ def main(): for e in all_modules: f2.write(e+"\n") + output_text_graph = "" + # flow between modules if args.type == 0: @@ -81,7 +87,15 @@ def main(): else: output_set_graph.add("\"" + module + "\"" + "->" + streamingSub[stream_out] + ";\n") - output_text_graph = "" + # graph head + output_text_graph += "digraph unix {\n" + output_text_graph += "graph [pad=\"0.5\"];\n" + output_text_graph += "size=\"25,25\";\n" + output_text_graph += "splines=" + output_text_graph += args.spline + output_text_graph += ";\n" + output_text_graph += "node [color=lightblue2, style=filled];\n" + # flow between data if args.type == 1: @@ -95,13 +109,16 @@ def main(): output_set_graph.add("\"" + stream_in + "\"" + "->" + stream_out + ";\n") + # graph head + output_text_graph += "digraph unix {\n" + output_text_graph += "graph [pad=\"0.5\"];\n" + output_text_graph += "size=\"25,25\";\n" + output_text_graph += "splines=" + output_text_graph += args.spline + output_text_graph += ";\n" + output_text_graph += "node [color=tan, style=filled];\n" - # graph head - output_text_graph += "digraph unix {\n"\ - "graph [pad=\"0.5\"];\n"\ - "size=\"25,25\";\n"\ - "node [color=lightblue2, style=filled];\n" # create final txt graph for elem in output_set_graph: diff --git a/doc/generate_modules_data_flow_graph.sh b/doc/generate_modules_data_flow_graph.sh index d9bbbbfd..790d461a 100755 --- a/doc/generate_modules_data_flow_graph.sh +++ b/doc/generate_modules_data_flow_graph.sh @@ -1,4 +1,4 @@ #!/bin/bash -python3 $AIL_HOME/doc/generate_graph_data.py 0 | dot -T png -o $AIL_HOME/doc/module-data-flow.png -python3 $AIL_HOME/doc/generate_graph_data.py 1 | dot -T png -o $AIL_HOME/doc/data-flow.png +python3 $AIL_HOME/doc/generate_graph_data.py 0 ortho | dot -T png -o $AIL_HOME/doc/module-data-flow.png +python3 $AIL_HOME/doc/generate_graph_data.py 1 ortho | dot -T png -o $AIL_HOME/doc/data-flow.png