2012-06-01 43 views
1

我一直在嘗試使用喬木佈局。我試過Cytoscape web 2喬木佈局

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 

我我失去了一些東西? 是否有一個喬木佈局使用的工作示例?

回答

2

您需要將arbor.js包含在HTML中的script標記中。文件jquery.cytoscapeweb.layout.arbor.js只是與Cytoscape Web連接。如果您需要IE支持,請確保您使用捆綁在Cytoscape Web ZIP中的arbor.js版本 - arbor不提供此開箱即用功能。

arbor.js未嵌入jquery.cytoscapeweb.layout.arbor.js的原因是因爲arbor.js需要位於自己的script標籤中,以便網絡工作人員正常工作。如果您將arbor.js與應用程序的其他腳本連接並縮小,arbor的路徑查找可能會中斷,或者arbor的網絡工作人員可能會與您的應用中的其他webworkers發生衝突。

+0

謝謝!我只包含了arbor.js文件,我的腳本現在正在工作。 –