Created
July 25, 2012 00:59
-
-
Save ptvans/3173711 to your computer and use it in GitHub Desktop.
just another inlet to tributary
This file contains 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 b = svg.append("g") | |
.attr("transform", "translate(150,150)"); | |
b.append("circle") | |
.attr("r", 80) | |
.style("fill","#99cccc") | |
var dot = b.append("circle") | |
.attr("r",10) | |
.style("fill","#666666") | |
var text = b.append("text") | |
.attr("transform", "rotate(0)translate(0,100)") | |
.attr("dy", "-.3em") | |
.text("vroom"); | |
text.transition() | |
.duration(2000) | |
//.attr("transform", "rotate(360)translate(0,-100)"); | |
.attrTween("transform", function() { | |
var rotate0 = this.transform.baseVal.getItem(0).angle, | |
interpolate = d3.interpolateNumber(rotate0, 360); | |
return function(t) { | |
return "rotate(" + interpolate(t) + ")translate(0,-100)"; | |
}; | |
}); | |
dot | |
.attr("transform", "rotate(0)translate(0,110)") | |
.attr("dy", "-.3em") | |
.text("b"); | |
dot.transition() | |
.duration(2000) | |
.attrTween("transform", function() { | |
var rotate0 = this.transform.baseVal.getItem(0).angle, | |
interpolate = d3.interpolateNumber(rotate0, 360); | |
return function(t) { | |
return "rotate(" + interpolate(t) + ")translate(0,-100)"; | |
}; | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment