Skip to content

Commit

Permalink
Merge pull request #62 from r-world-devs/v0.3.1
Browse files Browse the repository at this point in the history
V0.3.1
  • Loading branch information
galachad authored Oct 12, 2024
2 parents e3bfe89 + 5109c01 commit 61ee45a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: shinyCohortBuilder
Type: Package
Title: Modular Cohort-Building Framework for Analytical Dashboards
Version: 0.3.0
Version: 0.3.1
Authors@R:
c(person('Krystian', 'Igras',
email = '[email protected]',
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# shinyCohortBuilder 0.3.1

* Fix compatibility with latest version of glue package (#61)

# shinyCohortBuilder 0.3.0

* Most of the modals have now `easyClosed` option turned on (#25).
Expand Down
40 changes: 19 additions & 21 deletions R/filter_discrete.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,28 @@ choice_name <- function(name, parent_stat, current_stat, stats) {
#' @export
.pre_post_stats_text <- function(current, previous, name, brackets = TRUE,
percent = FALSE, stats = c("pre", "post")) {
name <- empty_if_false(!missing(name), paste0(name, " "), FALSE, "")
open_bracket <- empty_if_false(brackets && any(stats %in% c("pre", "post")), "(", FALSE, "")
post_stat <- empty_if_false(
"post" %in% stats,
glue::glue("<span class = 'cb_delayed'>{current}</span>"),
FALSE, ""
)
slash <- empty_if_false(length(stats) == 2, " / ", FALSE, "")
pre_stat <- empty_if_false("pre" %in% stats, previous, FALSE, "")
close_bracket <- empty_if_false(brackets && any(stats %in% c("pre", "post")), ")", FALSE, "")
percent_open_bracket <- empty_if_false(percent && length(stats) == 2, " (", FALSE, "")
percentage <- empty_if_false(
percent && length(stats) == 2,
glue::glue("<span class = 'cb_delayed'>{round(100 * current / previous, 0)}%</span>"),
FALSE, ""
)
percent_close_bracket <- empty_if_false(percent && length(stats) == 2, ")", FALSE, "")
glue::glue(
"<span>",
"{name}{open_bracket}{post_stat}{slash}{pre_stat}{close_bracket}",
"{percent_open_bracket}{percent}{percent_close_bracket}",
"</span>",
.envir = list(
name = empty_if_false(!missing(name), paste0(name, " "), FALSE, ""),
open_bracket = empty_if_false(brackets && any(stats %in% c("pre", "post")), "(", FALSE, ""),
post_stat = empty_if_false(
"post" %in% stats,
glue::glue("<span class = 'cb_delayed'>{current}</span>"),
FALSE, ""
),
slash = empty_if_false(length(stats) == 2, " / ", FALSE, ""),
pre_stat = empty_if_false("pre" %in% stats, previous, FALSE, ""),
close_bracket = empty_if_false(brackets && any(stats %in% c("pre", "post")), ")", FALSE, ""),
percent_open_bracket = empty_if_false(percent && length(stats) == 2, " (", FALSE, ""),
percent = empty_if_false(
percent && length(stats) == 2,
glue::glue("<span class = 'cb_delayed'>{round(100 * current / previous, 0)}%</span>"),
FALSE, ""
),
percent_close_bracket = empty_if_false(percent && length(stats) == 2, ")", FALSE, "")
)
"{percent_open_bracket}{percentage}{percent_close_bracket}",
"</span>"
)
}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ workflow to Shiny.

![](man/figures/doc_01.gif)

[![version](https://img.shields.io/static/v1.svg?label=github.com&message=v.0.3.0&color=ff69b4)](https://r-world-devs.github.io/shinyCohortBuilder/)
[![version](https://img.shields.io/static/v1.svg?label=github.com&message=v.0.3.1&color=ff69b4)](https://r-world-devs.github.io/shinyCohortBuilder/)
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)

## Installation
Expand Down

0 comments on commit 61ee45a

Please sign in to comment.