m_style_label: Specify Styling for Labels

Description Usage Arguments Examples

View source: R/style.R

Description

Styling options for the labels. Used inside m_add_label(), m_add_res_labels() and m_add_property_labels().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
m_style_label(
  font = "sans-serif",
  fontSize = 18,
  fontColor = "white",
  fontOpacity = 1,
  backgroundColor = "black",
  backgroundOpacity = 1,
  borderOpacity = 1,
  borderThickness = 0,
  borderColor = backgroundColor,
  inFront = TRUE,
  showBackground = TRUE,
  fixed = FALSE,
  alignment = c("topLeft", "topCenter", "topRight", "centerLeft", "center",
    "centerRight", "bottomLeft", "bottomCenter", "bottomRight"),
  position = NULL,
  frame = NULL
)

Arguments

font

Font name, default sans-serif.

fontSize

Height of text, default 18.

fontColor

Font color, default white.

fontOpacity

Font opacity, default 1.

backgroundColor

Color of background, default black.

backgroundOpacity

Opacity of background, default 1.

borderOpacity

Opacity of border, default 1.

borderThickness

Line width of border around label, default 0.

borderColor

Color of border, default backgroundColor.

inFront

Logical, if TRUE always put in front of model.

showBackground

Logical, show background rounded rectangle, default TRUE.

fixed

Logical, setes the label to change with the model when zooming.

alignment

String, how to orient the label with respect to position: 'topLeft' (default), 'topCenter', 'topRight', 'centerLeft', 'center', 'centerRight', 'bottomLeft', 'bottomCenter', 'bottomRight'.

position

x,y,z coordinates for label (for custom positioning).

frame

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

Examples

1
2
3
4
5
6
7
8
r3dmol() %>%
  m_add_model(data = pdb_1j72, format = "pdb") %>%
  m_set_style(style = m_style_stick()) %>%
  m_add_res_labels(style = m_style_label(
    fontSize = 14,
    backgroundColor = "green"
  )) %>%
  m_zoom_to()

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