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)

Arguments

graph

a graph made by drake::render_graph().

standalone

logical, whether the current graph is rendered on its own page, or is part of a larger rmarkdown document.

Details

Use it like:

graph <- visNetwork::visNetwork()
graph %<>% attach_dependencies()
graph %>% visNetwork::visSave()