R/mod_canvas_srv.R

Defines functions CanvasModuleServer

#' Canvas Server Functions
#'
#' @importFrom utils packageVersion
#' @noRd
CanvasModuleServer <- function(id, selected_template) {
  moduleServer(id, function(input, output, session) {
    setBookmarkExclude(c("html", "canvas", "screenshot"))

    observeEvent(selected_template(), {
      session$sendInputMessage("html", selected_template())
    })

    return(list(
      ui_code = reactive(input$canvas),
      html = reactive(input$html)
    ))
  })
}

Try the designer package in your browser

Any scripts or data that you put into this service are public.

designer documentation built on Aug. 20, 2023, 5:06 p.m.