The generators you're describing are exactly what I was envisioning and have 
been working with in the past. 

So I managed to get some code together. 
https://github.com/pleasetrythisathome/bardo Heavily based off the d3 code I 
used in react.animate. It's definitely still a work in progress but it works! 

transition [state target duration ease]

returns a channel that outputs values interpolated using IInterpolate protocol 
in ease.cljs

Integration with om would be easy, just merge the output a transition into 
app-state or local component state.

Path generators, color transitions, etc are all great ideas. You could just 
define a type for path, and implement IInterpolate (or implement IInterpolate 
on string as a multimethod to dispatch to color, path, etc interpolators.)

I like the idea of adding pause, resume etc. It'd be pretty straightforward to 
add a control channel that could dispatch on different action keywords to pause 
or resume. 

You get on end event for free when the channel is closed (take returns nil). 

As far as lists go, I'm thinking that there need to be definable (with default) 
enter and exit interpolators for list items. Basically it's implementing 
IInterpolate on nil and also for each type that doesn't implement ISeq, 
implementing a case where the second arg is nil. If this could be overridden at 
runtime, you could define list transitions with different nil behaviors. For 
example, sometimes you could immediately add the new item with value 0, and 
then transition normally, or maybe you want to add it half way through. Etc. 

Currently the implementation of IInterpolate don't check that the second args 
is of the same type, which it definitely should. There are probably only three 
meaningful cases. If the target is the same type, interpolate, if nil, try to 
dispatch an exit interpolator (maybe another protocol?), and if not the same 
type, fail in a meaningful way.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to