Layout problems with directed graph containing many disconnected components
I'm attaching some files that show the result of rendering with GraphPlot (gets it wrong) and with TikzGraph (gets it right).
The data are here: https://drive.google.com/file/d/12CfjV7kv2r7EAmSQoudfMog7p9r-OAr1/view?usp=sharing
Save that to /tmp/backedges.jld2 or something similar. Then you can create the graph with
julia> using FileIO
julia> backedges = load("/tmp/backedges.jld2", "backedges");
julia> using LightGraphs
julia> g = SimpleDiGraph(length(backedges))
{652, 0} directed simple Int64 graph
julia> for (i, deps) in enumerate(backedges)
for src in deps
add_edge!(g, src, i)
end
end
and then plot g.
With GraphPlot you can see the edges don't connect to nodes on both ends.
That is very ugly. I have't checked it yet, but is is possible, that what like unconnected lines, are actually the arrowheads of the lines, that are not resized properly?
As I suspected, the problem is, that the arrowhead size is not scaled nicely.
If you do something like gplot(g, arrowlengthfrac=0.01)it looks much nicer.
This does not mean of course, that we shouldn't fix the arrowhead size.