GraphRecipes.jl
GraphRecipes.jl copied to clipboard
Graphs
Finish up spectral graphs, then tackle tree layouts and directed graphs.
See also: https://github.com/JuliaPlots/Plots.jl/issues/4436
Decent progress:
graphplot(A, markersize=20rand(n)+10, marker_z=rand(n), lc=:blues, dim=3)



nice
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)
Here's another: http://web2-clone.research.att.com/export/sites/att_labs/groups/infovis/res/legacy_papers/DBLP-conf-gd-CarmelHK02.pdf
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.437.3177&rep=rep1&type=pdf
http://ac.els-cdn.com/S0925772105000313/1-s2.0-S0925772105000313-main.pdf?_tid=d2da40a0-4396-11e6-a5b9-00000aacb360&acdnat=1467822754_24f87632c06119b159157d66890ddd7a
See section 2.3 of http://link.springer.com/chapter/10.1007%2F978-3-540-31843-9_25#page-1
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

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)

What about a recipe for LightGraphs.jl? @sbromberger
Sure. What do we need to do?
@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.
Yeah, the readme examples on PlotRecipes are broken - I think you've already opened an issue there? Sorry for the confusion.