Commit 90f88358 authored by PkSM3's avatar PkSM3

glorious bugfix [filter+FA2+isolated]-interaction

parent 673ee45f
......@@ -52,7 +52,7 @@ var stopcriteria = false;
var iterationsFA2=1000;
var seed=999999999;//defaultseed
var semanticConverged=false;
var isolatedBCauseFilter = 0;
var showLabelsIfZoom=2.0;
......
......@@ -1370,6 +1370,7 @@ function unHide(id){
}
partialGraph.addNode(id,anode);
pr(partialGraph._core.graph.nodesIndex[id].displayX)
return;
}
}
......@@ -1448,6 +1449,7 @@ function unHideElem(id){
function changeToMeso(iwannagraph) {
labels=[]
partialGraph.stopForceAtlas2();
partialGraph.emptyGraph();
pr("changing to Meso-"+iwannagraph);
if(iwannagraph=="social") {
......@@ -1659,6 +1661,7 @@ function changeToMacro(iwannagraph) {
// pr("--------------------------------------------------------------------------------")
partialGraph.stopForceAtlas2();
partialGraph.emptyGraph();
if ( iwannagraph=="semantic" && !semanticConverged ) {
......@@ -1683,15 +1686,29 @@ function changeToMacro(iwannagraph) {
unHide(n);
}
} // and semantic edges
pr("im here")
createEdgesForExistingNodes(iwannagraph);
pr("im also here")
pr("nodes:")
pr(partialGraph._core.graph.nodesIndex)
pr("edges:")
pr(partialGraph._core.graph.edgesIndex)
if(iwannagraph=="social") showMeSomeLabels(6);
swMacro=true;
pr("im now here")
if (!is_empty(selections))
$.doTimeout(10,function (){
chosenones=(PAST=="a"||PAST=="b")?selections:opossites;
pr("the chosen ones")
pr(chosenones)
MultipleSelection(Object.keys(chosenones))
pr("im now right here")
});
} else {
......@@ -1755,6 +1772,8 @@ function changeToMacro(iwannagraph) {
// partialGraph.draw();
// // partialGraph.zoomTo(partialGraph._core.width / 2, partialGraph._core.height / 2, 0.8);
// partialGraph.refresh();
fa2enabled=true; partialGraph.startForceAtlas2();
$('.gradient').css({"background-size":"40px 40px"});
}
......
......@@ -1110,16 +1110,26 @@ sigma.publicPrototype.startForceAtlas2 = function() {
//if(!this.forceatlas2) {
if(fa2enabled) {
/*
isolatedBCauseFilter = 0;
for (var i in this._core.graph.nodesIndex) {
if(this._core.graph.nodesIndex[i].degree==0) {
this._core.graph.nodesIndex[i].hidden=true;
isolatedBCauseFilter++;
pr("\t\t\t\t\tFA2 Started")
var ene = this._core.graph.nodes.length;
var isolatedBCauseFilter = 0;
for (var i in this._core.graph.nodesIndex) {
if(this._core.graph.nodesIndex[i].degree==0) isolatedBCauseFilter++;
}
pr("|||||||||| probando una cosa super loca")
pr("|||||||||| isolatedBCauseFilter "+isolatedBCauseFilter)
pr("|||||||||| ene "+ene)
pr("isolatedBCauseFilter==ene = "+(isolatedBCauseFilter==ene))
if(isolatedBCauseFilter==ene) {
partialGraph.stopForceAtlas2();
return;
}
}
*/
......@@ -1200,12 +1210,17 @@ sigma.publicPrototype.startForceAtlas2 = function() {
};
sigma.publicPrototype.stopForceAtlas2 = function() {
pr("\t\t\t\t\tFA2 Stopped")
fa2enabled=false;
this.removeGenerator('forceatlas2');
updateMap();
partialGraph.refresh();
if(minimap) $("#overviewzone").show();
/*
// calc dimensions of connected subgraphs
......
......@@ -1274,10 +1274,31 @@ sigma.classes.Cascade = function() {
*/
function empty() {
self.nodes = [];
if(self.nodes.length>0) {
pr("splicing nodes")
self.nodes.splice(0, self.nodes.length);
}
self.nodesIndex = {};
if(self.nodesIndex.length>0) {
pr("splicing nodesIndex")
self.nodesIndex.splice(0, self.nodesIndex.length);
}
self.edges = [];
self.edgesIndex = {};
if(self.edges.length>0) {
pr("splicing edges")
self.edges.splice(0, self.edges.length);
}
self.edgesIndex = {};
if(self.edgesIndex.length>0) {
pr("splicing edgesIndex")
self.edgesIndex.splice(0, self.edgesIndex.length);
}
overNodes=false;
return self;
......
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