Fix ContentAlignment in rectpacking (Fix #989)
Dear ELK devs,
first of all it is a pleasure to be able to see all of the work that you and the various Kiel university students put into ELK's algorithm code base. Thank you very much for your work and to share it with the world. With this PR I try to solve a problem described in #989.
Unfortunately I wasn't able to solve the issue on all levels and for the vertical alignment enumeration. I'm lacking a professional Java development setup to be able to debug the algorithm up to my standards with Python. I picked up the gradlew workflow that you setup to compile ELK to elkjs such that I could use a locally developed version on my diagrams.
In trying to solve the ContentAlignment for the rectpacking algorithm I noticed that there are several similar types used across the algorithm phases. This hindered me to implement a recursive version of alignChildrenHorizontal since Java is a type safe language unlike Python. Even though I make heavy use of mypy there. In order to solve it recursively I'd advise to merge the BlockRow and RectRow classes and let a Block inherit from ElkNode. I was unable to understand when I was dealing with a RectRow, BlockRow or Block without debugging.
Here you can see the effect of the commit of this PR:
Before:
After:
It solves the horizontal alignment for first level children atleast. I'm open to work on this problem in collaboration here.
Cheers
Hi, I have currently little time to look at the changes but this seems to fail a test for the compaction step. I would like to take a look at this after the 0.9.0 release and add it to the 0.9.1 since I currently do not have the time to fix this myself (and there seem to be a lot of unrelated changes in your PR).