Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom action on click #31

Open
computermacgyver opened this issue Aug 9, 2013 · 5 comments
Open

Allow custom action on click #31

computermacgyver opened this issue Aug 9, 2013 · 5 comments

Comments

@computermacgyver
Copy link
Member

From #28,
"make it so that nodes outside a single node's clicked network remain faded but still visible even when a node is clicked on in order to view the data linked to that node."

Allow on click action to be set:

  • Hide non-connected nodes, edges from all connected nodes are visible (default)
  • Hide non-connected nodes, dim edges not directly connected to clicked node (New option: Dim edges not directly connected to a clicked node #48)
  • Dim non-connected nodes, edges from all connected nodes are not dimmed
  • Dim non-connected nodes and edges that are not directly connected to clicked node
  • Show panel only (all nodes/edges remain visible and not dimmed)
@novastra
Copy link

novastra commented Sep 3, 2014

Hi,
First of all thank you very much for this awesome work. I use it very often.
I would like to have some help with this issue :
Let's say A is link to C and to B which is linked to C

When I click on A, only those nodes are displayed,
How can I hide the connections between B and C in this case?

I see that hover on A when Dim parameter is set does that, I would like this behavior for click on node.
Can you tell me which line of main.js should be added?

Thank you very much,

@computermacgyver
Copy link
Member Author

Hi PrinceN,

This probably should be opened as a separate issue, because if I understand correctly you actually want to do the opposite of what this issue proposes. That is, if you have a graph with A-->B, A-->C, and B-->C, and the user clicks on A, you would like nodes A,B,and C to be shown, but only edges A-->B and A-->C to show and for edge B-->C not to show.

If I've understood correctly, you'll want to basically copy the code for the 'dim' hover attribute (possibly modifying it to actually hide using the 'hidden' attribute rather than dim using the color attributes) and adapt it and replace the code in the node select function

@novastra
Copy link

novastra commented Sep 4, 2014

Hello,

Thank you for answering so quickly! This is what I would like to do (dim the edges, not hide), I tried many modifications including your suggestions this morning but I am not very talented in JS I must admit.
I have difficulties in modifying 'sigInst.iterEdges(function (b)' from the code of 'fontion (e)' for the 'dim hover'.
I tried to change the attributes to make them work together but this where I lack the knowledge to do this.
Could you please help me once more with this?

Thank you,

@novastra
Copy link

Can you explain me how can I modify this part of the code to add a condition that would achieve this goal? I tried many modifications but if I understand correctly sigInst.neighbords includes both direct and indirect edges from activeNode (a).

if (a == b.source || a == b.target) sigInst.neighbors[a == b.target ? b.source : b.target] = n;

@computermacgyver
Copy link
Member Author

Continuing this conversation in a new issue specifically on this feature request

"New option: Dim edges not directly connected to a clicked node" #48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants