From f4d2e50c66c493deb1f916cad42ff8bcb8d9d60b Mon Sep 17 00:00:00 2001 From: davide-f <67809479+davide-f@users.noreply.github.com> Date: Tue, 20 Apr 2021 20:08:53 +0200 Subject: [PATCH 1/3] Transparent node markers --- src/SankeyPlots.jl | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/SankeyPlots.jl b/src/SankeyPlots.jl index 90184eb..68c286c 100644 --- a/src/SankeyPlots.jl +++ b/src/SankeyPlots.jl @@ -43,17 +43,17 @@ In addition to [Plots.jl attributes](http://docs.juliaplots.org/latest/attribute if node_colors === nothing node_colors = palette(get(plotattributes, :color_palette, :default)) end - + x, y, mask = sankey_layout!(g) perm = sortperm(y, rev=true) - + vw = vertex_weight.(Ref(g), vertices(g)) m = maximum(vw) - + if compact == true y = make_compact(x, y, vw / m) end - + src_offsets = get_src_offsets(g, perm) ./ m dst_offsets = get_dst_offsets(g, perm) ./ m @@ -64,10 +64,10 @@ In addition to [Plots.jl attributes](http://docs.juliaplots.org/latest/attribute ylabs = Float64[] lab_orientations = Symbol[] end - + for (i, v) in enumerate(vertices(g)) h = vw[i] / (2m) - + if !(mask[i]) @series begin seriestype := :shape @@ -105,7 +105,7 @@ In addition to [Plots.jl attributes](http://docs.juliaplots.org/latest/attribute y_coords = remap(1 ./ (1 .+ exp.(6 .* (1 .- 2 .* x_coords))), y_src, y_dst) append!(sankey_y, y_coords) sankey_x = range(x[i]+0.1, x[k]-0.1, step=0.01) - + @series begin seriestype := :path primary := false @@ -167,18 +167,18 @@ In addition to [Plots.jl attributes](http://docs.juliaplots.org/latest/attribute @series begin primary := :false seriestype := :scatter - markersize := 0 + markeralfa := 0 series_annotations := text.(names, lab_orientations, label_size) xlabs, ylabs end - + # extend axes for labels if label_position in (:left, :right) x_extra = label_position === :left ? minimum(xlabs) - 0.4 : maximum(xlabs) + 0.5 @series begin primary := false seriestype := :scatter - markersize := 0 + markeralfa := 0 [x_extra], [ylabs[1]] end end @@ -290,7 +290,7 @@ function make_compact(x, y, w) for (i, inds) in enumerate(uinds) y[inds] .+= (maxh - heights[i]) / 2 end - return y + return y end end From 04c3ef85ef85f5f72625971597a12fc57f5e6d34 Mon Sep 17 00:00:00 2001 From: davide-f <67809479+davide-f@users.noreply.github.com> Date: Tue, 20 Apr 2021 22:24:05 +0200 Subject: [PATCH 2/3] Update src/SankeyPlots.jl Co-authored-by: Daniel Schwabeneder --- src/SankeyPlots.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SankeyPlots.jl b/src/SankeyPlots.jl index 68c286c..5213f5c 100644 --- a/src/SankeyPlots.jl +++ b/src/SankeyPlots.jl @@ -167,7 +167,7 @@ In addition to [Plots.jl attributes](http://docs.juliaplots.org/latest/attribute @series begin primary := :false seriestype := :scatter - markeralfa := 0 + markeralpha := 0 series_annotations := text.(names, lab_orientations, label_size) xlabs, ylabs end From 20556ff1e226c5f9856b98cdf7d1eee46946d2a5 Mon Sep 17 00:00:00 2001 From: davide-f <67809479+davide-f@users.noreply.github.com> Date: Tue, 20 Apr 2021 22:24:09 +0200 Subject: [PATCH 3/3] Update src/SankeyPlots.jl Co-authored-by: Daniel Schwabeneder --- src/SankeyPlots.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SankeyPlots.jl b/src/SankeyPlots.jl index 5213f5c..72c9863 100644 --- a/src/SankeyPlots.jl +++ b/src/SankeyPlots.jl @@ -178,7 +178,7 @@ In addition to [Plots.jl attributes](http://docs.juliaplots.org/latest/attribute @series begin primary := false seriestype := :scatter - markeralfa := 0 + markeralpha := 0 [x_extra], [ylabs[1]] end end