Highlight selected node, its links, and its children in a D3 force directed graph

The error is because you are selecting the data objects (d.source and d.target) rather than the DOM elements associated with those data objects. You’ve got the line highlighting working, but I would probably combine your code into a single iteration, like this: link.style(“opacity”, function(o) { return o.source === d || o.target === d ? 1 … Read more