Description Usage Arguments Value Examples
View source: R/input-treecheck.R
Tree check Input
1 2 3 4 5 6 7 8 9 10 11 |
inputId |
The |
label |
Display label for the control, or |
choices |
A |
selected |
Default selected value, must correspond to the Id of the node. |
hierarchical |
When a level is selected, also select all levels below it? |
levels |
Sets the number of hierarchical levels deep the tree will be expanded to by default. |
borders |
Show or not borders around items. |
return_value |
Value returned server-side, default is the element name,
other possibilities are |
width |
The width of the input, e.g. |
Server-side: A character
value or a list
depending on the return_value
argument.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | library(shiny)
library(shinytreeview)
data("cities")
ui <- fluidPage(
tags$h3("treeviewInput cities example"),
treecheckInput(
inputId = "tree",
label = "Choose a city:",
choices = make_tree(
cities, c("continent", "country", "city")
)
),
verbatimTextOutput(outputId = "result")
)
server <- function(input, output, session) {
output$result <- renderPrint({
input$tree
})
}
if (interactive())
shinyApp(ui, server)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.