score:1

ok, this might be beyond me, but i think you somehow need to group your links into the same sorts of groups as your nodes. if you could somehow add the "group" attribute of the source node to the link, then when you click on the link something like this might work:

d3.selectall("line")function fade(){if 
(group = "selected", "opacity" = 1)
else
("opacity" = 0)
};

alternatively, if you can sort the links into groups before the data is loaded (in your php etc. script), then you could append 3 (or n) groups of lines with separate classes.

sorry, js isn't my strongsuit, hopefully someone more experienced will sort that out for us...


Related Query