Make a snapshot of a NGLVieweR object in Shinymode.
snapShot(NGLVieweR_proxy, fileName = "Snapshot", param = list())
A NGLVieweR object.
Optional name for Snapshot (default = "Snapshot").
Of type list, can be; antialias TRUE/FALSE
, trim
TRUE/FALSE
, transparent TRUE/FALSE
or scale numeric
.
For a full list of options, see "makeImage" and "ImageParameters" in the
official NGL.js manual.
API call containing NGLVieweR
id
and list of message
parameters.
NGLVieweR_example()
See example "snapshot".
Other options:
setFocus()
,
setQuality()
,
updateFocus()
,
updateFullscreen()
if (FALSE) { # \dontrun{
NGLVieweR_proxy("structure") %>%
snapShot("Snapshot", param = list(
antialias = TRUE,
trim = TRUE,
transparent = TRUE,
scale = 1))
} # }
if (interactive()) {
library(shiny)
ui <- fluidPage(
titlePanel("Viewer with API inputs"),
sidebarLayout(
sidebarPanel(
actionButton("snapshot", "Snapshot"),
),
mainPanel(
NGLVieweROutput("structure")
)
)
)
server <- function(input, output) {
output$structure <- renderNGLVieweR({
NGLVieweR("7CID") %>%
addRepresentation("cartoon",
param = list(
name = "cartoon",
color = "residueindex"
)
)
})
observeEvent(input$snapshot, {
NGLVieweR_proxy("structure") %>%
snapShot("Snapshot",
param = list(
antialias = TRUE,
trim = TRUE,
transparent = TRUE,
scale = 1
)
)
})
}
shinyApp(ui, server)
}