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

When nodes are dragged, labels stay on for that node #31

Open
nwlandry opened this issue Jul 24, 2019 · 6 comments
Open

When nodes are dragged, labels stay on for that node #31

nwlandry opened this issue Jul 24, 2019 · 6 comments
Labels

Comments

@nwlandry
Copy link

nwlandry commented Jul 24, 2019

Not sure if I am interacting with netwulf incorrectly, but after running the following code,

import networkx as nx
from netwulf import visualize

G = nx.barabasi_albert_graph(100,2)

visualize(G)

with "Display labels" off, when I drag a node in the visualization, the label stays on the node, even if I click it again. If I don't drag the node, then I can toggle the label on and off just fine. The only way to hide the label on that node again is to turn on the "Display labels" and then turn it off again.

Very minimal importance, but it was unexpected behavior, so I figured I would bring it up.

Great project!

@benmaier
Copy link
Owner

hi! yes, this annoys me as well. Thanks for bringing it up. We'll make sure to address this soon-ish!

@ulfaslak
Copy link
Collaborator

It because a drag event is unavoidably also a click event in d3. I tried fixing this a while back but dropped it because of more important issues. The easy fix is to just check if the node moved before a node gets a label, but I need to sit down and implement it in a good way. Traveling at the moment, but will see to this in a matter of weeks.

@benmaier
Copy link
Owner

maybe we could switch labels on and off by pressing 'L' when hovering?

@ulfaslak
Copy link
Collaborator

I see. You want to substitute a mouseclick for an 'L' click?

@benmaier
Copy link
Owner

I'll admit it's not very intuitive

@nwlandry
Copy link
Author

I understand why a drag event is also a click event, but my bigger question is, Why can't you toggle off the label if the node has been dragged, while you can if it's a simple click?

@benmaier benmaier added the js label Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants