knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
shinyExplorer uses DT::datatable
for visualizing a tree of nodes, in which each node behaves according to its class and can store arbitrary data.
Currently shinyExplorer is only available on Github. You can install the latest version with:
remotes::install_github("DavidBarke/shinyExplorer")
Create an explorer tree:
library(shinyExplorer) explorer_tree <- ExplorerTree$new(id = "tree", root_id = "root")
Take the root node and add nodes to it:
explorer_tree$get_root_node()$add_child("child1")$add_child("child2", return = "child")$add_child("grandchild")
Call the explorer
module in your server function and add explorer_ui
to your UI:
# Inside the server function shiny::callModule( module = explorer, id = "id_explorer", .root_node_r = shiny::reactive(explorer_tree$get_root_node()) ) # Explorer UI explorer_ui(id = ns("id_explorer"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.