Skip to content

Commit

Permalink
Merge pull request #18 from hexaeder/hw/LG_to_graphs
Browse files Browse the repository at this point in the history
move from LightGraphs to Graphs
  • Loading branch information
oxinabox authored Oct 19, 2021
2 parents 946c304 + 7c3bea2 commit 88117f5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
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`

### 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
5 changes: 4 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# set headless environment for plots
ENV["GKSwstype"] = "100"

using Plots
using LightGraphs
using Graphs
using LayeredLayouts
using Test
using VisualRegressionTests
Expand Down

2 comments on commit 88117f5

@oxinabox
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/47030

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.0 -m "<description of version>" 88117f5eef032b26638f2d295423c041a896fcae
git push origin v0.2.0

Please sign in to comment.