1

我一直在尝试使用乔木布局。我试过了

layout: {
    name:"arbor"
}

layout: {
    name:"arbor",
    liveUpdate: true,
    ready: undefined,
    maxSimulationTime: 4000,
    fit: true,
    padding: [ 50, 50, 50, 50 ],
    ungrabifyWhileSimulating: true,
    repulsion: undefined,
    stiffness: undefined,
    friction: undefined,
    gravity: true,
    fps: undefined,
    precision: undefined,
    nodeMass: undefined,
    edgeLength: undefined,
    stepSize: 1,
    stableEnergy: function( energy ){
        var e = energy; 
        return (e.max <= 7) || (e.mean <= 5);
    }
}

在这两种情况下,萤火虫控制台都会报告

arbor is not defined
http://localhost/WS/BioJS/biojs/src/main/resources/dependencies/cytoscape/jquery.cytoscapeweb.layout.arbor.js
Line 76

我错过了什么?有乔木布局使用的工作示例吗?

4

1 回答 1

2

您需要在 HTMLarbor.js中包含script标签。该文件jquery.cytoscapeweb.layout.arbor.js只是将 arbor 与 Cytoscape Web 接口。如果您需要 IE 支持,请确保使用arbor.jsCytoscape Web ZIP 中捆绑的版本——arbor 不提供开箱即用的功能。

之所以arbor.js没有嵌入,jquery.cytoscapeweb.layout.arbor.js是因为arbor.js需要在自己的script标签中才能使网络工作者正常工作。如果您arbor.js将应用程序的其他脚本连接并缩小,arbor 的路径查找可能会中断,或者 arbor 的 webworkers 可能与您应用程序中的其他 webworkers 发生冲突。

于 2012-06-05T17:41:12.080 回答