Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move from LightGraphs to Graphs #18

Merged
merged 5 commits into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name = "LayeredLayouts"
uuid = "f4a74d36-062a-4d48-97cd-1356bad1de4e"
authors = ["Lyndon White <lyndon.white@invenialabs.co.uk> and contributors"]
version = "0.1.2"
version = "0.2"

[deps]
Cbc = "9961bab8-2fa3-5c5a-9d89-47fab24efd76"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
ECOS = "e2685f51-7e38-5353-a97d-a921fd2c8199"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[compat]
Cbc = "0.7"
ECOS = "0.12.1"
Graphs = "1.4"
IterTools = "1.3"
JuMP = "0.21.3"
LightGraphs = "1.3"
julia = "1"

[extras]
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ Presently it has one algorithm:
[D. C. Zarate, P. L. Bodic, T. Dwyer, G. Gange and P. Stuckey, "Optimal Sankey Diagrams Via Integer Programming," _2018 IEEE Pacific Visualization Symposium (PacificVis)_, Kobe, 2018, pp. 135-139, doi: 10.1109/PacificVis.2018.00025.](https://ialab.it.monash.edu/~dwyer/papers/optimal-sankey-diagrams.pdf).
Which is a Sugiyama style layout algorthm via full mixed integer programming.

Starting from v0.2 `LayeredLayouts.jl` switches from `LightGraphs.jl` to `Graphs.jl` for graph representation. See this [discourse post](https://discourse.julialang.org/t/lightgraphs-jl-transition/69526/17) for more information. If you want to use `LightGraphs.jl` please specifically `] add LayeredLayouts@0.1`!
oxinabox marked this conversation as resolved.
Show resolved Hide resolved

### Usage
```julia
julia> using LayeredLayouts, LightGraphs
julia> using LayeredLayouts, Graphs

julia> tiny_depgraph = SimpleDiGraph(Edge.([
1 => 2;
Expand All @@ -30,7 +31,7 @@ julia> xs, ys
([1.0, 2.0, 1.0, 3.0, 3.0, 3.0, 2.0, 2.0, 4.0, 4.0, 4.0], [-0.500000683006983, -0.9285709647225431, 0.500000681452564, 0.40476260792712027, -0.5952375840605986, -1.5952379163280372, 3.0714291353124143, 2.0714290900138614, 1.404762745121713, 0.4047626078228009, -0.5952375294761111])

julia> paths
Dict{LightGraphs.SimpleGraphs.SimpleEdge{Int64},Tuple{Array{Float64,1},Array{Float64,1}}} with 13 entries:
Dict{Graphs.SimpleGraphs.SimpleEdge{Int64},Tuple{Array{Float64,1},Array{Float64,1}}} with 13 entries:
Edge 2 => 5 => ([2.0, 3.0], [-0.928571, -0.595238])
Edge 3 => 8 => ([1.0, 2.0], [0.500001, 2.07143])
Edge 3 => 5 => ([1.0, 2.0, 3.0], [0.500001, 0.0714291, -0.595238])
Expand Down
2 changes: 1 addition & 1 deletion src/LayeredLayouts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using JuMP
using ECOS
using Cbc
using IterTools: IterTools
using LightGraphs
using Graphs
using Random

export LayeredMinDistOne, Zarate
Expand Down
2 changes: 1 addition & 1 deletion src/zarate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ different nodes as x and y coordinates.

# Example:
```julia
using LightGraphs, Plots
using Graphs, Plots

g = random_orientation_dag(complete_graph(5))
xs, ys, paths = solve_positions(Zarate(), g)
Expand Down
2 changes: 1 addition & 1 deletion test/examples.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Examples
using LightGraphs
using Graphs
using SimpleWeightedGraphs
medium_pert = SimpleDiGraph(Edge.([
1 => 2
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Plots
using LightGraphs
using Graphs
using LayeredLayouts
using Test
using VisualRegressionTests
Expand Down