@@ -41,11 +41,16 @@ Distances for the node labels from center of nodes. Default: `0.0`
4141`nodelabelangleoffset`
4242Angle offset for the node labels (only used when `nodelabeldist` is not zero). Default: `π/4.0`
4343
44+ <<<<<<< HEAD
4445`max_nodelabelsize`
4546Largest 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`
5156Color 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
9499Angular width in radians for the edges (only used if `linetype = "curve`).
95100Default: `π/5 (36 degrees)`
96101
97- `backgroundc`
98- Color for the plot background. Default: `nothing`
99-
100102"""
101103function 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 14 d62b4 (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.4 Compose. w, nv (g)) .* nodesize
169+ ====== =
170+ nodecircle = fill (0.4 Compose. 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 14 d62b4 (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 14 d62b4 (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