Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upcoming scales 1.4.0 release #6172

Open
5 tasks
teunbrand opened this issue Oct 31, 2024 · 0 comments
Open
5 tasks

Upcoming scales 1.4.0 release #6172

teunbrand opened this issue Oct 31, 2024 · 0 comments
Labels
internals 🔎 wip work in progress

Comments

@teunbrand
Copy link
Collaborator

teunbrand commented Oct 31, 2024

The upcoming release of scales (r-lib/scales#474) prompts a few tasks on ggplot2's side.

  • Prepare for future incorporation of breaks_exp() into transform_exp() (Use snapshot expectations for transformation breaks #6171)
  • Remove shims like the following

    ggplot2/R/utilities.R

    Lines 792 to 808 in b29b831

    # Shim for scales/#424
    col_mix <- function(a, b, amount = 0.5) {
    input <- vec_recycle_common(a = a, b = b, amount = amount)
    a <- grDevices::col2rgb(input$a, TRUE)
    b <- grDevices::col2rgb(input$b, TRUE)
    new <- (a * (1 - input$amount) + b * input$amount)
    grDevices::rgb(
    new["red", ], new["green", ], new["blue", ],
    alpha = new["alpha", ], maxColorValue = 255
    )
    }
    on_load({
    if ("col_mix" %in% getNamespaceExports("scales")) {
    col_mix <- scales::col_mix
    }
    })
  • Tweak col_mix() calls to continue to produce the same hex codes, because the shim has a grDevices::rgb() backend while scales::col_mix() is based on {farver}, producing tiny differences.
  • Rework default colour/fill scales to accept new palette specifications (More palette flexibility #6112)
  • Ensure that default palettes can be retrieved from the theme (Scale palettes from theme #5946)
@teunbrand teunbrand added internals 🔎 wip work in progress labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internals 🔎 wip work in progress
Projects
None yet
Development

No branches or pull requests

1 participant