Learn R Programming

NGLVieweR (version 1.4.0)

stageParameters: Set stage parameters

Description

Set stage parameters.

Usage

stageParameters(NGLVieweR, ...)

Value

Returns list of stage parameters to NGLVieweR

htmlwidgets object.

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.

See Also

  • updateStage()

  • NGLVieweR_example() See example "basic".

Examples

Run this code
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)
}

Run the code above in your browser using DataLab