diff --git a/DESCRIPTION b/DESCRIPTION index 6041284b..34ba1647 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: safetyGraphics Title: Interactive Graphics for Monitoring Clinical Trial Safety -Version: 2.1.0 +Version: 2.2.0 Authors@R: c( person("Jeremy", "Wildfire", email = "jwildfire@gmail.com", role = c("cre","aut")), person("Becca", "Krouse", role="aut"), diff --git a/R/mod_filterTab.R b/R/mod_filterTab.R index 2cc6ec66..a3ea10bf 100644 --- a/R/mod_filterTab.R +++ b/R/mod_filterTab.R @@ -95,18 +95,27 @@ filterTab <- function(input, output, session, domainData, filterDomain, current_ ) } + n <- nrow(res_filter$filtered()) + N <- nrow(raw()) + shinyjs::html( "header-count", - nrow(res_filter$filtered()), + n, asis=TRUE ) shinyjs::html( "header-total", - nrow(raw()), + N, asis=TRUE ) + # Emphasize population header when subset is applied. + shinyjs::toggleClass( + selector = "#population-header", + class = "subset", + condition = n < N + ) }) observe({ diff --git a/R/mod_safetyGraphicsUI.R b/R/mod_safetyGraphicsUI.R index 81a55b9b..523b0a22 100644 --- a/R/mod_safetyGraphicsUI.R +++ b/R/mod_safetyGraphicsUI.R @@ -20,10 +20,16 @@ safetyGraphicsUI <- function(id, meta, domainData, mapping, standards){ #script to append population badge nav bar participant_badge<-tags$script( - HTML( - "var header = $('.navbar> .container-fluid'); - header.append('