-
-
Save Thinkscape/3554077 to your computer and use it in GitHub Desktop.
playing with joins and transitions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":600,"height":300,"hide":false},"endpoint":"tributary"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = [{"x": 100, "y": 110}, {"x": 200, "y": 201}]; | |
var data2 = [{"x": 150, "y": 150}, {"x": 210, "y": 202}]; | |
var svg = d3.select("svg"); | |
svg.selectAll("circle") | |
.data(data) | |
.enter().append("circle") | |
.attr("cx", function(d) { return d.x; }) | |
.attr("cy", function(d) { return d.y; }) | |
.transition() | |
.attr("r", function(d){ return 51;}); | |
setTimeout(function(){ | |
svg.selectAll("circle") | |
.data(data2) | |
.transition() | |
.attr("cx", function(d) { return d.x; }) | |
.attr("cy", function(d) { return d.y; }); | |
; | |
},1000) | |
// function(){ return 51;} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment