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

Simplify check_device() for {ragg}/{svglite} #5476

Merged
merged 4 commits into from
Oct 30, 2023

Conversation

teunbrand
Copy link
Collaborator

@teunbrand teunbrand commented Oct 11, 2023

This PR amends #5350 and fixes #5470.

Briefly, the latest versions of {ragg}/{svglite} now support the dev.capabilities() method of querying their capabilities.
Therefore, we don't need to manually encode into the check what we know about the packages.
Instead, the check for {ragg}/{svglite} asks the user to install these versions and then resumes as normal.

Showing that it works:

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2
packageVersion("ragg")
#> [1] '1.2.6'

ragg::agg_png()

check_device("patterns")
#> [1] TRUE
check_device("compositing")
#> Warning: The agg_png device does not support compositing.
#> [1] FALSE

invisible(dev.off())
packageVersion("svglite")
#> [1] '2.1.2'

svglite::svglite()

check_device("patterns")
#> [1] TRUE
check_device("compositing")
#> Warning: The devSVG device does not support compositing.
#> [1] FALSE

Created on 2023-10-11 with reprex v2.0.2

R/utilities-checks.R Outdated Show resolved Hide resolved
R/utilities-checks.R Outdated Show resolved Hide resolved
@thomasp85 thomasp85 added this to the ggplot2 3.5.0 milestone Oct 24, 2023
Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

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

LGTM

@teunbrand teunbrand merged commit 800268c into tidyverse:main Oct 30, 2023
12 checks passed
@teunbrand teunbrand deleted the check_device_amend branch October 30, 2023 08:55
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.

Simplify check_device()
3 participants