Skip to content

Commit 1c5cdae

Browse files
committed
Improve initialization of spring layout k parameter
1 parent 04fbce7 commit 1c5cdae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

netgraph/_node_layout.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,8 @@ def get_fruchterman_reingold_layout(edges,
449449
fixed_node_sizes = np.array([])
450450

451451
if k is None:
452-
area = np.product(scale)
452+
# area = np.product(scale)
453+
area = np.pi * (min(scale) / 2) ** 2
453454
k = np.sqrt(area / float(total_nodes))
454455

455456
temperatures = _get_temperature_decay(initial_temperature, total_iterations)

0 commit comments

Comments
 (0)