I have a stacked area graph that animates when the data changes.
The data shows values for a given date range (e.g., Dec. 10-15). When I add expand my date range to include an earlier date (e.g., Dec. 9-15), the data array has additional data prepended to the front.
When the paths animate though, the effect is very weird and undesirable.
See this jsfiddle showing the effect (click the Update button): http://jsfiddle.net/qprn9ta9/
This seems to be because of the fact that I am adding new points to the front of the SVG area, and the interpolation is animating them around based on the index.
How can I avoid this? Is there something built into D3 that can help? I looked for some sort of key function like you use with data()
, but didn't find anything similar. Any other ideas?