|
|
@@ -15,11 +15,11 @@ read_csv("metadata.csv") %>% |
|
|
|
C_HLEVEL = if_else(C_VISUALATTRIBUTES == "RA", str_count(C_FULLNAME, "\\\\") - 2, C_HLEVEL), # C_HLEVEL of modifiers are all 1, changing it to the correct number (either 2 or 3) |
|
|
|
C_FULLNAME2 = str_replace_all(C_FULLNAME, regex("\\\\( ){1,3}"), "\\\\"), # remove leading whitespace on nodes in the full path |
|
|
|
C_FULLNAME2 = str_replace_all(C_FULLNAME2, regex("( ){1,11}\\\\"), "\\\\"), # remove trailing whitespace on nodes in the full path |
|
|
|
sticon = recode(C_VISUALATTRIBUTES, |
|
|
|
sticon = recode(C_VISUALATTRIBUTES, # to delete ? |
|
|
|
"FA"="glyphicon glyphicon-folder-close", |
|
|
|
"LA"="glyphicon glyphicon-file", |
|
|
|
"RA"="glyphicon glyphicon-file blue"), |
|
|
|
type = C_VISUALATTRIBUTES) -> metadata |
|
|
|
type = C_VISUALATTRIBUTES) -> metadata # to delete too ? |
|
|
|
|
|
|
|
# Generate base trees |
|
|
|
metadata %>% |
|
|
@@ -38,17 +38,16 @@ server <- shinyServer(function(input, output, session) |
|
|
|
{ |
|
|
|
v <- reactiveValues() |
|
|
|
v$df <- explore_tree_df |
|
|
|
v$df2 <- search_tree_df |
|
|
|
v$requests <- c() # store previous requests for children to prevent doing them twice |
|
|
|
|
|
|
|
v$selected <- NULL |
|
|
|
|
|
|
|
v$df2 <- search_tree_df |
|
|
|
|
|
|
|
output$explore_tree <- renderTree(explore_tree) |
|
|
|
|
|
|
|
# Controls conditional panel |
|
|
|
output$selected <- reactive(length(v$selected) > 0) |
|
|
|
|
|
|
|
# When a node is selected, display information |
|
|
|
observeEvent(input$explore_tree, |
|
|
|
{ |
|
|
|
v$selected <- get_selected(input$explore_tree) |
|
|
@@ -89,12 +88,9 @@ server <- shinyServer(function(input, output, session) |
|
|
|
#Append children |
|
|
|
observeEvent(v$selected, |
|
|
|
{ |
|
|
|
#print(v$selected) |
|
|
|
if (all( |
|
|
|
## input$fetch_children, # controls if children should be appended on selection |
|
|
|
length(v$selected) > 0, # a node was selected |
|
|
|
nrow(v$node_line) == 1, # node was found in the dataframe |
|
|
|
v$is_leaf == F, # node is not a leaf |
|
|
|
if (all(length(v$selected) > 0, # a node was selected |
|
|
|
nrow(v$node_line) == 1, # node was found in the dataframe |
|
|
|
v$is_leaf == F, # node is not a leaf |
|
|
|
!(v$node_path %in% v$requests))) # request was not already done |
|
|
|
{ |
|
|
|
v$requests <- c(v$requests, v$node_path) # store the request |
|
|
|