snapShot {NGLVieweR} | R Documentation |
Snapshot
Description
Make a snapshot of a NGLVieweR object in Shinymode.
Usage
snapShot(NGLVieweR_proxy, fileName = "Snapshot", param = list())
Arguments
NGLVieweR_proxy |
A NGLVieweR object. |
fileName |
Optional name for Snapshot (default = "Snapshot"). |
param |
Of type list, can be; antialias |
Value
API call containing NGLVieweR
id
and list of message parameters.
See Also
NGLVieweR_example()
See example "snapshot".
Other options:
setFocus()
,
setQuality()
,
updateFocus()
,
updateFullscreen()
Examples
## Not run:
NGLVieweR_proxy("structure") %>%
snapShot("Snapshot", param = list(
antialias = TRUE,
trim = TRUE,
transparent = TRUE,
scale = 1))
## End(Not run)
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)
}
[Package NGLVieweR version 1.3.1 Index]