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

Feature request: svg support #15

Open
jplecavalier opened this issue Jan 26, 2021 · 4 comments
Open

Feature request: svg support #15

jplecavalier opened this issue Jan 26, 2021 · 4 comments

Comments

@jplecavalier
Copy link

Hi, thanks for the great job!

I'm wondering if it would be possible for you to add support for svg image within the internal read_image() function. For now, only png and jpeg are supported.

In the end, I'd like to be able to add svg logos as axis label in a ggplot using element_markdown() from ggtext. Let me know if you need a reprex, but I'm sure you get it without one.

Thanks again!

@clauswilke
Copy link
Collaborator

That's basically impossible given the current state of R graphics devices. If R graphics devices start supporting svg images then I can hand an image through.

@jplecavalier
Copy link
Author

I totally believe you since I have a very limited understanding of what's going on under the hood of graphic devices. I just want to point to this SO answer if this could help by any chance.

@clauswilke
Copy link
Collaborator

Yeah, I'm aware of grImport2. I feel it's too much of a compromise to be worth supporting. The moment people try to use it to import a real-world svg they've come across it'll not render correctly. I'd want to be able to at least pass svg's through to svg-aware graphics devices, such as svg. On the flip side, if your output device is a bitmap device, then pre-rendering the svg as a bitmap is fine also. So the subset of cases where you need vector graphics and are Ok with a very limited subset of the svg standard is rather small.

@clauswilke
Copy link
Collaborator

In any case, development on this code base is basically frozen, because there are many other features I'd like to support that can't be supported for various reasons.

The next iteration exists in a draft version, but it'll probably be 2-3 years before this is ready for prime time: https://clauswilke.com/sinab/

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

2 participants