Convert widgets to PNG image
m_png(id, width, height, captureDelay = 2000)
R3dmol id
or a r3dmol
object (the output from
r3dmol()
).
image width and height.
Image conversion delay setting. This argument is only
needed in some cases where the rendering is time-consuming (e.g. with
m_add_surface()
). The default value is 2000 milliseconds. Fixed to 0
when immediate rendering available.
Base64 encoded png image wrapped by <img>
tag.
library(r3dmol)
r3dmol() %>%
m_add_model(data = pdb_1j72, format = "pdb") %>%
m_set_style(style = m_style_cartoon()) %>%
m_zoom_to() %>%
m_png()