Commit 6a15ff56 authored by PkSM3's avatar PkSM3

spatialization corrected

parent d2d169a6
......@@ -184,11 +184,8 @@
<div style="visibility: hidden;" id="sigma-othergraph"></div>
<img id="semLoader" style="position:absolute; top:50%; left:40%; width:80px;" src="img2/loading-bar.gif"></img>
<ul id="ctlzoom">
<!-- <div class="content-header">
......
......@@ -211,11 +211,12 @@ function bringTheNoise(pathfile,type){
contentType: "application/json",
dataType: 'jsonp',
async: true,
success : function(data){
success : function(data) {
if(!isUndef(getUrlParam.seed))seed=getUrlParam.seed;
extractFromJson(data,seed);
changeToMacro("social");
pr(getClientTime()+" : DataExt Fin");
// < === DATA EXTRACTED!! === >
// < === DATA EXTRACTED!! === >
if(fa2enabled==="off") $("#edgesButton").hide();
pushSWClick("social");
......@@ -234,14 +235,14 @@ function bringTheNoise(pathfile,type){
pr("iterationsFA2: "+iterationsFA2)
var netname = pathfile.replace(/\_/g, ' ').toUpperCase();
$("#network").html(netname);
// < === ASYNCHRONOUS FA2.JS === >
// < === ASYNCHRONOUS FA2.JS === >
pr("prev first node:")
pr(partialGraph._core.graph.nodes[0])
pr(getClientTime()+" : Ini FA2");
var ForceAtlas2 = new Worker("FA2.js");
ForceAtlas2.postMessage({
ForceAtlas2.postMessage({
"nodes": partialGraph._core.graph.nodes,
"edges": partialGraph._core.graph.edges,
"it":iterationsFA2
......@@ -264,9 +265,12 @@ function bringTheNoise(pathfile,type){
pr(getClientTime()+" : Fin FA2");
console.log("Parsing and FA2 complete.");
pr("\n=================\n")
// < === ASYNCHRONOUS FA2.JS DONE!! === >
// < === ASYNCHRONOUS FA2.JS DONE!! === >
pr("aft first node:")
pr(partialGraph._core.graph.nodes[0])
// [ calculate iterations for semanticgraph ]
pr(getClientTime()+" : Ini FA2 for SemanticGraph");
var cut1_,cut2_,iterationsFA2_=iterationsFA2;
pr(otherGraph._core.graph.nodes.length)
......@@ -282,8 +286,10 @@ function bringTheNoise(pathfile,type){
}
if(nbnodes>=1000) iterationsFA2_ = 150;
pr("iterationsFA2 sem: "+iterationsFA2_)
// [ / calculate iterations for semanticgraph ]
// [ semantic layouting ]
var ForceAtlas2_ = new Worker("FA2.js");
ForceAtlas2_.postMessage({
"nodes": otherGraph._core.graph.nodes,
......@@ -312,11 +318,14 @@ function bringTheNoise(pathfile,type){
semanticConverged = true;
$("#semLoader").hide();
if( NOW=="B" ) changeToMacro("semantic");
if( NOW=="B" ) {
changeToMacro("semantic");
partialGraph.draw();
}
console.log("Parsing and FA2 complete for SemanticGraph.");
});
// [ / semantic layouting ]
......@@ -405,18 +414,6 @@ function bringTheNoise(pathfile,type){
}
});
}
}
}
......
......@@ -273,6 +273,8 @@ function RefreshState(newNOW){
$("#colorGraph").hide();
}
partialGraph.draw();
}
function pushSWClick(arg){
......@@ -1405,6 +1407,7 @@ function unHideElem(id){
function changeToMeso(iwannagraph) {
labels=[]
partialGraph.emptyGraph();
pr("changing to Meso-"+iwannagraph);
if(iwannagraph=="social") {
if(!is_empty(selections)){
......@@ -1574,10 +1577,10 @@ function changeToMeso(iwannagraph) {
}
}
// highlightSelectedNodes(true);
partialGraph.draw();
// partialGraph.zoomTo(partialGraph._core.width / 2, partialGraph._core.height / 2, 0.8);
partialGraph.refresh();
partialGraph.startForceAtlas2();
// partialGraph.draw();
// // partialGraph.zoomTo(partialGraph._core.width / 2, partialGraph._core.height / 2, 0.8);
// partialGraph.refresh();
// partialGraph.startForceAtlas2();
$('.gradient').css({"background-size":"90px 90px"});
}
......@@ -1659,10 +1662,10 @@ function changeToMacro(iwannagraph) {
}
// highlightSelectedNodes(true);
// // partialGraph.stopForceAtlas2();
partialGraph.draw();
// partialGraph.zoomTo(partialGraph._core.width / 2, partialGraph._core.height / 2, 0.8);
partialGraph.refresh();
partialGraph.startForceAtlas2();
// partialGraph.draw();
// // partialGraph.zoomTo(partialGraph._core.width / 2, partialGraph._core.height / 2, 0.8);
// partialGraph.refresh();
// partialGraph.startForceAtlas2();
$('.gradient').css({"background-size":"40px 40px"});
}
......
......@@ -612,8 +612,8 @@ function extractFromJson(data,seed){
size:1,
x:rand.getRandom(),
y:rand.getRandom(),
//x:Math.random(),
//y:Math.random(),
// x:Math.random(),
// y:Math.random(),
type:"",
htmlCont:"",
color:color
......
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