datastorm-open / visNetwork

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

visNetwork - Saving a subsetted plot as a PNG/JPEG/TIFF #413

Open Keaty19 opened 3 years ago

Keaty19 commented 3 years ago

Hi there. I've been using the visNetwork package as part of a Shiny app i've been developing for displaying gene networks. Big fan of the interface and all of the features available in the package. At the moment I'm trying to add a feature to my app which allows the user to download the figures created as image files - I've tried visExport/downloadHandler to download .html files but unfortunately I can't quite get them to output the subsetted graphs that are created (they always output all of the nodes/edges in the file as one complete network, whilst the network always exists as a smaller subset of these networks along with nodes/edges customisations). I've also tried the visSave function, which works brilliantly, but unfortunately the output image files are very poor quality (especially when plotting larger networks).

Are there any workarounds/planned updates that will enable the saving of higher quality image files of the created network? I've tried to use the visNetworkProxy and saveNodePosition technique (alongside downloadHandler) to get this working but unfortunately it still outputs a completely unsubsetted and uncustomised network in the .html file.

Thanks! Really enjoying the package so far.