iamralpht / iamralpht.github.io

ralpht's web examples and demos
http://iamralpht.github.io/
Other
480 stars 54 forks source link

Update Cassowary Version #3

Open slightlyoff opened 9 years ago

slightlyoff commented 9 years ago

Hey,

This project is amazing! I made some changes to cassowary.js that make it ~2x faster in Chrome; updating should be straightforward.

Latest built version here: https://github.com/slightlyoff/cassowary.js/blob/master/bin/c.js

mcbain commented 8 years ago

There is also a fast alternative impl. https://github.com/nucleic/kiwi/tree/feature-js?files=1

iamralpht commented 8 years ago

Apologies for the slow reply. Map is a pretty big win for Cassowary :).

Oddly enough I've been thinking about using a simpler solver for Slalom -- I haven't encountered any situations where I have cycles in the constraints (I think the kind of positioning I'm doing ends up being much simpler than general purpose view layout) but I have run into a few situations where I wish I had non-linear relationships.

I'm planning on writing a simpler "spreadsheet" solver that just sorts a list of constraints into a DAG and then evaluates it. It would bail on any cycles, but I could then have non-linear functions and therefore express more UIs (hopefully I'd finally be able to do the Chrome Mobile tab switcher UI with multiple touch points, and do pan-rotate-scale too...).

The other alternative if that doesn't work out and I still really want non-linear relationships is constraint relaxation, but I'm scared off by the runtime cost currently :(.

mcbain commented 8 years ago

@iamralpht sounds pretty cool. Saw somewhere that you work for Tesla Inc now. Will this be also open source?!

mcbain commented 8 years ago

@iamralpht btw. Since Famous Inc. seems to be dead, the community seek currently for an alternative for javascript rendering engine. I mentioned your work there - http://forums.infamous.io., since simply draw boxes on the screen very fast is not enough to create a responsive user-interface :)

iamralpht commented 8 years ago

@mcbain Huh, I didn't realize famous had pivoted; hope it works out for them. My original plan was to make a UI design tool that ran on tablets and let you draw boxes quickly and express the (motion) constraints between them using your fingers rather than a lot of code. I figured Slalom was the part that didn't exist the most so that was what I worked on first. I did a few hours work on a tool to draw UI using gestures, here: https://github.com/iamralpht/drawgui It's obviously not useful yet though. Didn't get to hooking up motion constraints which is the fun UI engineering challenge :).

For Slalom to progress it needs to demonstrate building reusable components instead of one-off demos. It's not there yet, and the Box abstraction in particular is holding it back... Maybe it gets paired back to just the solver and motion constraints, and then can be integrated more easily with React.Animated or whatever other component system folks want to use.

erikkaplun commented 8 years ago

Has there been any news on any of this? It's really interesting.