crossfilter | animate through date range

88 views Asked by At

I've built a d3 world (heat)map. Each country has a fill colour corresponding to a value.

I want to improve the map by using crossfilter to allow users to see historic as well as current data. So far so good. But as well as all the funky features of crossfilter, I want the user to be able to press 'play' and see how the shading of countries changes over time.

Has anyone done this or do you know of native support for this that i'm missing? I can't find anything on it via google.

thanks

Emma

1

There are 1 answers

0
Ethan Jewett On

I haven't done exactly this, but the basic idea would be that after the user presses "play", you would want to programmatically change the filter on your Crossfilter date dimension over time and re-render your charts after each change. You'll probably want to use requestAnimationFrame (https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame) to do this.