graphmod
graphmod copied to clipboard
Size attribute in resulting dot file causes output to be clipped
The resulting size attribute in the .dot
file produces seems to cause dot
to clip the graph. For instance, graphmod
will output something like:
digraph G {
size="6,4";
...
And after running a dot
with this file I see only a part of the diagram. Removing the size
attribute fixes this problem.
Two questions:
- How is this size attribute determined.
- Is there a way to prevent
graphmod
from adding a size attribute?
Thanks!
As a workaround setting -d
to 0 seems to help.
Hi, 6,4
is the default size, and you can use -d
to specify other dimensions if you'd like. Is there something we should fix? I forget the details, but I vaguely recall that adding this attribute improved the layout of the graphs in many cases.
Thanks for the quick reply :pray:
In my case using 6,4
~~messes up~~ causes dot
to severely clip all the diagrams I tried (using different repos). I wonder if it is possible to omit the size
attribute by default, since the more ad-hoc 6,4
can be added via a command line argument.
That's odd, I've never seen that happen... I don't think dot
is supposed to clip anything, but rather scale the picture (http://graphviz.org/doc/info/attrs.html#d:size). Could you point me to a repo that shows the problem, so I can try to figure out something to do---I am a bit weary of removing the default outright, as without it graphs tend to get very wide, which leads to a lot of edges corssing.
Sure, see for example this repo. You can try with the alonzo
directory for instance.
So if I run:
▶ find alonzo -name "*.hs" | xargs graphmod -q -p > test.dot
▶ dot test.dot -Tsvg -o test.svg
I get this svg as output:
It might help to report here the dot
version I'm using:
▶ dot -V
dot - graphviz version 2.43.0 (0)
Weird, I use the same version, and I can reproduce this, but only when dot
generates svg
. It looks fine with pdf
, png
, or when using xdot
pythong script (which is very handy btw). I wonder if that's a bug or a feature...
Hehe, no idea. But feel free to close this issue if keeping the ad-hoc size attribute makes sense to you. Hopefully people would find this issue if they run into the same problem. Alternatively we could add a note in the README or in the documentation.
I ran into this too, glad to see the fix is so easy.
Graphmod is amazing by the way!