Skip to content

Commit 40e21be

Browse files
committed
Revert "bug fix"
Remove commits that are in separate PRs This reverts commit d4a2ae4ba42a701ebe49865d2addf212c54f7bd7.
1 parent 6f4597f commit 40e21be

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ gplot(h)
196196
+ `arrowangleoffset` Angular width in radians for the arrows. Default: `π/9 (20 degrees)`
197197
+ `linetype` Type of line used for edges (:straight, :curve). Default: :straight
198198
+ `outangle` Angular width in radians for the edges (only used if `linetype = "curve`). Default: `π/5 (36 degrees)`
199-
+ `backgroundc` Color for the plot background. Default: `nothing`
200199

201200
# Reporting Bugs
202201

src/plot.jl

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,16 @@ Distances for the node labels from center of nodes. Default: `0.0`
4141
`nodelabelangleoffset`
4242
Angle offset for the node labels (only used when `nodelabeldist` is not zero). Default: `π/4.0`
4343
44+
<<<<<<< HEAD
4445
`max_nodelabelsize`
4546
Largest fontsize for the vertex labels. Default: `4.0`
47+
=======
48+
`NODELABELSIZE`
49+
Largest fontsize for the vertice labels. Default: `4.0`
50+
>>>>>>> parent of 14d62b4 (Fix #172. set background color (`backgroundc` kwarg):)
4651
4752
`nodelabelsize`
48-
Relative fontsize for the vertex labels, can be a Vector. Default: `1.0`
53+
Relative fontsize for the vertice labels, can be a Vector. Default: `1.0`
4954
5055
`nodefillc`
5156
Color to fill the nodes with, can be a Vector. Default: `colorant"turquoise"`
@@ -94,9 +99,6 @@ Type of line used for edges (:straight, :curve). Default: :straight
9499
Angular width in radians for the edges (only used if `linetype = "curve`).
95100
Default: `π/5 (36 degrees)`
96101
97-
`backgroundc`
98-
Color for the plot background. Default: `nothing`
99-
100102
"""
101103
function gplot(g::AbstractGraph{T},
102104
locs_x_in::Vector{R1}, locs_y_in::Vector{R2};
@@ -122,9 +124,14 @@ function gplot(g::AbstractGraph{T},
122124
nodestrokelw = 0.0,
123125
arrowlengthfrac = is_directed(g) ? 0.1 : 0.0,
124126
arrowangleoffset = π / 9,
127+
<<<<<<< HEAD
125128
linetype = :straight,
126129
outangle = π / 5,
127130
backgroundc = nothing) where {T <:Integer, R1 <: Real, R2 <: Real}
131+
=======
132+
linetype = "straight",
133+
outangle = π / 5) where {T <:Integer, R1 <: Real, R2 <: Real}
134+
>>>>>>> parent of 14d62b4 (Fix #172. set background color (`backgroundc` kwarg):)
128135

129136
@assert length(locs_x_in) == length(locs_y_in) == nv(g) "Position vectors must be of the same length as the number of nodes"
130137
@assert isnothing(nodelabel) || length(nodelabel) == nv(g) "`nodelabel` must either be `nothing` or a vector of the same length as the number of nodes"
@@ -157,12 +164,25 @@ function gplot(g::AbstractGraph{T},
157164
end
158165

159166
# Create nodes
167+
<<<<<<< HEAD
160168
nodecircle = fill(0.4Compose.w, nv(g)) .* nodesize
169+
=======
170+
nodecircle = fill(0.4Compose.w, length(locs_x))
171+
if isa(nodesize, Real)
172+
for i = 1:length(locs_x)
173+
nodecircle[i] *= nodesize
174+
end
175+
else
176+
for i = 1:length(locs_x)
177+
nodecircle[i] *= nodesize[i]
178+
end
179+
end
180+
>>>>>>> parent of 14d62b4 (Fix #172. set background color (`backgroundc` kwarg):)
161181
nodes = circle(locs_x, locs_y, nodecircle)
162182

163183
# Create node labels if provided
164184
texts = nothing
165-
if !isnothing(nodelabel)
185+
if nodelabel != nothing
166186
text_locs_x = deepcopy(locs_x)
167187
text_locs_y = deepcopy(locs_y)
168188
texts = text(text_locs_x .+ nodesize .* (nodelabeldist * cos(nodelabelangleoffset)),
@@ -207,10 +227,15 @@ function gplot(g::AbstractGraph{T},
207227
end
208228
end
209229

230+
<<<<<<< HEAD
210231
#build plot
211232
compose(context(units=UnitBox(-1.2, -1.2, +2.4, +2.4)),
212233
compose(context(), rectangle(-1.2, -1.2, +2.4, +2.4), fill(backgroundc)),
213234
compose(context(), texts, fill(nodelabelc), fontsize(nodelabelsize)),
235+
=======
236+
compose(context(units=UnitBox(-1.2, -1.2, +2.4, +2.4)),
237+
compose(context(), texts, fill(nodelabelc), stroke(nothing), fontsize(nodelabelsize)),
238+
>>>>>>> parent of 14d62b4 (Fix #172. set background color (`backgroundc` kwarg):)
214239
compose(context(), nodes, fill(nodefillc), stroke(nodestrokec), linewidth(nodestrokelw)),
215240
compose(context(), edgetexts, fill(edgelabelc), fontsize(edgelabelsize)),
216241
compose(context(), arrows, stroke(edgestrokec), linewidth(edgelinewidth)),

0 commit comments

Comments
 (0)