Compute the force layout (same as
but before rendering in the browser.
graph_offline_layout( g, steps = 500, spring_length = 30L, sping_coeff = 8e-04, gravity = -1.2, theta = 0.8, drag_coeff = 0.02, time_step = 20L, is_3d = TRUE, verlet_integration = FALSE, quiet = !interactive() ) graph_layout_offline( g, steps = 500, spring_length = 30L, sping_coeff = 8e-04, gravity = -1.2, theta = 0.8, drag_coeff = 0.02, time_step = 20L, is_3d = TRUE, verlet_integration = FALSE, quiet = !interactive() )
|An object of class |
|Number of steps to run the layout algorithm.|
|Used to compute Hook's law, default of |
|Hook's law coefficient, where |
|Coulomb's law coefficient. It's used to repel nodes thus should be negative if positive nodes attract each other.|
|Theta coefficient from Barnes Hut simulation, between |
|Drag force coefficient. Used to slow down system, thus should be less than |
|Default time step $dt$ for forces integration.|
|Whether to plot in 3 dimensions or 2 dimensions.|
|If you find that standard the default Euler integration produces too many errors and jitter, consider using verlet integration by settings this to |
|Set to |
This method is not necessarily faster than rendering in the browser as the graph has to be serialised to JSON once more to be processed by the https://github.com/anvaka/ngraph.forcelayout3d algorithm then reimported in grapher.
graph_layout_static for other "offline" layout methods.
gdata <- make_data(500) gdata %>% graph() %>% graph_layout_offline(steps = 100)