Commit a30b3fe5 authored by Romain Loth's avatar Romain Loth

reconnect FA2 with config from comex and sam's work

parent e9b2145c
...@@ -325,7 +325,7 @@ ...@@ -325,7 +325,7 @@
</li> </li>
<li> <li>
<a href="#" id="edgesButton" class="zoombarbuttons"> <a href="#" id="layoutButton" class="zoombarbuttons">
<img src="libs/img2/edges.png" style="width:32px"> <img src="libs/img2/edges.png" style="width:32px">
</a> </a>
</li> </li>
...@@ -554,6 +554,9 @@ ...@@ -554,6 +554,9 @@
<script src="tinawebJS/sigma_v1.2/plugins/sigma.layout.forceAtlas2/supervisor.js"></script> <script src="tinawebJS/sigma_v1.2/plugins/sigma.layout.forceAtlas2/supervisor.js"></script>
<script src="tinawebJS/sigma_v1.2/plugins/sigma.layout.forceAtlas2/worker.js"></script> <script src="tinawebJS/sigma_v1.2/plugins/sigma.layout.forceAtlas2/worker.js"></script>
<!-- testing sigma 1.5 imports from linkurious src -->
<!-- <script src="tinawebJS/sigma_v1.5/sigma.js" type="text/javascript" language="javascript"></script>
<script src="tinawebJS/sigma_v1.5/plugins.js" type="text/javascript" language="javascript"></script> -->
<!-- new sigma (1.0c => 1.2) compatibility imports --> <!-- new sigma (1.0c => 1.2) compatibility imports -->
<script src="tinawebJS/sigma_tools.js"></script> <script src="tinawebJS/sigma_tools.js"></script>
......
...@@ -711,21 +711,15 @@ TinaWebJS = function ( sigmacanvas ) { ...@@ -711,21 +711,15 @@ TinaWebJS = function ( sigmacanvas ) {
} }
}); });
$("#edgesButton").click(function () { $("#layoutButton").click(function () {
fa2enabled=true; if(TW.partialGraph.isForceAtlas2Running()) {
if(!isUndef(partialGraph.forceatlas2)) { partialGraph.stopForceAtlas2();
partialGraph.render();
if(partialGraph.forceatlas2.active) { fa2enabled=false;
partialGraph.stopForceAtlas2(); return;
partialGraph.render();
return;
} else {
partialGraph.startForceAtlas2();
return;
}
} else { } else {
partialGraph.startForceAtlas2(); partialGraph.startForceAtlas2();
fa2enabled=true;
return; return;
} }
}); });
......
...@@ -241,7 +241,10 @@ if(RES["OK"]) { ...@@ -241,7 +241,10 @@ if(RES["OK"]) {
rescaleIgnoreSize: true, rescaleIgnoreSize: true,
mouseEnabled: true, mouseEnabled: true,
touchEnabled: false touchEnabled: false,
animationsTime:300,
mouseZoomDuration:500
}, },
sigmaJsDrawingProperties, sigmaJsDrawingProperties,
sigmaJsGraphProperties, sigmaJsGraphProperties,
...@@ -284,6 +287,7 @@ if(RES["OK"]) { ...@@ -284,6 +287,7 @@ if(RES["OK"]) {
}, },
settings: customSettings settings: customSettings
}); });
// ==================================================================
// shortcuts to the renderer and camera // shortcuts to the renderer and camera
TW.cam = TW.partialGraph.camera TW.cam = TW.partialGraph.camera
...@@ -404,6 +408,29 @@ if(RES["OK"]) { ...@@ -404,6 +408,29 @@ if(RES["OK"]) {
} }
}).index(); }).index();
// config for any future forceAtlas2 calls
TW.partialGraph.configForceAtlas2({
// adapting speed -------------
slowDown: 1,
startingIterations: 5,
iterationsPerRender: 3,
barnesHutOptimize: false,
barnesHutTheta: .5,
// global behavior -----------
linLogMode: true,
edgeWeightInfluence: .5,
gravity: 3,
strongGravityMode: false,
scalingRatio: 1,
adjustSizes: false, // ~ messy but sort of in favor of overlap prevention
// favors global centrality
// (but rather not needed when data already shows topic-centered
// node groups and/nor when preferential attachment type of data)
outboundAttractionDistribution: false
})
// REFA new sigma.js // REFA new sigma.js
TW.partialGraph.camera.goTo({x:0, y:0, ratio:1.2, angle: 0}) TW.partialGraph.camera.goTo({x:0, y:0, ratio:1.2, angle: 0})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment