library(flexdashboard) library(shiny) library(jsTreeR)
nodes <- list( list( text = "RootA", data = list(value = 999), icon = "far fa-moon red", children = list( list( text = "ChildA1", icon = "fa fa-leaf green" ), list( text = "ChildA2", icon = "fa fa-leaf green" ) ) ), list( text = "RootB", icon = "far fa-moon red", children = list( list( text = "ChildB1", icon = "fa fa-leaf green" ), list( text = "ChildB2", icon = "fa fa-leaf green" ) ) ) ) output[["jstree"]] <- renderJstree({ jstree(nodes, dragAndDrop = TRUE, checkboxes = TRUE, theme = "proton") }) output[["treeSelected"]] <- renderPrint({ input[["jstree_selected"]] })
jstreeOutput("jstree")
verbatimTextOutput("treeSelected")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.