Skip to content

Commit 905125e

Browse files
authored
Merge pull request #24 from sisl/julia7
Julia 0.7-beta2 updates
2 parents 4e11322 + fc4f443 commit 905125e

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ language: julia
22
sudo: required
33
dist: trusty
44
julia:
5-
- 0.5
6-
- 0.6
5+
- 0.7
76
- nightly
87
matrix:
98
allow_failures:

REQUIRE

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
julia 0.5
2-
TikzPictures 0.3.5
3-
LightGraphs 0.6.0
4-
Compat 0.8.0
1+
julia 0.7-beta2
2+
TikzPictures 2.0.0
3+
LightGraphs 0.13.1

doc/TikzGraphs.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"metadata": {},
2828
"outputs": [],
2929
"source": [
30+
"using Pkg\n",
3031
"Pkg.add(\"TikzGraphs\")"
3132
]
3233
},

src/TikzGraphs.jl

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,32 @@ module TikzGraphs
55
export plot, Layouts
66
import LightGraphs: DiGraph, Graph, vertices, edges, src, dst
77

8-
using Compat
9-
import Compat.String
10-
11-
preamble = readstring(joinpath(dirname(@__FILE__), "..", "src", "preamble.tex"))
8+
preamble = read(joinpath(dirname(@__FILE__), "..", "src", "preamble.tex"), String)
129

1310
const AbstractGraph = Union{Graph, DiGraph}
1411

1512
using TikzPictures
1613

1714
module Layouts
18-
using Compat
1915
export Layered, Spring, SimpleNecklace
2016

21-
@compat abstract type Layout end
17+
abstract type Layout end
2218

23-
immutable Layered <: Layout end
19+
struct Layered <: Layout end
2420

25-
immutable Spring <: Layout
21+
struct Spring <: Layout
2622
randomSeed
2723
Spring(;randomSeed=42) = new(randomSeed)
2824
end
2925

30-
immutable SimpleNecklace <: Layout
26+
struct SimpleNecklace <: Layout
3127
end
3228
end
3329

3430
using .Layouts
3531

36-
plot{T<:AbstractString}(g, layout::Layouts.Layout, labels::Vector{T}=map(string, vertices(g)); args...) = plot(g; layout=layout, labels=labels, args...)
37-
plot{T<:AbstractString}(g, labels::Vector{T}; args...) = plot(g; layout=Layered(), labels=labels, args...)
32+
plot(g, layout::Layouts.Layout, labels::Vector{T}=map(string, vertices(g)); args...) where {T<:AbstractString} = plot(g; layout=layout, labels=labels, args...)
33+
plot(g, labels::Vector{T}; args...) where {T<:AbstractString} = plot(g; layout=Layered(), labels=labels, args...)
3834

3935
function edgeHelper(o::IOBuffer, a, b, edge_labels, edge_styles, edge_style)
4036
print(o, " [$(edge_style),")
@@ -59,7 +55,7 @@ end
5955
edge_str(g::DiGraph) = "->"
6056
edge_str(g::Graph) = "--"
6157

62-
function plot{T<:AbstractString}(g::AbstractGraph; layout::Layouts.Layout = Layered(), labels::Vector{T}=map(string, vertices(g)), edge_labels::Dict = Dict(), node_styles::Dict = Dict(), node_style="", edge_styles::Dict = Dict(), edge_style="", options="")
58+
function plot(g::AbstractGraph; layout::Layouts.Layout = Layered(), labels::Vector{T}=map(string, vertices(g)), edge_labels::Dict = Dict(), node_styles::Dict = Dict(), node_style="", edge_styles::Dict = Dict(), edge_style="", options="") where T<:AbstractString
6359
o = IOBuffer()
6460
println(o, "\\graph [$(layoutname(layout)), $(options_str(layout))] {")
6561
for v in vertices(g)

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using TikzGraphs
2-
using Base.Test
2+
using Test
33

44
@assert success(`lualatex -v`)
55
using NBInclude
6-
nbinclude(joinpath(dirname(@__FILE__), "..", "doc", "TikzGraphs.ipynb"))
6+
@nbinclude joinpath(dirname(@__FILE__), "..", "doc", "TikzGraphs.ipynb")

0 commit comments

Comments
 (0)