wilkelab / cowplot

cowplot: Streamlined Plot Theme and Plot Annotations for ggplot2
https://wilkelab.org/cowplot/
704 stars 84 forks source link

created draw_vector_image() #116

Closed julou closed 5 years ago

julou commented 5 years ago

I was bothered that nice vector cartoons had to be rasterised to be incorporated in figures… hence this additional function. I did my best to write it clean and robust. Happy to improve it if someone guides me!

julou commented 5 years ago

the first commit has more verbose code (also using unexported functions of grImport2) but somehow better hides irrelevant messages… the most recent one attempts to better use error handling but I can't get to hide one message of XML::xmlParse() I guess that the clean solution would be to update grImport2 to use a more modern xml package :-/

clauswilke commented 5 years ago

The regression tests are failing, and I don't think it's fixable. We cannot depend on packages not on CRAN, and we also cannot use unexported functions accessed via :::. These are standard CRAN rules.

julou commented 5 years ago

alright… thanks for your feedback. Note that the last 2 commits don't depend anymore on unexported functions. Regarding the dependence to grConvert which is not on CRAN, I did my best to "gracefully fail" if it's not installed. Is it enough to remove it from the DESCRIPTION's suggests section?

clauswilke commented 5 years ago

No that won't work. More generally, I'd rather not add dependencies to packages whose maintenance status is unclear.

I see at least three options for you:

  1. Write your own R package containing the draw_vector_image() function, and host it somewhere (e.g. on github).
  2. Work with the author of grConvert on a CRAN release.
  3. Fork grConvert and use it as the basis for a new package that provides the functionality you'd want to see.