m_add_arrow: Add arrow shape

Description Usage Arguments Examples

View source: R/add.R

Description

Add an arrow from start to end, additional customisation through m_shape_spec().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
m_add_arrow(
  id,
  start,
  end,
  radius = 0.2,
  radiusRatio = 1.62,
  mid = 0.62,
  spec = m_shape_spec(),
  hidden = FALSE
)

Arguments

id

R3dmol id or a r3dmol object (the output from r3dmol())

start

Start location of arrow Can be either m_sel() or m_vector3().

end

End location of arrow. Can be either m_sel() or m_vector3().

radius

Radius of base cylinder for arrow.

radiusRatio

Ratio of arrow point to the base cylinder. Default 1.618034.

mid

Relative position of the arrow point base, along the length of arrow object. Default to 0.618034.

spec

Additional shape specifications defined with m_shape_spec().

hidden

Hide object if TRUE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
r3dmol() %>%
  m_add_model(data = m_fetch_pdb("1bna")) %>%
  m_zoom_to(sel = m_sel(resi = 1)) %>%
  m_add_arrow(
    start = m_sel(resi = 1),
    end = m_sel(resi = 3),
    spec = m_shape_spec(color = "green")
  )

## End(Not run)

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