diff --git a/articles/3_go_further-Rmd.html b/articles/3_go_further-Rmd.html index 7c02bc513..5b755dd0f 100644 --- a/articles/3_go_further-Rmd.html +++ b/articles/3_go_further-Rmd.html @@ -394,20 +394,14 @@

8. Add contrasting dark a dark or light colour, which is determined based on the underlying polygon colour.

-contrast <-
-  function(pal,
-           pal_dark = "#121b24",
-           pal_light = "#fcfdfe") {
-    
-    out   <- rep(pal_dark, length(pal))
+contrast <- function(pal, pal_dark = "#121b24", pal_light = "#fcfdfe") {
+    out <- rep(pal_dark, length(pal))
     light <- farver::get_channel(pal, "l", space = "hcl")
     out[light < 50] <- pal_light
     out
   }
 
-aes_contrast <- {
-  aes(colour = after_scale(contrast(fill)))
-}
+aes_contrast <- aes(colour = after_scale(contrast(fill)))
 
 palmerpenguins::penguins |>
   count(species, sex) |> 
@@ -419,14 +413,12 @@ 

8. Add contrasting dark width = 0.75, position = position_dodge2(preserve = "single"), x_labels = \(x) str_to_sentence(x), - col_legend_place = "right", ) + geom_text( aes( y = n - (max(n * 0.04)), label = n, !!!aes_contrast, - # !!!aes(colour = after_scale(contrast(fill))), ), position = position_dodge2(width = 0.75, preserve = "single"), size = 3.53, @@ -453,7 +445,6 @@

8. Add contrasting dark geom_text( aes(label = round(r, 1), !!!aes_contrast, - # !!!aes(colour = after_scale(contrast(fill))), ), size = 3.53, show.legend = FALSE, diff --git a/articles/3_go_further-Rmd_files/figure-html/unnamed-chunk-12-1.svg b/articles/3_go_further-Rmd_files/figure-html/unnamed-chunk-12-1.svg index c923f02a7..be3ab4a96 100644 --- a/articles/3_go_further-Rmd_files/figure-html/unnamed-chunk-12-1.svg +++ b/articles/3_go_further-Rmd_files/figure-html/unnamed-chunk-12-1.svg @@ -133,171 +133,171 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - + + + + + + + + - - - - + + + + - - - - - - + + + + + + - - - - + + + + - - + + - - - + + + - + - + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + diff --git a/articles/4_extensions-Rmd.html b/articles/4_extensions-Rmd.html index 3333caace..6b17d100c 100644 --- a/articles/4_extensions-Rmd.html +++ b/articles/4_extensions-Rmd.html @@ -595,8 +595,8 @@

ggiraph ggiraph::opts_sizing(rescale = TRUE, width = 0.7), ggiraph::opts_tooltip(use_fill = TRUE), ggiraph::opts_hover(css = "stroke:black;stroke-width:1px;")))

-
- +
+

plotly::ggplotly @@ -620,8 +620,8 @@

plotly::ggplotly theme = light_mode(base_family = "arial")) plotly::ggplotly(p, tooltip = "text")

-
- +
+