D3.js v5 version, force steering graph to get relevant edges

how do I click on a point to mark the color of the valid edges connected to that point?

clipboard.png

May.22,2021

is implemented according to the event binding of d3,

.on('mouseenter', function(d){
   // 
   links.style('stroke-width', function(edge){
     if( edge.source === d || edge.target === d ){
        return '2px';
     }
   }).style('stroke', function(edge){
     if( edge.source === d || edge.target === d ){
        return '-sharp666';
     }
   });
Menu