-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Preview outputs margin automatic fitting #572
Comments
I observe that currently the margin is assign with a fixed value. This should be automatically determined so as to adapt to the graph size. In my opinion, we can assign the margin according to bounding box of the graph, for example 10 percent of the width of the bounding box. |
Yes, I've observed that as well. I used a slightly different approach suggested by wumalbert. If the user provides a margin that sufficiently contains the graph, the graph is exported as is. If the provided margin trims the graph, the approach will progressively increase the margin till it is completely contained. Apart from fitting the nodes, edges are fit. The solution works if we have the rendered image in the form of a linearized pixels array. Unfortunately, I couldnt find anything equivalent to this structure in the case of PDF and SVG. Hence, I was not able to apply it in those cases. I've uploaded the code at vijeshm@628c995. Could anyone please verify the code and let me know if I could send a pull request? |
Can you make a pull request directly so that I'll assign a reviewer? |
Sure. I'll do it right away. |
Related to issue #239 |
Compute the preview canvas size from the rendered elements, fixing #572
Automatic fitting is fixed except for labels, cf. #1218. |
Following https://forum.gephi.org/viewtopic.php?t=1762&p=5996#p5996
Output in PDF/PNG/SVG should fit automatically, at least for the nodes.
The text was updated successfully, but these errors were encountered: