Plotly.js requires gl in Electron contexts
See original GitHub issueWhen using plotly.js in an Electron app, it requires gl
. I’m guessing this is because Plotly.js determines that it’s running in a node context, even though there is a window
and a full browsing environment available. Installed gl
for now, figured I’d post an issue. I’ll link to the relevant PR on the nteract side shortly.
For those that stumble upon this issue, make sure to use:
const plotly = require('plotly.js/dist/plotly.js');
When requiring plotly. Everything will then work just fine in Electron land.
Issue Analytics
- State:
- Created 7 years ago
- Comments:25 (7 by maintainers)
Top Results From Across the Web
Issue in Electron built version - plotly.js
I'm using the plotly. js library to display charts in my application. While the library works fine when running either serve script, the...
Read more >glslify - npm
A node.js-style module system for GLSL! This module contains: glslify's command-line interface (CLI); glslify node/electron interface ...
Read more >npm - Snyk
@alancnet/fantasy-names · @alexamies/chinesedict-js · @alifd/next · @alpacahq/alpaca-trade-api · @amcharts/amcharts3-angular · @amcharts/amcharts4 ...
Read more >A curated list of awesome things related to Vue.js
Dockeron - A project built on Electron + Vue.js for Docker on desktop. ... vue-mapbox-gl - Vue 2.x component for Mapbox GL JS...
Read more >Clustering 4000 Stack Overflow tags with BigQuery k-means
Do we really need 4,000 one-hot encoded dimensions to obtain better ... parent-child, liquid, mapbox-gl-js, focus, angularjs-ng-repeat, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve updated the issue description to include the
require
into dist so people who end up at this issue see the way to handle it upfront.I got the
Uncaught Error: Cannot find module 'gl'
when trying theplotly.js
in Electron app.I installed version
1.18.1
vianpm install plotly.js
only
require('plotly.js/dist/plotly.js')
works