wch / webshot

Take screenshots of web pages from R
http://wch.github.io/webshot/
227 stars 40 forks source link

Adjusted .html could not be saved in .pdf #124

Open XuJahcenia opened 4 months ago

XuJahcenia commented 4 months ago

I draw a sankey plot in R:

`p <- sankeyNetwork(Links = links, Nodes = nodes, Source = "SourceID", #sourceID Target = "TargetID", #targetID Value = "value", NodeID = "name", colourScale=my_color,

nodePadding = 20,

               LinkGroup = 'subtype', 
               fontFamily = "arial",
               fontSize = 15, 
               nodeWidth = 40, 
               sinksRight = F,
               height = 400, width = 550) `

And the position of the nodes in the graph can be adjusted manually. But I saved this graph by webshot2::webshot, but those adjustment cannot be saved.

saveNetwork(p,"m6A_type_OS.html") webshot("m6A_type_OS.html" , "m6A_type_OS.pdf")

Can somebody give me some advice?

wch commented 4 months ago

I suggest using webshot2 instead of webshot. From the README in this repository:

Note: webshot uses PhantomJS, which is a headless browser that stopped development in 2018. Please use webshot2, which uses Chromium-based browsers.