Adds a button that will overwrite the style for the given selection with the new given styles.
m_button_set_style(
id,
style = m_style_cartoon(),
sel = m_sel(),
label = "Style"
)
R3dmol id
or a r3dmol
object (the output from
r3dmol()
)
# Add buttons to show and hide sticks
r3dmol() %>%
m_add_model(data = pdb_1j72, format = "pdb") %>%
m_zoom_to() %>%
m_set_style(m_style_cartoon()) %>%
m_button_add_style(m_style_stick(), label = "Add Sticks") %>%
m_button_add_style(m_style_sphere(scale = 0.3), label = "Add Spheres") %>%
m_button_set_style(m_style_cartoon(), label = "Set Cartoon")