Skip to content

Commit 391438a

Browse files
Merge pull request #22 from Bayer-Group/21_hover_font_color
Updated hover panels with improved color contrast and built-in sorting feature to move selected/highlighted/reference subgroups to the top
2 parents 24a6ccf + 95d0aa1 commit 391438a

8 files changed

Lines changed: 1217 additions & 1052 deletions

File tree

R/golem_utils_server.R

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,53 +11,53 @@ not_null <- Negate(is.null)
1111

1212
not_na <- Negate(is.na)
1313

14-
#' Removes the null from a vector
15-
#'
16-
#' @noRd
17-
#'
18-
#' @example
19-
#' drop_nulls(list(1, NULL, 2))
20-
drop_nulls <- function(x) {
21-
x[!sapply(x, is.null)]
22-
}
23-
24-
#' If x is `NULL`, return y, otherwise return x
25-
#'
26-
#' @param x,y Two elements to test, one potentially `NULL`
27-
#'
28-
#' @noRd
29-
#'
30-
#' @examples
31-
#' NULL %||% 1
32-
"%||%" <- function(x, y) {
33-
if (is.null(x)) {
34-
y
35-
} else {
36-
x
37-
}
38-
}
39-
40-
#' If x is `NA`, return y, otherwise return x
41-
#'
42-
#' @param x,y Two elements to test, one potentially `NA`
43-
#'
44-
#' @noRd
45-
#'
46-
#' @examples
47-
#' NA %|NA|% 1
48-
"%|NA|%" <- function(x, y) {
49-
if (is.na(x)) {
50-
y
51-
} else {
52-
x
53-
}
54-
}
55-
56-
#' Typing reactiveValues is too long
57-
#'
58-
#' @inheritParams reactiveValues
59-
#' @inheritParams reactiveValuesToList
60-
#'
61-
#' @noRd
62-
rv <- function(...) shiny::reactiveValues(...)
63-
rvtl <- function(...) shiny::reactiveValuesToList(...)
14+
#' #' Removes the null from a vector
15+
#' #'
16+
#' #' @noRd
17+
#' #'
18+
#' #' @example
19+
#' #' drop_nulls(list(1, NULL, 2))
20+
#' drop_nulls <- function(x) {
21+
#' x[!sapply(x, is.null)]
22+
#' }
23+
#'
24+
#' #' If x is `NULL`, return y, otherwise return x
25+
#' #'
26+
#' #' @param x,y Two elements to test, one potentially `NULL`
27+
#' #'
28+
#' #' @noRd
29+
#' #'
30+
#' #' @examples
31+
#' #' NULL %||% 1
32+
#' "%||%" <- function(x, y) {
33+
#' if (is.null(x)) {
34+
#' y
35+
#' } else {
36+
#' x
37+
#' }
38+
#' }
39+
#'
40+
#' #' If x is `NA`, return y, otherwise return x
41+
#' #'
42+
#' #' @param x,y Two elements to test, one potentially `NA`
43+
#' #'
44+
#' #' @noRd
45+
#' #'
46+
#' #' @examples
47+
#' #' NA %|NA|% 1
48+
#' "%|NA|%" <- function(x, y) {
49+
#' if (is.na(x)) {
50+
#' y
51+
#' } else {
52+
#' x
53+
#' }
54+
#' }
55+
#'
56+
#' #' Typing reactiveValues is too long
57+
#' #'
58+
#' #' @inheritParams reactiveValues
59+
#' #' @inheritParams reactiveValuesToList
60+
#' #'
61+
#' #' @noRd
62+
#' rv <- function(...) shiny::reactiveValues(...)
63+
#' rvtl <- function(...) shiny::reactiveValuesToList(...)

0 commit comments

Comments
 (0)