Input on visual layout tool

Sounds related to the bin packing problem.

Maybe this JavaScript library would be helpful inspiration: