Skip to content

Commit

Permalink
Merge pull request #40 from JuliaPlots/hw/use_graphs
Browse files Browse the repository at this point in the history
switch from LightGraphs to Graphs
  • Loading branch information
hexaeder authored Oct 19, 2021
2 parents ff0e29b + 5666119 commit 5f11a0c
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 27 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,14 @@ jobs:
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
- run: |
julia --project=docs -e '
using Documenter: DocMeta, doctest
using GraphMakie
DocMeta.setdocmeta!(GraphMakie, :DocTestSetup, :(using GraphMakie); recursive=true)
doctest(GraphMakie)'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name = "GraphMakie"
uuid = "1ecd5474-83a3-4783-bb4f-06765db800d2"
authors = ["Simon Danisch", "Hans Würfel"]
version = "0.2.4"
version = "0.3.0"

[deps]
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
NetworkLayout = "46757867-2c16-5918-afeb-47bfcb05e46a"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
GeometryBasics = "0.4"
LightGraphs = "1.3"
Graphs = "1.4"
Makie = "0.15"
NetworkLayout = "0.4"
NetworkLayout = "0.4.3"
StaticArrays = "1.2"
julia = "1"

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ This package is just a plotting recipe, you still need to use one of the Makie b
contribution such as suggesting features, raising issues and opening PRs are
welcome!

Starting from v0.3 `GraphMakie.jl` switches from `LightGraphs.jl` to `Graphs.jl` for the 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 [email protected]`!

## Installation
``` julia
pkg> add GraphMakie
Expand All @@ -22,7 +24,7 @@ pkg> add GraphMakie
```julia
using GLMakie
using GraphMakie
using LightGraphs
using Graphs
g = complete_graph(10)
graphplot(g)
```
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GraphMakie = "1ecd5474-83a3-4783-bb4f-06765db800d2"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
JSServe = "824d6782-a2ef-11e9-3a09-e5662e0c26f9"
LayeredLayouts = "f4a74d36-062a-4d48-97cd-1356bad1de4e"
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
NetworkDynamics = "22e9dc34-2a0d-11e9-0de0-8588d035468b"
Expand Down
6 changes: 5 additions & 1 deletion docs/examples/depgraph.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#=
!!! warning "example broken :("
This example is currently broken due to the `LightGraphs.jl`->`Graphs.jl` transition. Will be fixed soon...
In the mean time consult the [old docs](http://juliaplots.org/GraphMakie.jl/v0.2/generated/depgraph/).
# Dependency Graph of a Package
In this example we'll plot a dependency graph of a package using
[`PkgDeps.jl`](https://github.com/JuliaEcosystem/PkgDeps.jl) and
Expand All @@ -9,7 +13,7 @@ CairoMakie.activate!(type="png") #hide
CairoMakie.inline!(true) #hide
set_theme!(resolution=(800, 600)) #hide
using GraphMakie
using LightGraphs
using Graphs
using LayeredLayouts
using PkgDeps
using Makie.GeometryBasics
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/interactions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CairoMakie.activate!(type="png") # hide
set_theme!(resolution=(800, 400)) #hide
CairoMakie.inline!(true) # hide
using GraphMakie
using LightGraphs
using Graphs
using CairoMakie.Colors

import Random; Random.seed!(2) # hide
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/plots.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#=
# Plotting Graphs with `GraphMakie.jl`
## The `graphplot` Command
Plotting your first `AbstractGraph` from [`LightGraphs.jl`](https://juliagraphs.org/LightGraphs.jl/latest/)
Plotting your first `AbstractGraph` from [`Graphs.jl`](https://github.com/JuliaGraphs/Graphs.jl)
is as simple as
=#
using CairoMakie
CairoMakie.activate!(type="png") # hide
set_theme!(resolution=(800, 400)) #hide
CairoMakie.inline!(true) # hide
using GraphMakie
using LightGraphs
using Graphs
import Random; Random.seed!(2) # hide

g = wheel_graph(10)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/syntaxtree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using CairoMakie
CairoMakie.activate!(type="png") #hide
CairoMakie.inline!(true) #hide
set_theme!(resolution=(800, 600)) #hide
using LightGraphs
using Graphs
using GraphMakie
using NetworkLayout
using CairoMakie
Expand Down
6 changes: 5 additions & 1 deletion docs/examples/truss.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#=
!!! warning "example broken :("
This example is currently broken due to the `LightGraphs.jl`->`Graphs.jl` transition. Will be fixed soon...
In the mean time consult the [old docs](http://juliaplots.org/GraphMakie.jl/v0.2/generated/truss/).
# Stress on Truss
In this example we'll plot an animation of the stress on some truss structure
using `GaphMakie.jl` and [`NetworkDynamics.jl`](https://github.com/PIK-ICoN/NetworkDynamics.jl)
Expand All @@ -7,7 +11,7 @@ using `GaphMakie.jl` and [`NetworkDynamics.jl`](https://github.com/PIK-ICoN/Netw
=#
using NetworkDynamics
using OrdinaryDiffEq
using LightGraphs
using Graphs
using GraphMakie
using LinearAlgebra: norm,
using Printf
Expand Down
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using CairoMakie
using JSServe
using NetworkDynamics
using LayeredLayouts
using LightGraphs
using Graphs
using PkgDeps

DocMeta.setdocmeta!(GraphMakie, :DocTestSetup, :(using GraphMakie); recursive=true)
Expand Down
7 changes: 5 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ CurrentModule = GraphMakie
This is the Documentation for [GraphMakie](https://github.com/JuliaPlots/GraphMakie.jl).

This Package consists of two parts: a plot recipe for graphs types from
[LightGraphs.jl](https://juliagraphs.org/LightGraphs.jl/latest/) and some helper
[Graphs.jl](https://github.com/JuliaGraphs/Graphs.jl) and some helper
functions to add interactions to those plots.

!!! note "about Graphs.jl and LightGraphs.jl"
Starting from v0.3 `GraphMakie.jl` switches from `LightGraphs.jl` to `Graphs.jl` as the for the underlying graph package. 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 [email protected]`!

There are also [plot examples](generated/plots.md) and [interaction examples](generated/interactions.md) pages.

## The `graphplot` Recipe
Expand Down Expand Up @@ -38,7 +41,7 @@ To try them all use the following code in a `GLMakie` environment.
```julia
using GLMakie
using GraphMakie
using LightGraphs
using Graphs
g = wheel_graph(10)
f, ax, p = graphplot(g, edge_width=[3 for i in 1:ne(g)],
node_size=[10 for i in 1:nv(g)])
Expand Down
2 changes: 1 addition & 1 deletion src/GraphMakie.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module GraphMakie

using NetworkLayout
using LightGraphs
using Graphs
using Makie
using LinearAlgebra

Expand Down
2 changes: 1 addition & 1 deletion test/beziercurves_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ end
end

@testset "selfloop test" begin
using LightGraphs, GraphMakie
using Graphs, GraphMakie
g = star_graph(10)
add_edge!(g, 1, 1)
add_edge!(g, 2, 2)
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CairoMakie
using GraphMakie
using GraphMakie.LightGraphs
using GraphMakie.Graphs
using GraphMakie.NetworkLayout
using Makie.Colors
# using GLMakie
Expand Down

2 comments on commit 5f11a0c

@hexaeder
Copy link
Collaborator 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/47028

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.3.0 -m "<description of version>" 5f11a0c0731b9a2d4640b28d8633937019d72f52
git push origin v0.3.0

Please sign in to comment.