Hello Thomas,
ggraph
is wonderful – thank you and your team for putting it together! I have run into a bit of an issue with faceting by a node attribute. Sometimes it will work while others it will not, but I can't figure out where the difference is. There have been times where I have received errors, let everything just sit for a few minutes, and then rerun the same few lines resulting in a successful plot. Because of this, I am unable to provide an example of specific, reproducible code that results in the error. I have repeatedly received the two types of error messages shown below along with how I have tried to fix them.
Error message 1:
Error in gList(list(name = "background.1-19-23-1", gp = NULL, vp = NULL, :
only 'grobs' allowed in "gList"
I have no idea how to fix this, but if I remove the facet_nodes(~node_attribute)
line, everything runs smoothly.
Error message 2:
Error in Ops.factor(self$layout$PANEL, i) :
level sets of factors are different
For this, I have tried changing the attribute, which is numeric, to a factor facet_nodes(~factor(node_attribute))
but it doesn't fix the problem.
Error message 1 generally arises when my ggraph pipeline gets longer and more complicated. My only intuition about what could be the problem is that my igraph object has a bunch of node attributes (about 20) and I tend to run into this error with my more complex graphs. Still, with these larger objects, it still only breaks sometimes. I have a feeling that if I understood the inner workings of ggplot2
then I could resolve this, but I was hoping you had some insight.
Thank you and keep up the good work,
Josh Cook
I have switched the script to using the tidygraph
system (instead of a igraph
+ ggraph
, but the problem persists. I have also tried simplifying the ggraph
object by select
ing the node attributes I actually use in the plotting, but that didn't fix the issue, either.
This is probably due to changes in ggplot2 that has not been incorporated into graph yet. I don't have time to look into it right now (unfortunately), but it will surely be addressed with time
Can I get you to reply with wether you are still seeing these errors with the development version?
Sorry for the delay! I am trying to make a test system where I can cause the same errors I reported before using the CRAN version of 'ggraph'. I will keep you updated.
Update: I'm sorry, but I can't seem to get 'ggraph' to crash (a strange thing to apologize for...) when faceting by node. Go ahead and close this issue because this may mean it was something on my end that was fixed in an update to RStudio or MacOS.
Thanks for taking time to check in on this issue, though - I was excited to see your tweet announcing your return to dev on 'ggraph'!