-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix issue 359 (zoom overlay drawn beneath shapes) #448
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
Conversation
.then(done); | ||
}); | ||
|
||
it('should be appended to the the shape layer', function() { |
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.
you mean: to the zoom layer ?
Visual confirmation (mock): |
expect(d3.selectAll('.zoomlayer > .zoombox-corners').size()) | ||
.toEqual(0); | ||
expect(d3.selectAll('.zoomlayer > .select-outline').size()) | ||
.toEqual(2); |
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.
maybe add an assertion after doubleClick
making sure that the select-outline
are cleared.
@n-riesco I made a few minor comments, but this PR looks great. 🍻 to our new shape expert. |
Skimming through the numbers made me think this was a case of a comparison with too many digits. I set the precision to This PR is not ready. I need to investigate further the reason for this random failures. |
e2fa52f
to
04ef33e
Compare
|
This PR is ready again for review/merging. |
@@ -180,7 +180,9 @@ describe('Test click interactions:', function() { | |||
|
|||
describe('drag interactions', function() { | |||
beforeEach(function(done) { | |||
Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(done); | |||
Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() { | |||
setTimeout(done, 200); |
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.
I think #445 solves the same problem?
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.
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.
I couldn't adapt the solution to Firefox, because I couldn't find a flag similar to Chrome's --window-size
.
Using @monfera 's trick I got to enable webgl in my VM's chromium, like this:
user@host:~/github/plotly.js$ git diff
diff --git a/test/jasmine/karma.conf.js b/test/jasmine/karma.conf.js
index 5905271..52e1ce4 100644
--- a/test/jasmine/karma.conf.js
+++ b/test/jasmine/karma.conf.js
@@ -69,7 +69,15 @@ func.defaultConfig = {
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
- browsers: ['Chrome'],
+ browsers: ['Chrome_WindowSized'],
+
+ // custom browser options
+ customLaunchers: {
+ Chrome_WindowSized: {
+ base: 'Chrome',
+ flags: ['--window-size=1035,617', '--enable-webgl', '--ignore-gpu-blacklist'] // values came from observing default size; all test cases pass with it
+ }
+ },
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
I ran the tests using Chromium and the drag-interaction tests work, but one of the gl tests failed (the one that used to fail with Firefox). See:
user@host:~/github/plotly.js$ npm run test-jasmine
> [email protected] test-jasmine /home/user/github/plotly.js
> karma start test/jasmine/karma.conf.js
20 04 2016 16:17:53.134:INFO [framework.browserify]: registering rebuild (autoWatch=true)
20 04 2016 16:18:02.923:INFO [framework.browserify]: 9104144 bytes written (8.99 seconds)
20 04 2016 16:18:02.988:INFO [framework.browserify]: bundle built
20 04 2016 16:18:03.009:WARN [karma]: No captured browser, open http://localhost:9876/
20 04 2016 16:18:03.028:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
20 04 2016 16:18:03.034:INFO [launcher]: Starting browser Chrome
20 04 2016 16:18:05.306:INFO [Chromium 49.0.2623 (Ubuntu 0.0.0)]: Connected on socket /#f3LcZeKt1FWNckeOAAAA with id 18105360
Chromium 49.0.2623 (Ubuntu 0.0.0) Test gl plot interactions gl3d plots scatter3d click events should have FAILED
TypeError: Cannot convert undefined or null to object
at Object.<anonymous> (/tmp/b519d49625b3b7b09b7d4b9b755aee99.browserify:104577:31 <- tests/gl_plot_interact_test.js:141:0)
LOG: 'lost context'
LOG: 'lost context'
LOG: 'lost context'
LOG: 'lost context'
LOG: 'restyle fail', undefined, '', undefined
LOG: 'relayout fail', undefined, false
LOG: 'type newtype already registered'
LOG: 'Oops, tried to put a polar trace on an incompatible graph of cartesian data. Ignoring this dataset.', Object{type: 'newtype', r: 'this is polar'}
Chromium 49.0.2623 (Ubuntu 0.0.0): Executed 773 of 773 (1 FAILED) (1 min 8.793 secs / 1 min 8.043 secs)
Shall I drop 04ef33e from this PR?
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.
Shall I drop 04ef33e from this PR?
Yes please.
Those additional flags from Chrome would make a great addition, but they should be part of a different PR.
Looks great! |
cbee319
to
85c9948
Compare
Fixes plotly#359
* Test whether select elements are appended to the zoom layer. * Test whether lasso elements are appended to the zoom layer.
* Ensured the zoombox corners have been removed before emitting 'plotly_deselect' or 'plotly_selected'.
* Test that a double click removes a selection.
85c9948
to
a360992
Compare
* The drag interaction tests in click_test.js may fail when run by `npm run test-jasmine` while they succeed if run by `npm run test-jasmine -- tests/click_test.js`. * These failures disappear when a pause of 200ms is introduced in the `beforeEach` after creating the plot. * Shorter pauses of 0, 10, 20, 50 and 100 ms fail.
This reverts commit 9032cb7.
* In the drag interactions tests, make sure the notifier doesn't hide the drag elements.
This PR is ready again for review/merging. |
var tooltip = document.querySelector('.notifier-note'); | ||
if(tooltip) tooltip.style.display = 'None'; | ||
|
||
done(); |
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.
Beautiful. Thanks for figuring this out 🍻
@n-riesco Great PR. Thanks! |
- broken since #448 - 🔒 down with test
This PR comes from #395 . I couldn't rebase it, and I ended up cherry-picking the commits.
I followed @alexcjohnson 's advice and created a zoom layer between the info and the hover layers.
The PR is ready for review.