| updateFullscreen | R Documentation |
Enter or leave fullscreen. Works in Shinymode.
updateFullscreen(
NGLVieweR_proxy,
fullscreen = TRUE,
element = c("page", "viewer")
)
NGLVieweR_proxy |
A NGLVieweR object. |
fullscreen |
If |
element |
What to show fullscreen: |
Browsers only allow entering fullscreen in response to a user
action, such as clicking a button that triggers updateFullscreen().
API call containing NGLVieweR id and list of message
parameters.
NGLVieweR_example() See example "updateFullscreen".
Other options:
setFocus(),
setQuality(),
snapShot(),
updateFocus()
## Not run:
NGLVieweR_proxy("structure") %>% updateFullscreen()
## End(Not run)
if (interactive()) {
library(shiny)
ui <- fluidPage(
titlePanel("Viewer with API inputs"),
sidebarLayout(
sidebarPanel(
actionButton("enter", "Enter fullscreen"),
actionButton("exit", "Exit fullscreen")
),
mainPanel(
NGLVieweROutput("structure")
)
)
)
server = function(input, output) {
output$structure <- renderNGLVieweR({
NGLVieweR("7CID") %>%
addRepresentation("cartoon",
param = list(name = "cartoon", color = "red")
)
})
observeEvent(input$enter, {
NGLVieweR_proxy("structure") %>%
updateFullscreen(TRUE)
})
observeEvent(input$exit, {
NGLVieweR_proxy("structure") %>%
updateFullscreen(FALSE)
})
}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.