Skip to content

Commit ef373d5

Browse files
committed
minor changes:
-use `iszero` -remove `stroke(nothing)` or `fill(nothing` as `nothing` is already the default for these functions in Compose.jl
1 parent 5bc0ba3 commit ef373d5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/plot.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function gplot(g::AbstractGraph{T},
152152
edgelabelsize *= (max_edgelabelsize / maximum(edgelabelsize))
153153
nodelabelsize *= (max_nodelabelsize / maximum(nodelabelsize))
154154
max_nodestrokelw = maximum(nodestrokelw)
155-
if max_nodestrokelw > 0.0
155+
if !iszero(max_nodestrokelw)
156156
nodestrokelw *= (max_edgelinewidth / max_nodestrokelw)
157157
end
158158

@@ -207,13 +207,14 @@ function gplot(g::AbstractGraph{T},
207207
end
208208
end
209209

210+
#build plot
210211
compose(context(units=UnitBox(-1.2, -1.2, +2.4, +2.4)),
211212
compose(context(), rectangle(-1.2, -1.2, +2.4, +2.4), fill(backgroundc)),
212-
compose(context(), texts, fill(nodelabelc), stroke(nothing), fontsize(nodelabelsize)),
213+
compose(context(), texts, fill(nodelabelc), fontsize(nodelabelsize)),
213214
compose(context(), nodes, fill(nodefillc), stroke(nodestrokec), linewidth(nodestrokelw)),
214-
compose(context(), edgetexts, fill(edgelabelc), stroke(nothing), fontsize(edgelabelsize)),
215+
compose(context(), edgetexts, fill(edgelabelc), fontsize(edgelabelsize)),
215216
compose(context(), arrows, stroke(edgestrokec), linewidth(edgelinewidth)),
216-
compose(context(), lines, stroke(edgestrokec), fill(nothing), linewidth(edgelinewidth)))
217+
compose(context(), lines, stroke(edgestrokec), linewidth(edgelinewidth)))
217218
end
218219

219220
function gplot(g; layout::Function=spring_layout, keyargs...)

0 commit comments

Comments
 (0)