ggdag icon indicating copy to clipboard operation
ggdag copied to clipboard

Arrows in DAG don't change length when you resize the nodes

Open ben-oneill opened this issue 4 years ago • 2 comments

In my own function 'plot.data.mappings' I construct a DAG plot using ggplot2 with the ggdag functions for adding nodes, edges, etc. I have found that if you construct the plot with the default sizes (node sizes, etc.) then the edges/arrows line up fairly nicely with the edges of the circles (sometimes slightly off, but close). However, if you change the size of your nodes then the length of the edges does not change to accommodate this, so you either get edges that don't reach the nodes (if you use smaller than usual nodes) or edges that pierce inside the nodes (if you use larger than usual nodes).

It would be lovely if you could somehow update ggdag::geom_dag_edges so that it automatically takes account of the size of the nodes in ggdag::geom_dag_point to ensure that the end of the arrow lines up nicely with the edge of the cirlce. Ideally, the user would be able to change the node size in ggdag::geom_dag_point and the edges would automatically adjust (lengthen or shrink) to give you a nice looking DAG plot.

ben-oneill avatar Jan 11 '21 23:01 ben-oneill

I would love this too, but I am waiting on updates in ggraph to automate this. I'll leave it open but for the time being this won't be addressed unless it gets abandoned in ggraph

malcolmbarrett avatar Jan 11 '21 23:01 malcolmbarrett

No problem --- so long as it is "on your radar". This issue can just be a reminder for later then.

ben-oneill avatar Jan 11 '21 23:01 ben-oneill