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

Bug with nodes hovering #1349

Closed
jacomyal opened this issue Mar 20, 2023 · 4 comments
Closed

Bug with nodes hovering #1349

jacomyal opened this issue Mar 20, 2023 · 4 comments

Comments

@jacomyal
Copy link
Owner

Sometimes sigma does not properly detect which node is under the mouse cursor.

issue-hover-sigma

Steps to reproduce

  • Open sigmajs.org/examples/events in Chrome or Firefox (I don't have a Retina screen display BTW)
  • Ensure the web page body size is 1920x953 pixels (there are surely other dimensions where it fails)
  • Slowly move the mouse cursor to the left of the Valjean node, from the left, until the cursor is under the letter n of the label of the node MlleGillenormand (as in the captureabove)

Expected behavior

The Valjean node should be displayed as hovered, and the events log should display Event "enterNode", node Valjean (id "11.0").

Actual behavior

The Valjean node is displayed as not hovered, and the events log shows nothing.

@jacomyal jacomyal added the bug label Mar 20, 2023
@jacomyal
Copy link
Owner Author

The reason behind this bug is that the node sizes are not properly indexed in the quadtree:

this.quadtree.add(node, data.x, 1 - data.y, data.size / this.width);

The data.size / this.width is not the size of the node in the same coordinates system as the positions. Also, the bug can be even worse when zooming out, because the nodes are relatively bigger.

@jacomyal
Copy link
Owner Author

jacomyal commented Oct 3, 2023

Once #1382 is dealt with, this issue will be solved.

@krkryger
Copy link

Any updates on this issue? Would be very much appreciated!

@jacomyal
Copy link
Owner Author

@krkryger This bug is solved in the v3 branch, so if you migrate to the 3.0.0-beta.5 version, it will not occur anymore.

I waited this new version to reply because, in the 3.0.0-beta.4, another bug with similar symptoms was occurring...

I use this occasion to close this ticket, since it is actually solved.

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