plotly / react-pivottable

React-based drag'n'drop pivot table with Plotly.js charts
https://react-pivottable.js.org/
MIT License
1k stars 259 forks source link

Trouble with PlotlyComponent Using External plotly.js #30

Closed prenaut41 closed 6 years ago

prenaut41 commented 6 years ago

I'm using an external plotly.js version 1.15.0 with react-pivottable version 0.5.0.

The table views work fine, but I run into problems as soon as I try to create a chart.
I get an exception with an error message "Error while plotting: TypeError: Cannot read property 'selectAll' of undefined".

image

I get this error when plotComponentFactory() gets called. The PlotlyComponent.componentDidMount() function calls Plotly.newPlot and passes the container div element reference as a "div.js-plotly-plot" object. The error happens further down the line when plotly calls an "exports" function that expects this div object to have a ._fullLayout._infolayer.selectAll() function, but the ._infolayer property is missing from ._fullLayout.

Any ideas?

prenaut41 commented 6 years ago

Nevermind... I didn't realize how miserably out-of-date I was with the version of Plotly I have been using. When I tested with plotly version 1.37.1 it worked just fine. I should have checked that way, way earlier.