Skip to content

Error in facet_graph with one dimension #313

Description

@eveyp

I'm getting an error everytime I try to use facet_graph() with only one dimension. These plots work fine with facet_grid() instead of facet_graph() so I'm not sure what the issue is.

Here's an example that leads to the error:

library(ggraph)
library(tidygraph)
library(tibble)

nodes = tibble(
  id = 1:10,
  type = c(rep("A", 3), rep("B", 1), rep("C", 6))
)

edges = tibble(
  from = c(1, 5, 6, 7, 9),
  to =   c(2, 7, 8, 9, 10)
)

tbl_graph(nodes, edges) %>% 
  ggraph(layout = "tree", flip.y = FALSE) +
  geom_node_point() +
  geom_edge_link() +
  facet_graph(type ~ ., row_type = "node", scales = "free_y", space = "free")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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