m_shape_spec: Specify Styling for Generic Shapes

Description Usage Arguments Examples

View source: R/style.R

Description

Styling options for the various shapes. Used inside m_add_sphere(), m_add_arrow(), m_add_cylinder() etc.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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
)

Arguments

color

Solid color values.

opacity

Transparency value. 1 for opaque, 0 for invisible.

wireframe

Draw as wireframe, not solid surface.

hidden

If true, do not display object.

frame

If set, only display in this frame of an animation.

clickable

If true, user can click on object to trigger callback.

callback

Function to call on click.

hoverable

Logical, enabling hover_callback and unhover_callback functions to be called. Set hoverDuration in the viewer_spec() of r3dmol().

hover_callback

Function to be called upon hover.

unhover_callback

Function to be called upon hover stopping.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(r3dmol)
## Not run: 
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))

## End(Not run)

r3dmol documentation built on March 14, 2021, 5:08 p.m.