Currently, I am utilizing d3.js for a project and encountering an issue with rotating an SVG element 360 degrees to achieve a full spin back to its original position.
If I rotate the element 3/4 of the way using the following code snippet, it works effectively:
thing
.transition()
.attr('transform', 'rotate(270,640,426)')
.duration(6000);
However, when attempting to animate the complete rotation by specifying 360 degrees like this, nothing happens:
thing
.transition()
.attr('transform', 'rotate(360,640,426)')
.duration(6000);
I suspect that d3 (or possibly a general characteristic of the SVG transform attribute) recognizes the end position as identical to the beginning and therefore takes a shortcut by not executing any rotation. Likewise, if I try a 365-degree rotation, it only shifts by +5 degrees.
A. Why does this occur? B. What is the correct approach to accomplish a full 360-degree rotation?