visNetwork (version 0.1.1)

visInteraction: Network visualization interaction

Description

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

Usage

visInteraction(graph, dragNodes = NULL, dragView = NULL,
  hideEdgesOnDrag = NULL, hideNodesOnDrag = NULL, hover = NULL,
  hoverConnectedEdges = NULL, keyboard = NULL, multiselect = NULL,
  navigationButtons = NULL, selectable = NULL,
  selectConnectedEdges = NULL, tooltipDelay = NULL, zoomView = NULL)

Arguments

graph
: a visNetwork object
dragNodes
: Boolean. Default to true. When true, the nodes that are not fixed can be dragged by the user.
dragView
: Boolean. Default to true. When true, the view can be dragged around by the user.
hideEdgesOnDrag
: Boolean. Default to false. When true, the edges are not drawn when dragging the view. This can greatly speed up responsiveness on dragging, improving user experience.
hideNodesOnDrag
: Boolean. Default to false. When true, the nodes are not drawn when dragging the view. This can greatly speed up responsiveness on dragging, improving user experience.
hover
: Boolean. Default to false. When true, the nodes use their hover colors when the mouse moves over them.
hoverConnectedEdges
: Boolean. Default to true. When true, on hovering over a node, it's connecting edges are highlighted.
keyboard
: Just a Boolean, or a named list. When true, the keyboard shortcuts are enabled with the default settings. For further customization, you can supply an object.
  • "enabled"
{ : Boolean. Default to false. Toggle the usage of the keyboard
"bindToWindow"
: Boolean. Default to true. If this is true, global keyboard events will be used. If it is false, the keyboard events are only used when the network is active. It is activated on mouseOver automatically.

item

  • multiselect
  • navigationButtons
  • selectable
  • selectConnectedEdges
  • tooltipDelay
  • zoomView

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))

#frozen network
visNetwork(nodes, edges) %>%
 visInteraction(dragNodes = FALSE, dragView = FALSE, zoomView = FALSE)

visNetwork(nodes, edges) %>%
 visInteraction(hideEdgesOnDrag = TRUE)

visNetwork(nodes, edges) %>%
 visInteraction(hover = TRUE)

#navigation button
visNetwork(nodes, edges) %>%
 visInteraction(navigationButtons = TRUE)

visNetwork(nodes, edges) %>%
 visInteraction(selectConnectedEdges = FALSE)

visNetwork(nodes, edges) %>%
 visInteraction(multiselect = TRUE)

visNetwork(nodes, edges) %>%
  visInteraction(keyboard = TRUE)

Run the code above in your browser using DataLab