-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Plotly.js requires gl in Electron contexts #891
Comments
Related support for Plotly in nteract: nteract/nteract#662 Possibly related gl error: |
Requiring plotly.js as Is there an
The only reason that happens is because of our |
Sadly, no. I'll try the dist path, sounds like an awesome option. |
@rgbkrk how do you tell that gl isn't working inside electron? I my Julia package (PlotlyJS.jl) that uses Electron as a display window I am able to make a EDIT: I see -- just saw your edit :) |
@spencerlyon2 the Our |
Ok great, that dist bundle works perfect for displaying the plot above. |
@etpinard thanks for the explanation. I must be getting around it without knowing because I'm running plotly.js 0.16.2 inside electron without any problems -- oh well, don't fix it if is isn't broken! |
I'll have something nice for you soon @spencerlyon2 that you can use to send the plotly JSON spec over to this same component in nteract: nteract/nteract#662 |
That's great. I really need to take a closer look at nteract. I've been very happy with the combination of Electron + plotly.js for my Julia package -- it let's me to some really cool streaming things. |
@rgbkrk @spencerlyon2 Ok if I close this issue? |
Yep, good for me
|
My second comment in this thread is fixed, not the core bit. We're still stuck with a native dependency on |
... in a node.js context that is: which we don't support (at least until jsdom/jsdom#1368 is done - as plotly.js makes use of |
I may end up creating a separate package specifically for electron uses that cuts a version based on plotly.js, though I'd rather not manage that and let it get out of sync. |
Yeah good point about the maintenance burden. We might end up publishing another package specifically from node contexts ( |
Yup, browser only is fine for me (browserifiable/webpackable that is). |
Ok we just tried to switch our build setup to not have any compilers, etc. available and the fact that |
What if |
I'd vote 👎 on that, plotly.js is a browser-only app at the moment (and for the foreseeable future). I don't see why we should add a dev dependency to make sure that |
I think something is lost in translation here. I want a browser only app too and |
Welp, I'm a jerk. It was a peer dependency of a downstream dependency that has been resolved since upgrading. No Sorry to waste your time @etpinard, thank you for the lovely JS. |
I got the I installed version only |
please read #891 (comment) |
I've updated the issue description to include the |
Since our overall bundled electron app was rather big (especially for Hydrogen), @lgeiger made minimal-plotly with only the |
When 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 awindow
and a full browsing environment available. Installedgl
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:
When requiring plotly. Everything will then work just fine in Electron land.
The text was updated successfully, but these errors were encountered: