graphmod icon indicating copy to clipboard operation
graphmod copied to clipboard

How do I make resulting output sharper?

Open Martinsos opened this issue 2 years ago • 1 comments

Hi, thanks for this great library!

I am building the module graph with following command:

graphmod --quiet --prune-edges $PROJECT_ROOT/src/**/*.hs | dot -Gsize=20,20! -Tpng -o module-graph.png

The PNG I get as a result is looking good, with two problems however:

  1. Node names are pretty small, so zooming in is required.
  2. Resolution is not high enough to be able to read the node names clearly even after zooming in.

Therefore, I would love to:

  1. Increase the font size of nodes.
  2. Increase the resolution of the image itself.

I tried increasing dot -Gsize= to 40,40 and that helps with resolution, but I have no idea how to increase the font size. Any help is welcome!

I also tried doing dot -Nfontsize=20, but that had no effect.

Martinsos avatar Apr 13 '22 11:04 Martinsos

What I learned since asking this question is following:

  1. I probably just need to figure out how to make dot show the graph as I want, so this probably has nothing to do with graphmod itself.
  2. I can use -Gsize=N,N to increase resolution, I can use -Nfontsize=N to increase node label font size. There are different layouts dot can use, however fontsize doesn't seem to work for me if I use it with dot layout, which is the only layout that gives good results for this use case. So I am kind of stuck there. I managed to get fontsize working for other layouts, but for dot layout, it gets ignored if it is bigger than ~12. I can put it to smaller, that makes it smaller, but anything beyond ~12 seems to be capped to 12 or something close to 12. I tried also doing -Nfixedsize=false but that didn't help.

I realize now this has nothing to do with graphmod, so feel free to close the issue -> I will still leave it open a bit, in case you can help me easily. Also, I am guessing some other people who don't know graphviz might also encounter this issue, so it might be useful for them to have this issue exist.

Martinsos avatar Apr 13 '22 12:04 Martinsos