Skip to content

Commit

Permalink
Merge pull request #115 from OHDSI/cohort_overlap_interactive
Browse files Browse the repository at this point in the history
Use plotly in cohort overlap
  • Loading branch information
edward-burn authored Nov 14, 2024
2 parents c449eda + 32b9c12 commit 1816cca
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions inst/shiny/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ server <- function(input, output, session) {


# achilles_code_use -----

createOutputAchillesCodeUse <- shiny::reactive({
achillesFiltered <- dataFiltered$achilles_code_use |>
filterData("achilles_code_use", input)
CodelistGenerator::tableAchillesCodeUse(achillesFiltered,
header = input$achilles_code_use_header,
groupColumn = input$achilles_code_use_groupColumn,
CodelistGenerator::tableAchillesCodeUse(achillesFiltered,
header = input$achilles_code_use_header,
groupColumn = input$achilles_code_use_groupColumn,
hide = input$achilles_code_use_hide)

})

output$achilles_code_use_gt <- gt::render_gt({
createOutputAchillesCodeUse()
})
Expand Down Expand Up @@ -452,7 +452,7 @@ server <- function(input, output, session) {
uniqueCombinations = input$summarise_cohort_overlap_ggplot2_2_uniqueCombinations
)
})
output$summarise_cohort_overlap_ggplot2_2 <- shiny::renderPlot({
output$summarise_cohort_overlap_ggplot2_2 <- plotly::renderPlotly({
createOutput2()
})
output$summarise_cohort_overlap_ggplot2_2_download <- shiny::downloadHandler(
Expand Down Expand Up @@ -846,14 +846,14 @@ server <- function(input, output, session) {
)
# compare lsc ----
output$plotly_compare_lsc <- renderPlotly({
lscFiltered <- dataFiltered$summarise_large_scale_characteristics |>
lscFiltered <- dataFiltered$summarise_large_scale_characteristics |>
filter(variable_level %in% input$compare_large_scale_characteristics_grouping_time_window) |>
filterSettings(table_name %in% input$compare_large_scale_characteristics_grouping_table)

if (nrow(lscFiltered) == 0) {
validate("No data to plot")
}

plotComparedLsc(lsc = lscFiltered,
cohorts = c(input$compare_large_scale_characteristics_grouping_cohort_1,
input$compare_large_scale_characteristics_grouping_cohort_2))
Expand Down
6 changes: 3 additions & 3 deletions inst/shiny/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ ui <- bslib::page_navbar(
)
)
),

## unmapped concepts -----
bslib::nav_panel(
title = "Unmapped concepts",
Expand Down Expand Up @@ -834,7 +834,7 @@ ui <- bslib::page_navbar(
),
position = "right"
),
shiny::plotOutput("summarise_cohort_overlap_ggplot2_2")
plotly::plotlyOutput("summarise_cohort_overlap_ggplot2_2")
)
)
)
Expand Down Expand Up @@ -1239,7 +1239,7 @@ ui <- bslib::page_navbar(
# )
# )
# )

## Prevalence -----
bslib::nav_panel(
title = "Prevalence",
Expand Down

0 comments on commit 1816cca

Please sign in to comment.