#' Title
#'
#' @param id
#' @param theme
#'
#' @return
#' @export
#'
#' @examples
goldenLayout <- function(id, theme = 'dark') {
fillPage(
htmlDependency("jqueryui", "1.11.1", c(href="src_js"),
script = "jquery-1.11.1.min.js"),
htmlDependency(
"goldenLayout", "4.5.0", c(href="src_js"),
stylesheet = "css/goldenlayout-base.css"
),
if(theme == 'dark'){
htmlDependency(
"darkGold", c(href="src_css"),
stylesheet = "css/goldenlayout-dark-theme.css"
)
} else if(theme == 'light') {
htmlDependency(
"lightGold", c(href="src_css"),
stylesheet = "css/goldenlayout-light-theme.css"
)
}
# tags$script(HTML("
# var config = {
# content: [{
# type: 'row',
# content:[{
# type: 'component',
# componentName: 'testComponent1',
# componentState: { outputID: 'A' }
# },{
# type: 'column',
# content:[{
# type: 'component',
# componentName: 'testComponent1',
# componentState: { outputID: 'B' }
# },{
# type: 'component',
# componentName: 'testComponent1',
# componentState: { outputID: 'C' }
# }]
# }]
# }]
# };
# ")
# ),
# tags$script(HTML("myLayout.init();"))
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.