@@ -15,8 +15,10 @@ function graphline(edge_list, locs_x, locs_y, nodesize::Vector{T}, arrowlength,
15
15
starty = locs_y[i] + nodesize[i]* sin (θ)
16
16
endx = locs_x[j] + nodesize[j]* cos (θ+ π)
17
17
endy = locs_y[j] + nodesize[j]* sin (θ+ π)
18
- lines[e_idx] = [(startx, starty), (endx, endy)]
19
18
arr1, arr2 = arrowcoords (θ, endx, endy, arrowlength, angleoffset)
19
+ endx0 = (arr1[1 ] + arr2[1 ]) / 2
20
+ endy0 = (arr1[2 ] + arr2[2 ]) / 2
21
+ lines[e_idx] = [(startx, starty), (endx0, endy0)]
20
22
arrows[e_idx] = [arr1, (endx, endy), arr2]
21
23
end
22
24
lines, arrows
@@ -36,8 +38,10 @@ function graphline(edge_list, locs_x, locs_y, nodesize::Real, arrowlength, angle
36
38
starty = locs_y[i] + nodesize* sin (θ)
37
39
endx = locs_x[j] + nodesize* cos (θ+ π)
38
40
endy = locs_y[j] + nodesize* sin (θ+ π)
39
- lines[e_idx] = [(startx, starty), (endx, endy)]
40
41
arr1, arr2 = arrowcoords (θ, endx, endy, arrowlength, angleoffset)
42
+ endx0 = (arr1[1 ] + arr2[1 ]) / 2
43
+ endy0 = (arr1[2 ] + arr2[2 ]) / 2
44
+ lines[e_idx] = [(startx, starty), (endx0, endy0)]
41
45
arrows[e_idx] = [arr1, (endx, endy), arr2]
42
46
end
43
47
lines, arrows
@@ -100,9 +104,10 @@ function graphcurve(edge_list, locs_x, locs_y, nodesize::Vector{T}, arrowlength,
100
104
d = 2 * π * nodesize[i]
101
105
end
102
106
103
- curves[e_idx, :] = curveedge (startx, starty, endx, endy, θ, outangle, d)
104
-
105
107
arr1, arr2 = arrowcoords (θ- outangle, endx, endy, arrowlength, angleoffset)
108
+ endx0 = (arr1[1 ] + arr2[1 ]) / 2
109
+ endy0 = (arr1[2 ] + arr2[2 ]) / 2
110
+ curves[e_idx, :] = curveedge (startx, starty, endx0, endy0, θ, outangle, d)
106
111
arrows[e_idx] = [arr1, (endx, endy), arr2]
107
112
end
108
113
return curves, arrows
@@ -129,9 +134,10 @@ function graphcurve(edge_list, locs_x, locs_y, nodesize::Real, arrowlength, angl
129
134
d = 2 * π * nodesize
130
135
end
131
136
132
- curves[e_idx, :] = curveedge (startx, starty, endx, endy, θ, outangle, d)
133
-
134
137
arr1, arr2 = arrowcoords (θ- outangle, endx, endy, arrowlength, angleoffset)
138
+ endx0 = (arr1[1 ] + arr2[1 ]) / 2
139
+ endy0 = (arr1[2 ] + arr2[2 ]) / 2
140
+ curves[e_idx, :] = curveedge (startx, starty, endx0, endy0, θ, outangle, d)
135
141
arrows[e_idx] = [arr1, (endx, endy), arr2]
136
142
end
137
143
return curves, arrows
@@ -214,7 +220,7 @@ function build_curved_edges(edge_list, locs_x, locs_y, nodesize, arrowlengthfrac
214
220
if arrowlengthfrac > 0.0
215
221
curves_cord, arrows_cord = graphcurve (edge_list, locs_x, locs_y, nodesize, arrowlengthfrac, arrowangleoffset, outangle)
216
222
curves = curve (curves_cord[:,1 ], curves_cord[:,2 ], curves_cord[:,3 ], curves_cord[:,4 ])
217
- carrows = line (arrows_cord)
223
+ carrows = polygon (arrows_cord)
218
224
else
219
225
curves_cord = graphcurve (edge_list, locs_x, locs_y, nodesize, outangle)
220
226
curves = curve (curves_cord[:,1 ], curves_cord[:,2 ], curves_cord[:,3 ], curves_cord[:,4 ])
@@ -228,7 +234,7 @@ function build_straight_edges(edge_list, locs_x, locs_y, nodesize, arrowlengthfr
228
234
if arrowlengthfrac > 0.0
229
235
lines_cord, arrows_cord = graphline (edge_list, locs_x, locs_y, nodesize, arrowlengthfrac, arrowangleoffset)
230
236
lines = line (lines_cord)
231
- larrows = line (arrows_cord)
237
+ larrows = polygon (arrows_cord)
232
238
else
233
239
lines_cord = graphline (edge_list, locs_x, locs_y, nodesize)
234
240
lines = line (lines_cord)
0 commit comments