visPhysics | R Documentation |
Network visualization Physics options. For full documentation, have a look at visDocumentation.
visPhysics( graph, solver = NULL, maxVelocity = NULL, minVelocity = NULL, timestep = NULL, barnesHut = NULL, forceAtlas2Based = NULL, repulsion = NULL, hierarchicalRepulsion = NULL, stabilization = NULL, adaptiveTimestep = NULL, wind = NULL, enabled = NULL )
graph |
: a visNetwork object |
solver |
: String. Default to 'barnesHut'. You can select your own solver. Possible options: 'barnesHut', 'repulsion', 'hierarchicalRepulsion', 'forceAtlas2Based'. When setting the hierarchical layout, the hierarchical repulsion solver is automaticaly selected, regardless of what you fill in here. |
maxVelocity |
: Number. Default to 50. The physics module limits the maximum velocity of the nodes to increase the time to stabilization. This is the maximum value. |
minVelocity |
: Number. Default to 0.1. Once the minimum velocity is reached for all nodes, we assume the network has been stabilized and the simulation stops. |
timestep |
: Number. Default to 0.5. The physics simulation is discrete. This means we take a step in time, calculate the forces, move the nodes and take another step. If you increase this number the steps will be too large and the network can get unstable. If you see a lot of jittery movement in the network, you may want to reduce this value a little. |
barnesHut, |
named list of options
|
forceAtlas2Based, |
named list of options
|
repulsion, |
named list of options
|
hierarchicalRepulsion, |
named list of options
|
stabilization, |
Just a boolean, or a named list of options
|
adaptiveTimestep |
: Boolean. Default to true. If this is enabled, the timestep will intelligently be adapted (only during the stabilization stage if stabilization is enabled!) to greatly decrease stabilization times. The timestep configured above is taken as the minimum timestep. This can be further improved by using the improvedLayout algorithm. |
wind, |
Named list. A force that pushes all non-fixed nodes in the given direction. Requires all nodes are connected to nodes which are fixed, otherwise non-attached nodes will keep moving indefinitely.
|
enabled |
: Boolean. Default to true. Toggle the physics system on or off. This property is optional. If you define any of the options below and enabled is undefined, this will be set to true. |
See online documentation https://datastorm-open.github.io/visNetwork/
visNodes for nodes options, visEdges for edges options, visGroups for groups options, visLegend for adding legend, visOptions for custom option, visLayout & visHierarchicalLayout for layout, visPhysics for control physics, visInteraction for interaction, visNetworkProxy & visFocus & visFit for animation within shiny, visDocumentation, visEvents, visConfigure ...
nodes <- data.frame(id = 1:10) edges <- data.frame(from = round(runif(8)*10), to = round(runif(8)*10)) visNetwork(nodes, edges) %>% visPhysics(solver = "repulsion") visNetwork(nodes, edges) %>% visPhysics(solver = "forceAtlas2Based", forceAtlas2Based = list(gravitationalConstant = -10)) visNetwork(nodes, edges) %>% visPhysics(stabilization = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.