updateFullscreen {NGLVieweR}R Documentation

Fullscreen

Description

Put viewer in fullscreen. Works in Shinymode.

Usage

updateFullscreen(NGLVieweR_proxy, fullscreen = TRUE)

Arguments

NGLVieweR_proxy

A NGLVieweR object.

fullscreen

If TRUE put viewer in fullscreen.

Value

API call containing NGLVieweR id and list of message parameters.

See Also

NGLVieweR_example() See example "updateFullscreen".

Other options: setFocus(), setQuality(), snapShot(), updateFocus()

Examples

## Not run: 
NGLVieweR_proxy("structure") %>% updateFullscreen()

## End(Not run)

if (interactive()) {
library(shiny)

ui <- fluidPage(
  titlePanel("Viewer with API inputs"),
  sidebarLayout(
    sidebarPanel(
      actionButton("fullscreen", "Fullscreen"),
    ),
    mainPanel(
      NGLVieweROutput("structure")
    )
  )
)
server = function(input, output) {
 output$structure <- renderNGLVieweR({
  NGLVieweR("7CID") %>%
    addRepresentation("cartoon",
      param = list(name = "cartoon", color = "red")
    )
})

  observeEvent(input$fullscreen, {
  NGLVieweR_proxy("structure") %>%
    updateFullscreen()
})
}
  shinyApp(ui, server)
}

[Package NGLVieweR version 1.3.1 Index]