Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltips fixes post bh #47

Merged
merged 16 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
8d35715
Feat: Adding inputs from all pages (not just LA) so that bookmarking …
JT-39 Nov 27, 2024
115d24a
Feat: Alphabetically ordering indicators for when all topics is selected
JT-39 Nov 27, 2024
e7b8c6b
Feat: Using the global covid method to find what years should be trea…
JT-39 Nov 27, 2024
be87e23
Feat: Using a join instead of filter so that each measure uses its ri…
JT-39 Nov 27, 2024
dd9e0b1
Feat: Adding new covid years method to all relevant scripts
JT-39 Nov 27, 2024
05bc86a
Feat: Tooltip for LA input to explain can scroll or type, also doing …
JT-39 Nov 27, 2024
38074c5
Feat: Adding bslib tooltip to reactable cell instead of tippy
JT-39 Nov 27, 2024
b9b2556
Chore: Roxygen comments for new tooltip fns
JT-39 Nov 27, 2024
3dbc85e
Feat: Applying new tooltip with direction to each reactable tooltip
JT-39 Nov 27, 2024
48d2984
Feat: Setting tooltip class with arrow gov colour and changing icon t…
JT-39 Nov 28, 2024
211397c
Feat: Adding tooltip to Year Range and making tooltip text html
JT-39 Nov 28, 2024
849bc1a
Feat: Adding tooltips to Create Your Own tables and Charts (instead o…
JT-39 Nov 28, 2024
edc2a4e
Feat: Adding placeholder to multi-chart selections and improving Crea…
JT-39 Nov 28, 2024
8641fad
Feat: Making year range tooltip bulletpoints
JT-39 Nov 28, 2024
6e79633
Feat: Adding tooltip to ui Create Your Own charts, removing fullstops
JT-39 Nov 28, 2024
ffd6595
Tests: Fixing tests for new default indicator and using .data to spec…
JT-39 Nov 28, 2024
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
309 changes: 156 additions & 153 deletions 02_dev/create_your_own_page/create_own_table_dev_mod_app.R
Original file line number Diff line number Diff line change
@@ -1,153 +1,156 @@
# Load global
source(here::here("global.R"))

# Load functions
list.files("R/", full.names = TRUE) |>
(\(x) {
x[grepl("fn_", x)]
})() |>
purrr::walk(source)

# Load modules
list.files("R/lait_modules/", full.names = TRUE) |>
purrr::walk(source)

# Main App UI
ui <- bslib::page_fillable(
## Other language dependencies ===============================================
shiny::includeCSS(here::here("www/dfe_shiny_gov_style.css")),
tags$head(htmltools::includeScript("www/custom_js.js")),
# Makes the remove button work
reactable.extras::reactable_extras_dependency(),

# Start of app ===============================================================

# Main selections ============================================================
h1("Create your own"),
# Full dataset notification banner
full_data_on_github_noti(),
div(
class = "well",
style = "overflow-y: visible; padding: 1rem;",
bslib::layout_column_wrap(
Create_MainInputsUI("create_inputs")["Main choices"],
),
bslib::layout_column_wrap(
Create_MainInputsUI("create_inputs")["LA grouping"],
Create_MainInputsUI("create_inputs")["Other grouping"],
YearRangeUI("year_range"),
Create_MainInputsUI("create_inputs")["Clear all current selections"]
)
),
# Staging table and Add selections button
StagingTableUI("staging_table"),
QueryTableUI("query_table"),
CreateOwnTableUI("create_own_table"),
# Charts =====================================================================
div(
class = "well",
style = "overflow-y: visible;",
h3("Output Charts (Charts showing data from saved selections)"),
p("Note a maximum of 4 geographies and 3 indicators can be shown."),

# Line chart ---------------------------------------------------------------
bslib::navset_tab(
CreateOwnLineChartUI("create_own_line"),
CreateOwnBarChartUI("create_own_bar")
)
)
)

# Main App Server
server <- function(input, output, session) {
# Call the main inputs module
create_inputs <- Create_MainInputsServer(
"create_inputs",
topic_indicator_full
)

# Year range
year_input <- YearRangeServer(
"year_range",
bds_metrics,
create_inputs$indicator,
create_inputs$clear_selections
)

# Geog Groupings
geog_groups <- GroupingInputServer(
"geog_groups",
create_inputs,
la_names_bds,
region_names_bds,
stat_n_geog,
stat_n_la
)

# Filtering BDS for staging data
staging_bds <- StagingBDSServer(
"staging_bds",
create_inputs,
geog_groups,
year_input,
bds_metrics
)

# Build staging data
staging_data <- StagingDataServer(
"staging_data",
create_inputs,
staging_bds,
region_names_bds,
la_names_bds,
stat_n_la
)

# Output staging table
StagingTableServer(
"staging_table",
create_inputs,
region_names_bds,
la_names_bds,
stat_n_la,
geog_groups,
year_input,
bds_metrics
)

query_data <- QueryDataServer(
"query_data",
create_inputs,
geog_groups,
year_input,
staging_data
)

query_table <- QueryTableServer(
"query_table",
query_data
)

CreateOwnTableServer(
"create_own_table",
query_table,
bds_metrics
)

CreateOwnLineChartServer(
"create_own_line",
query_table,
bds_metrics,
covid_affected_indicators
)

CreateOwnBarChartServer(
"create_own_bar",
query_table,
bds_metrics,
covid_affected_indicators
)
}

# Run the application
shinyApp(ui = ui, server = server)
# Load global
source(here::here("global.R"))

# Load functions
list.files("R/", full.names = TRUE) |>
(\(x) {
x[grepl("fn_", x)]
})() |>
purrr::walk(source)

# Load modules
list.files("R/lait_modules/", full.names = TRUE) |>
purrr::walk(source)

# Main App UI
ui <- bslib::page_fillable(
## Other language dependencies ===============================================
shiny::includeCSS(here::here("www/dfe_shiny_gov_style.css")),
tags$head(htmltools::includeScript("www/custom_js.js")),
# Makes the remove button work
reactable.extras::reactable_extras_dependency(),

# Start of app ===============================================================

# Main selections ============================================================
h1("Create your own"),
# Full dataset notification banner
full_data_on_github_noti(),
div(
class = "well",
style = "overflow-y: visible; padding: 1rem;",
bslib::layout_column_wrap(
Create_MainInputsUI("create_inputs")["Main choices"],
),
bslib::layout_column_wrap(
Create_MainInputsUI("create_inputs")["LA grouping"],
Create_MainInputsUI("create_inputs")["Other grouping"],
YearRangeUI("year_range"),
Create_MainInputsUI("create_inputs")["Clear all current selections"]
)
),
# Staging table and Add selections button
StagingTableUI("staging_table"),
QueryTableUI("query_table"),
CreateOwnTableUI("create_own_table"),
# Charts =====================================================================
div(
class = "well",
style = "overflow-y: visible;",
h3(
"Output Charts",
create_tooltip_icon("Charts showing data from all the saved selections")
),
p("Note a maximum of 4 geographies and 3 indicators can be shown."),

# Line chart ---------------------------------------------------------------
bslib::navset_tab(
CreateOwnLineChartUI("create_own_line"),
CreateOwnBarChartUI("create_own_bar")
)
)
)

# Main App Server
server <- function(input, output, session) {
# Call the main inputs module
create_inputs <- Create_MainInputsServer(
"create_inputs",
topic_indicator_full
)

# Year range
year_input <- YearRangeServer(
"year_range",
bds_metrics,
create_inputs$indicator,
create_inputs$clear_selections
)

# Geog Groupings
geog_groups <- GroupingInputServer(
"geog_groups",
create_inputs,
la_names_bds,
region_names_bds,
stat_n_geog,
stat_n_la
)

# Filtering BDS for staging data
staging_bds <- StagingBDSServer(
"staging_bds",
create_inputs,
geog_groups,
year_input,
bds_metrics
)

# Build staging data
staging_data <- StagingDataServer(
"staging_data",
create_inputs,
staging_bds,
region_names_bds,
la_names_bds,
stat_n_la
)

# Output staging table
StagingTableServer(
"staging_table",
create_inputs,
region_names_bds,
la_names_bds,
stat_n_la,
geog_groups,
year_input,
bds_metrics
)

query_data <- QueryDataServer(
"query_data",
create_inputs,
geog_groups,
year_input,
staging_data
)

query_table <- QueryTableServer(
"query_table",
query_data
)

CreateOwnTableServer(
"create_own_table",
query_table,
bds_metrics
)

CreateOwnLineChartServer(
"create_own_line",
query_table,
bds_metrics,
covid_affected_data
)

CreateOwnBarChartServer(
"create_own_bar",
query_table,
bds_metrics,
covid_affected_data
)
}

# Run the application
shinyApp(ui = ui, server = server)
Loading