Skip to content

Commit 67bd950

Browse files
committed
Multiple dispatch was messing up because types were not specified for spring layout and `kws` not preceeded by `;`
1 parent 4d574e0 commit 67bd950

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/layout.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ julia> locs_x, locs_y = spring_layout(g)
102102
```
103103
"""
104104
function spring_layout(g::AbstractGraph,
105-
locs_x=2*rand(nv(g)).-1.0,
106-
locs_y=2*rand(nv(g)).-1.0;
105+
locs_x::Vector{R1}=2*rand(nv(g)).-1.0,
106+
locs_y::Vector{R2}=2*rand(nv(g)).-1.0;
107107
C=2.0,
108108
MAXITER=100,
109-
INITTEMP=2.0)
109+
INITTEMP=2.0) where {R1 <: Real, R2 <: Real}
110110

111111
nvg = nv(g)
112112
adj_matrix = adjacency_matrix(g)
@@ -174,7 +174,7 @@ end
174174

175175
using Random: MersenneTwister
176176

177-
function spring_layout(g::AbstractGraph, seed::Integer, kws...)
177+
function spring_layout(g::AbstractGraph, seed::Integer; kws...)
178178
rng = MersenneTwister(seed)
179179
spring_layout(g, 2 .* rand(rng, nv(g)) .- 1.0, 2 .* rand(rng,nv(g)) .- 1.0; kws...)
180180
end

0 commit comments

Comments
 (0)