ShinyTreeMenuHTML: Build the ShinyTreeMenu HTML

Description Usage Arguments Details Value Examples

Description

ShinyTreeMenuHTML() builds the TreeMenu HTML using treedata. You can render the TreeMenu HTML using renderShinyTreeMenu

Usage

1
ShinyTreeMenuHTML(treedata, select_id = NULL, level_icons = "plus")

Arguments

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.

Details

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:

X = the level number

For further explanation, see examples.

Value

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.

Examples

 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()

emillykkejensen/ShinyTreeMenu documentation built on May 9, 2019, 5:01 a.m.