l_isLoon <- function(target) {
UseMethod("l_isLoon", target)
}
l_isLoon.default <- function(target) {
FALSE
}
l_isLoon.loon <- function(target) {
if(is.list(target)) {
FALSE
} else {
as.logical(as.character(tcltk::tcl('::loon::isKnownWidget', target)))
}
}
l_isLoon.l_tour <- function(target) {
plot_name <- setdiff(names(unclass(target)), "projection")
plot <- target[[plot_name]]
l_isLoon(plot)
}
l_isLoon.l_tour_compound <- function(target) {
plot_name <- setdiff(names(unclass(target)), "projection")
plot <- target[[plot_name]]
all(vapply(plot,
function(p) l_isLoon(p),
logical(1L)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.