Appreciate it! It was indeed not easy and required a ton of trial and error. I planned on writing a blog post to broadly explain the layout-generation algorithm (including some code). Unfortunately, I have not yet found the time for it. Hopefully soon.
For now, I am more than happy to give some tips that have majorly contributed to achieving these results. Let me know!