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
allow using ggraph *without* attaching it #85
Comments
This is unfortunately outside the hands of ggraph. It all boils down to how ggplot2 itself handles guides and legends. Currently it is looking on the search path for functions of the right name so you'll need to import these from ggraph in order to get it to work... hopefully the guide system will get an overhaul and adopt the ggproto approach someday, but as I said this is ggplot2 stuff, not ggraph |
thanks so much for clarifying! Do you have any recommendation for how to go about this if I have an So for now, I just remind users to |
as per thomasp85/ggraph#85 it is actually impossible (for now) to render g without `library(ggraph)`.
This is fine:
However, when plotted without
ggraph
attached, the legend is missing and there are different colors.I am (wildly) guessing this has something to do with the black magic of the edge aesthetics that
ggraph
does.This is not a problem in a script use (where usually you'd have
library(ggraph)
), but it can be a little odd in in-package use:I'd rather not import the entire
ggraph
namespace, but without that, my examples onggraph
-derivative functions will not work properly (as in the above).The behavior also strikes me as a little unexpected because,
class(g)
is only"gg" "ggplot"
, which makes me think that justggplot::print.ggplot()
ought to do the trick.Is there any chance this could be changed?
The text was updated successfully, but these errors were encountered: