Skip to content

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

@RiboRings

Description

@RiboRings

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions