I am trying to import and use Plotly.js in my angular2-meteor project. I got it working by adding plotly.js in the public folder and adding a script tag like this:
Hi, I am facing the exact same issue (though I don’t think this is related to angular, only to Meteor). I am trying to import plotly into a file in the imports folder.
I tried import plotly from 'plotly.js' and many other combination, without success…
Thanks for the quick answer. However the proposed answer looks more like a hack (loading plotly.js from the CDN). I think the issue comes from the plotly npm package itself, that is meant for server only. But isn’t the Meteor import system meant to handle this situation ?
Hi, I still can’t get that to work. I tried to download the js file directly, but I can’t get that to work either… Is there a way to load manually libs ? Only answer I found is “build a Meteor package with your bare hands”…
It seems that the correct solution is import * from 'plotly.js' (it does work with other packages, such as crossover for instance), in addition to the typings file you suggested. However, there seems to be a weird bug with graceful-fs that makes the install impossible.
So, so far, CDN is the way. It is not such a terrible solution, since we still have good typings.