I am trying to save a Sankey plot that I created using the sankeyNetwork() function of the "networkD3" package in a .png format. I have explored different options but have not figure out to get the high-resolution graph. Please give me some suggestions.
One of the option that I tried:
saveNetwork(p, "sn2.html")
webshot::webshot("sn2.html","sn.png", vwidth = 1000, vheight = 900)
htmlwidgetsor webshot are the only ones I know. What I do is saving the image by simply using the pull-down menu from the graphic window in R-Studio ('save as...') . You can specify resolution, but I don't know whether it is close to what you need. Have you tried that already?
or try webshot2, which can be installed with remotes::install_github("rstudio/webshot2")... it requires Chrome or a Chromium based browser to be installed.
Thank you for the suggestion, I end up using webshot, I explore the zoom option that is available in webshot function. It worked pretty well for me what I was looking for.