This should be done for self-contained instances of visNetwork, when not being rendered as part of a larger document. It sets up some stylesheet + javascript dependencies.
attach_dependencies(graph, standalone = T)
graph | a graph made by |
---|---|
standalone | logical, whether the current graph is rendered on its own page, or is part of a larger rmarkdown document. |
Use it like:
graph <- visNetwork::visNetwork() graph %<>% attach_dependencies() graph %>% visNetwork::visSave()