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

geom_graph: Error in compute_layout(..., self = self) : object 'node_map' not found #377

Open
RiboRings opened this issue Oct 9, 2024 · 0 comments

Comments

@RiboRings
Copy link

Hi!

I am trying to group facets by edge variables both row-wise and column-wise. However, geom_graph seems to fail even when setting col_type = "edge". Of course I could use facet_edges instead, but ideally I would like to reproduce the layout of facet_wrap with the lateral panel titles, and not that of facet_grid. Below is an example of the error:

library(ggraph)
library(tidygraph)

# Create variable that should be represented by the column
highschool$group <- rbinom(nrow(highschool), 1, 0.5)

gr <- as_tbl_graph(highschool)

# Failing example with facet_graph
ggraph(gr) +
  geom_edge_link() +
  geom_node_point() +
  facet_graph(year ~ group, col_type = "edge")

#> Error in compute_layout(..., self = self) : object 'node_map' not found

# Working example with facet_edges
ggraph(gr) +
  geom_edge_link() +
  geom_node_point() +
  facet_edges(year ~ group)

Screenshot 2024-10-09 at 11 59 38

Thanks for the nice package!

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