It’s possible to control the interactions of the network with visInteraction() :

Frozen network

  • dragNodes : enable or not the selection and movement of nodes (click on a node, and move your mouse)?
  • dragView : enable or not the movement of the full network (click everywhere except node, and move your mouse) ?
  • zoomView : enable or not the zoom (use mouse scroll) ?
visNetwork(nodes, edges, height = "500px", width = "100%") %>% 
  visInteraction(dragNodes = FALSE, 
                 dragView = FALSE, 
                 zoomView = FALSE) %>%
  visLayout(randomSeed = 123)

Hide edges/nodes on drag

Can increase the performance.

  • hideEdgesOnDrag : hide egdes when dragging the view
  • hideNodesOnDrag : hide nodes when dragging the view
visNetwork(nodes, edges, height = "500px", width = "100%") %>% 
  visInteraction(hideEdgesOnDrag = TRUE) %>%
  visLayout(randomSeed = 123)

And also…

  • keyboard : enable keyboard manipulation rather than mouse (click on network before)
  • hover and hoverConnectedEdges : control hover
  • selectable : disable nodes and edges selection
  • tooltipDelay : set delay before show pop-up
visNetwork(nodes, edges, height = "500px", width = "100%") %>% 
  visInteraction(keyboard = TRUE, tooltipDelay = 0)

© 2020-2021 DataStorm

Fork me on GitHub