Skip to content

Commit

Permalink
Improve initialization of spring layout k parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbrodersen committed Dec 11, 2023
1 parent 04fbce7 commit 1c5cdae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion netgraph/_node_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,8 @@ def get_fruchterman_reingold_layout(edges,
fixed_node_sizes = np.array([])

if k is None:
area = np.product(scale)
# area = np.product(scale)
area = np.pi * (min(scale) / 2) ** 2
k = np.sqrt(area / float(total_nodes))

temperatures = _get_temperature_decay(initial_temperature, total_iterations)
Expand Down

0 comments on commit 1c5cdae

Please sign in to comment.