-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Consider exporting repel_boxes
#88
Comments
Cool! I think exporting the function might be a reasonable path forward. I guess the major benefit of not exporting is that I gain the freedom to completely rewrite it and hack on it without breaking dependencies. Alternatively, you might actually prefer to copy my code into your package. That gives you more freedom to make the function do exactly what you want. This also protects you from future changes that might happen in my function. I think that gives you a valuable benefit of additional freedom to change the code at the cost of duplicating code across two packages. Would you consider copying the code? What are your thoughts on the best approach here? |
Thanks for the fast response @slowkow! I can certainly copy the code if you would prefer that to exporting. It is always nice to be able to rewrite things. Thanks for letting me use the code! If I do copy it, I will let people know in the documentation that it came from Either way, a wrapper for |
Ok, sounds like it might be best to copy the code. Please copy and modify as you wish with some kind of attribution. It's not the most elegant code in the entire world, but it works. Good luck! I agree that
These two caveats make me think that As a separate pull request, I would be very happy to include some code to repel text labels in base R graphics. I think it might be easy to implement by coping the |
Sounds good, thanks! Thanks for the info! As far as I can tell, those caveats don't apply to me because I calculate the coordinates of the bounding box for each text label and use ggfittext to fill the box, but I can see how they might be an issue to others. Unfortunately, I don't have much base R plotting experience either, but I will keep it in mind. Thanks again! |
I wanted to thank you again for letting me use your code! It really improved the visualizations in my package. The updated version with your code is on CRAN now. I just made this figure and was thinking how much better it is because the labels don't overlap. So much better than before! Thanks again! |
Summary
Hi! Thanks for the great package!
I am developing a package that produces graphs using ggfittext and I wanted to add label overlap avoidance. Some labels should be repel, some others not, and the labels are all different sizes. I have been able to use your package successfully by calling the internal function
repel_boxes
, but this causes Notes on my R CMD Check that I would like to get rid of.https://github.com/grunwaldlab/metacoder/blob/2bb32d0a5a3a0b7e843dc19a3ebbf7c744367469/R/heat_tree.R#L867-L874
Suggestions
Would you consider exporting
repel_boxes
? I think it is generally useful for applying your algorithm outside of ggplot2 and others might find it useful.If you like, I can submit a pull request with the changes.
The text was updated successfully, but these errors were encountered: