JSFiddle - React, Tailwind, and code Playground
HTML
<div class="z" style="top:50px;left:50px;width:100px;height:100px;background-color:red"></div>
CSS
div{position: absolute;}
JavaScript
let deg=0;
const id=setInterval(draw, 10);
function draw() {
d3.select(".z").style("transform","rotate("+(deg++)+"deg)")
if(deg>360)clearInterval(id);
}