visNetwork (version 0.1.1)

visPhysics: Network visualization Physics options

Description

Network visualization Physics options. For full documentation, have a look at visDocumentation.

Usage

visPhysics(graph, solver = NULL, maxVelocity = NULL, minVelocity = NULL,
  timestep = NULL, barnesHut = NULL, forceAtlas2Based = NULL,
  repulsion = NULL, hierarchicalRepulsion = NULL, stabilization = NULL,
  adaptiveTimestep = NULL)

Arguments

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,
maxVelocity
: Number. Default to 50. The physics module limits the maximum velocity of the nodes to increase the time to stabilization. This is the maximium 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 s
barnesHut,
named list of options
  • "gravitationalConstant"
{ : Number. Default to -2000. Gravity attracts. We like repulsion. So the value is negative. If you want the repulsion to be stronger, decrease the value (so -10000, -50000).} "centra

item

  • forceAtlas2Based,
  • "centralGravity"
  • "springLength"
  • "springConstant"
  • "damping"
  • "avoidOverlap"
  • repulsion,
  • "centralGravity"
  • "springLength"
  • "springConstant"
  • "damping"
  • hierarchicalRepulsion,
  • "centralGravity"
  • "springLength"
  • "springConstant"
  • "damping"
  • stabilization,
  • "iterations"
  • "updateInterval"
  • "onlyDynamicEdges"
  • "fit"
  • adaptiveTimestep

itemize

  • "enabled"

See Also

visNodes for nodes options, visEdges for edges options, visGroups for groups options, visLayout & visHierarchicalLayout for layout, visPhysics for physics, visInteraction for interaction, ...

Examples

Run this code
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)

Run the code above in your browser using DataCamp Workspace