私は非常に簡単な問題を抱えていますが、解決策を見つけることができませんでした。クラスが割り当てられた円のグループを作成しました。mouseOver では、マウスが置かれている円と同じクラスのすべての円のプロパティを変更したいと考えています。
これは私のコードです
svg.selectAll(".filas")
.data(new Array(18))
.enter().append("g")
.attr("class","filas")
.attr("transform", function (d,i) { return "translate(400," + ((20*i)+20) + ")";})
.selectAll("circle")
.data(function () {
return new Array(4);
})
.enter().append("circle")
.attr("cy", 0)
.attr("cx", function (d,i) {return -1 * (i+4) * 30;})
.attr("r", 10);
//set classes to circles
svg.selectAll("circle")
.data(data)
.attr("class", function(d) {
return (d) ? "fp_" + d : null;
})
.on("mouseover", mouseover)
;
function mouseover(clase) {
svg.selectAll(".fp_K")
.transition()
.duration(500)
.style("opacity", .2);
円ごとに .on("mouseover", mouseover) を追加しましたが、関数の書き方がわかりません。これまでのところ、関数 mouseover で選択されているクラスのプロパティのみを変更できました。
前もって感謝します。
ここにコード全体があります