Description Usage Arguments Value Examples
Create a grid of viewers that share a WebGL canvas
1 2 3 4 5 6 7 8 9 10 |
viewer |
A list contains sub-viewers. |
element_id |
HTML string identifier. |
rows |
Number of rows in viewer grid. |
cols |
Number of columns in viewer grid. |
control_all |
Logical, simaultaneous mouse control of all windows in the grid. |
viewer_config |
Viewer specification to apply to all subviewers. |
width |
Fixed width for combined viewer (in css units). Ignored when
used in a Shiny app – use the |
height |
Fixed height for combined viewer (in css units). It is recommended to not use this parameter since the widget knows how to adjust its height automatically. |
An r3dmol
object (the output from r3dmol()
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | library(r3dmol)
m1 <- r3dmol() %>%
m_add_model(data = pdb_6zsl, format = "pdb") %>%
m_zoom_to()
m2 <- m1 %>%
m_set_style(style = m_style_cartoon(color = "spectrum"))
m3 <- m1 %>%
m_set_style(style = m_style_stick())
m4 <- m1 %>%
m_set_style(style = m_style_sphere())
m_grid(
viewer = list(m1, m2, m3, m4),
control_all = TRUE,
viewer_config = m_viewer_spec(
backgroundColor = "black"
)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.