Add a button for spinning the scene
m_button_spin(
id,
speed = 1,
axis = "y",
label = "Spin",
stopButton = TRUE,
stopLabel = "Stop"
)R3dmol id or a r3dmol object (the output from
r3dmol()).
Speed multiplier for spin animation. Defaults to 1. Negative value reverses the direction of spin.
Axis ("x", "y", "z", "vx",
"vy", "vz") to rotate around. Default "y". View
relative (rather than model relative) axes are prefixed with "v".
String for button label.
Logical, whether to also create a button to stop the spin.
String for the stop button label.
R3dmol id or a r3dmol object (the output from
r3dmol())
# Add buttons to start and stop spin
r3dmol() %>%
m_add_model(data = pdb_1j72, format = "pdb") %>%
m_zoom_to() %>%
m_set_style(m_style_cartoon()) %>%
m_button_spin()
# Add buttons to stop already spinning scene
r3dmol() %>%
m_add_model(data = pdb_1j72, format = "pdb") %>%
m_zoom_to() %>%
m_set_style(m_style_cartoon()) %>%
m_spin() %>%
m_button_spin()