Explorateur d'ontologies i2b2 HEGP
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
5.4KB

  1. library(shiny)
  2. library(shinyjs)
  3. library(shinyTree) # Need version 0.2.7
  4. library(rclipboard)
  5. cssTypes <- "{'default': {'icon' : 'glyphicon glyphicon-folder-open' },
  6. 'file' : {'icon' : 'glyphicon glyphicon-file'},
  7. 'FA' : {'icon' : 'glyphicon glyphicon-folder-open'},
  8. 'LA' : {'icon' : 'glyphicon glyphicon-file'},
  9. 'RA' : {'icon' : 'glyphicon glyphicon-file blue'}}"
  10. ui <- shinyUI(navbarPage("Page",
  11. position = "fixed-top",
  12. tabPanel("Explore",
  13. sidebarLayout(sidebarPanel(style = "position:fixed;top:70px;width:inherit;overflow-y:scroll;max-height: 600px;margin-right:20px",
  14. tags$head(tags$style(HTML(".blue {color: blue}"))), # CSS for colored node : blue = RA
  15. conditionalPanel(condition = "output.selected == true",
  16. h3("Selected"),
  17. h4("C_NAME :"), textOutput('c_name'),
  18. h4("C_BASECODE :"), textOutput('c_basecode'),
  19. h4("C_FULLNAME : "), div(style="display: inline-block;width:45px;", uiOutput("clip")),
  20. h4("Matching Codes : "), tableOutput("codes"))),
  21. mainPanel(style = "top:70px;",
  22. tabsetPanel(tabPanel("Tree",
  23. shinyTree("explore_tree",
  24. sort=T,
  25. animation=F)),
  26. tabPanel("Matching codes",
  27. actionButton("open_matching_code", 'OPEN'),
  28. shinyTree("matching_code_tree",
  29. sort=T,
  30. animation=F,
  31. types = cssTypes)))))),
  32. tabPanel("Search",
  33. sidebarLayout(sidebarPanel(style = "position:fixed;top:70px;width:inherit;overflow-y:scroll;max-height: 600px;margin-right:20px",
  34. textInput(inputId = "text_to_search",
  35. label = "Search Text",
  36. value = "hyp(o|er)gly"),
  37. checkboxInput(inputId = "use_regex",
  38. label = "Use Regex",
  39. value = T),
  40. selectInput(inputId = "search_on",
  41. label = "Search On",
  42. choices = c("C_FULLNAME", "C_NAME", "C_BASECODE"),
  43. selected = "C_NAME"),
  44. actionButton(inputId = "perform_search",
  45. label = "Launch Search"),
  46. actionButton(inputId = "open_all",
  47. label = "Open the Tree"),
  48. conditionalPanel(condition = "output.s_selected == true",
  49. h3("Selected :"),
  50. h4("C_NAME :"), textOutput('s_name'),
  51. h4("C_BASECODE :"), textOutput('s_basecode'),
  52. h4("C_FULLNAME :"), div(style="display: inline-block;width:45px;", uiOutput("s_clip")))),
  53. mainPanel(style = "top:70px;",
  54. useShinyjs(),
  55. rclipboardSetup(),
  56. shinyTree("search_tree",
  57. sort=T,
  58. animation=F,
  59. types = cssTypes))))))