Skip to content
Snippets Groups Projects

Generic htm lwidget

Merged arsenij.ustjanzew requested to merge genericHTMLwidget into master
1 file
+ 5
3
Compare changes
  • Side-by-side
  • Inline
+ 5
3
@@ -5,7 +5,7 @@
#' @param package The name of the R package that defines the class(object).
#' @param page The name of the page to add the object to.
#' @param title An optional component title.
add_vis_object <- function(dashboard, object, package = NULL, page = "default", title = NULL, ...){
add_vis_object <- function(dashboard, object, package, page = "default", title = NULL, ...){
sanitised_page <- i2dash:::.create_page_name(page)
if (!(sanitised_page %in% names(dashboard@pages))) {
warning(sprintf("i2dashboard does not contain a page named '%s'", sanitised_page))
@@ -17,8 +17,6 @@ add_vis_object <- function(dashboard, object, package = NULL, page = "default",
return(dashboard)
}
if(is.null(package)) package <- "unknown package name"
# Create random component for RDS filename
component_id <- paste0("obj_", stringi::stri_rand_strings(1, 6))
@@ -71,5 +69,9 @@ setMethod("add_component",
return(dashboard)
}
package <- packageSlot(component)
if(is.null(package)) {
warning("The package name of this HTML widget could not be determined. The component was not added to the dashboard.")
return(dashboard)
}
add_vis_object(dashboard, component, package, page, title, ...)
})
Loading