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
Suggestion for a vignette enhancement #112
Comments
It is not easy. I managed to get 90% there, e.g. at which point there was almost no code left from ggdag as I had to rewrite everything using API-side it looks like this: p = (
ggplot()
+ aes(x=x, y=y, xend=xend, yend=yend)
+ geom_dagitty_edge2()
+ geom_dagitty_node()
+ geom_node_label(nudge_y=-0.3)
+ theme_dagitty()
+ scale_y_continuous(expand = expansion(mult=0.25))
+ scale_x_continuous(expand = expansion(mult=0.25))
)
(
p %+% node_dagitty(dagitty::getExample('M-bias'))
+ p %+% node_dagitty(dagitty::getExample('mediator'))
+ p %+% node_dagitty(dagitty::getExample('Sebastiani'))
+ patchwork::plot_layout(design="AB\nCC", heights=c(1, 3), guides='collect')
+ patchwork::plot_annotation(tag_levels = 'a')
) |
Thanks and bravo! Is there a snippet I could look at to understand how you approached this? (No hurry at all, I' m on holidays for the next 10 days) |
Can you all tell me your goal in replicating the dagitty site output? Do you prefer the look? Are the legends and colors helpful to you in some capacity? I definitely don't intend on being able to do @krassowski did out of box with ggdag, but there may be core components here that would be useful to add |
I uploaded my code here for reference https://github.com/krassowski/ggdagitty. Some places where I needed to extend
Some related upstream issues are: |
All three of those items would be good (preferably separate) PRs to ggdag There's already an issue for the control point problem #21 |
Thanks again for this great package.
One use-case I think for this package is to reproduce and enhance the DAG display proposed by daggity.net, that is node and edges with the following semiology:
I tried and found it not trivial to reproduce with {ggdag}. I think it might be useful to show how to reproduce such visualization in a vignette. Maybe it's just me, but I thought it might be of interest to other newcomers.
The text was updated successfully, but these errors were encountered: