Skip to content

webgl not supported #4989

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

Closed
danielfrunza opened this issue Jul 8, 2020 · 5 comments
Closed

webgl not supported #4989

danielfrunza opened this issue Jul 8, 2020 · 5 comments

Comments

@danielfrunza
Copy link

danielfrunza commented Jul 8, 2020

WARN: webgl setup failed possibly due to enabling preserveDrawingBuffer config. The device may not be supported by is-mobile module! Inverting preserveDrawingBuffer option in second attempt to create webgl scene.

The above message is displayed despite that my browser supports WebGL as here

The environment:
Angular: 9.0.7
PlotlyJS: 1.54.5
Chrome: Version 83.0.4103.116 (Official Build) (64-bit)

Steps to reproduce:

  1. create an angular 9 project
  2. npm install plotly.js
  3. add plotly.min.js in scripts in angular.json:
    "scripts": [ "node_modules/plotly.js/dist/plotly.min.js" ]
  4. create an angular component and add a 3D surface plot from docs
  5. ng serve --prod

When using the --prod from angular compiler, I think that the already minified plotly.min.js gets bundled and minified in a wrong way. If the angular app is served or build without the '--prod' option everything works as expected.

PS: The last version of Plotly that is still working with --prod flag is 1.41.3

SS without --prod
plotly2

SS with --prod
plotly1
plotly3

@archmoj
Copy link
Contributor

archmoj commented Jul 8, 2020

@danielfrunza Which browser & OS are you using?

It may be related to gl-vis/gl-plot3d#11 of v1.42.0.

To investigate, you could use dist/plotly.js and add

console.log({
  opts: opts.glOptions, 
  glplot: scene.glplot
});

here:

// invert preserveDrawingBuffer setup which could be resulted from is-mobile not detecting the right device

@danielfrunza
Copy link
Author

@danielfrunza Which browser & OS are you using?

Chrome: Version 83.0.4103.116 (Official Build) (64-bit)
Windows 10

@archmoj
Copy link
Contributor

archmoj commented Jul 8, 2020

@danielfrunza Which browser & OS are you using?

Chrome: Version 83.0.4103.116 (Official Build) (64-bit)
Windows 10

@danielfrunza and this demo works?

@danielfrunza
Copy link
Author

if I replace:
angular.json:
"scripts": [ "node_modules/plotly.js/dist/plotly.min.js" ]

with:
angular.json:
"scripts": [ "node_modules/plotly.js/dist/plotly.js" ]

It works fine! Thanks for advice

@archmoj
Copy link
Contributor

archmoj commented Jul 8, 2020

if I replace:
angular.json:
"scripts": [ "node_modules/plotly.js/dist/plotly.min.js" ]

with:
angular.json:
"scripts": [ "node_modules/plotly.js/dist/plotly.js" ]

It works fine! Thanks for advice

@danielfrunza wanna close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants