Reputation: 513
Similar to this example:
I have a function that highlights the chords linked to the selected group and hides all unrelated chords:
function fade() {
return function(d, i) {
svg.selectAll("path.chord")
.filter(function(d) {
return d.source.index != i && d.target.index != i;
})
.style("visibility", "hidden");
};
}
I was trying to extend this so that it not only hides the chords, but also the text labels for groups that are not connected to the currently selected group.
Is it possible to combine these two operations into a single function that I pass to .on("mouseover",[function])
?
Upvotes: 1
Views: 3220
Reputation: 435
You can select with a logical OR like this:
svg.selectAll("path.chord, text.groupLabel")
see the documentation on selections for more details
Upvotes: 3