Closed jonng2024 closed 3 months ago
I am working on a better solution but for now you will need to use webshot2
to save the plots like explained here. If you need higher quality images you can increase the zoom.
library(webshot2)
# Generate plot with width and height specifications
cluster_plot <-
GC_chart(ophA_clusters,
group = "class",
cluster = "cluster",
width = "400px",
height = "250px")
# Save plot to temp.html file
htmlwidgets::saveWidget(cluster_plot, "temp.html", selfcontained = TRUE)
# Save plot to .png (or .jpg, .jpeg, .webp, .pdf)
webshot2::webshot(
"temp.html",
"output.png",
zoom = 2, # Increase zoom for higher resolution
selector = ".geneviewer")
Ok sure, thank you so much for all your hard work =)
Hi, I have a related issue - is there a way to export the pictures including the links between clusters? The links get lost after exporting to html. I have noticed that they are also missing in the examples at https://nvelden.github.io/geneviewer/reference/GC_links.html. Thank you for this great library!
What browser are you using? I can see the links on Chrome and Firefox.
I am using Firefox (125.0) on Ubuntu.
Just tried using Chrome and it works, thank you for the tip and for the quick response! :)
There was an issue the way the links were rendering. They should now also be visible in Firefox. Thanks a lot for pointing this out!
Hi, thanks for developing this library, its a lifesaver for me! Would it be possible to give us the ability to save the chart directly as svg and png please?
If we choose the png option, would it be possible to specify the resolution? This is because I realised that for reasonably complex plots, the resolution is not good enough when I zoom in to look at genes.
Perhaps this library could be connected to ggplot somehow? Thank you =)