javascript - D3.js: Stop transitions being interrupted? -
i'm working d3.js. i've got transitions working nicely, have 1 problem: if second transition starts before first 1 ends, this jsfiddle demonstrating problem: http://jsfiddle.net/kqxhj/11/ it works fine of time - cdg , lax appended , removed data changes - if click button twice in rapid succession, you'll notice new elements don't appear. this meat of code: function update(data) { var g = vis.selectall("g.airport").data(data, function(d) { return d.name; }); var genter = g.enter().append("g") .attr("class", function(d) { return "airport " + d.name; }); // perform various updates , transitions... [...] // remove exited elements. g.exit().transition() .duration(1000) .attr("transform", "translate(0," + 1.5*h + ")"); g.exit().transition().delay(1000) .remove(); } d3.select('#clickme').on("click", function() { update(curr...