Skip to content

Misc perf improvements #1772

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

Merged
merged 14 commits into from
Jun 11, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion test/jasmine/tests/cartesian_interact_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,10 @@ describe('axis zoom/pan and main plot zoom', function() {
}

function doDblClick(subplot, directions) {
return function() { return doubleClick(getDragger(subplot, directions)); };
return function() {
gd._mouseDownTime = 0; // ensure independence from any previous clicks
return doubleClick(getDragger(subplot, directions));
};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Man, this one was brutal - the key was that (locally, in chrome, when running multiple tests) it was seeing a previous click (from the same test, despite the fact that it still cared whether another test had been run before this one) too close to the first click of the doubleclick, and ended up responding as if there were two doubleclicks - which I still don't quite understand, I didn't think a triple-click would look like two doubles, but anyway this works and we can use this in the future (similar to your trick with gd._lastHoverTime @etpinard ) to cut down on unnecessary delays in the test suite.

For future reference @etpinard since we talked about potentially doing this, I went off on a dead end for a while when I noticed that calling Plotly.purge(gd) during destroyGraphDiv caused all sorts of problems... That turns out to be unrelated, that sometimes there are some things still waiting to happen on the plot after tests have finished (like rehover) which will fail (and confusingly attribute the failure to the next test that's run, since it's happening async) if we've purged the plot of attributes like emit but they still complete without failure if all we've done is remove the gd from the DOM.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for writing down the details.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

🎉 nice work

}

function checkRanges(newRanges, msg) {
Expand Down