Skip to content

Commit

Permalink
latest change
Browse files Browse the repository at this point in the history
Merge branch 'main' of https://github.com/nhsbsa-data-analytics/int644genderpaygap

# Conflicts:
#	R/data.R
#	R/headcount_data_class.R
#	R/mod_scrollytell_example.R
#	R/utils_charts.R
#	data-raw/01_headcount_by_gender_afc.R
#	tests/testthat/test-utils_charts.R
  • Loading branch information
kygoffe committed Nov 3, 2023
2 parents 30c12eb + e1b1c8f commit 16d3e86
Show file tree
Hide file tree
Showing 47 changed files with 2,011 additions and 726 deletions.
5 changes: 5 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@
^gitleaks.toml$
^\.github$
^\.lintr$
^data_temp$
^\./R/data\.r$
^review$
^doc$
^Meta$
4 changes: 3 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ jobs:
token: '${{ secrets.GITHUB_TOKEN }}'

- uses: r-lib/actions/check-r-package@v2

with:
error-on: 'error'

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ rsconnect
# Excel files (including macros and templates) #
################################################
*.[xX][lL][sS][xXmMtT]?
# Any RDA files
*.[rR][dD][aA]
data/*
data_temp/*
4 changes: 3 additions & 1 deletion .lintr
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
linters: linters_with_defaults(
line_length_linter(90),
object_usage_linter = NULL
object_usage_linter = NULL,
object_name_linter = NULL,
infix_spaces_linter = NULL
)
exclude: "# Exclude Linting"
exclude_start: "# Begin Exclude Linting"
Expand Down
20 changes: 10 additions & 10 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ Imports:
htmltools,
magrittr,
nhsbsaR,
rlang,
scrollytell,
shiny,
shinyjs,
dplyr (>= 1.1.3),
dbplyr (>= 2.3.3),
forcats (>= 1.0.0),
dplyr (>= 1.1.2),
futile.logger (>= 1.4.3),
stringr,
formatR,
tidyr
htmlwidgets,
markdown,
shinyWidgets,
ggplot2
Suggests:
pkgload,
testthat (>= 3.0.0),
usethis
usethis,
tidyr,
graphics,
stats
Remotes:
nhsbsa-data-analytics/nhsbsaR,
statistiekcbs/scrollytell
nhsbsa-data-analytics/nhsbsaR
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
Expand Down
11 changes: 9 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# Generated by roxygen2: do not edit by hand

export("%>%")
export(gender_profile)
export(gpg_bar)
export(gpg_column)
export(gpg_data)
export(gpg_dumbbell)
export(gpg_pyramid)
export(gpg_stack)
export(gpg_trend)
export(h1_tabstop)
export(h2_tabstop)
export(h3_tabstop)
export(h4_tabstop)
export(h5_tabstop)
export(h6_tabstop)
export(headcount_data)
export(nhs_card)
export(nhs_card_tabstop)
export(nhs_footer)
Expand All @@ -27,3 +32,5 @@ importFrom(golem,bundle_resources)
importFrom(golem,favicon)
importFrom(golem,with_golem_options)
importFrom(magrittr,"%>%")
importFrom(shiny,NS)
importFrom(shiny,tagList)
55 changes: 51 additions & 4 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,55 @@
#' @import shiny
#' @noRd
app_server <- function(input, output, session) {
# Your application server logic
mod_markdown_example_server("markdown_example_ui_1")
mod_chart_example_server("chart_example_ui_1")
mod_scrollytell_example_server("scrollytell_example_1")
mod_headcount_server("headcount")
mod_paygap_server("paygap")
mod_quartile_server("quartile")

observeEvent(input$content_main, {
tag <- switch(input$content_main,
"Introduction" = "introduction",
"Gender profile" = "headcount",
"Gender pay gap" = "paygap",
"Pay quartile" = "quartile",
"Action" = "gpg_action"
)

if (input$content_main == "Introduction") {
shinyjs::runjs("window.scrollTo(0, 0);")
} else {
shinyjs::runjs(paste0("document.getElementById('", tag, "').scrollIntoView();"))
}
})

observeEvent(input$top_headcount_intro, {
# jump to the top of the screen
shinyjs::runjs("window.scrollTo(0, 0)")

updateSelectInput(session,
inputId = "content_main",
selected = "Introduction"
)
})


observeEvent(input$top_paygap_intro, {
# jump to the top of the screen
shinyjs::runjs("window.scrollTo(0, 0)")

updateSelectInput(session,
inputId = "content_main",
selected = "Introduction"
)
})

Check warning on line 48 in R/app_server.R

View workflow job for this annotation

GitHub Actions / lint

file=R/app_server.R,line=48,col=1,[trailing_whitespace_linter] Trailing whitespace is superfluous.
observeEvent(input$top_quartile_intro, {
# jump to the top of the screen
shinyjs::runjs("window.scrollTo(0, 0)")

Check warning on line 52 in R/app_server.R

View workflow job for this annotation

GitHub Actions / lint

file=R/app_server.R,line=52,col=1,[trailing_whitespace_linter] Trailing whitespace is superfluous.
updateSelectInput(session,
inputId = "content_main",

Check warning on line 54 in R/app_server.R

View workflow job for this annotation

GitHub Actions / lint

file=R/app_server.R,line=54,col=22,[indentation_linter] Indentation should be 6 spaces but is 22 spaces.
selected = "Introduction"
)
})

Check warning on line 58 in R/app_server.R

View workflow job for this annotation

GitHub Actions / lint

file=R/app_server.R,line=58,col=1,[trailing_whitespace_linter] Trailing whitespace is superfluous.
}
51 changes: 36 additions & 15 deletions R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,43 @@ app_ui <- function(request) {
div(
class = "nhsuk-main-wrapper",
role = "main",
nhs_navlistPanel(
fluidRow(
id = "mainTabs",
well = FALSE,
widths = c(3, 9),
tabPanel(
title = "Introduction",
mod_markdown_example_ui("markdown_example_ui_1")
column(width = 10),
shinyWidgets::pickerInput(
inputId = "content_main",
label = "Content:",
choices = c(
"Introduction",
"Gender profile",
"Gender pay gap",
"Pay quartile",
"Action"
),
selected = "Introduction",
width = "fit",
inline = TRUE
),
tabPanel(
title = "Charts",
mod_chart_example_ui("chart_example_ui_1")
),
tabPanel(
title = "Scrolly example",
mod_scrollytell_example_ui("scrollytell_example_1")
)
tags$div(id = "introduction"),
mod_introduction_ui("introduction"),
hr(),
br(),
tags$div(id = "headcount"),
mod_headcount_ui("headcount"),
accessible_action_link("top_headcount_intro", "Go to top page"),
hr(),
br(),
tags$div(id = "paygap"),
mod_paygap_ui("paygap"),
accessible_action_link("top_paygap_intro", "Go to top page"),
hr(),
br(),
tags$div(id = "quartile"),
mod_quartile_ui("quartile"),
accessible_action_link("top_quartile_intro", "Go to top page"),
hr(),
br(),
tags$div(id = "gpg_action")
)
)
)
Expand All @@ -60,7 +81,7 @@ golem_add_external_resources <- function() {

tags$head(
favicon("assets/favicons/favicon"),
tags$title("nhsbsaGPG"),
tags$title("NHSBSA gender pay gap report"),

# Add here other external resources
# for example, you can add shinyalert::useShinyalert()
Expand Down
16 changes: 0 additions & 16 deletions R/data.R

This file was deleted.

23 changes: 0 additions & 23 deletions R/faithful.R

This file was deleted.

Loading

0 comments on commit 16d3e86

Please sign in to comment.