d3.js - Rotating around axis in d3js -
i'm trying create rotation controller rotate rectangle around center point in d3js. i've managed scrape using several resources, when try rotate around center point rectangle 'fly' away.
here's jsfiddle showing rotation:
self.attr('transform', 'translate(' + curx + ', ' + cury + ') rotate(' + newrotation + ')' );
https://jsfiddle.net/skoq1eww/1/, , here's 1 showing fly away when trying rotate around rectangle's center point:
self.attr('transform', 'translate(' + curx + ', ' + cury + ') rotate(' + newrotation + ', 50, 25)' );
https://jsfiddle.net/skoq1eww/3/.
i've found related stackoverflow posts relating rotating around axis , advise adding in origin coords rotation i've done above, reason can't seem work. i've been racking brain on few hours , i'm stuck. please point me in right direction?
thanks in advance.
wiki
Comments
Post a Comment