I will explain the problem that I have in my real project. I consume a web service and this returns me n points x, y. I mimic a custom web service. I want to put a circle in these coordinates, and for each circle I want to draw a line that connects them. eg:

I would like to add a line between the circles, but showing the animation. eg:
http://bl.ocks.org/duopixel/4063326
for example, this animation, but point by point
When I launch my application, I want the line to have an animation from the start circle to the end. and if I add a new circle, I want to create a line and create an animation for the circle. How can i do this?
http://jsfiddle.net/2rv0o8da/
var svg = d3.select('svg');
var dataSet = [10, 20, 30, 40];
function display(data){
var circle = svg.selectAll('circle')
.data(data)
.enter()
.append('circle')
.attr({
r:function(d){ return d },
cx:function(d, i){ return i * 100 + 50 },
cy:50,
fill: 'red'
});
}
display(dataSet);
setTimeout(function(){
display([5]);
},2000)
source
share