m_add_label: Add label to viewer

Description Usage Arguments Value Examples

View source: R/add.R

Description

Add label to viewer

Usage

1
m_add_label(id, text, style = m_style_label(), sel = m_sel(), noshow = TRUE)

Arguments

id

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

text

Label text

style

Label style specification

sel

Set position of label to center of this selection

noshow

if TRUE, do not immediately display label - when adding multiple labels this is more efficient

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(r3dmol)

r3dmol() %>%
  m_add_model(data = pdb_6zsl, format = "pdb") %>%
  m_add_label(
    text = "Label",
    sel = m_vector3(-6.89, 0.75, 0.35),
    style = m_style_label(
      backgroundColor = "#666666",
      backgroundOpacity = 0.9
    )
  ) %>%
  m_zoom_to()

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