powered by
This function creates a configuration list for G6 Fruchterman layout with all available options as parameters.
fruchterman_layout(height = NULL, width = NULL, gravity = 10, speed = 5, ...)
A list containing the configuration for G6 fruchterman layout.
Numeric. Layout height. Defaults to container height.
Numeric. Layout width. Defaults to container width.
Numeric. Central force attracting nodes to the center. Larger values make the layout more compact. Defaults to 10.
Numeric. Node movement speed per iteration. Higher values may cause oscillation. Defaults to 5.
Additional parameters to pass to the layout. See https://g6.antv.antgroup.com/en/manual/layout/fruchterman-layout.
if (interactive()) { g6(lesmis$nodes, lesmis$edges) |> g6_layout(fruchterman_layout( gravity = 5, speed = 5 )) |> g6_behaviors( "zoom-canvas", drag_element() ) }
Run the code above in your browser using DataLab