Skip to content

Commit

Permalink
Boxes + horizonal flow makes for more readable call graphs.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVF committed Nov 12, 2024
1 parent 3befc96 commit 2aee055
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion slither/printers/call/call_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()))]
+ ["}"]
)
Expand All @@ -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))
Expand Down

0 comments on commit 2aee055

Please sign in to comment.