Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Authors@R: c(
person("Matt", "Dray", , "matt.dray@nhs.net", role = c("aut", "cre")),
person("Tom", "Jemmett", , "thomas.jemmett@nhs.net", role = "aut"),
person("Zoë", "Turner", , "zoe.turner3@nhs.net", role = "ctb"),
person("Claire", "Welsh", , "claire.welsh8@nhs.net", role = "ctb")
person("Claire", "Welsh", , "claire.welsh8@nhs.net", role = "ctb"),
person("YiWen", "Hon", , "yiwen.hon@nhs.net", role = "ctb")
)
Description: A Shiny-app-in-a-package to explore data related to Types of
Potentially-Mitigatable Activity (TPMAs) with the goal of finding
Expand Down
11 changes: 0 additions & 11 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,6 @@ app_server <- function(input, output, session) {
as.numeric(Sys.getenv("BASELINE_YEAR", 202324))
})

# Open sidebar ---
shiny::observe({
if (input$page_navbar == "Visualisations") {
# Sidebar options only relevant to visualisations
bslib::toggle_sidebar("sidebar", open = TRUE)
} else {
bslib::toggle_sidebar("sidebar", open = FALSE)
}
}) |>
shiny::bindEvent(input$page_navbar)

# Open sidebar accordions ----
shiny::observe({
# Data must load before accordions open
Expand Down
85 changes: 43 additions & 42 deletions R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,6 @@ app_ui <- function(request) {
selected = "Visualisations", # start with this panel open
fillable = FALSE, # scrollable pages (i.e. don't fit cards to window extent)

sidebar = bslib::sidebar(
id = "sidebar",
open = "closed",
width = 400,
bslib::accordion(
id = "sidebar_accordion",
open = FALSE,
multiple = TRUE,
bslib::accordion_panel(
title = "Datasets",
icon = bsicons::bs_icon("table"),
mod_select_geography_ui("mod_select_geography"),
mod_select_provider_ui("mod_select_provider")
),
bslib::accordion_panel(
title = "Types of Potentially-Mitigatable Activity (TPMAs)",
icon = bsicons::bs_icon("hospital"),
mod_select_strategy_ui("mod_select_strategy")
),
bslib::accordion_panel(
title = "Bookmark",
icon = bsicons::bs_icon("bookmark"),
shiny::bookmarkButton(
label = "Generate shareable URL",
title = "Bookmark your selections and get a URL for sharing",
icon = NULL
)
)
)
),

bslib::nav_panel(
id = "nav_panel_overview",
title = "Overview",
Expand Down Expand Up @@ -99,17 +68,49 @@ app_ui <- function(request) {
title = "Visualisations",
icon = bsicons::bs_icon("graph-up"),

mod_show_strategy_text_ui("mod_show_strategy_text"),
mod_plot_rates_ui("mod_plot_rates"),
bslib::layout_columns(
col_widths = c(6, 6),
mod_table_diagnoses_ui("mod_table_diagnoses"),
mod_table_procedures_ui("mod_table_procedures")
),
bslib::layout_columns(
col_widths = c(6, 6),
mod_plot_age_sex_pyramid_ui("mod_plot_age_sex_pyramid"),
mod_plot_nee_ui("mod_plot_nee")
bslib::layout_sidebar(
sidebar = bslib::sidebar(
id = "sidebar",
open = "open", # no longer needs to be toggled -- it only exists here
width = 400,
bslib::accordion(
id = "sidebar_accordion",
open = FALSE,
multiple = TRUE,
bslib::accordion_panel(
title = "Datasets",
icon = bsicons::bs_icon("table"),
mod_select_geography_ui("mod_select_geography"),
mod_select_provider_ui("mod_select_provider")
),
bslib::accordion_panel(
title = "Types of Potentially-Mitigatable Activity (TPMAs)",
icon = bsicons::bs_icon("hospital"),
mod_select_strategy_ui("mod_select_strategy")
),
bslib::accordion_panel(
title = "Bookmark",
icon = bsicons::bs_icon("bookmark"),
shiny::bookmarkButton(
label = "Generate shareable URL",
title = "Bookmark your selections and get a URL for sharing",
icon = NULL
)
)
)
),
mod_show_strategy_text_ui("mod_show_strategy_text"),
mod_plot_rates_ui("mod_plot_rates"),
bslib::layout_columns(
col_widths = c(6, 6),
mod_table_diagnoses_ui("mod_table_diagnoses"),
mod_table_procedures_ui("mod_table_procedures")
),
bslib::layout_columns(
col_widths = c(6, 6),
mod_plot_age_sex_pyramid_ui("mod_plot_age_sex_pyramid"),
mod_plot_nee_ui("mod_plot_nee")
)
)
),

Expand Down
Loading
Loading