4 ms·
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
by 01100011 2y ago
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.
- amelius 2y agoWhat do you mean by root and tail nodes?
- 01100011 2y agoRoots: Nodes with no dependencies. Tails: Nodes with no dependents.
- amelius 2y agoOk, maybe I am misunderstanding, but why would you want to have them at the same level?
- dcuthbertson 2y agoI'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.
- amelius 2y agoI 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.
- graphviz 2y agoThis 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.
- anileated 2y agohttps://github.com/vizdom-dev/vizdom/ https://github.com/vizdom-dev/vizdom/ seems like a nice library for rendering directed graphs into SVG, and apparently has automatic layout capabilities.
- mkesper 2y agoPlease 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.
- s0l0ist 2y agoHey 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).