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

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

if (FALSE) {
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")
  )
}