From 2fb507bab4a7b84ae75ebc798bc366bd6864fbd3 Mon Sep 17 00:00:00 2001 From: Spencer Childress Date: Wed, 11 May 2022 13:08:22 -0400 Subject: [PATCH 1/3] update version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6041284b..b59e08dd 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.1.1 Authors@R: c( person("Jeremy", "Wildfire", email = "jwildfire@gmail.com", role = c("cre","aut")), person("Becca", "Krouse", role="aut"), From a9a89f9b2049a25a0310d1f97fd63fcc976eb9df Mon Sep 17 00:00:00 2001 From: Spencer Childress Date: Wed, 11 May 2022 13:55:19 -0400 Subject: [PATCH 2/3] fix #672 --- R/mod_filterTab.R | 13 +++++++++++-- R/mod_safetyGraphicsUI.R | 14 ++++++++++---- inst/www/index.css | 4 ++++ 3 files changed, 25 insertions(+), 6 deletions(-) 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('
/
');" - ) + HTML(paste0( + "var header = $('.navbar > .container-fluid');", + "header.append(\"", + "
", + "", + "/", + " participants", + "
", + "\");" + )) ) if(isNamespaceLoaded("shinybusy")){ spinner<-shinybusy::add_busy_spinner(spin = "atom", position="bottom-right") diff --git a/inst/www/index.css b/inst/www/index.css index efdc5f3c..4e3961e0 100644 --- a/inst/www/index.css +++ b/inst/www/index.css @@ -64,6 +64,10 @@ table.metatable.dataTable tr > td:last-of-type, table.metatable.trdataTable tr > margin-top:1em; } +#population-header.subset { + background: red; +} + #dataSettings-previews .nav-tabs{ margin-bottom: 1em; } From 10c2d6fc6630a6e43b7648b5ccdc3b87a6e3d026 Mon Sep 17 00:00:00 2001 From: Spencer Childress Date: Wed, 11 May 2022 14:30:59 -0400 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Jeremy Wildfire --- DESCRIPTION | 2 +- inst/www/index.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b59e08dd..34ba1647 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: safetyGraphics Title: Interactive Graphics for Monitoring Clinical Trial Safety -Version: 2.1.1 +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/inst/www/index.css b/inst/www/index.css index 4e3961e0..ded3585c 100644 --- a/inst/www/index.css +++ b/inst/www/index.css @@ -65,7 +65,7 @@ table.metatable.dataTable tr > td:last-of-type, table.metatable.trdataTable tr > } #population-header.subset { - background: red; + background: blue; } #dataSettings-previews .nav-tabs{