Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hdavid16 committed Jul 27, 2022
1 parent 52f4aae commit 4c1f900
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/layout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,20 +205,20 @@ function shell_layout(g, nlist::Union{Nothing, Vector{Vector{Int}}} = nothing)
if nv(g) == 1
return [0.0], [0.0]
end
if nlist == nothing
if isnothing(nlist)
nlist = [collect(1:nv(g))]
end
radius = 0.0
if length(nlist[1]) > 1
radius = 1.0
end
locs_x = Float64[]
locs_y = Float64[]
locs_x = zeros(nv(g))
locs_y = zeros(nv(g))
for nodes in nlist
# Discard the extra angle since it matches 0 radians.
θ = range(0, stop=2pi, length=length(nodes)+1)[1:end-1]
append!(locs_x, radius*cos.(θ))
append!(locs_y, radius*sin.(θ))
locs_x[nodes] = radius*cos.(θ)
locs_y[nodes] = radius*sin.(θ)
radius += 1.0
end
return locs_x, locs_y
Expand Down

0 comments on commit 4c1f900

Please sign in to comment.