@@ -9,7 +9,6 @@ function graphline(g, locs_x, locs_y, nodesize::Vector{T}, arrowlength, angleoff
9
9
j = dst (e)
10
10
Δx = locs_x[j] - locs_x[i]
11
11
Δy = locs_y[j] - locs_y[i]
12
- d = hypot (Δx, Δy)
13
12
θ = atan (Δy,Δx)
14
13
startx = locs_x[i] + nodesize[i]* cos (θ)
15
14
starty = locs_y[i] + nodesize[i]* sin (θ)
@@ -30,7 +29,6 @@ function graphline(g::AbstractGraph{T}, locs_x, locs_y, nodesize::Real, arrowlen
30
29
j = dst (e)
31
30
Δx = locs_x[j] - locs_x[i]
32
31
Δy = locs_y[j] - locs_y[i]
33
- d = hypot (Δx, Δy)
34
32
θ = atan (Δy,Δx)
35
33
startx = locs_x[i] + nodesize* cos (θ)
36
34
starty = locs_y[i] + nodesize* sin (θ)
@@ -50,7 +48,6 @@ function graphline(g::AbstractGraph{T}, locs_x, locs_y, nodesize::Vector{<:Real}
50
48
j = dst (e)
51
49
Δx = locs_x[j] - locs_x[i]
52
50
Δy = locs_y[j] - locs_y[i]
53
- d = hypot (Δx, Δy)
54
51
θ = atan (Δy,Δx)
55
52
startx = locs_x[i] + nodesize[i]* cos (θ)
56
53
starty = locs_y[i] + nodesize[i]* sin (θ)
@@ -68,7 +65,6 @@ function graphline(g::AbstractGraph{T}, locs_x, locs_y, nodesize::Real) where {T
68
65
j = dst (e)
69
66
Δx = locs_x[j] - locs_x[i]
70
67
Δy = locs_y[j] - locs_y[i]
71
- d = hypot (Δx, Δy)
72
68
θ = atan (Δy,Δx)
73
69
startx = locs_x[i] + nodesize* cos (θ)
74
70
starty = locs_y[i] + nodesize* sin (θ)
@@ -87,20 +83,19 @@ function graphcurve(g::AbstractGraph{T}, locs_x, locs_y, nodesize::Vector{<:Real
87
83
j = dst (e)
88
84
Δx = locs_x[j] - locs_x[i]
89
85
Δy = locs_y[j] - locs_y[i]
90
- # d = hypot(Δx, Δy)
91
86
θ = atan (Δy,Δx)
92
87
startx = locs_x[i] + nodesize[i]* cos (θ+ outangle)
93
88
starty = locs_y[i] + nodesize[i]* sin (θ+ outangle)
94
89
endx = locs_x[j] + nodesize[j]* cos (θ+ π- outangle)
95
90
endy = locs_y[j] + nodesize[j]* sin (θ+ π- outangle)
96
91
97
- d2 = hypot (endx- startx, endy- starty)
92
+ d = hypot (endx- startx, endy- starty)
98
93
99
94
if i == j
100
- d2 = 2 * π * nodesize[i]
95
+ d = 2 * π * nodesize[i]
101
96
end
102
97
103
- curves[e_idx] = curveedge (startx, starty, endx, endy, θ, outangle, d2 )
98
+ curves[e_idx] = curveedge (startx, starty, endx, endy, θ, outangle, d )
104
99
105
100
arr1, arr2 = arrowcoords (θ- outangle, endx, endy, arrowlength, angleoffset)
106
101
arrows[e_idx] = [arr1, (endx, endy), arr2]
@@ -116,20 +111,19 @@ function graphcurve(g, locs_x, locs_y, nodesize::Real, arrowlength, angleoffset,
116
111
j = dst (e)
117
112
Δx = locs_x[j] - locs_x[i]
118
113
Δy = locs_y[j] - locs_y[i]
119
- # d = hypot(Δx, Δy)
120
114
θ = atan (Δy,Δx)
121
115
startx = locs_x[i] + nodesize* cos (θ+ outangle)
122
116
starty = locs_y[i] + nodesize* sin (θ+ outangle)
123
117
endx = locs_x[j] + nodesize* cos (θ+ π- outangle)
124
118
endy = locs_y[j] + nodesize* sin (θ+ π- outangle)
125
119
126
- d2 = hypot (endx- startx, endy- starty)
120
+ d = hypot (endx- startx, endy- starty)
127
121
128
122
if i == j
129
- d2 = 2 * π * nodesize
123
+ d = 2 * π * nodesize
130
124
end
131
125
132
- curves[e_idx] = curveedge (startx, starty, endx, endy, θ, outangle, d2 )
126
+ curves[e_idx] = curveedge (startx, starty, endx, endy, θ, outangle, d )
133
127
134
128
arr1, arr2 = arrowcoords (θ- outangle, endx, endy, arrowlength, angleoffset)
135
129
arrows[e_idx] = [arr1, (endx, endy), arr2]
@@ -144,20 +138,19 @@ function graphcurve(g, locs_x, locs_y, nodesize::Real, outangle)
144
138
j = dst (e)
145
139
Δx = locs_x[j] - locs_x[i]
146
140
Δy = locs_y[j] - locs_y[i]
147
- # d = hypot(Δx, Δy)
148
141
θ = atan (Δy,Δx)
149
142
startx = locs_x[i] + nodesize* cos (θ+ outangle)
150
143
starty = locs_y[i] + nodesize* sin (θ+ outangle)
151
144
endx = locs_x[j] + nodesize* cos (θ+ π- outangle)
152
145
endy = locs_y[j] + nodesize* sin (θ+ π- outangle)
153
146
154
- d2 = hypot (endx- startx, endy- starty)
147
+ d = hypot (endx- startx, endy- starty)
155
148
156
149
if i == j
157
- d2 = 2 * π * nodesize
150
+ d = 2 * π * nodesize
158
151
end
159
152
160
- curves[e_idx] = curveedge (startx, starty, endx, endy, θ, outangle, d2 )
153
+ curves[e_idx] = curveedge (startx, starty, endx, endy, θ, outangle, d )
161
154
end
162
155
return vcat .(curves... )
163
156
end
@@ -169,20 +162,19 @@ function graphcurve(g::AbstractGraph{T}, locs_x, locs_y, nodesize::Vector{<:Real
169
162
j = dst (e)
170
163
Δx = locs_x[j] - locs_x[i]
171
164
Δy = locs_y[j] - locs_y[i]
172
- # d = hypot(Δx, Δy)
173
165
θ = atan (Δy,Δx)
174
166
startx = locs_x[i] + nodesize[i]* cos (θ+ outangle)
175
167
starty = locs_y[i] + nodesize[i]* sin (θ+ outangle)
176
168
endx = locs_x[j] + nodesize[j]* cos (θ+ π- outangle)
177
169
endy = locs_y[j] + nodesize[j]* sin (θ+ π- outangle)
178
170
179
- d2 = hypot (endx- startx, endy- starty)
171
+ d = hypot (endx- startx, endy- starty)
180
172
181
173
if i == j
182
- d2 = 2 * π * nodesize[i]
174
+ d = 2 * π * nodesize[i]
183
175
end
184
176
185
- curves[e_idx] = curveedge (startx, starty, endx, endy, θ, outangle, d2 )
177
+ curves[e_idx] = curveedge (startx, starty, endx, endy, θ, outangle, d )
186
178
end
187
179
return vcat .(curves... )
188
180
end
0 commit comments