4
我是d3.js的新手,不确定使用哪个d3功能。d3.js使用极坐标的绘图元素
我需要将一组元素放置在一个原点(圆圈)上。
svg.selectAll('circle').each(function() {
d3.select(this)
.attr('cx', r * Math.cos(theta))
.attr('cy', r * Math.sin(theta));
theta += thetaInc;
});
因此,不要像上面的代码那样做一些乏味的事情,那么做到这一点的d3简短方法是什么?