@@ -21,6 +21,18 @@ ${name} <- function(message, width = NULL, height = NULL, elementId = NULL) {
2121 )
2222}
2323
24+ #' Called by HTMLWidgets to produce the widget's root element.
25+ #' @noRd
26+ widget_html.${name} <- function(id, style, class, ...) {
27+ htmltools::tagList(
28+ # Necessary for RStudio viewer version < 1.2
29+ reactR::html_dependency_corejs(),
30+ reactR::html_dependency_react(),
31+ reactR::html_dependency_reacttools(),
32+ htmltools::tags$div(id = id, class = class, style = style)
33+ )
34+ }
35+
2436#' Shiny bindings for ${name}
2537#'
2638#' Output and render functions for using ${name} within Shiny
@@ -48,15 +60,3 @@ render${capName} <- function(expr, env = parent.frame(), quoted = FALSE) {
4860 if (!quoted) { expr <- substitute(expr) } # force quoted
4961 htmlwidgets::shinyRenderWidget(expr, ${name}Output, env, quoted = TRUE)
5062}
51-
52- #' Called by HTMLWidgets to produce the widget's root element.
53- #' @rdname ${name}-shiny
54- ${name}_html <- function(id, style, class, ...) {
55- htmltools::tagList(
56- # Necessary for RStudio viewer version < 1.2
57- reactR::html_dependency_corejs(),
58- reactR::html_dependency_react(),
59- reactR::html_dependency_reacttools(),
60- htmltools::tags$div(id = id, class = class, style = style)
61- )
62- }
0 commit comments