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

fixes padding issue of box algorithm #1087

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ private KVector placeBoxes(final List<ElkNode> sortedBoxes, final double minSpac
double stddev = areaStdDev(sortedBoxes, mean);

totalArea += (sortedBoxes.size() * 1 * stddev);
// add top and bottom padding to total area
totalArea += Math.sqrt(totalArea) * (padding.getBottom() + padding.getTop());
// add left and right padding
totalArea += Math.sqrt(totalArea) * (padding.getRight());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left padding is missing here. Does adding the padding here help with the underlying issue? I.e. is this something we want finished and merged or does it not really help?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking the padding into account does not fully solve the issue since the desired aspect ratio is a ratio, which cannot be influenced concrete values (the padding). Hence, it helps make it a little better but does not fully solve the problem.



// calculate the required row width w to achieve the desired aspect ratio,
// i.e.: w*h=area s.t. w/h=dar -> w=sqrt(area * dar)
Expand Down