Skip to content

Commit d047d4a

Browse files
authored
Merge pull request #77 from The-Strategy-Unit/v033-pres
Improve user interface, provide info
2 parents c884ac3 + 0ba5e30 commit d047d4a

30 files changed

+236
-54
lines changed

.Renviron.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ AZ_STORAGE_EP=
44
AZ_SUPPORT_CONTAINER=
55
BASELINE_YEAR=
66
DATA_VERSION=
7+
FEEDBACK_FORM_URL=
78
# To run app locally
89
AZ_APP_ID=
910
AZ_TENANT_ID=

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export(get_container)
99
export(get_golem_config)
1010
export(isolate_provider_peers)
1111
export(make_strategy_group_lookup)
12+
export(md_file_to_html)
1213
export(plot_age_sex_pyramid)
1314
export(plot_nee)
1415
export(plot_rates_box)

R/app_server.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ app_server <- function(input, output, session) {
1010

1111
# Variables ----
1212
geographies <- c(
13-
"New Hospital Programme (NHP) schemes" = "nhp",
13+
"NHS provider trusts" = "nhp",
1414
"Local authorities (LAs)" = "la"
1515
)
1616
data_types <- c("age_sex", "diagnoses", "procedures", "rates")

R/app_ui.R

Lines changed: 94 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,116 @@
22
#' @param request Internal parameter for 'shiny'.
33
#' @noRd
44
app_ui <- function(request) {
5-
bslib::page_sidebar(
6-
title = "Explore potentially-mitigatable activity data (in development)",
5+
bslib::page_navbar(
6+
id = "page_navbar",
7+
title = "Explore potentially-mitigatable activity data",
8+
selected = "Visualisations", # start with this panel open
79
fillable = FALSE, # allow page scroll
810

11+
bslib::nav_panel(
12+
id = "nav_panel_viz",
13+
title = "Visualisations",
14+
15+
bslib::card(
16+
fill = FALSE,
17+
bslib::card_header(
18+
class = "bg-warning",
19+
bsicons::bs_icon("exclamation-triangle"),
20+
"Warning"
21+
),
22+
"This app is in development and its output has not been verified.",
23+
"The information presented here should not be relied on as fact."
24+
),
25+
26+
bslib::layout_columns(
27+
col_widths = c(3, 9),
28+
fill = FALSE,
29+
fillable = FALSE,
30+
mod_show_strategy_text_ui("mod_show_strategy_text"),
31+
bslib::layout_column_wrap(
32+
width = 1,
33+
gap = "0.8rem",
34+
mod_plot_rates_ui("mod_plot_rates"),
35+
bslib::layout_column_wrap(
36+
width = 1 / 2,
37+
mod_table_procedures_ui("mod_table_procedures"),
38+
mod_table_diagnoses_ui("mod_table_diagnoses")
39+
),
40+
bslib::layout_column_wrap(
41+
width = 1 / 2,
42+
mod_plot_age_sex_pyramid_ui("mod_plot_age_sex_pyramid"),
43+
mod_plot_nee_ui("mod_plot_nee")
44+
),
45+
)
46+
)
47+
),
48+
49+
bslib::nav_panel(
50+
id = "nav_panel_info",
51+
title = "Information",
52+
bslib::layout_columns(
53+
bslib::layout_columns(
54+
col_widths = c(12, 12),
55+
bslib::card(
56+
id = "card_purpose",
57+
bslib::card_header("Purpose"),
58+
md_file_to_html("app", "text", "info-purpose.md")
59+
),
60+
bslib::card(
61+
id = "card_data",
62+
bslib::card_header("Definitions"),
63+
md_file_to_html("app", "text", "info-definitions.md")
64+
),
65+
bslib::card(
66+
id = "card_data",
67+
bslib::card_header("Data"),
68+
md_file_to_html("app", "text", "info-data.md")
69+
)
70+
),
71+
bslib::layout_columns(
72+
col_widths = c(12, 12),
73+
bslib::card(
74+
id = "card_navigation",
75+
bslib::card_header("Navigation"),
76+
md_file_to_html("app", "text", "info-navigation.md")
77+
),
78+
bslib::card(
79+
id = "card_how_to_use",
80+
bslib::card_header("Interface"),
81+
md_file_to_html("app", "text", "info-interface.md")
82+
)
83+
)
84+
)
85+
),
86+
87+
bslib::nav_item(
88+
class = "ms-auto", # push to far-right
89+
shiny::tags$a(
90+
href = Sys.getenv("FEEDBACK_FORM_URL"),
91+
target = "_blank",
92+
class = "nav-link",
93+
bsicons::bs_icon("chat-dots"),
94+
"Give feedback"
95+
)
96+
),
97+
998
sidebar = bslib::sidebar(
1099
bslib::accordion(
11100
id = "sidebar_accordion",
12101
open = FALSE,
13102
multiple = TRUE,
14103
bslib::accordion_panel(
15-
title = "Statistical units",
16-
icon = bsicons::bs_icon("pin-map"),
104+
title = "Datasets",
105+
icon = bsicons::bs_icon("table"),
17106
mod_select_geography_ui("mod_select_geography"),
18107
mod_select_provider_ui("mod_select_provider"),
19108
),
20109
bslib::accordion_panel(
21-
title = "Types of potentially mitigatable activity (TPMAs)",
110+
title = "Types of Potentially Mitigatable Activity (TPMAs)",
22111
icon = bsicons::bs_icon("hospital"),
23112
mod_select_strategy_ui("mod_select_strategy")
24113
)
25114
)
26-
),
27-
28-
bslib::card(
29-
fill = FALSE,
30-
bslib::card_header(
31-
class = "bg-warning",
32-
bsicons::bs_icon("exclamation-triangle"),
33-
"Warning"
34-
),
35-
"This application is in development and its output has not been verified.
36-
The information presented here should not be relied on as fact."
37-
),
38-
39-
bslib::layout_columns(
40-
col_widths = c(3, 9),
41-
fill = FALSE,
42-
fillable = FALSE,
43-
mod_show_strategy_text_ui("mod_show_strategy_text"),
44-
bslib::layout_column_wrap(
45-
width = 1,
46-
gap = "0.8rem",
47-
mod_plot_rates_ui("mod_plot_rates"),
48-
bslib::layout_column_wrap(
49-
width = 1 / 2,
50-
mod_table_procedures_ui("mod_table_procedures"),
51-
mod_table_diagnoses_ui("mod_table_diagnoses")
52-
),
53-
bslib::layout_column_wrap(
54-
width = 1 / 2,
55-
mod_plot_age_sex_pyramid_ui("mod_plot_age_sex_pyramid"),
56-
mod_plot_nee_ui("mod_plot_nee")
57-
),
58-
)
59115
)
60116
)
61117
}

R/mod_plot_age_sex_pyramid.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
mod_plot_age_sex_pyramid_ui <- function(id) {
55
ns <- shiny::NS(id)
66
bslib::card(
7-
bslib::card_header("Age-sex pyramid"),
7+
bslib::card_header(
8+
"Age-sex pyramid",
9+
bslib::tooltip(
10+
bsicons::bs_icon("info-circle"),
11+
md_file_to_html("app", "text", "viz-pyramid.md"),
12+
placement = "right"
13+
)
14+
),
815
bslib::card_body(
916
shinycssloaders::withSpinner(
1017
shiny::plotOutput(ns("age_sex_pyramid"))

R/mod_plot_nee.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44
mod_plot_nee_ui <- function(id) {
55
ns <- shiny::NS(id)
66
bslib::card(
7-
bslib::card_header("National Elicitation Exercise (NEE) estimate"),
7+
bslib::card_header(
8+
"National Elicitation Exercise (NEE) estimate",
9+
bslib::tooltip(
10+
bsicons::bs_icon("info-circle"),
11+
md_file_to_html("app", "text", "viz-nee.md"),
12+
placement = "right"
13+
)
14+
),
815
bslib::card_body(
9-
shiny::p("2039/40 horizon. Mean represented as a point."),
1016
shinycssloaders::withSpinner(shiny::plotOutput(ns("nee")))
1117
),
1218
full_screen = TRUE

R/mod_plot_rates_box.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
mod_plot_rates_box_ui <- function(id) {
55
ns <- shiny::NS(id)
66
bslib::card(
7-
bslib::card_header("Rates Box"),
7+
bslib::card_header(
8+
"Rates Box",
9+
bslib::tooltip(
10+
bsicons::bs_icon("info-circle"),
11+
md_file_to_html("app", "text", "viz-box.md"),
12+
placement = "right"
13+
)
14+
),
815
bslib::card_body(
916
shinycssloaders::withSpinner(
1017
shiny::plotOutput(ns("rates_box_plot"))

R/mod_plot_rates_funnel.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
mod_plot_rates_funnel_ui <- function(id) {
55
ns <- shiny::NS(id)
66
bslib::card(
7-
bslib::card_header("Rates Funnel"),
7+
bslib::card_header(
8+
"Rates Funnel",
9+
bslib::tooltip(
10+
bsicons::bs_icon("info-circle"),
11+
md_file_to_html("app", "text", "viz-funnel.md"),
12+
placement = "right"
13+
)
14+
),
815
bslib::card_body(
916
shinycssloaders::withSpinner(
1017
shiny::plotOutput(ns("rates_funnel_plot"))

R/mod_plot_rates_trend.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
mod_plot_rates_trend_ui <- function(id) {
55
ns <- shiny::NS(id)
66
bslib::card(
7-
bslib::card_header("Rates Trend"),
7+
bslib::card_header(
8+
"Rates Trend",
9+
bslib::tooltip(
10+
bsicons::bs_icon("info-circle"),
11+
md_file_to_html("app", "text", "viz-trend.md"),
12+
placement = "right"
13+
)
14+
),
815
bslib::card_body(
916
shinycssloaders::withSpinner(
1017
shiny::plotOutput(ns("rates_trend_plot"))

R/mod_select_geography.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod_select_geography_ui <- function(id) {
55
ns <- shiny::NS(id)
66
shiny::selectInput(
77
ns("geography_select"),
8-
"Choose a geographic unit:",
8+
"Filter by geography:",
99
choices = NULL
1010
)
1111
}

0 commit comments

Comments
 (0)