Hacker News new | ask | show | jobs
by bramstein 5864 days ago
You hit the nail on the head. The library is meant for applications that can not use CSS layout, because the algorithm they need is not possible in CSS, or because they are rendering to a context that does not have layout management such as Canvas or SVG. Think of projects like Mozilla Bespin (https://mozillalabs.com/bespin/) which uses Canvas for drawing its editor. Having standard layout algorithms available would be a great help there.

I was quite hesitant about making the jQuery plugin public because I was fearing reactions such as this. It was meant as a demo, and a nice way to test the layout managers. For a long time I had a message on the jQuery plugin page stating something along the lines of "please, please, consider using CSS before you use this plugin."

The nice thing about programming against a layout manager API is that you can easily write new algorithms while the (DOM) interface remains the same. It would be trivial to write a layout manager that does layout like Masonry. As another example, I'm currently working on a pack layout which can be used to pack small images into a larger one (e.g. CSS sprites,) and a layout manager that implements the CSS box layout module. I was also considering a text layout based on my TeX line breaking work (http://www.bramstein.com/projects/typeset/.)