| vol_set | R Documentation |
Sends settings to a widget that is already on screen, without rebuilding it.
vol_set(id, options, session = shiny::getDefaultReactiveDomain())
id |
Output identifier of the widget. |
options |
Named list of viewer settings; see |
session |
The shiny session. |
Change a running widget
Rendering the widget again would rebuild the whole page and reload the payload, which for a slider that a reader is dragging is the wrong trade. This sends the settings alone, so the state of the camera and of the loaded textures survives.
NULL, invisibly. Called for its effect.
vol_widget() for the widget and the keys it takes,
render_vol_widget(), vol_snapshot(), shinyVolumr().
# Inside the server function of a shiny application; see render_vol_widget()
# for a complete one.
if (interactive() && requireNamespace("shiny", quietly = TRUE)) {
server <- function(input, output, session) {
output$volume <- render_vol_widget(vol_widget(vol_example_payload()))
shiny::observe(vol_set("volume", list(slab = input$slab,
slabZ = input$depth)))
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.