diff --git a/DESCRIPTION b/DESCRIPTION index 7d15acb..3d2f81a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: forestly Title: Interactive Forest Plot -Version: 0.1.1 +Version: 0.1.2 Authors@R: c( person("Yilong", "Zhang", role = c("aut")), person("Benjamin", "Wang", email = "benjamin.wang@merck.com", role = c("aut", "cre")), @@ -47,4 +47,4 @@ Suggests: VignetteBuilder: knitr Config/testthat/edition: 3 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 diff --git a/NEWS.md b/NEWS.md index 35a8a1f..948679c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,12 +1,17 @@ +# forestly 0.1.2 + +- Fix a bug that prevents reactable from rendering under reactR >= 0.6.0 (#67). +- Add a new argument `filter_label` to `ae_forestly()` for controlling slider bar label (#68). + # forestly 0.1.1 -- Add button to display SOC column for subset -- Refine the default value of `meta_forestly()` -- Update `format_ae_listing()` to be better aligned with oncology AEs reporting -- Enhance functionality related to drill-down listing -- Inherit paramter_term from all parameters of a metadata by default (#20) -- Allow user to specify treatment group (#15) -- Add warning when using tibble as input (#17) +- Add button to display SOC column for subset. +- Refine the default value of `meta_forestly()`. +- Update `format_ae_listing()` to be better aligned with oncology AEs reporting. +- Enhance functionality related to drill-down listing. +- Inherit paramter_term from all parameters of a metadata by default (#20). +- Allow user to specify treatment group (#15). +- Add warning when using tibble as input (#17). - Fix bug when there is no record of a selected AE category (#9). - Fix bug when there are multiple plots displayed on one page (#12). - Update dataset `forestly_adae` since a variable was a factor diff --git a/R/ae_forestly.R b/R/ae_forestly.R index 03b5ded..1e81721 100644 --- a/R/ae_forestly.R +++ b/R/ae_forestly.R @@ -21,6 +21,7 @@ #' @param outdata An `outdata` object created by [format_ae_forestly()]. #' @param display_soc_toggle A boolean value to display SOC toggle button. #' @param filter A character value of the filter variable. +#' @param filter_label A character value of the label for slider bar. #' @param width A numeric value of width of the table in pixels. #' @param max_page A numeric value of max page number shown in the table. #' @@ -44,11 +45,18 @@ ae_forestly <- function(outdata, display_soc_toggle = TRUE, filter = c("prop", "n"), + filter_label = NULL, width = 1400, max_page = NULL) { filter <- match.arg(filter) filter_range <- c(0, 100) + if(is.null(filter_label)) { + filter_label <- ifelse(filter == "prop", + "Incidence (%) in One or More Treatment Groups", + "Number of AE in One or More Treatment Groups") + } + # `max_page` controls the maximum page number displayed in the interactive forest table. # By default (`NULL`), it will display the counts that round up to the nearest hundred. if (is.null(max_page)) { @@ -102,7 +110,7 @@ ae_forestly <- function(outdata, if (filter == "prop") { filter_subject <- crosstalk::filter_slider( id = "filter_subject", - label = "Incidence (%) in One or More Treatment Groups", + label = filter_label, sharedData = tbl, column = ~hide_prop, # whose values will be used for this slider step = 1, # specifies interval between each select-able value on the slider @@ -115,13 +123,13 @@ ae_forestly <- function(outdata, if (filter == "n") { filter_subject <- crosstalk::filter_slider( id = "filter_subject", - label = "Number of AE in One or More Treatment Groups", + label = filter_label, sharedData = tbl, column = ~hide_n, step = 1, width = 250, - min = filter_range[1], - max = filter_range[2] + min = filter_range[1], # the leftmost value of the slider + max = filter_range[2] # the rightmost value of the slider ) } diff --git a/man/ae_forestly.Rd b/man/ae_forestly.Rd index e89ca2a..324b423 100644 --- a/man/ae_forestly.Rd +++ b/man/ae_forestly.Rd @@ -8,6 +8,7 @@ ae_forestly( outdata, display_soc_toggle = TRUE, filter = c("prop", "n"), + filter_label = NULL, width = 1400, max_page = NULL ) @@ -19,6 +20,8 @@ ae_forestly( \item{filter}{A character value of the filter variable.} +\item{filter_label}{A character value of the label for slider bar.} + \item{width}{A numeric value of width of the table in pixels.} \item{max_page}{A numeric value of max page number shown in the table.}