@@ -206,33 +206,24 @@ function gplot(g::AbstractGraph{T},
206
206
end
207
207
208
208
# Create lines and arrow heads
209
- lines, arrows = nothing , nothing
209
+ lines, larrows = nothing , nothing
210
+ curves, carrows = nothing , nothing
210
211
if linetype == " curve"
211
- if arrowlengthfrac > 0.0
212
- curves_cord, arrows_cord = graphcurve (g, locs_x, locs_y, nodesize, arrowlengthfrac, arrowangleoffset, outangle)
213
- lines = curve (curves_cord[:,1 ], curves_cord[:,2 ], curves_cord[:,3 ], curves_cord[:,4 ])
214
- arrows = line (arrows_cord)
215
- else
216
- curves_cord = graphcurve (g, locs_x, locs_y, nodesize, outangle)
217
- lines = curve (curves_cord[:,1 ], curves_cord[:,2 ], curves_cord[:,3 ], curves_cord[:,4 ])
218
- end
212
+ curves, carrows = build_curved_edges (g, locs_x, locs_y, nodesize, arrowlengthfrac, arrowangleoffset, outangle)
213
+ elseif has_self_loops (g)
214
+ lines, larrows, curves, carrows = build_straight_curved_edges (g, locs_x, locs_y, nodesize, arrowlengthfrac, arrowangleoffset, outangle)
219
215
else
220
- if arrowlengthfrac > 0.0
221
- lines_cord, arrows_cord = graphline (g, locs_x, locs_y, nodesize, arrowlengthfrac, arrowangleoffset)
222
- lines = line (lines_cord)
223
- arrows = line (arrows_cord)
224
- else
225
- lines_cord = graphline (g, locs_x, locs_y, nodesize)
226
- lines = line (lines_cord)
227
- end
216
+ lines, larrows = build_straight_edges (g, locs_x, locs_y, nodesize, arrowlengthfrac, arrowangleoffset)
228
217
end
229
218
230
219
compose (context (units= UnitBox (- 1.2 , - 1.2 , + 2.4 , + 2.4 )),
231
220
compose (context (), texts, fill (nodelabelc), stroke (nothing ), fontsize (nodelabelsize)),
232
221
compose (context (), nodes, fill (nodefillc), stroke (nodestrokec), linewidth (nodestrokelw)),
233
222
compose (context (), edgetexts, fill (edgelabelc), stroke (nothing ), fontsize (edgelabelsize)),
234
- compose (context (), arrows, stroke (edgestrokec), linewidth (edgelinewidth)),
235
- compose (context (), lines, stroke (edgestrokec), fill (nothing ), linewidth (edgelinewidth)))
223
+ compose (context (), larrows, stroke (edgestrokec), linewidth (edgelinewidth)),
224
+ compose (context (), carrows, stroke (edgestrokec), linewidth (edgelinewidth)),
225
+ compose (context (), lines, stroke (edgestrokec), fill (nothing ), linewidth (edgelinewidth)),
226
+ compose (context (), curves, stroke (edgestrokec), fill (nothing ), linewidth (edgelinewidth)))
236
227
end
237
228
238
229
function gplot (g; layout:: Function = spring_layout, keyargs... )
0 commit comments