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

Creating a package on top of ggsvg #11

Open
jimjam-slam opened this issue Dec 11, 2022 · 0 comments
Open

Creating a package on top of ggsvg #11

jimjam-slam opened this issue Dec 11, 2022 · 0 comments

Comments

@jimjam-slam
Copy link

Hi Mike,

I'm maintaining ggflags, and I'm starting to hit a dead end with the SVG backend it uses (grImport2), which requires that I heavily pre-process my source images (flags).

I'm considering doing a 1.0 release with a different backend (which would make things like shifting our , and I'm evaluating ggsvg as a potential candidate.

If I were to build ggflags on top of ggsvg, I imagine the idea of it would be a geom_flag that:

  1. Take a two-letter country code as the flag aesthetic,
  2. Maps it to an included flag SVG file,
  3. Passes the content of that file to geom_point_svg with the country aesthetic.

I'm not super sure how that transformation from flag to country works, though. If aesthetics are directly applied to a layer, then geom_flag has access to the data and the mapping at the time the plot of defined, but if the flags are the only layer and aesthetics are defined globally, it doesn't.

I think I was hoping I could shortcut fully rewriting a ggplot2 extension package and avoid diving back into ggproto by just cheekily calling geom_point_svg directly, but this might not be the right approach. What do you think?

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