Hide links over a certain length, based on computations by
Nodes will actually be hidden in resulting visualisation but not removed.
hide_long_links(g, length = 1) compute_links_length(g)
|An object of class |
|Length above which links should be hidden.|
This is the technique used by [https://github.com/anvaka](Andrei Kashcha) , in his [https://anvaka.github.io/pm](package managers visualisation project) , though the latter does not use ngraph.pixel (which grapher uses) and hides links based on the length in pixels. Hiding distant edges allows to undo the hairball while still being able to discern smaller communities.
gdata <- make_data(500) g <- graph(gdata) %>% graph_layout_static(scaling = c(-1000, 1000)) %>% graph_cluster() %>% scale_link_color(cluster) # hide links longer than 100 hide_long_links(g, 100) # or get computed lengths lengths <- compute_links_length(g) # define threshold threshold <- quantile(lengths$length, .2) hide_long_links(g, threshold)