Skip to content

Commit

Permalink
Merge pull request #29 from davide-f/master
Browse files Browse the repository at this point in the history
Push version
  • Loading branch information
davide-f authored Dec 22, 2024
2 parents d27d757 + 44abbed commit 9f2abbc
Show file tree
Hide file tree
Showing 18 changed files with 16 additions and 13 deletions.
14 changes: 6 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
name = "SankeyPlots"
uuid = "8fd88ec8-d95c-41fc-b299-05f2225f2cc5"
authors = ["Daniel Schwabeneder <[email protected]> and Davide Fioriti <[email protected]>"]
version = "0.2.2"
version = "0.3.0"

[deps]
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
LayeredLayouts = "f4a74d36-062a-4d48-97cd-1356bad1de4e"
MetaGraphs = "626554b9-1ddb-594c-aa3c-2596fe9399a5"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
Graphs = "1.5"
LayeredLayouts = "0.2.4"
MetaGraphs = "0.7"
Plots = "1"
RecipesBase = "1"
julia = "1.5"
Graphs = "1.10"
LayeredLayouts = "0.2.10"
MetaGraphs = "0.8"
Plots = "1.35"
julia = "1"

[extras]
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ pkg> add SankeyPlots

## Usage

The following examples describes how to create a Sankey diagram with the default settings.
The Sankey diagram is described by passing to the `sankey` function the source nodes `src`, destination nodes `dst`, and the weights `weights` of the edges. The nodes are indexed by integers starting from 1, and the size of the blocks and flows are proportional to the weights.

```julia
using SankeyPlots

Expand Down
10 changes: 6 additions & 4 deletions src/SankeyPlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module SankeyPlots

using LayeredLayouts
using Plots
using RecipesBase
using Graphs, MetaGraphs
using SparseArrays

Expand Down Expand Up @@ -37,8 +36,8 @@ In addition to [Plots.jl attributes](http://docs.juliaplots.org/latest/attribute
label_position=:inside,
label_size=8,
compact=false,
force_layer::Vector{Pair{Int,Int}}=Vector{Pair{Int,Int}}(),
force_order::Vector{Pair{Int,Int}}=Vector{Pair{Int,Int}}(),
force_layer=Vector{Pair{Int,Int}}(),
force_order=Vector{Pair{Int,Int}}(),
)
g = sankey_graph(s.args...)
names = sankey_names(g, node_labels)
Expand Down Expand Up @@ -197,7 +196,10 @@ In addition to [Plots.jl attributes](http://docs.juliaplots.org/latest/attribute

primary := false
framestyle --> :none
legend --> label_position === :legend ? :outertopright : false
legend --> label_position === :legend ? true : false
if label_position === :legend
legend_position --> :outertopright
end
()
end

Expand Down
Binary file modified test/refs/edge_color_#789.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 modified test/refs/edge_color_dst.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 modified test/refs/edge_color_manual.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 modified test/refs/edge_color_src.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 modified test/refs/force_layer.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 modified test/refs/force_order.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 modified test/refs/label_position_bottom.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 modified test/refs/label_position_left.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 modified test/refs/label_position_legend.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 modified test/refs/label_position_node.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 modified test/refs/label_position_right.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 modified test/refs/label_position_top.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 modified test/refs/readme.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 modified test/refs/readme_kwargs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ energy_colors = palette(:seaborn_colorblind)[[9, 10, 3, 5, 2, 8, 1, 4]]
@testset "force_order" begin
@test_reference "refs/force_order.png" sankey(
src, dst, weights;
force_order=[1=>5] # node 1 shall come before node 5
force_order=[1=>2, 1=>5, 6=>3, 3=>4] # node 1 shall come before node 5
)
end
end

2 comments on commit 9f2abbc

@davide-f
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/121866

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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>" 9f2abbcb2b5c4dc5f38d8a2cd74d5551931c742f
git push origin v0.3.0

Please sign in to comment.