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

Allow for discrete versions of gradients #131

Merged
merged 7 commits into from
Jun 2, 2021
Merged

Conversation

dlcomeaux
Copy link
Contributor

This is a relatively simple PR - it just adds the gradients to the list of allowed color palettes for the discrete scales. I also updated the documentation and vignettes accordingly. I could be missing something, so please let me know @gritzenthaler if there's some reason why this wouldn't work in practice.

One thing I was thinking about as additional work might be to find a way to "recenter" a diverging discrete palette around some non-mid-point using factors (I can see instances where this might come up in a mapping context, i.e., you have five bins above zero and two below - the current code would center it around the 4th factor, no matter the value). However, I couldn't see an easy way to do that, since the discrete scales don't seem to have a rescaling option easily available.

Open to other thoughts - I thought at the very least this adds the requested functionality and doesn't preclude a more sophisticated approach later on.

@dlcomeaux
Copy link
Contributor Author

Note - this passed check on my machine. It seems there is an issue with the pkgdown deployment to the test branch, I would suggest we re-run later in case it's a temporary glitch (unless @nmpeterson or @matthewstern have encountered this before / know what it might be a result of?). Here's the error:

  x Failed to parse Rd in abbr_years.Rd
ℹ there is no package called ‘textshaping’ 

Execution halted
Error: Process completed with exit code 1.

@matthewstern
Copy link
Contributor

FWIW, rerunning the previously-successful pkgdown action on the most recent commit to the version1.2 branch (ebdbb66) creates a similar error situation and fails. Comparing the GHA log for a successful vs unsuccessful run shows entirely different response to the "install dependencies" code. I am hoping these failures have something to with a package update elsewhere, and this will resolve itself automatically in a few days.

Mainly doing this to start a new check
@nmpeterson
Copy link
Contributor

@dlcomeaux FYI, you can re-run a failed check without a new commit. Just go to the Actions tab, open the failed action you want to re-run, then click "Re-run jobs"

@nmpeterson
Copy link
Contributor

nmpeterson commented May 12, 2021

Also, regarding the current error with the textshaping package, just keep an eye on its CRAN page. Once the macOS release binary version (currently 0.3.3) matches the version listed at the top (0.3.4), the action should work. The way the pkgdown action is configured, it tries to install the latest version of every dependency, but if the binaries haven't been updated then they can't be installed.

Interestingly, the same issue does not occur for the R-CMD-check action.

Just for internal references
@dlcomeaux
Copy link
Contributor Author

@nmpeterson the binaries have been updated, and everything seems to be in order again.

Copy link
Contributor

@matthewstern matthewstern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am OK with this changes but would like @gritzenthaler to confirm before merging.

@gritzenthaler
Copy link
Contributor

I've been rather inactive on this project lately but getting to this now! I'll review it by the end of the day.

Copy link
Contributor

@gritzenthaler gritzenthaler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks great, thanks Daniel!

@gritzenthaler gritzenthaler merged commit 0c3353b into version1.2 Jun 2, 2021
@gritzenthaler gritzenthaler deleted the discrete_colors branch June 2, 2021 17:40
@nmpeterson nmpeterson mentioned this pull request Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unable to use cmapplot continuous color palettes for fill aesthetic discrete option for continuous palettes
4 participants