Skip to content

Commit

Permalink
Merge pull request #78 from dfe-analytical-services/feature/download_…
Browse files Browse the repository at this point in the history
…button

Adding download buttons to all tables
  • Loading branch information
yauemily committed Jun 14, 2024
2 parents 085380d + ea7cbae commit 13c4369
Show file tree
Hide file tree
Showing 11 changed files with 733 additions and 214 deletions.
74 changes: 51 additions & 23 deletions R/enabler2_page.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ enabler2_tab <- function() {
inputId = "spend1_region_tbl",
label = "View chart as table",
help_text = (
reactableOutput("table_tot_spending_reg")
HTML(paste0(
csvDownloadButton("table_tot_spending_reg", filename = "spend_on_CSC_regions.csv"),
reactableOutput("table_tot_spending_reg")
))
# reactableOutput("table_tot_spending_reg")
)
),
details(
Expand Down Expand Up @@ -163,7 +167,13 @@ enabler2_tab <- function() {
details(
inputId = "minus_cla_reg_tbl",
label = "View chart as table",
help_text = reactableOutput("table_spend_excl_cla_reg")
help_text = (
HTML(paste0(
csvDownloadButton("table_spend_excl_cla_reg", filename = "spend_on_CSC_excl_CLA_regions.csv"),
reactableOutput("table_spend_excl_cla_reg")
))
# reactableOutput("table_spend_excl_cla_reg")
)
),
details(
inputId = "minus_cla_info",
Expand Down Expand Up @@ -292,7 +302,12 @@ enabler2_tab <- function() {
inputId = "tbl_ofsted_latest_ratings",
label = "View latest ratings",
help_text = (
reactableOutput("ofsted_latest_ratings_tbl")
HTML(paste0(
csvDownloadButton("ofsted_latest_ratings_tbl", filename = "Ofsted_leadership_ratings_all_LA_rating_date.csv"),
reactableOutput("ofsted_latest_ratings_tbl")
))

# reactableOutput("ofsted_latest_ratings_tbl")
)
)
),
Expand All @@ -306,7 +321,11 @@ enabler2_tab <- function() {
inputId = "tbl_ofsted",
label = "View chart as a table",
help_text = (
reactableOutput("ofsted_tbl")
HTML(paste0(
csvDownloadButton("ofsted_tbl", filename = "Ofsted_leadership_ratings_national.csv"),
reactableOutput("ofsted_tbl")
))
# reactableOutput("ofsted_tbl")
)
),
details(
Expand All @@ -332,7 +351,11 @@ enabler2_tab <- function() {
inputId = "tbl_ofsted_reg",
label = "View chart as a table",
help_text = (
reactableOutput("ofsted_reg_tbl")
HTML(paste0(
csvDownloadButton("ofsted_reg_tbl", filename = "Ofsted_leadership_ratings_regions.csv"),
reactableOutput("ofsted_reg_tbl")
))
# reactableOutput("ofsted_reg_tbl")
)
),
details(
Expand All @@ -349,24 +372,29 @@ enabler2_tab <- function() {
)
),
gov_row(
h2("Ofsted – The impact of leaders on social work practice with children and families with statistical neighbours"),
p("Hover over each data point to see the year of their last Ofsted inspection."),
plotlyOutput("ofsted_SN_plot"),
br(),
details(
inputId = "tbl_ofsted_SN",
label = "View chart as a table",
help_text = (
reactableOutput("ofsted_SN_tbl")
)
),
details(
inputId = "ofsted_stat_neighbours_info",
label = "Additional information:",
help_text = (
p("Statistical neighbours info")
)
)
uiOutput("ofsted_rating_SN_ui"),
# h2("Ofsted – The impact of leaders on social work practice with children and families with statistical neighbours"),
# p("Hover over each data point to see the year of their last Ofsted inspection."),
# plotlyOutput("ofsted_SN_plot"),
# br(),
# details(
# inputId = "tbl_ofsted_SN",
# label = "View chart as a table",
# help_text = (
# HTML(paste0(
# csvDownloadButton("ofsted_SN_tbl", filename = paste0("Ofsted_leadership_ratings_SN_", input$geographic_breakdown_o4, ".csv"))
# reactableOutput("ofsted_SN_tbl")
# ))
# #reactableOutput("ofsted_SN_tbl")
# )
# ),
# details(
# inputId = "ofsted_stat_neighbours_info",
# label = "Additional information:",
# help_text = (
# p("Statistical neighbours info")
# )
# )
)
),
open = FALSE,
Expand Down
67 changes: 56 additions & 11 deletions R/enabler3_page.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ enabler3_tab <- function() {
inputId = "tbl_s_w_turnover",
label = "View chart as a table",
help_text = (
reactableOutput("table_s_w_turnover")
HTML(paste0(
csvDownloadButton("table_s_w_turnover", filename = "social_worker_turnover.csv"),
reactableOutput("table_s_w_turnover")
))
# reactableOutput("table_s_w_turnover")
)
),
details(
Expand Down Expand Up @@ -175,7 +179,11 @@ enabler3_tab <- function() {
inputId = "tbl_turnover_reg",
label = "View chart as a table",
help_text = (
reactableOutput("table_turnover_reg")
HTML(paste0(
csvDownloadButton("table_turnover_reg", filename = "social_worker_turnover_region.csv"),
reactableOutput("table_turnover_reg")
))
# reactableOutput("table_turnover_reg")
)
),
details(
Expand Down Expand Up @@ -228,7 +236,11 @@ enabler3_tab <- function() {
inputId = "tbl_agency_worker",
label = "View chart as a table",
help_text = (
reactableOutput("table_agency_worker")
HTML(paste0(
csvDownloadButton("table_agency_worker", filename = "agency_worker_rate.csv"),
reactableOutput("table_agency_worker")
))
# reactableOutput("table_agency_worker")
)
),
details(
Expand Down Expand Up @@ -258,7 +270,11 @@ enabler3_tab <- function() {
inputId = "tbl_agency_reg",
label = "View chart as a table",
help_text = (
reactableOutput("table_agency_reg")
HTML(paste0(
csvDownloadButton("table_agency_reg", filename = "agency_worker_rate_regions.csv"),
reactableOutput("table_agency_reg")
))
# reactableOutput("table_agency_reg")
)
),
details(
Expand Down Expand Up @@ -308,7 +324,12 @@ enabler3_tab <- function() {
inputId = "tbl_vacancy_rate",
label = "View chart as a table",
help_text = (
reactableOutput("table_vacancy_rate")
HTML(paste0(
csvDownloadButton("table_vacancy_rate", filename = "vacancy_rates.csv"),
reactableOutput("table_vacancy_rate")
))

# reactableOutput("table_vacancy_rate")
)
),
details(
Expand Down Expand Up @@ -338,7 +359,11 @@ enabler3_tab <- function() {
inputId = "tbl_vacancy_reg",
label = "View chart as a table",
help_text = (
reactableOutput("table_vacancy_reg")
HTML(paste0(
csvDownloadButton("table_vacancy_reg", filename = "vacancy_rates_regions.csv"),
reactableOutput("table_vacancy_reg")
))
# reactableOutput("table_vacancy_reg")
)
),
details(
Expand Down Expand Up @@ -408,7 +433,11 @@ enabler3_tab <- function() {
inputId = "tbl_caseload",
label = "View chart as a table",
help_text = (
reactableOutput("table_caseload")
HTML(paste0(
csvDownloadButton("table_caseload", filename = "avg_caseload.csv"),
reactableOutput("table_caseload")
))
# reactableOutput("table_caseload")
)
),
details(
Expand Down Expand Up @@ -438,7 +467,11 @@ enabler3_tab <- function() {
inputId = "tbl_caseload_reg",
label = "View chart as a table",
help_text = (
reactableOutput("table_caseload_reg")
HTML(paste0(
csvDownloadButton("table_caseload_reg", filename = "avg_caseload_regions.csv"),
reactableOutput("table_caseload_reg")
))
# reactableOutput("table_caseload_reg")
)
),
details(
Expand Down Expand Up @@ -506,7 +539,11 @@ enabler3_tab <- function() {
inputId = "tbl_ethnicity",
label = "View Chart as a table",
help_text = (
reactableOutput("table_ethnicity_rate")
HTML(paste0(
csvDownloadButton("table_ethnicity_rate", filename = "social_worker_ethnicity.csv"),
reactableOutput("table_ethnicity_rate")
))
# reactableOutput("table_ethnicity_rate")
)
),
details(
Expand Down Expand Up @@ -545,7 +582,11 @@ enabler3_tab <- function() {
inputId = "tbl_population_ethnicity",
label = "View Chart as a table",
help_text = (
reactableOutput("table_population_ethnicity_rate")
HTML(paste0(
csvDownloadButton("table_population_ethnicity_rate", filename = "social_worker_ethnicity_vs_population.csv"),
reactableOutput("table_population_ethnicity_rate")
))
# reactableOutput("table_population_ethnicity_rate")
)
),
details(
Expand Down Expand Up @@ -583,7 +624,11 @@ enabler3_tab <- function() {
inputId = "tbl_seniority_eth",
label = "View Chart as a table",
help_text = (
reactableOutput("table_seniority_eth")
HTML(paste0(
csvDownloadButton("table_seniority_eth", filename = "social_worker_seniority.csv"),
reactableOutput("table_seniority_eth")
))
# reactableOutput("table_seniority_eth")
)
),
details(
Expand Down
Loading

0 comments on commit 13c4369

Please sign in to comment.