@@ -76,7 +76,7 @@ function graphline(g::AbstractGraph{T}, locs_x, locs_y, nodesize::Real) where {T
7676end
7777
7878function graphcurve (g:: AbstractGraph{T} , locs_x, locs_y, nodesize:: Vector{<:Real} , arrowlength, angleoffset, outangle= pi / 5 ) where {T<: Integer }
79- curves = Vector {Vector{ Tuple{Float64,Float64}}} (undef, ne (g))
79+ curves = Matrix { Tuple{Float64,Float64}} (undef, ne (g), 4 )
8080 arrows = Array {Vector{Tuple{Float64,Float64}}} (undef, ne (g))
8181 for (e_idx, e) in enumerate (edges (g))
8282 i = src (e)
@@ -95,16 +95,16 @@ function graphcurve(g::AbstractGraph{T}, locs_x, locs_y, nodesize::Vector{<:Real
9595 d = 2 * π * nodesize[i]
9696 end
9797
98- curves[e_idx] = curveedge (startx, starty, endx, endy, θ, outangle, d)
98+ curves[e_idx, : ] = curveedge (startx, starty, endx, endy, θ, outangle, d)
9999
100100 arr1, arr2 = arrowcoords (θ- outangle, endx, endy, arrowlength, angleoffset)
101101 arrows[e_idx] = [arr1, (endx, endy), arr2]
102102 end
103- return vcat .( curves... ) , arrows
103+ return curves, arrows
104104end
105105
106106function graphcurve (g, locs_x, locs_y, nodesize:: Real , arrowlength, angleoffset, outangle= pi / 5 )
107- curves = Vector {Vector{ Tuple{Float64,Float64}}} (undef, ne (g))
107+ curves = Matrix { Tuple{Float64,Float64}} (undef, ne (g), 4 )
108108 arrows = Array {Vector{Tuple{Float64,Float64}}} (undef, ne (g))
109109 for (e_idx, e) in enumerate (edges (g))
110110 i = src (e)
@@ -123,16 +123,16 @@ function graphcurve(g, locs_x, locs_y, nodesize::Real, arrowlength, angleoffset,
123123 d = 2 * π * nodesize
124124 end
125125
126- curves[e_idx] = curveedge (startx, starty, endx, endy, θ, outangle, d)
126+ curves[e_idx, : ] = curveedge (startx, starty, endx, endy, θ, outangle, d)
127127
128128 arr1, arr2 = arrowcoords (θ- outangle, endx, endy, arrowlength, angleoffset)
129129 arrows[e_idx] = [arr1, (endx, endy), arr2]
130130 end
131- return vcat .( curves... ) , arrows
131+ return curves, arrows
132132end
133133
134134function graphcurve (g, locs_x, locs_y, nodesize:: Real , outangle)
135- curves = Vector {Vector{ Tuple{Float64,Float64}}} (undef, ne (g))
135+ curves = Matrix { Tuple{Float64,Float64}} (undef, ne (g), 4 )
136136 for (e_idx, e) in enumerate (edges (g))
137137 i = src (e)
138138 j = dst (e)
@@ -150,13 +150,13 @@ function graphcurve(g, locs_x, locs_y, nodesize::Real, outangle)
150150 d = 2 * π * nodesize
151151 end
152152
153- curves[e_idx] = curveedge (startx, starty, endx, endy, θ, outangle, d)
153+ curves[e_idx, : ] = curveedge (startx, starty, endx, endy, θ, outangle, d)
154154 end
155- return vcat .( curves... )
155+ return curves
156156end
157157
158158function graphcurve (g:: AbstractGraph{T} , locs_x, locs_y, nodesize:: Vector{<:Real} , outangle) where {T<: Integer }
159- curves = Vector {Vector{ Tuple{Float64,Float64}}} (undef, ne (g))
159+ curves = Matrix { Tuple{Float64,Float64}} (undef, ne (g), 4 )
160160 for (e_idx, e) in enumerate (edges (g))
161161 i = src (e)
162162 j = dst (e)
@@ -174,9 +174,9 @@ function graphcurve(g::AbstractGraph{T}, locs_x, locs_y, nodesize::Vector{<:Real
174174 d = 2 * π * nodesize[i]
175175 end
176176
177- curves[e_idx] = curveedge (startx, starty, endx, endy, θ, outangle, d)
177+ curves[e_idx, : ] = curveedge (startx, starty, endx, endy, θ, outangle, d)
178178 end
179- return vcat .( curves... )
179+ return curves
180180end
181181
182182# this function is copy from [IainNZ](https://github.com/IainNZ)'s [GraphLayout.jl](https://github.com/IainNZ/GraphLayout.jl)
@@ -199,5 +199,5 @@ function curveedge(x1, y1, x2, y2, θ, outangle, d; k=0.5)
199199 xc2 = x2 + r * cos (θ + π - outangle)
200200 yc2 = y2 + r * sin (θ + π - outangle)
201201
202- return [(x1,y1), (xc1, yc1), (xc2, yc2), (x2, y2)]
202+ return [(x1,y1) (xc1, yc1) (xc2, yc2) (x2, y2)]
203203end
0 commit comments