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

Make it easier to specify edge capping relative to scaled size of node points #202

Open
thomasp85 opened this issue Aug 24, 2019 · 3 comments

Comments

@thomasp85
Copy link
Owner

No idea how to achieve this but would be nice

@schochastics
Copy link
Contributor

If anyone is looking for a workaround, here is what I do. Not sure if it is the best way, but it works.

library(igraph)
library(ggraph)

g <- make_graph(c(1,2,2,3))
V(g)$size <- c(1,5,15)
E(g)$esize <- V(g)$size[get.edgelist(g)[,2]]+2

ggraph(g,x=c(0,1,2),y=c(0,0,0))+
  geom_edge_link(end_cap=circle(rep(E(g)$esize,3),"points"),
                  arrow=arrow(angle = 10, length = unit(0.25, "inches"),ends = "last", type = "closed"),n=2)+
  geom_node_point(size=V(g)$size,shape=21,stroke=1,colour="red")+
  scale_x_continuous(limits=c(-1,3))+
  theme_graph()+
  theme(legend.position = "none")

@thomasp85
Copy link
Owner Author

Yeah, that's the thing... I thing that is the only way to do it consistently now, but it circumvent scaling completely and sort of hacks how you style points (plus the code is quite cumbersome)...

As I said I don't have any solution, but I would really like one

@malcolmbarrett
Copy link
Contributor

Going to bump this issue since you're working on ggraph and this feature would be particularly beneficial for ggdag :)

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

3 participants