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

Frozen network

  • dragNodes : enabled or not the selection and movement of nodes (click on a node, and move your mouse)?
  • dragView : enabled or not the movement of the full network (click everywhere except node, and move your mouse) ?
  • zoomView : enabled 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 : enabled keyboard manipulation rather than mouse (click on network before)
  • hover and hoverConnectedEdges : control hover
  • selectable : disabled nodes and edges selection
  • tooltipDelay : set delay before show pop-up
visNetwork(nodes, edges, height = "500px", width = "100%") %>% 
  visInteraction(keyboard = TRUE, tooltipDelay = 0)

© 2016-2017 DataStorm

Fork me on GitHub