私は D3 を初めて使用し、ケースで行き詰まっています。SVG に円を追加するボタンがあります。
d3.select("button#add").on("click", function()
{
svg.append('circle')
.attr('class', 'little')
.attr("cx", Math.random()*280+10)
.attr("cy",Math.random()*280+10)
.attr("r", 12);
});
その後、円をクリックしたときに色を変更したいと思います。何らかの理由で、コードはイベントを開始しません。
d3.selectAll(".little").on('click', function()
{
d3.select(this).style("fill", "red");
});