Skip to content

blog D3 brownian bridge

dchudz edited this page Feb 1, 2014 · 1 revision

http://www.youtube.com/watch?v=QUHn0r_j5cE

In reality, the robots started in their pattern and then moved randomly. Viewed backward, the robots are still moving randomly, but they're restricted to end up in the right place.

http://jsfiddle.net/dchudz/9hXzX/8/

I don't have a general function that avoids repetition, but the link shows how to get the current attribute from the element (so you don't need it available in the data).

Maybe clean it up so I'm not putting the circle parametrization directly in the bridge call.

In addition to blog post, I should add this to the d3 examples page.

Creating a general function like "attrBrownianBridge" instead of "attrTween"/"attr".

I've basically given up on this part (should ask someone for help at some point, I guess):

I'd like to create a function "transition.attrBrownianBridge(attr, endvalue)"

Can use this as a starting point:

https://github.com/mbostock/d3/blob/master/src/transition/attr.js

Maybe remove stuff from that to learn what's needed for my purposes, and then just switch the "interpolate" function out for mine.

Ack, there's a bunch of functions this uses that aren't accessible from outside the codebase. I could probably do this if I dorked d3, but I don't want that.