Output and render functions for using JBrowseRApp() within Shiny
applications and interactive Rmd documents. These are separate from
JBrowseROutput() because the app is a separate widget with its own
JavaScript bundle: htmlwidgets dispatches on the output element's class, so
rendering a JBrowseRApp() into a JBrowseROutput() loads the single-view
bundle and fails to build.
JBrowseRAppOutput(outputId, width = "100%", height = "400px")
renderJBrowseRApp(expr, env = parent.frame(), quoted = FALSE)output variable to read from
Must be a valid CSS unit or a number, which will be coerced to a string and have 'px' appended.
Must be a valid CSS unit or a number, which will be coerced to a string and have 'px' appended.
An expression that generates a JBrowseRApp
The environment in which to evaluate expr.
Is expr a quoted expression (with quote())? This
is useful if you want to save an expression in a variable.
the Shiny UI bindings for a JBrowseRApp htmlwidget
the Shiny server bindings for a JBrowseRApp htmlwidget
Whatever the user does to the layout — navigating, opening tracks, adding or
rearranging views — is reported as
input[[paste0(outputId, "_session")]], in the same shape session =
takes. So "save this layout" is storing that value, and reopening it is
passing it back:
output$app <- renderJBrowseRApp(JBrowseRApp(assemblies, views = saved()))
observeEvent(input$save, { saved(input$app_session) })It rides a coarse signal — which views exist, what each has open, and where
each is looking — so it settles after a gesture instead of firing per frame.
As with _location, reading it in the reactive that feeds
renderJBrowseRApp() builds a loop: store it on an event, don't wire it
straight through.