auchenberg / dependo

Visualize your CommonJS or AMD module dependencies in a force directed graph report.
MIT License
484 stars 50 forks source link

Highlight both incoming and outgoing links when hovering over a node #2

Open jdiamond opened 11 years ago

jdiamond commented 11 years ago

I think it would be useful if dependo could highlight both incoming and outgoing links when hovering over a node. Right now it only highlights the outgoing links.

Maybe holding down different modifier keys (alt, ctrl) while hovering could hide one or the other sets.

auchenberg commented 11 years ago

Good idea. I actually had all the nodes highlighted to begin with, but has limited to only take direct children, after feedback some others.

How about adding some controls, so you can toggle how it should work?

jdiamond commented 11 years ago

Yeah, I'd be happy with controls or even just a variable that I can set in the JavaScript console. =)

I tried making some changes in the JavaScript embedded in my report but only got it to half work before opening this issue.

I changed this:

    // Build linked index
    data.links.forEach(function(d) {
      linkedByIndex[d.source.index + "," + d.target.index] = 1;
    });

to this:

    // Build linked index
    data.links.forEach(function(d) {
      linkedByIndex[d.source + "," + d.target] = 1;
    });

That fixed it so that the incoming nodes aren't dimmed. I couldn't figure out how to not dim the links.

npradeep commented 11 years ago

Hi ,

I have implemented in one of my page but this is not highlighted even out going links also. I found the issue, with the name having special characters and spaces. So if any name with special characters and spaces it never highlighted the outgoing links. Can anyone help on this issue.

christianacca commented 11 years ago

+100 for being able to add controls to be able to see incoming and/or outgoing dependencies :-)