-
Notifications
You must be signed in to change notification settings - Fork 33
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
Saving DAGs programatically #164
Comments
Note to self: dowhy, another causal package, now supports DAGitty syntax to generate causal graphs (see docs). I haven't looked under the hood yet, but their graphs are implemented a bit differently using the DOT graph format, not zEpid graphs are pleasingly aesthetic though :) Would be a nice feature to support DAGitty graphs in future. Not sure if I'm skilled enough to build this in, but would like to look into it over time |
Thanks for looking into this! As for compatibility with DAGitty, I think the format is like below. If that is provided as a string, I think it should be possible to parse? There are some items that aren't immediately clear to me in the format though. Like what does the positivity after
|
Cool find!: I just stumbled across the program Checkout the Mermaid Github IO Some advantages:
I will keep playing around and see how we could implement. See what you think! |
From the code above:
executing the line
Would there be a work-around for this? |
Yes! if I will fix my example above (where I don't clarify this!) |
Could it be related to how the positions are determined? The above code from me is assigning positions via If you were to take DAGitty's positions (like positions = {"A": [-2.200,-1.520], "B": [1.400,-1.460], ...} That should keep the same general look to the output as DAGitty. However, every node in the DAG would need to be assigned a 2D position in the dictionary (otherwise you will get an error). Let me know if that helps |
Thanks! Yes, I had supplied
So as you suggested, I supplied the dict of arrays to |
From a previous comment on DAGitty positions,
it seems the details after the path curves the arrow (something like curving bullets?). Not essential, but could be something of interest in future. |
Question. I've been building the plotting features in an external private repo, and wondering how to proceed with merging the functionality into What might be a reasonable way to proceed? I could tidy things up then add you to the external repo? Cheers |
Ahh! AFAIK there isn't an easy way to get curved arrows. However, this doesn't seem to be true anymore. But I don't know if that functionality can be used in an arrow-specific way (easily). Let's start with an external repo (and you can share with me). We can talk about merging or keeping separate. Thanks :) |
I had corresponded with @pzivich over email and am posting our communication here for the benefit of other users.
JD.
PZ.
Thanks Paul for the advice!
For longer term, it seems useful to build this or something similar into zEpid graphics to programatically save (complex) DAGs in Python for publication. Possibly using position values from DAGs generated in dagitty, which is handy to quickly graph and analyse complex DAGs. Just a thought.
Cheers
The text was updated successfully, but these errors were encountered: