Description Usage Arguments Value See Also Examples
Make a snapshot of a NGLVieweR object in Shinymode.
1 | snapShot(NGLVieweR_proxy, fileName = "Snapshot", param = list())
|
NGLVieweR_proxy |
A NGLVieweR object. |
fileName |
Optional name for Snapshot (default = "Snapshot"). |
param |
Of type list, can be; antialias |
API call containing NGLVieweR
id
and list of message parameters.
NGLVieweR_example()
See example "snapshot".
Other options:
setFocus()
,
setQuality()
,
updateFocus()
,
updateFullscreen()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | ## 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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.