R/goldenLayout.R

#' 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();"))
  )

}
jshukle/shinyGold documentation built on May 26, 2019, 10:35 a.m.