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

updateDimensions in PreviewController does not take into account node size #514

Closed
ripkrizbi opened this issue Jan 23, 2012 · 1 comment
Closed
Assignees
Labels
Preview Wishlist New features (not a bug)
Milestone

Comments

@ripkrizbi
Copy link

updateDimensions() in PreviewControllerImpl.java (Preview API) that is used to (re)calculate graph dimensions does so based on node centers, without considering node sizes, so the nodes on the border are cut off.

I would suggest adding a few lines to the loop over nodes: (PreviewControllerImpl.java line 192)

        for (Item nodeItem : nodeItems) {
            float x = (Float) nodeItem.getData("x");
            float y = (Float) nodeItem.getData("y");
            float s = (Float) nodeItem.getData("size");


            if (x-s < topLeftX) {
                topLeftX = x-s;
            }
            if (y-s < topLeftY) {
                topLeftY = y-s;
            }
            if (x+s > bottomRightX) {
                bottomRightX = x+s;
            }
            if (y+s > bottomRightY) {
                bottomRightY = y+s;
            }
        }

I can see that there is a "margin" property, but I can't find a way to set this property through the UI. One more issue is the correct calculation of graph boundaries when labels are rendered....

@ghost ghost assigned mbastian Jan 24, 2012
@mbastian
Copy link
Member

Thanks for your patch! I added the code. The size should be divided by two though to be exact.

The margin is only useful for exports so it is set from the export's settings (the settings button on the export dialog).

mbastian added a commit to mbastian/gephi that referenced this issue Jan 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Preview Wishlist New features (not a bug)
Projects
None yet
Development

No branches or pull requests

2 participants