Output and render functions for JBrowseR() in Shiny apps and interactive Rmd documents.

JBrowseROutput(outputId, width = "100%", height = "400px")

renderJBrowseR(expr, env = parent.frame(), quoted = FALSE)

Arguments

outputId

output variable to read from

width, height

a valid CSS unit, or a number coerced to pixels

expr

An expression that generates a JBrowseR

env

The environment in which to evaluate expr.

quoted

Is expr a quoted expression (with quote())?

Value

the Shiny UI bindings for a JBrowseR htmlwidget

the Shiny server bindings for a JBrowseR htmlwidget

Details

The widget reports three inputs, namespaced by output id: input[[paste0(outputId, "_selected_feature")]] is the clicked feature, _location the visible region as the location box prints it (thousands separators included), and _session the layout in the shape session = takes. Each settles after a gesture rather than firing per frame.

A re-render whose options differ only in tracks, location or local_files is applied to the browser on the page, keeping the user's zoom and track order; any other changed option builds a new browser. Reading _location or _session in the reactive that feeds renderJBrowseR() builds a loop: navigate from an observer with update_jbrowse() instead.