score:3

Accepted answer

There are actually a couple of things happening here - as you pointed out, the data outside of your new data range is not being removed, but also, new data that is outside of the existing data range is not being added. This all has to do with what selection you are modifying in your code - your update function should be using the enter() and exit() selections to handle these - see Thinking with Joins.

Here is an updated fiddle: http://jsfiddle.net/LPtTm/11/


Related Query