goda icon indicating copy to clipboard operation
goda copied to clipboard

graph: support for vertical direction

Open kravemir opened this issue 6 years ago • 1 comments

First, I would like to say, that this is a very useful project/tool, and I have been exactly for :+1:

goda graph github.com/loov/goda/...:root | dot -Tsvg -o graph.svg

Regarding the issue. I'm visualizing internal package dependencies of my wip/hobby project, and there are many levels. In combination with "longer" package names, the graph is quite very wide, aspect ratio of ~ 7:1.

Would it be possible, to add flag --direction vertical to set graph's direction to be vertical? Or, maybe --direction top-bottom or --direction to-bottom indicating also, that it goes from top to bottom, not just any "vertical".

kravemir avatar Oct 10 '19 15:10 kravemir

Honestly, I would like it to work as well. :D... currently the top-to-bottom rankdir is a mess mostly. It ends up much worse, that's why I didn't expose the dot option for it. I'll introduce it when it can reliably give decent output.

You can override the rankdir with:

goda graph github.com/loov/goda/...:root | sed s/rankdir=LR;/rankdir=TB;/ | sed s/tailport=e// | dot -Tsvg -o graph.svg

I'll add graphml support at some point https://github.com/loov/goda/issues/24, which would allow to open in yEd and do better layouting.

egonelbre avatar Oct 10 '19 17:10 egonelbre