Skip to content

Commit

Permalink
Update about-main.R
Browse files Browse the repository at this point in the history
- copying edits from Nate for about
  • Loading branch information
jreps committed May 21, 2024
1 parent e269342 commit 9ec0597
Showing 1 changed file with 43 additions and 25 deletions.
68 changes: 43 additions & 25 deletions R/about-main.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,24 @@ aboutViewer <- function(id = 'homepage') {
)
}

targetedValueBox <- function(
value,
subtitle,
icon,
color,
href,
target = "_new"
) {
valueBox <- shinydashboard::valueBox(
value = value,
subtitle = subtitle,
icon = icon,
color = color,
href = href
)
shiny::tagAppendAttributes(valueBox,.cssSelector="a", target=target)
}

#' The module server for the shiny app home
#'
#' @details
Expand Down Expand Up @@ -105,83 +123,83 @@ aboutServer <- function(id = 'homepage',
output$datasourcesBox <-
shinydashboard::renderValueBox({
if ("DataSources" %in% tab_names) {
shinydashboard::valueBox(
targetedValueBox(
value = "Data Sources",
subtitle = "Data sources used in this analysis",
icon = shiny::icon("database"),
color = "aqua",
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/DataSources.html"
)
} else {
shinydashboard::valueBox(
targetedValueBox(
value = "Data Sources",
subtitle = "This module was not included in this analysis",
icon = shiny::icon("database"),
color = "black",
href = NULL
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/DataSources.html"
)
}
})

output$cohortsBox <-
shinydashboard::renderValueBox({
if ("Cohorts" %in% tab_names) {
shinydashboard::valueBox(
targetedValueBox(
value = "Cohorts",
subtitle = "Cohorts included in this analysis",
icon = shiny::icon("user-gear"),
color = "purple",
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/Cohorts.html"
)
} else {
shinydashboard::valueBox(
targetedValueBox(
value = "Cohorts",
subtitle = "This module was not included in this analysis",
icon = shiny::icon("user-gear"),
color = "black",
href = NULL
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/Cohorts.html"
)
}
})

output$characterizationBox <-
shinydashboard::renderValueBox({
if ("Characterization" %in% tab_names) {
shinydashboard::valueBox(
targetedValueBox(
value = "Characterization",
subtitle = "Characterization results for this analysis",
icon = shiny::icon("table"),
color = "teal",
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/Characterization.html"
)
} else {
shinydashboard::valueBox(
targetedValueBox(
value = "Characterization",
subtitle = "This module was not included in this analysis",
icon = shiny::icon("table"),
color = "black",
href = NULL
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/Characterization.html"
)
}
})

output$cohortDiagnosticsBox <-
shinydashboard::renderValueBox({
if ("CohortDiagnostics" %in% tab_names) {
shinydashboard::valueBox(
targetedValueBox(
value = "Cohort Diagnostics",
subtitle = "Cohort Diagnostics results for the cohorts included in this analysis",
icon = shiny::icon("users"),
color = "yellow",
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/CohortDiagnostics.html"
)
} else {
shinydashboard::valueBox(
targetedValueBox(
value = "Cohort Diagnostics",
subtitle = "This module was not included in this analysis",
icon = shiny::icon("users"),
color = "black",
href = NULL
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/CohortDiagnostics.html"
)
}
})
Expand All @@ -190,87 +208,87 @@ aboutServer <- function(id = 'homepage',
output$cohortMethodBox <-
shinydashboard::renderValueBox({
if ("CohortMethod" %in% tab_names) {
shinydashboard::valueBox(
targetedValueBox(
value = "Cohort Method",
subtitle = "Cohort Method results for this analysis",
icon = shiny::icon("chart-column"),
color = "maroon",
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/CohortMethod.html"
)
} else {
shinydashboard::valueBox(
targetedValueBox(
value = "Cohort Method",
subtitle = "This module was not included in this analysis",
icon = shiny::icon("chart-column"),
color = "black",
href = NULL
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/CohortMethod.html"
)
}
})

output$predictionBox <-
shinydashboard::renderValueBox({
if ("Prediction" %in% tab_names) {
shinydashboard::valueBox(
targetedValueBox(
value = "Prediction",
subtitle = "Patient-level Prediction results for this analysis",
icon = shiny::icon("chart-line"),
color = "blue",
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/Prediction.html"
)
} else {
shinydashboard::valueBox(
targetedValueBox(
value = "Prediction",
subtitle = "This module was not included in this analysis",
icon = shiny::icon("chart-line"),
color = "black",
href = NULL
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/Prediction.html"
)
}
})

output$sccsBox <-
shinydashboard::renderValueBox({
if ("SCCS" %in% tab_names) {
shinydashboard::valueBox(
targetedValueBox(
value = "SCCS",
subtitle = "Self-Controlled Case Series results for this analysis",
icon = shiny::icon("people-arrows"),
color = "red",
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/SelfControlledCaseSeries.html"
)
} else {
shinydashboard::valueBox(
targetedValueBox(
value = "SCCS",
subtitle = "This module was not included in this analysis",
icon = shiny::icon("people-arrows"),
color = "black",
href = NULL
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/SelfControlledCaseSeries.html"
)
}
})

output$evidenceSynthesisBox <-
shinydashboard::renderValueBox({
if ("Meta" %in% tab_names) {
shinydashboard::valueBox(
targetedValueBox(
value = "Meta",
subtitle = "Meta Analysis results for this analysis",
icon = shiny::icon("sliders"),
color = "olive",
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/EvidenceSynthesis.html"
)
} else {
shinydashboard::valueBox(
targetedValueBox(
value = "Meta",
subtitle =
"This module was not included in this analysis",
icon = shiny::icon("sliders"),
color = "black",
href = NULL
href = "https://ohdsi.github.io/OhdsiShinyModules/articles/EvidenceSynthesis.html"
)
}
})

})
}
}

0 comments on commit 9ec0597

Please sign in to comment.