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

Strange layout of components #93

Closed
asl opened this issue Jul 15, 2022 · 5 comments · Fixed by #97
Closed

Strange layout of components #93

asl opened this issue Jul 15, 2022 · 5 comments · Fixed by #97
Labels
Milestone

Comments

@asl
Copy link
Owner

asl commented Jul 15, 2022

Hmm ok. Well this has for some reason put every component in one row, which doesn't seem very space efficient
image

Compare this to the original packing method:
image

Originally posted by @rlorigro in #91 (comment)

@asl asl added the ui label Jul 15, 2022
@asl asl added this to the 2022.07 milestone Jul 15, 2022
@asl
Copy link
Owner Author

asl commented Jul 17, 2022

Ok, apparently the shiny new TileToRowCCPacker from OGDF was doing some strange things in some cases. So, I went ahead and ported old "embedded" packer which seems to work better and has some useful features.

I'm having the following packing of components which look reasonable to me given the aspect ratio

Screenshot 2022-07-17 at 23 58 39

asl added a commit that referenced this issue Jul 17, 2022
@rlorigro
Copy link

That looks reasonable to me as well. The old version used to sort them by size, which was nice in some ways, but I don't have a strong preference.

@asl asl mentioned this issue Jul 17, 2022
@asl
Copy link
Owner Author

asl commented Jul 17, 2022

That looks reasonable to me as well. The old version used to sort them by size, which was nice in some ways, but I don't have a strong preference.

This is the old version :) Note that the layout depends on aspect ratio. Essentially it tries to organize components in row-column fashion trying to preserve the aspect ratio. The algorithm is greedy: it tries to place the new component in any empty spot in every "row". And if there is no space – new row is added. As a result, if we're having one large (and wide) component, then everything got organized by size with the default square aspect ratio.

For the record, here is the layout with square scene (upper one was more rectangular):
Screenshot 2022-07-18 at 00 23 49

@rlorigro
Copy link

Oh ok interesting. I didn't expect aspect ratio to make all the difference. I assumed the threading is what reordered things. Thanks

@asl
Copy link
Owner Author

asl commented Jul 17, 2022

Oh, no. The components are always processed being sorted by height (and first optionally rotated to be more "horizontal"). So, yes, sometimes small components could fit into spare spot

@asl asl closed this as completed in #97 Jul 17, 2022
asl added a commit that referenced this issue Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants