Open bluprince13 opened 5 years ago
I just had to install plotly.
npm install plotly.js
Shouldn't it be installed automatically if it is a dependancy?
I saw this same behavior. If you have plotly declared as a dependency in package.json, it is worth noting that "plotly" and "plotly.js" are different things. You want "plotly.js". I got hasty letting my IDE auto-complete package names for me, and got the wrong one.
I have the same problem and have found that I can only get it to work with "plotly.js" and not the (in my understanding) recommended plotly.js-dist. Are there real compatibility issues or is the update outstanding. This is an issue for me since for plotly.js npm throws 8 audit warnings.
I'm currently using this with plotly.js-dist. You can just use the factory.js
with your own plotly dist.
import plotComponentFactory from "react-plotly.js/factory";
import Plotly from "plotly.js-dist";
const PlotComponent = plotComponentFactory(Plotly);
export default PlotComponent;
CodeSandbox link: https://codesandbox.io/s/fancy-smoke-9jlm3?fontsize=14&hidenavigation=1&theme=dark
@oeph Works like a charm, thank you. It might be beneficial to mention/link this option in the installation section of the README. I admit, I should have seen it, but imo it does not hurt making it idiot proof :smiley:
I get the following error when I start my react app.