-
Notifications
You must be signed in to change notification settings - Fork 148
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
Graph bounding box can’t be calculated #95
Comments
Yes, it seems the text bounding box is being overestimated. But I don't believe this is being used to calculate the overall bounding box. This code was added by @iamahuman in 4b00a68 as part of PR #63. IIUC, this is used to speed up drawing (to skip drawing unnecessary elements), and an overestimation of the bounding box along the y-axis should merely mean slightly slower performance (text elements are drawn, even when they are above/below the visible area), not wrong graph bounding box. The overall graph bounding box is determined by xdot output of dot itself, and is not affected by these values. |
Lines 646 to 649 in a8715f6
and when the Graph is created by Lines 537 to 538 in a8715f6
Am I doing something wrong? My goal is to use Actually xdot is not ideal for this as it depends on GTK while I only need the parts that don’t. Would you be open to split it into two libraries? If yes, we should think about how the rendering works. I think it would make sense to e.g. have a For backwards compat the |
You're right. I wasn't able to figure out how to calculate the text height at that time, so I just went for the most conservative option. This was because the bounds were only added as a means to enhance rendering performance, and It was an attempt to prioritize correctness (or at least, not introducing regression) over speed. |
I suppose GraphViz itself fits in general for non-interactive use cases. |
My point was that the For its current use, You could try to fix it, so bounding is accurate, and never an approximatiom. No objectsion. Also note that xdot already includes the graph bounding box too: $ dot -T xdot tests/chars.dot
digraph G {
graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 53.74 342 53.74 342 0 ",
bb="0,0,342,53.74",
xdotversion=1.7
]; Note the
I don't oppose in principle. I think there was even a Qt port of it at some point. See #9 But as I explained in https://github.com/jrfonseca/xdot.py#status I barely have time to do anything . I spent a couple hours this morning looking at PRs for the first time in 4-5 months. In other words: if you want to submit a PR that addresses your needs, and doesn't gives me extra work, I'm for it. Anything that requires my involvement other than reviewing and accepting a PR is unlikely to happen, even if its a good idea. It's a pity nobody else stepped up to help maintain this. Maybe I did something wrong along the way. But the fact is that sooner or later my other life commitments will force me to completely halt this and other small pet OSS projects of mine completely. If the projects remain useful hopefully they will live as some fork. |
Your analysis is correct; any subgraphs containing text nodes will result in their own bounding boxes being overestimated as well. The rendering engine could therefore unnecessarily traverse the (otherwise invisible) graph; however, its child shapes are still tested according to their own bounding boxes, which means some performance benefit is kept. |
Three options that come to my mind:
|
there’s also https://adoptoposs.org and some other GitHub org I forgot …
yeah, doing releases and so on is also part of it so yeah, we should probably involve one of the maintainer orgs. |
@iamahuman , @flying-sheep , thanks for your suggestions for maintenance alternatives. I'll look into those. @flying-sheep, I think I answered your questions. Closing now. Feel free to comment if there's anything else. |
Since text bounding boxes always contain
y0 == -inf
, nodes and by extension the whole graph will always havemin(ya, -inf) == -inf
there. (same fory1
, which will always beinf
)xdot.py/xdot/ui/elements.py
Line 215 in 6f0a5cc
xdot.py/xdot/ui/elements.py
Line 92 in 6f0a5cc
So how is this expected to work …?
The text was updated successfully, but these errors were encountered: