ondrajz / go-callvis

Visualize call graph of a Go program using Graphviz
https://ofabry.github.io/go-callvis
MIT License
5.91k stars 408 forks source link

focus on multiple packages #28

Closed andy-miracl closed 5 years ago

andy-miracl commented 6 years ago

We have a library that is separated into many sub-packages in deeply nested folders in the repo. We would like to visualize this entire library, i.e. we would like to focus on all these sub-packages. How can we do this?

Thanks

Andy

andy-miracl commented 6 years ago

Looking at the code, our problem seems to stem from the fact that the -focus option defaults to main. I can circumvent this by explicitly setting -focus "", then using appropriate -limit to keep the size down.

ondrajz commented 6 years ago

I used empty focus by default to prevent huge outputs. What is needed is more filtering options to minimize this.

ondrajz commented 6 years ago

@andy-miracl Hey, I made a PR https://github.com/TrueFurby/go-callvis/pull/29 with some enhancements that might make it more useful for you.

The call graph output is now served via HTTP server in SVG format and you can click on packages to change focus.

The PR will need some more README changes before I merge it, but you can try it already, let me know if you find any issues.