datastorm-open / visNetwork

R package, using vis.js library for network visualization
Other
545 stars 125 forks source link

Can HTML dependencies be saved in a specific location? #389

Closed angusveitch closed 4 years ago

angusveitch commented 4 years ago

I need to publish a series of networks (like, dozens of them) in HTML format in the same folder. Rather than each html file having its own copy of the javascript libraries, I want the dependencies to be saved only once in a specific location. I know this is possible with the saveWidget function via the 'libdir' parameter, as I have used this option in other packages such as Plotly. But I don't know how to call this option via the visSave function. Can this be done presently, or would this require an enhancement to visSave?

This seems to be a very similar question to the one asked in #238, but I can't find a solution in that thread.

angusveitch commented 4 years ago

Ok so I think I've answered my own question. All I had to do was use saveWidget to save the output instead of visSave. It seems to do the same thing. I'd like to be sure, though: does visSave do anything that saveWidget doesn't?

bthieurmel commented 4 years ago

visSave just call saveWidget