-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Make all gl traces show "no webgl message" and fail gracefully #2697
Conversation
- by making sure it scene creation returns early when WebGL context creation fails.
- gl2d was broken (fixed here) - all regl-based trace types (scattergl, scatterpolargl, splom and parcoords) were missing.
checkNoWebGLMsg(false); | ||
}) | ||
.catch(failTest) | ||
.then(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.
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.
src/traces/scattergl/index.js
Outdated
scene.error2d = false; | ||
scene.line2d = false; | ||
scene.scatter2d = false; | ||
scene.fill2d = false; |
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.
what happens if we add some other component to support a new feature, would we also have to add it here? Will the tests below fail and force that, or would we need to add a new test for the new feature? Just wondering if there's some way we can preempt these concerns like
if(!success) {
for(var key in scene) {
if(something about key or scene[key]) scene[key] = false;
}
}
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.
all DRY'ed up in eb594d1
Nice! with reference to the gif above, I would say that the error message should have an opaque background (white?) and a border (grey?) so it stands out a bit on top of the axes. Other than that 👍 |
Nicely done! 💃 |
fixes #2665 (the fail gracefully part) and #2666 (the missing message part).
Most importantly, I found a pretty solid way to test no-webgl environments. Adding a
--disable-webgl
flag to the Chrome CLI in our Karma config did the trick.@alexcjohnson @nicolaskruchten