Description Usage Arguments Examples
View source: R/cascading-theme.R
Combines two values. For most values, child
is returned in place
of parent
. Exeptions are formulas (converted to quosures
and evaluated with the object parent
and objects from the
CascadingTheme's data
field available), functions (evaluated
on the parent
if there is one), and cascading_element()
s (values
are merged recursively). Use rlang::as_box()
to cascade items
without applying any class-based rules, and rlang::zap()
to
remove a key from the parent cascading_element()
.
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 | cascade(parent, child = missing_value(), cascading_theme = NULL)
## Default S3 method:
cascade(parent, child = missing_value(), cascading_theme = NULL)
## S3 method for class ''function''
cascade(parent, child = missing_value(), cascading_theme = NULL)
## S3 method for class 'quosure'
cascade(parent, child = missing_value(), cascading_theme = NULL)
## S3 method for class 'formula'
cascade(parent, child = missing_value(), cascading_theme = NULL)
reverse_cascade(child, parent = missing_value(), cascading_theme = NULL)
## Default S3 method:
reverse_cascade(child, parent = missing_value(), cascading_theme = NULL)
## S3 method for class ''function''
reverse_cascade(child, parent = missing_value(), cascading_theme = NULL)
## S3 method for class 'quosure'
reverse_cascade(child, parent = missing_value(), cascading_theme = NULL)
## S3 method for class 'formula'
reverse_cascade(child, parent = missing_value(), cascading_theme = NULL)
## S3 method for class 'cascading_element'
reverse_cascade(child, parent = missing_value(), cascading_theme = NULL)
|
parent |
The value to be inherited from |
child |
The value to inherit |
cascading_theme |
The CascadingTheme object from which |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # in most cases, child is returned in place parent
cascade("parent value", "child value")
# formulas/quosures can use `parent` (tidy evaluation is supported)
# and data supplied by the theme
cascade(
"parent value",
~paste(parent, "child value", sep = separator),
CascadingTheme$new(data = list(separator = "=>"))
)
# items of cascading elements are merged recursively using the
# same rules
cascade(
cascading_element(key1 = "parent value 1", key2 = "parent_value 2"),
cascading_element(
key1 = "child value 1",
key2 = ~paste(parent, "child value2", sep = separator)
),
CascadingTheme$new(data = list(separator = "=>"))
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.