* use logical `NA` that can be cast to character * chore: Use ggplot2's default color scale `na.value` * chore: document() * chore: Also set `na.value = "grey50"` in `scale_xaringan_discrete()`. * chore: Add news item --------- Co-authored-by: Garrick Aden-Buie <garrick@adenbuie.com>tags/v0.4.4
| # xaringanthemer (development version) | # xaringanthemer (development version) | ||||
| - `scale_xaringan_continuous()` and `scale_xaringan_discrete()` now set | |||||
| `na.value = "grey50"` by default for compatibility with ggplot2 > 3.5.2 | |||||
| (thanks @teunbrand, #82). | |||||
| # xaringanthemer 0.4.3 | # xaringanthemer 0.4.3 | ||||
| - Update the spelling of `colour` for compatibility with ggplot2 >= 3.5.1 (@teunbrand #79). | - Update the spelling of `colour` for compatibility with ggplot2 >= 3.5.1 (@teunbrand #79). |
| ..., | ..., | ||||
| color = NULL, | color = NULL, | ||||
| direction = 1, | direction = 1, | ||||
| inverse = FALSE | |||||
| inverse = FALSE, | |||||
| na.value = "grey50" | |||||
| ) { | ) { | ||||
| requires_package("ggplot2", "scale_xaringan_discrete") | requires_package("ggplot2", "scale_xaringan_discrete") | ||||
| ) | ) | ||||
| } | } | ||||
| ggplot2::discrete_scale(aes_type, "manual", pal, ...) | |||||
| ggplot2::discrete_scale(aes_type, "manual", pal, ..., na.value = na.value) | |||||
| } | } | ||||
| #' @rdname scale_xaringan | #' @rdname scale_xaringan | ||||
| color = NULL, | color = NULL, | ||||
| begin = 0, | begin = 0, | ||||
| end = 1, | end = 1, | ||||
| inverse = FALSE | |||||
| inverse = FALSE, | |||||
| na.value = "grey50" | |||||
| ) { | ) { | ||||
| requires_package("ggplot2", "scale_xaringan_continuous") | requires_package("ggplot2", "scale_xaringan_continuous") | ||||
| requires_package("scales", "scale_xaringan_continuous") | requires_package("scales", "scale_xaringan_continuous") | ||||
| palette = scales::gradient_n_pal(colors, values = NULL), | palette = scales::gradient_n_pal(colors, values = NULL), | ||||
| rescaler = rescaler, | rescaler = rescaler, | ||||
| oob = scales::censor, | oob = scales::censor, | ||||
| na.value = na.value, | |||||
| ... | ... | ||||
| ) | ) | ||||
| } | } |
| ..., | ..., | ||||
| color = NULL, | color = NULL, | ||||
| direction = 1, | direction = 1, | ||||
| inverse = FALSE | |||||
| inverse = FALSE, | |||||
| na.value = "grey50" | |||||
| ) | ) | ||||
| scale_xaringan_fill_discrete(..., color = NULL, direction = 1, inverse = FALSE) | scale_xaringan_fill_discrete(..., color = NULL, direction = 1, inverse = FALSE) | ||||
| color = NULL, | color = NULL, | ||||
| begin = 0, | begin = 0, | ||||
| end = 1, | end = 1, | ||||
| inverse = FALSE | |||||
| inverse = FALSE, | |||||
| na.value = "grey50" | |||||
| ) | ) | ||||
| scale_xaringan_fill_continuous( | scale_xaringan_fill_continuous( | ||||
| color is chosen to work well with the inverse slide styles, namely the | color is chosen to work well with the inverse slide styles, namely the | ||||
| value of \code{inverse_header_color}} | value of \code{inverse_header_color}} | ||||
| \item{na.value}{Color to be used for missing data points.} | |||||
| \item{begin}{Number in the range of \code{[0, 1]} indicating to which point in the color scale the smallest data value should be mapped.} | \item{begin}{Number in the range of \code{[0, 1]} indicating to which point in the color scale the smallest data value should be mapped.} | ||||
| \item{end}{Number in the range of \code{[0, 1]} indicating to which point in the color scale the largest data value should be mapped.} | \item{end}{Number in the range of \code{[0, 1]} indicating to which point in the color scale the largest data value should be mapped.} |