News for hackers. Stuff that matters.
Re:DAGitty – draw and analyze causal diagrams by 01100011 on Wednesday September 04, 2024 @11:43AM (#41447112)
I work on a graph-based library and regularly generate DAGs for analysis and debugging. I have been using graphviz/dot but it's just so damn frustrating. You have to jump through hoops to get the layout right. It would be nice if something as ubiquitous as graphviz had a dedicated rendering engine for DAGs which did moderately sane things like place root and tail nodes on the same rank without requiring me to figure out which nodes are and manually position them.
Re:DAGitty – draw and analyze causal diagrams by amelius on Wednesday September 04, 2024 @02:23PM (#41448850)
What do you mean by root and tail nodes?
Re:DAGitty – draw and analyze causal diagrams by 01100011 on Wednesday September 04, 2024 @07:56PM (#41452076)
Roots: Nodes with no dependencies.

Tails: Nodes with no dependents.

Re:DAGitty – draw and analyze causal diagrams by amelius on Thursday September 05, 2024 @05:13AM (#41454912)
Ok, maybe I am misunderstanding, but why would you want to have them at the same level?
Re:DAGitty – draw and analyze causal diagrams by dcuthbertson on Thursday September 05, 2024 @01:32PM (#41458771)
I'd guess the GGP meant all of the root nodes together on one level and all of the tail nodes together on another, but single level. At least that's what makes sense to me.
Re:DAGitty – draw and analyze causal diagrams by graphviz on Thursday September 05, 2024 @11:16PM (#41462571)
This seems like it could be done in a little script in the graphviz gvpr processor.

Someone could implement this as a feature in graphviz. It might take a day to implement.

There are probably other "solutions" that already handle this more gracefully, but otherwise don't have a very complete set of features relative to graphviz.

It's reasonable (and constructive) for you to complain, but your "issue" is representative of a wide set of "issues" we've seen, and the real problem is we're just a little unimportant niche service and all this work is being done by volunteers and they mainly work on the things they know how to do.

Re:DAGitty – draw and analyze causal diagrams by amelius on Friday September 06, 2024 @06:26AM (#41464744)
I was thinking perhaps they want them both aligned to one side of the drawing. So for example if the direction goes from left to right, then the start and end nodes might need to be at the top.
Re:DAGitty – draw and analyze causal diagrams by anileated on Thursday September 05, 2024 @03:48AM (#41454506)
https://github.com/vizdom-dev/vizdom/ seems like a nice library for rendering directed graphs into SVG, and apparently has automatic layout capabilities.
Re:DAGitty – draw and analyze causal diagrams by mkesper on Thursday September 05, 2024 @06:52AM (#41455392)
Please note that while Vizdom is freely available for use under the Apache License 2.0, the Rust WebAssembly binary included in this library is closed-source. You are free to use the library, but the source code for the Rust WebAssembly binary is not publicly available.
Re:DAGitty – draw and analyze causal diagrams by s0l0ist on Wednesday September 11, 2024 @12:33AM (#41508047)
Hey that's me! Thanks for mentioning it.

So far it has automatic layout that will position (and create a rendering) for hierarchical graphs - even if your data isn't hierarchical in nature. This is how the algorithm works internally as it is a reflection of Dagrejs.

I plan to support more layout types in the future.

As for placement of 'root' nodes (aka source and sink nodes) - in reference to the parent comment - my hope is to expose graph theory methods that you can run before layout/render which would help facilitate this automatically, but it's non-trivial to codify as it requires a substantial refactor to the layout algorithm(s).