|
- library(shiny)
- library(shinyjs)
- library(shinyTree) # Need version 0.2.7
- library(rclipboard)
-
- cssTypes <- "{'default': {'icon' : 'glyphicon glyphicon-folder-open' },
- 'file' : {'icon' : 'glyphicon glyphicon-file'},
- 'FA' : {'icon' : 'glyphicon glyphicon-folder-open'},
- 'LA' : {'icon' : 'glyphicon glyphicon-file'},
- 'RA' : {'icon' : 'glyphicon glyphicon-file blue'}}"
-
- ui <- shinyUI(navbarPage("Page",
- position = "fixed-top",
- tabPanel("Explore",
- sidebarLayout(sidebarPanel(style = "position:fixed;top:70px;width:inherit;overflow-y:scroll;max-height: 600px;margin-right:20px",
- tags$head(tags$style(HTML(".blue {color: blue}"))), # CSS for colored node : blue = RA
- conditionalPanel(condition = "output.selected == true",
- h3("Selected"),
- h4("C_NAME :"), textOutput('c_name'),
- h4("C_BASECODE :"), textOutput('c_basecode'),
- h4("C_FULLNAME : "), div(style="display: inline-block;width:45px;", uiOutput("clip")),
- h4("Matching Codes : "), tableOutput("codes"))),
- mainPanel(style = "top:70px;",
- tabsetPanel(tabPanel("Tree",
- shinyTree("explore_tree",
- sort=T,
- animation=F)),
- tabPanel("Matching codes",
- actionButton("open_matching_code", 'OPEN'),
- shinyTree("matching_code_tree",
- sort=T,
- animation=F,
- types = cssTypes)))))),
- tabPanel("Search",
- sidebarLayout(sidebarPanel(style = "position:fixed;top:70px;width:inherit;overflow-y:scroll;max-height: 600px;margin-right:20px",
- textInput(inputId = "text_to_search",
- label = "Search Text",
- value = "hyp(o|er)gly"),
- checkboxInput(inputId = "use_regex",
- label = "Use Regex",
- value = T),
- selectInput(inputId = "search_on",
- label = "Search On",
- choices = c("C_FULLNAME", "C_NAME", "C_BASECODE"),
- selected = "C_NAME"),
- actionButton(inputId = "perform_search",
- label = "Launch Search"),
- actionButton(inputId = "open_all",
- label = "Open the Tree"),
- conditionalPanel(condition = "output.s_selected == true",
- h3("Selected :"),
- h4("C_NAME :"), textOutput('s_name'),
- h4("C_BASECODE :"), textOutput('s_basecode'),
- h4("C_FULLNAME :"), div(style="display: inline-block;width:45px;", uiOutput("s_clip")))),
- mainPanel(style = "top:70px;",
- useShinyjs(),
- rclipboardSetup(),
- shinyTree("search_tree",
- sort=T,
- animation=F,
- types = cssTypes))))))
|