0
散布図の上にあるすべての点を強調表示しようとしています。これまでのところ、私はこの機能を持っていますが、ドットのすべてを強調表示しています(または、今は黒を表示しますが、それは何でも)。実際に同じIDを共有しているものだけを強調表示する必要があります。私はparentNode()を使用してdだけでなく、実際のポイントを取得し、ポイントの新しい配列を構築し、そのように強調表示できますか?たぶん私はずっと真っ直ぐな解決策を見逃しているように感じる。D3散布図特定のデータ条件に一致するすべての点を強調表示
dots.on('mouseover', function(d) {
let dotId = '';
let dot = d3.select(this)
.datum(function(x) {
dotId = x.playerId;
console.log(dotId);
return this.dataset; });
dots.each(function(d){
console.log(d.playerId);
if (d.playerId === dotId) {
dots.style('stroke', 'black');
}
});
});
dots.on('mouseout', function(d) {
//remove stuff
});
}