Based on htmlwidgets, so :
- compatible with shiny, R Markdown documents, and RStudio viewer
The package proposes all the features available in vis.js API, and even more with special features for R :
- easy to use
- custom shapes, styles, colors, sizes, …
- works smooth on any modern browser for up to a few thousand nodes and edges
- interactivity controls (zoom, physics, movement of nodes, tooltip, events, …)
Package is now available on CRAN.
install.packages("visNetwork") # can have new features in developpement version devtools::install_github("datastorm-open/visNetwork")
How it’s works ?
visNetwork needs at least two informations :
- a nodes data.frame, with
- a edges data.frame, with
tocolumns, which make the link with
require(visNetwork, quietly = TRUE) # minimal example nodes <- data.frame(id = 1:3) edges <- data.frame(from = c(1,2), to = c(1,3)) visNetwork(nodes, edges, width = "100%")
Find help ?
visDocumentation() vignette("Introduction-to-visNetwork") # with CRAN version # shiny example shiny::runApp(system.file("shiny", package = "visNetwork"))