From 2aee0555b43ae733e227510fc25dc197fcc916ac Mon Sep 17 00:00:00 2001 From: Daniel Von Fange Date: Tue, 12 Nov 2024 08:57:23 -0500 Subject: [PATCH] Boxes + horizonal flow makes for more readable call graphs. --- slither/printers/call/call_graph.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/slither/printers/call/call_graph.py b/slither/printers/call/call_graph.py index 38225e6d7a..4f13a7d44b 100644 --- a/slither/printers/call/call_graph.py +++ b/slither/printers/call/call_graph.py @@ -256,6 +256,8 @@ def output(self, filename: str) -> Output: } content = "\n".join( ["strict digraph {"] + + ["rankdir=\"LR\""] + + ["node [shape=box]"] + [_process_functions(list(all_functions_as_dict.values()))] + ["}"] ) @@ -267,7 +269,11 @@ def output(self, filename: str) -> Output: with open(derived_output_filename, "w", encoding="utf8") as f: info += f"Call Graph: {derived_output_filename}\n" content = "\n".join( - ["strict digraph {"] + [_process_functions(derived_contract.functions)] + ["}"] + ["strict digraph {"] + + ["rankdir=\"LR\""] + + ["node [shape=box]"] + + [_process_functions(derived_contract.functions)] + + ["}"] ) f.write(content) results.append((derived_output_filename, content))