Styling options for the various shapes. Used inside m_add_sphere()
,
m_add_arrow()
, m_add_cylinder()
etc.
m_shape_spec(
color = NULL,
opacity = 1,
wireframe = FALSE,
hidden = FALSE,
frame = NULL,
clickable = FALSE,
callback = NULL,
hoverable = FALSE,
hover_callback = NULL,
unhover_callback = NULL
)
Solid color values.
Transparency value. 1 for opaque, 0 for invisible.
Draw as wireframe, not solid surface.
If true, do not display object.
If set, only display in this frame of an animation.
If true, user can click on object to trigger callback.
Function to call on click.
Logical, enabling hover_callback and unhover_callback functions to be called. Set hoverDuration in the viewer_spec() of r3dmol().
Function to be called upon hover.
Function to be called upon hover stopping.
library(r3dmol)
if (FALSE) {
r3dmol() %>%
m_add_model(data = m_fetch_pdb("1bna")) %>%
m_add_sphere(
center = m_sel(resi = 1),
spec = m_shape_spec(color = "green", wireframe = TRUE)
) %>%
m_zoom_to(sel = m_sel(resi = 1))
}