Guest User

Untitled

a guest
Dec 16th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. var data = [{"x": 100, "y": 110}, {"x": 200, "y": 201}];
  2. var data2 = [{"x": 150, "y": 150}, {"x": 210, "y": 202}];
  3. var svg = d3.select("svg");
  4.  
  5. svg.selectAll("circle")
  6. .data(data)
  7. .enter().append("circle")
  8. .attr("cx", function(d) { return d.x; })
  9. .attr("cy", function(d) { return d.y; })
  10. .transition()
  11. .attr("r", function(d){ return 51;});
  12.  
  13. setTimeout(function(){
  14. svg.selectAll("circle")
  15. .data(data2)
  16. .transition()
  17. .attr("cx", function(d) { return d.x; })
  18. .attr("cy", function(d) { return d.y; });
  19. ;
  20. },1000)
  21.  
  22.  
  23. // function(){ return 51;}
Add Comment
Please, Sign In to add comment