-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Throttle selectPoints #2040
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
Throttle selectPoints #2040
Changes from 1 commit
a6df912
aa434dd
753b2c9
256c5c7
80508e8
0861736
1968af7
6da3cfa
b6d64be
811073e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -208,21 +208,23 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) { | |
|
|
||
| dragOptions.doneFn = function(dragged, numclicks) { | ||
| corners.remove(); | ||
| throttle.clear(throttleID); | ||
|
|
||
| if(!dragged && numclicks === 2) { | ||
| // clear selection on doubleclick | ||
| outlines.remove(); | ||
| for(i = 0; i < searchTraces.length; i++) { | ||
| searchInfo = searchTraces[i]; | ||
| searchInfo.selectPoints(searchInfo, false); | ||
| } | ||
| throttle.done(throttleID).then(function() { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to wait for any throttling-delayed move event before we process the mouseup event, so we have the correct data. |
||
| throttle.clear(throttleID); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't think so. It doesn't come into play here, but you could imagine wanting to finish whatever event had been throttled when
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. Thanks! |
||
|
|
||
| gd.emit('plotly_deselect', null); | ||
| } | ||
| else { | ||
| dragOptions.gd.emit('plotly_selected', eventData); | ||
| } | ||
| if(!dragged && numclicks === 2) { | ||
| // clear selection on doubleclick | ||
| outlines.remove(); | ||
| for(i = 0; i < searchTraces.length; i++) { | ||
| searchInfo = searchTraces[i]; | ||
| searchInfo.selectPoints(searchInfo, false); | ||
| } | ||
|
|
||
| gd.emit('plotly_deselect', null); | ||
| } | ||
| else { | ||
| dragOptions.gd.emit('plotly_selected', eventData); | ||
| } | ||
| }); | ||
| }; | ||
| }; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So
callbackcan't itself be async - which is fine but deserves a mention in the docstring.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-> b6d64be