m_add_property_labels: Add property labels

Description Usage Arguments Value Examples

View source: R/add.R

Description

This will generate one label per a selected atom at the atom's coordinates with the property value as the label text.

Usage

1
m_add_property_labels(id, prop, sel = m_sel(), style = m_style_label())

Arguments

id

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

prop

Property name ()

sel

Atom selection specification

style

Style spec to add to specified atoms

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
14
15
16
17
library(r3dmol)

r3dmol() %>%
  m_add_model(data = "data-raw/Conformer3D_CID_5291.sdf", format = "sdf") %>%
  m_set_style(style = m_style_stick(radius = 2)) %>%
  m_zoom_to() %>%
  m_add_property_labels(
    prop = "index",
    sel = list(not = list(elem = "H")),
    style = m_style_label(
      fontColor = "black",
      font = "sans-serif",
      fontSize = 28,
      showBackground = FALSE,
      alignment = "center"
    )
  )

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