# NOT RUN {
nodes <- data.frame(id = 1:10,
title = '<a target="_blank" href="https://github.com/datastorm-open/visNetwork">github</a>')
edges <- data.frame(from = round(runif(8)*10), to = round(runif(8)*10))
# custom tooltip
# default value : 'position: fixed;visibility:hidden;padding: 5px;font-family: verdana;
# font-size:14px;font-color:#000000;background-color: #f5f4ed;-moz-border-radius: 3px;*
# -webkit-border-radius: 3px;border-radius: 3px; border: 1px solid #808074;
# box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);max-width:400px;word-break: break-all'
visNetwork(nodes, edges) %>%
visInteraction(tooltipStyle = 'position: fixed;visibility:hidden;padding: 5px;white-space: nowrap;
font-family: cursive;font-size:18px;font-color:purple;background-color: red;')
nodes <- data.frame(id = 1:3)
edges <- data.frame(from = c(1,2), to = c(1,3))
# 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