Chapter 14 Performances
The graphTweets has already seen great performance improvements and can now build large graphs.
The sigmajs library needs some explanation, namely on layout, and renderers.
The sigmajs package actually comes with three renderers out-of-the-box;
canvas, the default,
svg makes for slightly nicer looking graphs but at performance costs so only use it for the smaller graphs. In contrast,
webgl is extremely performant.
Let’s plot huge graph using
webgl to demonstrate, below we graph 25,000 nodes.
data <- sg_make_nodes_edges(25000) # make 25,000 nodes sigmajs("webgl") %>% # set to webgl sg_nodes(data$nodes, id, size) %>% sg_edges(data$edges, id, source ,target) %>% sg_layout() %>% sg_settings( nodeColor = "default", defaultNodeColor = "#328983", edgeColor = "default", defaultEdgeColor = "#b9b9b9" )