Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prints only part of the graph into PDF file - with offset #97

Open
yurivict opened this issue Oct 12, 2021 · 8 comments
Open

Prints only part of the graph into PDF file - with offset #97

yurivict opened this issue Oct 12, 2021 · 8 comments
Labels

Comments

@yurivict
Copy link

yurivict commented Oct 12, 2021

image

By default it should paint a properly centered whole graph onto one page.

Version: py38-xdot-1.2
Python-3.8
OS: FreeBSD 13

@Mome
Copy link
Contributor

Mome commented Oct 25, 2021

Can you please give some more detail on how you got to this output, so one can reproduce it?

@yurivict
Copy link
Author

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 }
}                                                                                                                                                                                           

image

@yurivict
Copy link
Author

crazy.gv.txt example prints like this:

image

@yurivict
Copy link
Author

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.

@Mome
Copy link
Contributor

Mome commented Oct 26, 2021

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.

@yurivict
Copy link
Author

I press the Print button and then save as PDF.

@jrfonseca
Copy link
Owner

jrfonseca commented Nov 27, 2021

It sounds like #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.

@jrfonseca jrfonseca added the bug label Nov 27, 2021
@yurivict
Copy link
Author

Alternatively you can just fix the pdf writer to center the drawing properly in the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants