Skip to content
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

Merged
merged 6 commits into from
Jun 6, 2018

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Jun 5, 2018

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

etpinard added 3 commits June 5, 2018 15:24
- 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.
@etpinard etpinard added bug something broken status: reviewable labels Jun 5, 2018
@etpinard etpinard added this to the v1.39.0 milestone Jun 5, 2018
checkNoWebGLMsg(false);
})
.catch(failTest)
.then(done);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this gives:

peek 2018-06-05 17-26

Copy link
Contributor Author

Choose a reason for hiding this comment

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

new stylez

peek 2018-06-06 15-10

@etpinard etpinard changed the title Make all gl traces show "no webgl message" and gracefully Make all gl traces show "no webgl message" and fail gracefully Jun 5, 2018
scene.error2d = false;
scene.line2d = false;
scene.scatter2d = false;
scene.fill2d = false;
Copy link
Collaborator

@alexcjohnson alexcjohnson Jun 5, 2018

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;
  }
}

Copy link
Contributor Author

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

@nicolaskruchten
Copy link
Contributor

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 👍

@alexcjohnson
Copy link
Collaborator

Nicely done! 💃

@etpinard etpinard merged commit b88abdb into master Jun 6, 2018
@etpinard etpinard deleted the fix-no-webgl-msg branch June 6, 2018 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plotly.react() in non-WebGL contexts
3 participants