caps <- NULL
.onLoad <- function(libname, pkgname) {
## Not in RCloud? Return silently
if (! requireNamespace("rcloud.support", quietly = TRUE)) return()
path <- system.file(
package = "rcloud.cube",
"javascript",
"rcloud.cube.js"
)
caps <<- rcloud.support::rcloud.install.js.module(
"rcloud.cube",
paste(readLines(path), collapse = '\n')
)
# keep adding R functions here for JS to call
ocaps <- list(
execute_query = make_oc(execute_query)
)
if (!is.null(caps)) caps$init(ocaps)
}
make_oc <- function(x) {
do.call(base::`:::`, list("rcloud.support", "make.oc"))(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.