-
Notifications
You must be signed in to change notification settings - Fork 0
/
set_bscui_styles.R
37 lines (37 loc) · 1.19 KB
/
set_bscui_styles.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
###############################################################################@
#' Set styles of elements of a bscui widget
#'
#' @param widget a [`bscui`] object
#' @param element_styles NULL or a data frame with an **id** column providing
#' the element identifier and one column per style name. Column names
#' should correspond to a style name in camel case (e.g., "strokeOpacity").
#' @param to_ignore identifiers of elements to ignore:
#' if those elements are children of elements to update they won't be updated
#' @param targeted_tags targeted_tags affected tag names
#' (by default: structure_shapes of the scui object)
#' @param append if TRUE the value will be concatenate with the existing value
#'
#' @return The modified [`bscui`] object
#'
#' @example inst/examples/main-example.R
#'
#' @export
#'
set_bscui_styles <- function(
widget,
element_styles,
to_ignore = NULL,
targeted_tags = widget$x$structure_shapes,
append = FALSE
){
widget$x$element_styles <- c(
widget$x$element_styles,
list(list(
element_styles = element_styles,
to_ignore = to_ignore,
targeted_tags = targeted_tags,
append = append
))
)
return(widget)
}