#' Widget output function for use in Shiny #' #' @param outputId outputId #' @param width width #' @param height height #' @export xmlviewOutput <- function(outputId, width = '100%', height = '400px'){ htmlwidgets::shinyWidgetOutput(outputId, 'xmlview', width, height, package = 'xmlview') } #' Widget render function for use in Shiny #' #' @param expr expr #' @param env env #' @param quoted quoted #' @export renderXmlview <- function(expr, env = parent.frame(), quoted = FALSE) { if (!quoted) { expr <- substitute(expr) } # force quoted htmlwidgets::shinyRenderWidget(expr, xmlviewOutput, env, quoted = TRUE) }