xdot.py
xdot.py copied to clipboard
Prints only part of the graph into PDF file - with offset
By default it should paint a properly centered whole graph onto one page.
Version: py38-xdot-1.2 Python-3.8 OS: FreeBSD 13
Can you please give some more detail on how you got to this output, so one can reproduce it?
This DOT is clipped slightly when printed:
graph {
rankdir=LR;
a -- { b c d }; b -- { c e }; c -- { e f }; d -- { f g }; e -- h;
f -- { h i j g }; g -- k; h -- { o l }; i -- { l m j }; j -- { m n k };
k -- { n r }; l -- { o m }; m -- { o p n }; n -- { q r };
o -- { s p }; p -- { s t q }; q -- { t r }; r -- t; s -- z; t -- z;
{ rank=same; b, c, d }
{ rank=same; e, f, g }
{ rank=same; h, i, j, k }
{ rank=same; l, m, n }
{ rank=same; o, p, q, r }
{ rank=same; s, t }
}
IMO, for large graphs xdot should offer the user to choose how many pages to split it into in X/Y directions. But it should never just clip graphs.
OK, you used "print to file". Yes, I can confirm this looks really bad, and for me it also clips the graph the other way around.
In case you want to use another export feature, I added one in #96. However the pdf export will not stick to a paper page format.
I press the Print button and then save as PDF.
It sounds like https://github.com/jrfonseca/xdot.py/pull/96 might go some way to address this.
That said, I feel we're wandering outside the remit of xdot.py
. I accepted printing because it was "easy". If it turns out it's not that easy, then I rather not burdern xdot.py
with printing. xdot.py
was meant for visualization. If folks want to convert dot to something else, they should just use Graphviz tools directly. xdot.py
is not meant to be an UI for Graphviz tools. Just an interactive visualizer.
Alternatively you can just fix the pdf writer to center the drawing properly in the page.