plotly / angular-plotly.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot set PlotlyViaCDNModule.setPlotlyBundle to null

tonylindsayqub opened this issue · comments

Problem Overview

I had difficulty setting plotlyJs up in my angular project. I tried using the PlotlyViaCDNModule import. This works, however I tries to set the optional parameter to null to access the full range of plots. This gave me the error:

Argument of type 'null' is not assignable to parameter of type 'PlotlyBundleName'.

I am currently using the basic bundle, however I know there are chart I will need later not included with the 'basic' set.

Steps Followed

Installed plotly in an Angular solution with below commands
npm install plotly.js-dist --save
npm install @types/plotly.js --save
Rename folder "plotly.js" to "plotly.js-dist" in "node_modules/@types".

Hello @tonylindsayqub. What do you set to null? The PlotlyViaCDNModule.setPlotlyBundle ?
I just saw that the error asks you to set it to null although the validation doesn't allow it. It's a bug 🐛

Will fix it soon!
Meanwhile, just comment out this line for now and you will get the plotly full

Yes, I tried to set PlotlyViaCDNModule.setPlotlyBundle to null. I think one of the specified package has all the plots I require. I'll try commenting it out if I get stuck.

Thanks for the response!

@tonylindsayqub please, update to 4.0.4 to get the fix 😸