-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
V2 double click event #1153
Comments
Hi @aeviox, You are right, the double click events are missing, and it shouldn't be too hard to add. We will try to add that soon, probably at the same time we tackle issue #1142. Thanks for the report, I'll keep you updated here as soon as we have something. |
Worth nothing that the wheel events don't look like they are there either, but again correct me if I'm wrong. Thanks again! |
Indeed, I never thought of it, but it's easy to add and I can imagine this feature being useful sometime. |
Would love the doubleclick and wheel events aswell 😄 |
This commit implements the four new different events: - wheelNode - wheelStage - doubleClickNode - doubleClickStage
I just pushed a commit implementing the wheel and double-click events. However, there are two things to note:
This should be deployed within the upcoming v2.1.0 release. |
I just submitted a pull request that I believe fixes the first of your concerns, allowing wheel and doubleClick event handlers to prevent the default behavior defined in the MouseCaptor. The usage looks like this (where renderer is a reference to the Sigma renderer):
Another option could be to make the preventDefault() method available to the Node and Stage events by simply adding it as a property to the returned object here and bind it to the MouseCoords event. This would just have the benefit of avoiding the "event.event...". |
Hello,
I may be mistaken, but it doesn't appear that doubleClick events are available yet in V2. In the source it looks like the mouse captor handleDoubleClick() method does not emit any events, and no double click events exist for the sigma class itself, like 'doubleClickNode' or 'doubleClickStage'.
What I've ended up doing in my project to change the default double click behavior is just redefine the captor handler, like so:
sigma.getMouseCaptor().handleDoubleClick = function(event) { console.log("Double Click!") }
Is this the intended way to handle double click events, or will this emitted event be added at some point?
Thanks!
The text was updated successfully, but these errors were encountered: