
Here is the last example - I clicked on the transform attributes on the output so that the shapes fly left and up - to improve / clear the code - any help from anyone to make it more efficient?
** LAST CODE - http://jsfiddle.net/NYEaX/617/ **
var users = that.vis.selectAll("path")
.data(that.nodes);
users
.enter().append("path")
.attr("id", function(d){
return d.id;
})
.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; })
.attr("d", d3.svg.symbol()
.size(function(d) { return d.size; })
.type(function(d) { return d.type; }))
.style("fill", "steelblue")
.style("stroke", "white")
.style("stroke-width", "1.5px")
.call(that.force.drag);
users
.attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; })
.transition()
.duration(500);
users.exit()
.transition()
.duration(750)
.attr("transform", function(d) { return "translate(-100,100)"; })
.remove();
source
share