Skip to content

Commit

Permalink
UPDATE METHOD POPUP FUNCTION
Browse files Browse the repository at this point in the history
- make everything easier to edit
  • Loading branch information
Hypertyz committed Jun 20, 2020
1 parent 99ad828 commit 0e37d09
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 4 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ Imports:
glue,
htmltools,
MODifieR,
shinyWidgets,
shinydashboard
shinyWidgets
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.1
Expand Down
79 changes: 77 additions & 2 deletions R/mod_Description1.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,85 @@ mod_Description1_server <- function(input, output, session, con){
upload_description <- reactive({
req((input$Inference_method))
method <- input$Inference_method

# Method's description
descrip <- function(method){
if (method == "Clique Sum"){
description = "This is Clique Sum"
return(description)
}
if (method == "WGCNA"){
description = "This is WGCNA"
return(description)
}
if (method == "DIAMoND"){
description = "This is DIAMoND"
return(description)
}
if (method == "DiffCoEx"){
description = "This is DiffCoEx"
return(description)
}
if (method == "MCODE"){
description = "This is MCODE"
return(description)
}
if (method == "MODA"){
description = "This is MODA"
return(description)
}
if (method == "Module Discoverer"){
description = "This is Module Discoverer"
return(description)
}
if (method == "Correlation Clique"){
description = "This is Correlation Clique"
return(description)
}
}

# Method's link
hyperlink <- function(method){
if (method == "Clique Sum"){
description = "https://www.google.com/"
return(description)
}
if (method == "WGCNA"){
description = "https://www.google.com/"
return(description)
}
if (method == "DIAMoND"){
description = "https://www.google.com/"
return(description)
}
if (method == "DiffCoEx"){
description = "https://www.google.com/"
return(description)
}
if (method == "MCODE"){
description = "https://www.google.com/"
return(description)
}
if (method == "MODA"){
description = "https://www.google.com/"
return(description)
}
if (method == "Module Discoverer"){
description = "https://www.google.com/"
return(description)
}
if (method == "Correlation Clique"){
description = "https://www.google.com/"
return(description)
}
}


if (is.null(method)){
return(NULL)
}

#Popup Modal
if (method %in% c("Clique Sum", "WGCNA", "DIAMoND", "DiffCoEx", "MCODE", "MODA", "Module Discoverer", "Correlation Clique")){
description <- tagList(tags$button(paste("Click me to learn more about ", method),
id = "method",
Expand All @@ -49,10 +124,10 @@ mod_Description1_server <- function(input, output, session, con){
tags$button("×", type = "button", class = "close", `data-dismiss` = "modal", `aria-hidden` = "true"),
tags$h4(method ,class = "modal-title", style = "color: black")),
tags$div(`class` = "modal-body",
tags$p(paste(method,"'s description"), style = "color: black")),
tags$p(descrip(method = method), style = "color: black")),
tags$div(`class` = "modal-footer",
tags$button("Close", class = "btn btn-default", `data-dismiss` = "modal"),
tags$a("Learn more", class= "btn btn-default", href="https://bootswatch.com/flatly/", style = "background-color: #2c3e50; border-color: #2c3e50"))))))
tags$a("Learn more", class= "btn btn-default", href=hyperlink(method = method), style = "background-color: #2c3e50; border-color: #2c3e50"))))))
return(description)
}
}
Expand Down

0 comments on commit 0e37d09

Please sign in to comment.