These are really awesome - a very big well done to the author.<p>Only this morning I was thinking of how to implement a few of these types of interactions for a web app I'm developing - I actually might adapt some of the source code for my uses (assuming that's allowed under the License?).<p>If you're still working on a syntax for this, maybe you'll want to have a look at uilang or uiscript (both on Github) or Grid Style Sheets (<a href="http://gridstylesheets.org/" rel="nofollow">http://gridstylesheets.org/</a>).
Neat! I love how the demos are inline with the exposition and code, and it's striking how little code is necessary to make things go.<p>That said, this paragraph struck me as a great illustration of why I tend to prefer procedural layout systems to declarative ones, at least in production code:<p><i>Also note that there's slip! If you drag from the middle of the box, you'll see that the part of the image you grabbed slips out from under your finger. That's because the manipulator is just operating on the box's y coordinate. If we wanted to avoid slip then we'd have to create a new variable when the finger goes down, relate it to y (that is, fingery = box.y - 123 times scale, based on the current scale and finger start position) and then manipulate fingery instead of box.y. This isn't very hard, but the current manipulator code doesn't support it.</i><p>There will always be some situation the layout system's designer didn't predict. With procedural layout, you can write the procedure yourself. With declarative or constraint-based layout, you're stuck, since there's no way to express your special case in the limited language provided. Declarative systems are great for demos or rough prototypes, but when you want full control, there's no substitute for the power of procedural code, IMO.
This post is super cool and deserves more love. Physics constraints are super flexible. I've thought about using them for some pathfinding type work but have never tried. This is an even more far removed use. Very clever! I love it.
Awesome! This is incredibly cool. Thank you for putting it together. I cant wait to take a closer look at the code!<p>I've been meaning to get my head around cassowary for a while now. I think your project is the motivation I need to get to it :)