stageParameters: Set stage parameters

Description Usage Arguments Value See Also Examples

View source: R/NGLVieweR.R

Description

Set stage parameters.

Usage

1

Arguments

NGLVieweR

A NGLVieweR object.

...

Options controlling the stage. Most common options are backgroundColor, rotateSpeed, zoomSpeed, hoverTimeout and lightIntensity. For a full list of options, see the "stageParameters" method in the official NGL.js manual.

Value

Returns list of stage parameters to NGLVieweR htmlwidgets object.

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
NGLVieweR("7CID") %>%
 stageParameters(backgroundColor = "white", zoomSpeed = 1) %>%
 addRepresentation("cartoon", param = list(name = "cartoon", colorScheme="residueindex"))

if (interactive()) {
  library(shiny)
  ui <- fluidPage(NGLVieweROutput("structure"))
  server <- function(input, output) {
    output$structure <- renderNGLVieweR({
      NGLVieweR("7CID") %>%
        stageParameters(backgroundColor = "white", zoomSpeed = 1) %>%
        addRepresentation("cartoon",
          param = list(name = "cartoon", colorScheme = "residueindex")
        )
    })
  }
  shinyApp(ui, server)
}

NGLVieweR documentation built on June 1, 2021, 9:08 a.m.