Skip to contents

Output and render functions for using hic() within Shiny applications and interactive R Markdown / Quarto documents.

Usage

hicOutput(output_id, width = "100%", height = "480px")

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

Arguments

output_id

Output variable to read from.

width, height

Element size, passed to htmlwidgets::shinyWidgetOutput().

expr

An expression that generates a hic() widget.

env

The environment in which to evaluate expr.

quoted

Is expr already quoted? Defaults to FALSE.

Value

hicOutput() returns a Shiny output UI element; renderHic() returns a Shiny render function.

Examples

if (interactive() && requireNamespace("shiny", quietly = TRUE)) {
  ui <- fluidPage(hicOutput("h"))
  server <- function(input, output) {
    output$h <- renderHic({
      hic(matrix(runif(100), 10, 10))
    })
  }
  shinyApp(ui, server)
}