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

enhanced 'dev.capabilities()' support #109

Closed
trevorld opened this issue Mar 21, 2022 · 3 comments
Closed

enhanced 'dev.capabilities()' support #109

trevorld opened this issue Mar 21, 2022 · 3 comments

Comments

@trevorld
Copy link

Currently {ragg} does not provide full information to the enhanced dev.capabilities() feature introduced in R 4.2:

ragg::agg_png(tempfile())
print(dev.capabilities())
dev.off()
$semiTransparency
[1] TRUE

$transparentBackground
[1] "fully"

$rasterImage
[1] NA

$capture
[1] FALSE

$locator
[1] FALSE

$events
character(0)

$patterns
[1] NA

$clippingPaths
[1] NA

$masks
[1] NA

$compositing
[1] FALSE

$transformations
[1] FALSE

$paths
[1] FALSE

Note unlike {svglite} this lack of support doesn't currently cause me any headaches since

device <- names(grDevices::dev.cur())
(device %in% c("agg_jpeg", "agg_ppm", "agg_png", "agg_tiff")) && 
        (packageVersion("ragg") >= '1.2.0')

should reliably tell me what I want to know but if every graphics device that added support for masking, gradients, etc. also supported the enhanced dev.capabilities() support it would be much easier for developers to properly guess whether the active graphic device has such support instead of using hacks like the above.

@thomasp85
Copy link
Member

Thanks for raising this - I was sure it was deduced automatically

@thomasp85
Copy link
Member

it appears the capabilities callback was added in the latest update. Will add this once I get around to add the latest features

@teunbrand
Copy link

Thanks Thomas for fixing this ^_^

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

No branches or pull requests

3 participants