thomasp85 / ggraph

Grammar of Graph Graphics
https://ggraph.data-imaginist.com
Other
1.08k stars 116 forks source link

Still missing edges when using native end_cap and start_cap #282

Closed jdfoote closed 10 months ago

jdfoote commented 3 years ago

It looks to me like #254 should be fixed, but I am updated to 2.0.4 and I'm still seeing the same behavior. Here's a MWE.

Is there something I'm missing?

set.seed(23)
G = as_tbl_graph(random.graph.game(8, .25, directed = T))
G %>%
  activate(nodes) %>%
  mutate(degree = centrality_degree(mode = 'in')) %>%
  ggraph() +
  geom_node_point(aes(size = degree), color = '#ceb888') +
  geom_edge_fan(aes(end_cap = circle(node2.degree,"native"),
                    start_cap = circle(node1.degree, "native")),
                arrow = arrow(length = unit(3, 'mm'))) 

image

thomasp85 commented 10 months ago

The issue is that you are using "native" units which goes from 0 to 1 across the range of the viewport. This means that all the cap areas are much larger than the viewport