Description Usage Arguments Details Value Examples
ShinyTreeMenuHTML() builds the TreeMenu HTML using treedata. You can render the
TreeMenu HTML using renderShinyTreeMenu
1 | ShinyTreeMenuHTML(treedata, select_id = NULL, level_icons = "plus")
|
treedata |
data.table; treedata - see details for more |
select_id |
character; Id belonging to the branch you want to open. If NULL (default) the function will return the base tree using level 1. |
level_icons |
character; Names of fa-icons to use for the tree. Must be of length 1 or the same length as the number of levels. |
treedata:
The data used by ShinyTreeMenu is a long formatet data.table considing of two colums for every level in the tree. Thees two colums must be named:
levelX_id: The id used to identify the item. This must be unique within the same branch.
levelX_name: The name to be shown in the menu.
X = the level number
For further explanation, see examples.
A HTML class character containing the tree menu. If select_id is NULL it will return the base base tree HTML using level 1. Otherwise it will return the branch of select_id.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Use test data from ShinyTreeMenu
treedata <- ShinyTreeMenu::treetestdata
#######################################
#--- Example to understand the concept
# Generate base tree HTML at level 1
treemenu <-
ShinyTreeMenuHTML(treedata = treedata,
level_icons = "tree")
# Generate branch HTML to level 1, id 3
branch_3 <-
ShinyTreeMenuHTML(treedata = treedata,
select_id = "3",
level_icons = "tree")
#######################################
#--- Shiny example
# To use ShinyTreeMenuHTML() with RStudio Shiny use renderShinyTreeMenu()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.