Skip to content
Snippets Groups Projects

Generic htm lwidget

Merged arsenij.ustjanzew requested to merge genericHTMLwidget into master
Files
2
+ 15
9
@@ -64,14 +64,20 @@ setMethod("add_component",
setMethod("add_component",
signature = signature(dashboard = "i2dashboard", component = "ANY"),
definition = function(dashboard, component, page = "default", title = NULL, ...) {
if(!inherits(component, "htmlwidget")) {
warning("The object has to inherit from the class 'htmlwidget'.")
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)
# HTMLWIDGETS
if(inherits(component, "htmlwidget")) {
package <- packageSlot(component)
if(is.null(package)) {
warning("No component added, since the package name of the HTML widget could not be determined.")
return(dashboard)
}
return(add_vis_object(dashboard, component, package, page, title, ...))
}
add_vis_object(dashboard, component, package, page, title, ...)
# OTHER
warning("The component did not inherit from any of the currently supported classes ('htmlwidget').")
return(dashboard)
})
Loading