-
Notifications
You must be signed in to change notification settings - Fork 114
Closed
Description
I can only create this problem when using layout = "tree" and start_cap = label_rect(). Any other start/end cap geoms work fine and any other layout works fine too. But when both conditions are met, extra edges are drawn from a (random?) subset of nodes to the bottom left corner (-1,0) of the plot.
library(igraph)
library(ggraph)
#small data
simple <- make_graph('bull')
V(simple)$name <- c('Thomas', 'Bob', 'Hadley', 'Winston', 'Baptiste')
E(simple)$type <- sample(c('friend', 'foe'), 5, TRUE)
# bad graph with the phantom extra edges
ggraph(simple, layout = 'tree') +
geom_edge_link(aes(start_cap = label_rect(node1.name),
end_cap = label_rect(node2.name)),
arrow = arrow(length = unit(4, 'mm'))) +
geom_node_text(aes(label = name))
rexdouglass
