Skip to content

Instantly share code, notes, and snippets.

@ptvans
Created July 25, 2012 00:59
Show Gist options
  • Save ptvans/3173711 to your computer and use it in GitHub Desktop.
Save ptvans/3173711 to your computer and use it in GitHub Desktop.
just another inlet to tributary
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