From 574b1b4f084527d3ebe13cc8da82d073d596d32c Mon Sep 17 00:00:00 2001 From: Anil Tuncel Date: Fri, 20 Oct 2023 09:54:27 +0200 Subject: [PATCH] update plotting of dependency_graph --- Makefile | 4 ++-- .../{efel_graph_dependency => efel_graph_dependency.py} | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) rename utils/{efel_graph_dependency => efel_graph_dependency.py} (95%) diff --git a/Makefile b/Makefile index 80fbd0bd..a74476ef 100644 --- a/Makefile +++ b/Makefile @@ -53,5 +53,5 @@ push: clean install test doc doc_upload format: clang-format -i -style="google" efel/cppcore/*.cpp graph: - pip install pygraphviz==1.3.1 - utils/efel_graph_dependency -i efel/DependencyV5.txt --graph dependencies.png --graph-deps + pip install pygraphviz==1.11 + python utils/efel_graph_dependency.py -i efel/DependencyV5.txt --graph dependencies.png --graph-deps diff --git a/utils/efel_graph_dependency b/utils/efel_graph_dependency.py similarity index 95% rename from utils/efel_graph_dependency rename to utils/efel_graph_dependency.py index 83437fc7..9f08197f 100755 --- a/utils/efel_graph_dependency +++ b/utils/efel_graph_dependency.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python '''graph the dependency graph''' import argparse @@ -83,15 +82,19 @@ def output_graphivz(feature_library, filename, draw_dependencies=False, import sys sys.exit('Need to have the "pygraphviz" package installed') G = pygraphviz.AGraph(name='Dependencies', directed=True) + # below attributes are for the aesthetics G.graph_attr['overlap'] = 'false' - G.graph_attr['rankdir'] = 'TB' + G.graph_attr['rankdir'] = 'LR' + G.graph_attr['ranksep'] = '2.5' + G.graph_attr['nodesep'] = '0' + for library, color in zip(sorted(feature_library.keys()), COLORS): if 'Default' == library: continue G.add_node(library, shape='circle', color=color) sg = G.add_subgraph(name=library, style="") - for name, feature in feature_library[library].iteritems(): + for name, feature in feature_library[library].items(): full_name = library + ':' + name sg.add_node(full_name, label=name, shape='box', color=color) sg.add_edge(library, full_name, color=color)