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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -