GraphRecipes.jl icon indicating copy to clipboard operation
GraphRecipes.jl copied to clipboard

Graphs

Open tbreloff opened this issue 9 years ago • 14 comments

Finish up spectral graphs, then tackle tree layouts and directed graphs.

See also: https://github.com/JuliaPlots/Plots.jl/issues/4436

tbreloff avatar Jun 09 '16 17:06 tbreloff

Decent progress:

graphplot(A, markersize=20rand(n)+10, marker_z=rand(n), lc=:blues, dim=3)

tmp

tbreloff avatar Jun 15 '16 06:06 tbreloff

tmp

tmp

tbreloff avatar Jun 15 '16 19:06 tbreloff

nice

Evizero avatar Jun 16 '16 11:06 Evizero

Thinking about tree-based layouts for directed graphs... I'd really prefer that GraphLayouts.jl was the source for layout algorithms, but I worry about the speed at which the dependencies will go away (i.e. Compose and JuMP)

In the meantime, I'd like to get something working in PlotRecipes. Here are some ideas:

  • https://www.youtube.com/watch?v=N0rWr8c1CeY
  • http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.56.4906&rep=rep1&type=pdf
  • https://cs.brown.edu/~rt/gdhandbook/chapters/hierarchical.pdf (I think this is what is implemented in GraphLayout? probably too ambitious)

tbreloff avatar Jul 05 '16 15:07 tbreloff

Here's another: http://web2-clone.research.att.com/export/sites/att_labs/groups/infovis/res/legacy_papers/DBLP-conf-gd-CarmelHK02.pdf

tbreloff avatar Jul 05 '16 15:07 tbreloff

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.437.3177&rep=rep1&type=pdf

tbreloff avatar Jul 05 '16 16:07 tbreloff

http://ac.els-cdn.com/S0925772105000313/1-s2.0-S0925772105000313-main.pdf?_tid=d2da40a0-4396-11e6-a5b9-00000aacb360&acdnat=1467822754_24f87632c06119b159157d66890ddd7a

tbreloff avatar Jul 06 '16 16:07 tbreloff

See section 2.3 of http://link.springer.com/chapter/10.1007%2F978-3-540-31843-9_25#page-1

tbreloff avatar Jul 06 '16 16:07 tbreloff

This is roughly the "section 2.3" algorithm:

using PlotRecipes; pyplot(size=(300,300))
n = 40
s, d = Plots.unzip(unique([(rand(1:n),rand(1:n)) for i=1:60]))
s = convert(Vector{Int}, s)
d = convert(Vector{Int}, d)
w = ones(length(s));

basex, basey = rand(n), rand(n)
@gif for i=1:100
    x, y = PlotRecipes.by_axis_local_stress_graph(s,d,w, x=copy(basex),y=copy(basey),maxiter=i)
    graphplot(s,d,w, m=(linspace(20,40,n),:inferno), l=(3,:black), x=x, y=y, series_annotations=map(string,1:n), curves=false)
end

tmp

tbreloff avatar Jul 08 '16 19:07 tbreloff

Progress with trees:

using PlotRecipes; gr(size=(500,500))
s = [1,2,2,3,3,2,5,4,7]
d = [2,3,4,5,6,7,6,5,4]
w = ones(length(s))
n = max(maximum(s), maximum(d))

graphplot(s,d,w,func=:tree,series_annotations=map(string,1:n),root=:top)

tmp

tbreloff avatar Jul 08 '16 21:07 tbreloff

What about a recipe for LightGraphs.jl? @sbromberger

ChrisRackauckas avatar Oct 28 '16 16:10 ChrisRackauckas

Sure. What do we need to do?

sbromberger avatar Oct 28 '16 16:10 sbromberger

@tbreloff You should definitely put your last example on the main page of the website. I just spent one hour trying to figure out how to get these nice round labeled vertices and finally ended up here after browsing the documentation, examples and code source.

my-little-repository avatar Nov 02 '17 20:11 my-little-repository

Yeah, the readme examples on PlotRecipes are broken - I think you've already opened an issue there? Sorry for the confusion.

mkborregaard avatar Nov 02 '17 22:11 mkborregaard