I was trying to use plotly graph library in Angular 6, the graph plotting is working fine but unable to identify how to use plotly JavaScript APIs using the angular component(https://github.com/plotly/angular-plotly.js/blob/master/README.md ).
So, I'm using following code in angular component to directly access plotly JavaScript APIs like deleteTrace, addTrace..
import * as Plotly from 'plotly.js';
But while accessing the Plotly object I'm getting this error:
index.js:6 Uncaught ReferenceError: global is not defined
at Object../node_modules/has-hover/index.js (index.js:6)
at __webpack_require__ (bootstrap:76)
at Object../node_modules/plotly.js/src/plot_api/plot_api.js (plot_api.js:15)
at __webpack_require__ (bootstrap:76)
at Object../node_modules/plotly.js/src/plot_api/index.js (index.js:11)
at __webpack_require__ (bootstrap:76)
at Object../node_modules/plotly.js/src/core.js (core.js:28)
at __webpack_require__ (bootstrap:76)
at Object../node_modules/plotly.js/lib/core.js (core.js:11)
at __webpack_require__ (bootstrap:76)