Skip to content

enhanced 'dev.capabilities()' support #152

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

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

enhanced 'dev.capabilities()' support #152

trevorld opened this issue Mar 21, 2022 · 0 comments

Comments

@trevorld
Copy link
Contributor

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

svglite::svglite(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

I'm finding it difficult to reliably guess whether the active graphics device is being provided by svglite::svglite() or instead by vdiffr::write_svg() since in either case names(dev.cur()) == "devSVG". In the first case I'd like {gridpattern} / {ggpattern} to default to using the new alpha mask / gradient support whereas in the later case I need to fall back on a slower, rasterized alternative.

However if {svglite} added support for the new dev.capabilities() then I could simply rely on isTRUE(dev.capabilities()$clippingPaths) to tell if the active graphics device is provided by svglite::svglite() instead of vdiffr::write_svg() (when R >= 4.2).

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

1 participant