Skip to content

Commit

Permalink
merge GraphRecipes & StatsPlots into monorepo - fix docs build (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg authored Oct 13, 2024
1 parent c1cfa30 commit 46c6361
Show file tree
Hide file tree
Showing 64 changed files with 6,469 additions and 53 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,27 @@ jobs:

- uses: julia-actions/cache@v2

- name: Develop RecipesBase, RecipesPipeline, PlotsBase, Plots
- name: Develop all Plots packages
env:
JULIA_PKG_PRECOMPILE_AUTO: 0
shell: julia --color=yes {0}
run: |
using Pkg
foreach(path -> Pkg.develop(; path), ("./RecipesBase", "./RecipesPipeline", "./PlotsBase", "."))
Pkg.develop([
(; path="./RecipesBase"),
(; path="./RecipesPipeline"),
(; path="./PlotsBase"),
(; path="."),
(; path="./GraphRecipes"),
(; path="./StatsPlots"),
])
- name: Install conda based matplotlib
env:
JULIA_PKG_PRECOMPILE_AUTO: 0
run: julia --color=yes ci/matplotlib.jl

- name: Test RecipesBase, RecipesPipeline, PlotsBase, Plots
- name: Test all Plots packages
timeout-minutes: 60
run: |
cmd=(julia --color=yes)
Expand All @@ -87,13 +94,9 @@ jobs:
echo ${cmd[@]}
${cmd[@]} -e '
using Pkg
foreach(name -> Pkg.test(name; coverage=true), ("RecipesBase", "RecipesPipeline", "PlotsBase", "Plots"))
Pkg.test(["GraphRecipes", "StatsPlots"]; coverage=true)
Pkg.test(["RecipesBase", "RecipesPipeline", "PlotsBase", "Plots"]; coverage=true)
'
- name: Test downstream packages
if: startsWith(matrix.os, 'ubuntu')
run: |
xvfb-run julia --color=yes ci/downstream.jl GraphRecipes || true
xvfb-run julia --color=yes ci/downstream.jl StatsPlots || true
- uses: julia-actions/julia-processcoverage@latest
if: startsWith(matrix.os, 'ubuntu')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Format Julia files
run: |
using JuliaFormatter
format(["RecipesBase", "RecipesPipeline", "PlotsBase", "src", "test"])
format(["RecipesBase", "RecipesPipeline", "PlotsBase", "src", "test", "GraphRecipes", "StatsPlots"])
shell: julia --color=yes --compile=min -O0 {0}

- name: suggester / JuliaFormatter
Expand Down
22 changes: 22 additions & 0 deletions GraphRecipes/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The GraphRecipes.jl package is licensed under the MIT "Expat" License:

> Copyright (c) 2016: Thomas Breloff.
>
> Permission is hereby granted, free of charge, to any person obtaining
> a copy of this software and associated documentation files (the
> "Software"), to deal in the Software without restriction, including
> without limitation the rights to use, copy, modify, merge, publish,
> distribute, sublicense, and/or sell copies of the Software, and to
> permit persons to whom the Software is furnished to do so, subject to
> the following conditions:
>
> The above copyright notice and this permission notice shall be
> included in all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
45 changes: 45 additions & 0 deletions GraphRecipes/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name = "GraphRecipes"
uuid = "bd48cda9-67a9-57be-86fa-5b3c104eda73"
version = "1.0"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
GeometryTypes = "4d00f742-c7ba-57c2-abde-4428a4b178cb"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
NetworkLayout = "46757867-2c16-5918-afeb-47bfcb05e46a"
PlotUtils = "995b91a9-d308-5afd-9ec6-746e21dbc043"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
AbstractTrees = "0.4"
GeometryTypes = "0.8"
Graphs = "1.7"
Interpolations = "0.13 - 0.15"
NaNMath = "1"
NetworkLayout = "0.4"
PlotUtils = "0.6.2, 1"
RecipesBase = "1"
Statistics = "1"
julia = "1.10"

[extras]
Gtk = "4c0ca9eb-093a-5379-98c5-f87ac0bbbf44"
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
VisualRegressionTests = "34922c18-7c2a-561c-bac1-01e79b2c4c92"

[targets]
test = ["Gtk", "ImageMagick", "LinearAlgebra", "Logging", "Markdown", "Plots", "Random", "SparseArrays", "StableRNGs", "Test", "VisualRegressionTests"]
44 changes: 44 additions & 0 deletions GraphRecipes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[gh-ci-img]: https://github.com/JuliaPlots/GraphRecipes.jl/workflows/ci/badge.svg?branch=master
[gh-ci-url]: https://github.com/JuliaPlots/GraphRecipes.jl/actions?query=workflow%3Aci

# GraphRecipes
The repository formerly known as PlotRecipes

[![Build Status][gh-ci-img]][gh-ci-url]
[![Documentation](https://img.shields.io/badge/docs-stable-blue.svg)](https://docs.juliaplots.org/stable/GraphRecipes/introduction)
[![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://julialang.zulipchat.com/#narrow/stream/236493-plots)

## Summary
In this repository, a graph is a network of connected nodes (although sometimes people use the same word to refer to a plot). If you want to do plotting, then use [Plots.jl](https://github.com/JuliaPlots/Plots.jl).

For a given graph, there are many legitimate ways to display and visualize the graph. However, some graph layouts will convey the structure of the underlying graph much more clearly than other layouts. GraphRecipes provides many options for producing graph layouts including (un)directed graphs, tree graphs and arc/chord diagrams. For each layout type the `graphplot` function will try to create a default layout that optimizes visual clarity. However, the user can tweak the default layout through a large number of powerful keyword arguments, see the [documentation](https://docs.juliaplots.org/stable/GraphRecipes/introduction) for more details and some examples.

## Installation
```julia
] add GraphRecipes
```

## An example
```julia
using GraphRecipes
using Plots

g = [0 1 1;
1 0 1;
1 1 0]

graphplot(g,
x=[0,-1/tan/3),1/tan/3)], y=[1,0,0],
nodeshape=:circle, nodesize=1.1,
axis_buffer=0.6,
curves=false,
color=:black,
nodecolor=[colorant"#389826",colorant"#CB3C33",colorant"#9558B2"],
linewidth=10)
```
![](assets/readme_julia_logo_pun.png)


This repo maintains a collection of recipes for graph analysis, and is a reduced and refactored version of the previous PlotRecipes. It uses the powerful machinery of [Plots](https://github.com/JuliPlots/Plots.jl) and [RecipesBase](https://github.com/JuliaPlots/Plots.jl/tree/master/RecipesBase) to turn simple transformations into flexible visualizations.

Original author: Thomas Breloff (@tbreloff)
Binary file added GraphRecipes/assets/arc_chord_diagrams.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/ast_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/custom_nodeshapes_single.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/custom_nodeshapes_various.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/directed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/edgelabel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/julia_dict_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/julia_type_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/light_graphs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/marker_properties.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/multigraphs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/random_3d_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/random_labelled_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/readme_julia_logo_pun.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added GraphRecipes/assets/selfedges.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions GraphRecipes/src/GraphRecipes.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module GraphRecipes

using Graphs
using PlotUtils # ColorGradient
using RecipesBase

using InteractiveUtils # subtypes
using LinearAlgebra
using SparseArrays
using Statistics
using NaNMath
using GeometryTypes
using Interpolations

import NetworkLayout
import Graphs: rng_from_rng_or_seed

include("utils.jl")
include("graph_layouts.jl")
include("graphs.jl")
include("misc.jl")
include("trees.jl")

end
Loading

0 comments on commit 46c6361

Please sign in to comment.