I'm having trouble when I try to correctly execute a rotation animation using the D3.js library. The problem has to do with the point at which I want to rotate the element about.
Here is a fiddle I made to show what I mean (in slow motion): http://jsfiddle.net/74mCb/
It seems like the source of the problem lies here:
.attr("transform", "rotate(-60, 150,130)");
And then I rotate it like so:
.attr("transform", "rotate(40 150,130)");
I would like the butt of the needle to stay in position (to be the center of rotation), could someone please explain what I am doing wrong?
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…