Skip to content

Commit 9a42e98

Browse files
juliohmsbromberger
authored andcommitted
Fix warnings in Julia v0.6 (#41)
* Fix warnings in Julia v0.6 * Fix warnings in Julia v0.6 (part II)
1 parent b1394ac commit 9a42e98

File tree

4 files changed

+16
-19
lines changed

4 files changed

+16
-19
lines changed

src/GraphPlot.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ const gadflyjs = joinpath(dirname(Base.source_path()), "gadfly.js")
99

1010
export
1111
gplot,
12-
gplot1,
1312
gplothtml,
14-
gplothtml1,
1513
random_layout,
1614
circular_layout,
1715
spring_layout,
@@ -29,16 +27,15 @@ include("stress.jl")
2927
include("shape.jl")
3028
include("lines.jl")
3129
include("plot.jl")
32-
include("plot_test.jl")
3330

3431
# read graph
3532
include("graphio.jl")
3633

3734
function test()
38-
include(joinpath(Pkg.dir("GraphPlot"), "test", "runtests.jl"))
35+
include(joinpath(Pkg.dir("GraphPlot"), "test", "runtests.jl"))
3936
end
4037

41-
38+
4239
# These functions are mappings to various graph packages.
4340
# Currently only LightGraphs is supported.
4441
_nv(g::LightGraphs.AbstractGraph) = LightGraphs.nv(g)

src/layout.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ function spring_layout(G, locs_x=2*rand(_nv(G)).-1.0, locs_y=2*rand(_nv(G)).-1.0
155155
function scaler(z, a, b)
156156
2.0*((z - a)/(b - a)) - 1.0
157157
end
158-
map!(z -> scaler(z, min_x, max_x), locs_x)
159-
map!(z -> scaler(z, min_y, max_y), locs_y)
158+
map!(z -> scaler(z, min_x, max_x), locs_x, locs_x)
159+
map!(z -> scaler(z, min_y, max_y), locs_y, locs_y)
160160

161161
return locs_x,locs_y
162162
end

src/lines.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ function graphline{T<:Real}(g, locs_x, locs_y, nodesize::Vector{T}, arrowlength,
2323
end
2424

2525
function graphline{T<:Real}(g, locs_x, locs_y, nodesize::T, arrowlength, angleoffset)
26-
lines = Array(Vector{Tuple{Float64,Float64}}, _ne(g))
27-
arrows = Array(Vector{Tuple{Float64,Float64}}, _ne(g))
26+
lines = Array{Vector{Tuple{Float64,Float64}}}(_ne(g))
27+
arrows = Array{Vector{Tuple{Float64,Float64}}}(_ne(g))
2828
for (e_idx, e) in enumerate(_edges(g))
2929
i = _src_index(e, g)
3030
j = _dst_index(e, g)
@@ -44,7 +44,7 @@ function graphline{T<:Real}(g, locs_x, locs_y, nodesize::T, arrowlength, angleof
4444
end
4545

4646
function graphline{T<:Real}(g, locs_x, locs_y, nodesize::Vector{T})
47-
lines = Array(Vector{Tuple{Float64,Float64}}, _ne(g))
47+
lines = Array{Vector{Tuple{Float64,Float64}}}(_ne(g))
4848
for (e_idx, e) in enumerate(_edges(g))
4949
i = _src_index(e, g)
5050
j = _dst_index(e, g)
@@ -62,7 +62,7 @@ function graphline{T<:Real}(g, locs_x, locs_y, nodesize::Vector{T})
6262
end
6363

6464
function graphline{T<:Real}(g, locs_x, locs_y, nodesize::T)
65-
lines = Array(Vector{Tuple{Float64,Float64}}, _ne(g))
65+
lines = Array{Vector{Tuple{Float64,Float64}}}(_ne(g))
6666
for (e_idx, e) in enumerate(_edges(g))
6767
i = _src_index(e, g)
6868
j = _dst_index(e, g)
@@ -80,8 +80,8 @@ function graphline{T<:Real}(g, locs_x, locs_y, nodesize::T)
8080
end
8181

8282
function graphcurve{T<:Real}(g, locs_x, locs_y, nodesize::Vector{T}, arrowlength, angleoffset, outangle=pi/5)
83-
lines = Array(Vector, _ne(g))
84-
arrows = Array(Vector{Tuple{Float64,Float64}}, _ne(g))
83+
lines = Array{Vector}(_ne(g))
84+
arrows = Array{Vector{Tuple{Float64,Float64}}}(_ne(g))
8585
for (e_idx, e) in enumerate(_edges(g))
8686
i = _src_index(e, g)
8787
j = _dst_index(e, g)
@@ -106,8 +106,8 @@ function graphcurve{T<:Real}(g, locs_x, locs_y, nodesize::Vector{T}, arrowlength
106106
end
107107

108108
function graphcurve{T<:Real}(g, locs_x, locs_y, nodesize::T, arrowlength, angleoffset, outangle=pi/5)
109-
lines = Array(Vector, _ne(g))
110-
arrows = Array(Vector{Tuple{Float64,Float64}}, _ne(g))
109+
lines = Array{Vector}(_ne(g))
110+
arrows = Array{Vector{Tuple{Float64,Float64}}}(_ne(g))
111111
for (e_idx, e) in enumerate(_edges(g))
112112
i = _src_index(e, g)
113113
j = _dst_index(e, g)
@@ -132,7 +132,7 @@ function graphcurve{T<:Real}(g, locs_x, locs_y, nodesize::T, arrowlength, angleo
132132
end
133133

134134
function graphcurve{T<:Real}(g, locs_x, locs_y, nodesize::T, outangle)
135-
lines = Array(Vector, _ne(g))
135+
lines = Array{Vector}(_ne(g))
136136
for (e_idx, e) in enumerate(_edges(g))
137137
i = _src_index(e, g)
138138
j = _dst_index(e, g)
@@ -150,7 +150,7 @@ function graphcurve{T<:Real}(g, locs_x, locs_y, nodesize::T, outangle)
150150
end
151151

152152
function graphcurve{T<:Real}(g, locs_x, locs_y, nodesize::Vector{T}, outangle)
153-
lines = Array(Vector, _ne(g))
153+
lines = Array{Vector}(_ne(g))
154154
for (e_idx, e) in enumerate(_edges(g))
155155
i = _src_index(e, g)
156156
j = _dst_index(e, g)

src/plot.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ function gplot{T<:Real}(G,
131131
function scaler(z, a, b)
132132
2.0*((z - a)/(b - a)) - 1.0
133133
end
134-
map!(z -> scaler(z, min_x, max_x), locs_x)
135-
map!(z -> scaler(z, min_y, max_y), locs_y)
134+
map!(z -> scaler(z, min_x, max_x), locs_x, locs_x)
135+
map!(z -> scaler(z, min_y, max_y), locs_y, locs_y)
136136

137137
# Determine sizes
138138
#const NODESIZE = 0.25/sqrt(N)

0 commit comments

Comments
 (0)