cytoscape.js不稳定分支的使用方法

How to use the unstable branch of cytoscape.js

我想使用 'line-gradient-stop-colors' 和 ''line-gradient-stop-positions' 来根据一些数据向我的图形边缘添加一些颜色渐变。我看到这些样式还没有包含在主要的 cytoscape 版本中,所以我需要在 github 上使用 'unstable' 分支。根据评论here 我应该能够获得分支并进行构建。我能够让分支执行(然后,我可以在 node_modules 上看到)

npm install git://github.com/cytoscape/cytoscape.js.git#unstable --save

但是我该如何构建才能在我的 vue 应用程序上使用这个版本?我该如何导入它?谢谢!

请参阅 Cytoscape.js 存储库中的 readme file。将目录更改为 node_modules/cytoscape/ 后,您首先需要执行 npm install,然后使用 npm run dist.

进行构建
cd node_modules/cytoscape/
npm install
npm run dist

构建后,您应该可以正常导入它。