Skip to content

Commit 7928c25

Browse files
committed
visualization.py improve layout for small graphs
1 parent f776627 commit 7928c25

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pyirk/visualization.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,10 @@ def get_node_color(node):
535535
else:
536536
return "black"
537537

538-
if len(G.edges) < 4:
538+
if len(G.edges) <= 2:
539539
layout = "dot"
540+
elif len(G.edges) <= 8:
541+
layout = "fdp"
540542
else:
541543
layout = "sfdp"
542544

@@ -579,6 +581,7 @@ def get_node_color(node):
579581
"arrowType": "normal",
580582
"penwidth": 2,
581583
"minlen": 1, # note: this only applies to dot layout
584+
"len": 1, # note: this only applies to dot fdp layout
582585
# label
583586
"label": d["edge"].short_key,
584587
"fontsize": FONTSIZE,

0 commit comments

Comments
 (0)