[英]Difference between .on and addEventListener with react and plot.ly
[英]Import Plot.ly React Component into Meteor
在按照说明在Meteor中使用Plotly的React组件的说明时,
import createPlotlyComponent from 'react-plotlyjs';
import Plotly from 'plotly.js/dist/plotly-cartesian';
const PlotlyComponent = createPlotlyComponent(Plotly);
给出错误
Uncaught Error: Cannot find module 'plotly.js/dist/plotly-cartesian'
我们如何安装/加载plotly-cartesian
? react-plotlyjs
NPM软件包已经安装。
的package.json
{
"name": "chart-test",
"private": true,
"scripts": {
"start": "meteor run"
},
"dependencies": {
"babel-runtime": "^6.23.0",
"meteor-node-stubs": "~0.2.0",
"meteor-rxjs": "^0.4.7",
"pondjs": "^0.8.4",
"react": "^15.4.2",
"react-addons-pure-render-mixin": "^15.4.2",
"react-dom": "^15.4.2",
"react-plotlyjs": "^0.4.0",
"react-router": "^3.0.2",
"rxjs": "^5.2.0"
}
}
您可能会错过
"plotly.js": "^1.26.1",
对于我而言,plotly的解决方法是导入'plotly.js/dist/plotly'
而不是笛卡尔版本。
这个问题可能与以下建议一致: https : //github.com/benjeffery/react-plotlyjs/issues/15
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.