Commit 3ad22b68 authored by PkSM3's avatar PkSM3

bugs-fixed in localview

parent e8c8c22d
...@@ -158,10 +158,12 @@ function justhide(){ ...@@ -158,10 +158,12 @@ function justhide(){
// EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight"); // EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) { function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
if ($(sliderDivID).html()!="") { // if ($(sliderDivID).html()!="") {
pr("\t\t\t\t\t\t[[ algorithm not applied "+sliderDivID+" ]]") // pr("\t\t\t\t\t\t[[ algorithm not applied "+sliderDivID+" ]]")
return; // return;
} // }
// sliderDivID = "#sliderAEdgeWeight" // sliderDivID = "#sliderAEdgeWeight"
// type = "nodes1" // type = "nodes1"
// type_attrb = "label" // type_attrb = "label"
...@@ -176,7 +178,22 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) { ...@@ -176,7 +178,22 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
// AlgorithmForSliders ( partialGraph._core.graph.edges , "label" , "nodes2" , "weight") // AlgorithmForSliders ( partialGraph._core.graph.edges , "label" , "nodes2" , "weight")
// AlgorithmForSliders ( partialGraph._core.graph.nodes , "type" , "Document" , "size") // AlgorithmForSliders ( partialGraph._core.graph.nodes , "type" , "Document" , "size")
// AlgorithmForSliders ( partialGraph._core.graph.nodes , "type" , "NGram" , "size") // AlgorithmForSliders ( partialGraph._core.graph.nodes , "type" , "NGram" , "size")
if(partialGraph._core.graph.edges.length==0) return; if(partialGraph._core.graph.edges.length==0) {
pr("je suis ici et essai ca")
$(sliderDivID).freshslider({
range: true,
step:1,
value:[10, 60],
enabled: false,
onchange:function(low, high){
console.log(low, high);
}
});
return;
}
var filterparams = AlgorithmForSliders ( partialGraph._core.graph.edges , type_attrb , type , criteria) var filterparams = AlgorithmForSliders ( partialGraph._core.graph.edges , type_attrb , type , criteria)
var steps = filterparams["steps"] var steps = filterparams["steps"]
...@@ -241,10 +258,12 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) { ...@@ -241,10 +258,12 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
// NodeWeightFilter ( "#sliderBNodeWeight" , "NGram" , "type" , "size") // NodeWeightFilter ( "#sliderBNodeWeight" , "NGram" , "type" , "size")
function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) { function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) {
if ($(sliderDivID).html()!="") { // if ($(sliderDivID).html()!="") {
pr("\t\t\t\t\t\t[[ algorithm not applied "+sliderDivID+" ]]") // pr("\t\t\t\t\t\t[[ algorithm not applied "+sliderDivID+" ]]")
return; // return;
} // }
// sliderDivID = "#sliderAEdgeWeight" // sliderDivID = "#sliderAEdgeWeight"
// type = "nodes1" // type = "nodes1"
// type_attrb = "label" // type_attrb = "label"
...@@ -259,8 +278,23 @@ function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) { ...@@ -259,8 +278,23 @@ function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) {
// AlgorithmForSliders ( partialGraph._core.graph.edges , "label" , "nodes2" , "weight") // AlgorithmForSliders ( partialGraph._core.graph.edges , "label" , "nodes2" , "weight")
// AlgorithmForSliders ( partialGraph._core.graph.nodes , "type" , "Document" , "size") // AlgorithmForSliders ( partialGraph._core.graph.nodes , "type" , "Document" , "size")
// AlgorithmForSliders ( partialGraph._core.graph.nodes , "type" , "NGram" , "size") // AlgorithmForSliders ( partialGraph._core.graph.nodes , "type" , "NGram" , "size")
if(partialGraph._core.graph.nodes.length==0) return;
if(partialGraph._core.graph.nodes.length==0) {
$(sliderDivID).freshslider({
range: true,
step:1,
value:[10, 60],
enabled: false,
onchange:function(low, high){
console.log(low, high);
}
});
return;
}
var filterparams = AlgorithmForSliders ( partialGraph._core.graph.nodes , type_attrb , type , criteria) var filterparams = AlgorithmForSliders ( partialGraph._core.graph.nodes , type_attrb , type , criteria)
var steps = filterparams["steps"] var steps = filterparams["steps"]
var finalarray = filterparams["finalarray"] var finalarray = filterparams["finalarray"]
...@@ -357,17 +391,22 @@ function AlgorithmForSliders( elements , type_attrb , type , criteria) { ...@@ -357,17 +391,22 @@ function AlgorithmForSliders( elements , type_attrb , type , criteria) {
// // pr(e[criteria]) // // pr(e[criteria])
// } // }
var N = result.length var N = result.length
var magnitude = (""+N).length //order of magnitude of edges|nodes // var magnitude = (""+N).length //order of magnitude of edges|nodes
var exponent = magnitude - 1 // var exponent = magnitude - 1
var steps = Math.pow(10,exponent) // #(10 ^ magnit-1) steps // var steps = Math.pow(10,exponent) // #(10 ^ magnit-1) steps
var stepsize = Math.round(N/steps)// ~~(visibledges / #steps) // var stepsize = Math.round(N/steps)// ~~(visibledges / #steps)
// pr("-----------------------------------")
// pr("number of visible nodes|edges: "+N); //var roundsqrtN = Math.round( Math.sqrt( N ) );
// pr("magnitude : "+magnitude) var steps = Math.round( Math.sqrt( N ) );
// pr("number of steps : "+steps) var stepsize = Math.round( N / steps );
// pr("size of one step : "+stepsize)
// pr("-----------------------------------") pr("-----------------------------------")
pr("number of visible nodes|edges: "+N);
pr("number of steps : "+steps)
pr("size of one step : "+stepsize)
pr("-----------------------------------")
var finalarray = [] var finalarray = []
......
...@@ -713,7 +713,9 @@ function SigmaLayouting( URL, DATA, NAME) { ...@@ -713,7 +713,9 @@ function SigmaLayouting( URL, DATA, NAME) {
$("#semLoader").hide(); $("#semLoader").hide();
if( NOW=="B" ) { if( NOW=="B" ) {
changeToMacro("semantic"); changeToMacro("semantic");
partialGraph.draw(); partialGraph.draw();
$("#sliderBEdgeWeight").html("");
$("#sliderBNodeWeight").html("");
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight"); EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size") NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size")
$("#colorGraph").hide(); $("#colorGraph").hide();
......
...@@ -153,8 +153,10 @@ function cancelSelection (fromTagCloud) { ...@@ -153,8 +153,10 @@ function cancelSelection (fromTagCloud) {
$("#tips").html(getTips()); $("#tips").html(getTips());
} }
for(var i in deselections){ for(var i in deselections){
partialGraph._core.graph.nodesIndex[i].forceLabel=false; if( !isUndef(partialGraph._core.graph.nodesIndex[i]) ) {
partialGraph._core.graph.nodesIndex[i].neighbour=false; partialGraph._core.graph.nodesIndex[i].forceLabel=false;
partialGraph._core.graph.nodesIndex[i].neighbour=false;
}
} }
deselections={}; deselections={};
// leftPanel("close"); // leftPanel("close");
...@@ -240,8 +242,6 @@ function RefreshState(newNOW){ ...@@ -240,8 +242,6 @@ function RefreshState(newNOW){
if(is_empty(selections) || i==0) LevelButtonDisable(false); if(is_empty(selections) || i==0) LevelButtonDisable(false);
} }
//this should be available!!
EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
$("#semLoader").hide(); $("#semLoader").hide();
$("#colorGraph").show(); $("#colorGraph").show();
...@@ -265,17 +265,9 @@ function RefreshState(newNOW){ ...@@ -265,17 +265,9 @@ function RefreshState(newNOW){
} }
if ( semanticConverged ) $("#semLoader").hide(); if ( semanticConverged ) $("#semLoader").hide();
else $("#semLoader").show(); else $("#semLoader").show();
//this should be available!!
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size")
$("#colorGraph").hide();
} }
if(NOW=="AaBb"){ if(NOW=="AaBb"){
LevelButtonDisable(true); LevelButtonDisable(true);
EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size")
$("#colorGraph").hide();
} }
partialGraph.draw(); partialGraph.draw();
...@@ -692,43 +684,47 @@ function markAsSelected(n_id,sel) { ...@@ -692,43 +684,47 @@ function markAsSelected(n_id,sel) {
!isUndef(nodes1[nodeSel.id].neighbours) !isUndef(nodes1[nodeSel.id].neighbours)
){ ){
neigh=nodes1[nodeSel.id].neighbours;/**/ neigh=nodes1[nodeSel.id].neighbours;/**/
for(var i in neigh){ for(var i in neigh) {
nodeVec = partialGraph._core.graph.nodesIndex[neigh[i]];
// vec.color = vec.attr['true_color']; if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) {
// vec.attr['grey'] = 0;
// pr("nodeselected: "+nodeSel.id+"\t"+nodeSel.label+"\t\t||\t\tvecino: "+vec.id+"\t"+vec.label) nodeVec = partialGraph._core.graph.nodesIndex[neigh[i]];
// vec.color = vec.attr['true_color'];
possibledge1 = partialGraph._core.graph.edgesIndex[nodeVec.id+";"+nodeSel.id] // vec.attr['grey'] = 0;
possibledge2 = partialGraph._core.graph.edgesIndex[nodeSel.id+";"+nodeVec.id] // pr("nodeselected: "+nodeSel.id+"\t"+nodeSel.label+"\t\t||\t\tvecino: "+vec.id+"\t"+vec.label)
an_edge = (!isUndef(possibledge1))?possibledge1:possibledge2; possibledge1 = partialGraph._core.graph.edgesIndex[nodeVec.id+";"+nodeSel.id]
if(!isUndef(an_edge) && !an_edge.hidden) { possibledge2 = partialGraph._core.graph.edgesIndex[nodeSel.id+";"+nodeVec.id]
//highlight node an_edge = (!isUndef(possibledge1))?possibledge1:possibledge2;
// nodeVec.hidden = false; if(!isUndef(an_edge) && !an_edge.hidden) {
nodeVec.color = nodeVec.attr['true_color'];
nodeVec.attr['grey'] = 0; //highlight node
// nodeVec.hidden = false;
//highlight edge nodeVec.color = nodeVec.attr['true_color'];
an_edge.color = an_edge.attr['true_color']; nodeVec.attr['grey'] = 0;
an_edge.attr['grey'] = 0;
//highlight edge
an_edge.color = an_edge.attr['true_color'];
an_edge.attr['grey'] = 0;
}
// if ( (NOW=="a" || NOW=="b") && nodeVec.color==grey)
// pr(nodeVec)
// nodeVec.hidden = true
// an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id];
// if(!isUndef(an_edge) && !an_edge.hidden){
// an_edge.color = an_edge.attr['true_color'];
// an_edge.attr['grey'] = 0;
// }
// an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id];
// if(!isUndef(an_edge) && !an_edge.hidden){
// an_edge.color = an_edge.attr['true_color'];
// an_edge.attr['grey'] = 0;
// }
} }
// if ( (NOW=="a" || NOW=="b") && nodeVec.color==grey)
// pr(nodeVec)
// nodeVec.hidden = true
// an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id];
// if(!isUndef(an_edge) && !an_edge.hidden){
// an_edge.color = an_edge.attr['true_color'];
// an_edge.attr['grey'] = 0;
// }
// an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id];
// if(!isUndef(an_edge) && !an_edge.hidden){
// an_edge.color = an_edge.attr['true_color'];
// an_edge.attr['grey'] = 0;
// }
} }
} }
} else { } else {
...@@ -738,18 +734,21 @@ function markAsSelected(n_id,sel) { ...@@ -738,18 +734,21 @@ function markAsSelected(n_id,sel) {
){ ){
neigh=bipartiteN2D[nodeSel.id].neighbours;/**/ neigh=bipartiteN2D[nodeSel.id].neighbours;/**/
for(var i in neigh){ for(var i in neigh){
vec = partialGraph._core.graph.nodesIndex[neigh[i]];
vec.color = vec.attr['true_color']; if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ){
vec.attr['grey'] = 0; vec = partialGraph._core.graph.nodesIndex[neigh[i]];
an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id]; vec.color = vec.attr['true_color'];
if(!isUndef(an_edge) && !an_edge.hidden){ vec.attr['grey'] = 0;
an_edge.color = an_edge.attr['true_color']; an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id];
an_edge.attr['grey'] = 0; if(!isUndef(an_edge) && !an_edge.hidden){
} an_edge.color = an_edge.attr['true_color'];
an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id]; an_edge.attr['grey'] = 0;
if(!isUndef(an_edge) && !an_edge.hidden){ }
an_edge.color = an_edge.attr['true_color']; an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id];
an_edge.attr['grey'] = 0; if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.color = an_edge.attr['true_color'];
an_edge.attr['grey'] = 0;
}
} }
} }
} }
...@@ -761,20 +760,24 @@ function markAsSelected(n_id,sel) { ...@@ -761,20 +760,24 @@ function markAsSelected(n_id,sel) {
!isUndef(bipartiteD2N[nodeSel.id].neighbours) !isUndef(bipartiteD2N[nodeSel.id].neighbours)
){ ){
neigh=bipartiteD2N[nodeSel.id].neighbours;/**/ neigh=bipartiteD2N[nodeSel.id].neighbours;/**/
for(var i in neigh){ for(var i in neigh) {
vec = partialGraph._core.graph.nodesIndex[neigh[i]];
vec.color = vec.attr['true_color']; if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) {
vec.attr['grey'] = 0; vec = partialGraph._core.graph.nodesIndex[neigh[i]];
an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id]; vec.color = vec.attr['true_color'];
if(!isUndef(an_edge) && !an_edge.hidden){ vec.attr['grey'] = 0;
an_edge.color = an_edge.attr['true_color']; an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id];
an_edge.attr['grey'] = 0; if(!isUndef(an_edge) && !an_edge.hidden){
} an_edge.color = an_edge.attr['true_color'];
an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id]; an_edge.attr['grey'] = 0;
if(!isUndef(an_edge) && !an_edge.hidden){ }
an_edge.color = an_edge.attr['true_color']; an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id];
an_edge.attr['grey'] = 0; if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.color = an_edge.attr['true_color'];
an_edge.attr['grey'] = 0;
}
} }
} }
} }
} }
...@@ -785,45 +788,47 @@ function markAsSelected(n_id,sel) { ...@@ -785,45 +788,47 @@ function markAsSelected(n_id,sel) {
neigh=nodes2[nodeSel.id].neighbours;/**/ neigh=nodes2[nodeSel.id].neighbours;/**/
for(var i in neigh){ for(var i in neigh){
nodeVec = partialGraph._core.graph.nodesIndex[neigh[i]]; if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) {
// vec.color = vec.attr['true_color']; nodeVec = partialGraph._core.graph.nodesIndex[neigh[i]];
// vec.attr['grey'] = 0; // vec.color = vec.attr['true_color'];
// pr("nodeselected: "+nodeSel.id+"\t"+nodeSel.label+"\t\t||\t\tvecino: "+vec.id+"\t"+vec.label) // vec.attr['grey'] = 0;
// pr("nodeselected: "+nodeSel.id+"\t"+nodeSel.label+"\t\t||\t\tvecino: "+vec.id+"\t"+vec.label)
possibledge1 = partialGraph._core.graph.edgesIndex[nodeVec.id+";"+nodeSel.id]
possibledge2 = partialGraph._core.graph.edgesIndex[nodeSel.id+";"+nodeVec.id] possibledge1 = partialGraph._core.graph.edgesIndex[nodeVec.id+";"+nodeSel.id]
possibledge2 = partialGraph._core.graph.edgesIndex[nodeSel.id+";"+nodeVec.id]
an_edge = (!isUndef(possibledge1))?possibledge1:possibledge2;
if(!isUndef(an_edge) && !an_edge.hidden) { an_edge = (!isUndef(possibledge1))?possibledge1:possibledge2;
if(!isUndef(an_edge) && !an_edge.hidden) {
//highlight node
// nodeVec.hidden = false; //highlight node
nodeVec.color = nodeVec.attr['true_color']; // nodeVec.hidden = false;
nodeVec.attr['grey'] = 0; nodeVec.color = nodeVec.attr['true_color'];
nodeVec.attr['grey'] = 0;
//highlight edge
an_edge.color = an_edge.attr['true_color']; //highlight edge
an_edge.attr['grey'] = 0; an_edge.color = an_edge.attr['true_color'];
an_edge.attr['grey'] = 0;
}
// if ( (NOW=="a" || NOW=="b") && nodeVec.color==grey)
// pr(nodeVec)
// nodeVec.hidden = true
// vec = partialGraph._core.graph.nodesIndex[neigh[i]];
// vec.color = vec.attr['true_color'];
// vec.attr['grey'] = 0;
// an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id];
// if(!isUndef(an_edge) && !an_edge.hidden){
// an_edge.color = an_edge.attr['true_color'];
// an_edge.attr['grey'] = 0;
// }
// an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id];
// if(!isUndef(an_edge) && !an_edge.hidden){
// an_edge.color = an_edge.attr['true_color'];
// an_edge.attr['grey'] = 0;
// }
} }
// if ( (NOW=="a" || NOW=="b") && nodeVec.color==grey)
// pr(nodeVec)
// nodeVec.hidden = true
// vec = partialGraph._core.graph.nodesIndex[neigh[i]];
// vec.color = vec.attr['true_color'];
// vec.attr['grey'] = 0;
// an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id];
// if(!isUndef(an_edge) && !an_edge.hidden){
// an_edge.color = an_edge.attr['true_color'];
// an_edge.attr['grey'] = 0;
// }
// an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id];
// if(!isUndef(an_edge) && !an_edge.hidden){
// an_edge.color = an_edge.attr['true_color'];
// an_edge.attr['grey'] = 0;
// }
} }
} }
} }
...@@ -836,18 +841,20 @@ function markAsSelected(n_id,sel) { ...@@ -836,18 +841,20 @@ function markAsSelected(n_id,sel) {
){ ){
neigh=nodes1[nodeSel.id].neighbours;/**/ neigh=nodes1[nodeSel.id].neighbours;/**/
for(var i in neigh){ for(var i in neigh){
vec = partialGraph._core.graph.nodesIndex[neigh[i]]; if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) {
vec.color = vec.attr['true_color']; vec = partialGraph._core.graph.nodesIndex[neigh[i]];
vec.attr['grey'] = 0; vec.color = vec.attr['true_color'];
an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id]; vec.attr['grey'] = 0;
if(!isUndef(an_edge) && !an_edge.hidden){ an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id];
an_edge.color = an_edge.attr['true_color']; if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.attr['grey'] = 0; an_edge.color = an_edge.attr['true_color'];
} an_edge.attr['grey'] = 0;
an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id]; }
if(!isUndef(an_edge) && !an_edge.hidden){ an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id];
an_edge.color = an_edge.attr['true_color']; if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.attr['grey'] = 0; an_edge.color = an_edge.attr['true_color'];
an_edge.attr['grey'] = 0;
}
} }
} }
} }
...@@ -856,19 +863,21 @@ function markAsSelected(n_id,sel) { ...@@ -856,19 +863,21 @@ function markAsSelected(n_id,sel) {
!isUndef(bipartiteD2N[nodeSel.id].neighbours) !isUndef(bipartiteD2N[nodeSel.id].neighbours)
){ ){
neigh=bipartiteD2N[nodeSel.id].neighbours;/**/ neigh=bipartiteD2N[nodeSel.id].neighbours;/**/
for(var i in neigh){ for(var i in neigh) {
vec = partialGraph._core.graph.nodesIndex[neigh[i]]; if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) {
vec.color = vec.attr['true_color']; vec = partialGraph._core.graph.nodesIndex[neigh[i]];
vec.attr['grey'] = 0; vec.color = vec.attr['true_color'];
an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id]; vec.attr['grey'] = 0;
if(!isUndef(an_edge) && !an_edge.hidden){ an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id];
an_edge.color = an_edge.attr['true_color']; if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.attr['grey'] = 0; an_edge.color = an_edge.attr['true_color'];
} an_edge.attr['grey'] = 0;
an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id]; }
if(!isUndef(an_edge) && !an_edge.hidden){ an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id];
an_edge.color = an_edge.attr['true_color']; if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.attr['grey'] = 0; an_edge.color = an_edge.attr['true_color'];
an_edge.attr['grey'] = 0;
}
} }
} }
} }
...@@ -878,19 +887,21 @@ function markAsSelected(n_id,sel) { ...@@ -878,19 +887,21 @@ function markAsSelected(n_id,sel) {
!isUndef(nodes2[nodeSel.id].neighbours) !isUndef(nodes2[nodeSel.id].neighbours)
){ ){
neigh=nodes2[nodeSel.id].neighbours;/**/ neigh=nodes2[nodeSel.id].neighbours;/**/
for(var i in neigh){ for(var i in neigh) {
vec = partialGraph._core.graph.nodesIndex[neigh[i]]; if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) {
vec.color = vec.attr['true_color']; vec = partialGraph._core.graph.nodesIndex[neigh[i]];
vec.attr['grey'] = 0; vec.color = vec.attr['true_color'];
an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id]; vec.attr['grey'] = 0;
if(!isUndef(an_edge) && !an_edge.hidden){ an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id];
an_edge.color = an_edge.attr['true_color']; if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.attr['grey'] = 0; an_edge.color = an_edge.attr['true_color'];
} an_edge.attr['grey'] = 0;
an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id]; }
if(!isUndef(an_edge) && !an_edge.hidden){ an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id];
an_edge.color = an_edge.attr['true_color']; if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.attr['grey'] = 0; an_edge.color = an_edge.attr['true_color'];
an_edge.attr['grey'] = 0;
}
} }
} }
} }
...@@ -900,18 +911,20 @@ function markAsSelected(n_id,sel) { ...@@ -900,18 +911,20 @@ function markAsSelected(n_id,sel) {
){ ){
neigh=bipartiteN2D[nodeSel.id].neighbours;/**/ neigh=bipartiteN2D[nodeSel.id].neighbours;/**/
for(var i in neigh){ for(var i in neigh){
vec = partialGraph._core.graph.nodesIndex[neigh[i]]; if( !isUndef(partialGraph._core.graph.nodesIndex[neigh[i]]) ) {
vec.color = vec.attr['true_color']; vec = partialGraph._core.graph.nodesIndex[neigh[i]];
vec.attr['grey'] = 0; vec.color = vec.attr['true_color'];
an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id]; vec.attr['grey'] = 0;
if(!isUndef(an_edge) && !an_edge.hidden){ an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id];
an_edge.color = an_edge.attr['true_color']; if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.attr['grey'] = 0; an_edge.color = an_edge.attr['true_color'];
} an_edge.attr['grey'] = 0;
an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id]; }
if(!isUndef(an_edge) && !an_edge.hidden) { an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id];
an_edge.color = an_edge.attr['true_color']; if(!isUndef(an_edge) && !an_edge.hidden) {
an_edge.attr['grey'] = 0; an_edge.color = an_edge.attr['true_color'];
an_edge.attr['grey'] = 0;
}
} }
} }
} }
...@@ -1512,6 +1525,9 @@ function changeToMeso(iwannagraph) { ...@@ -1512,6 +1525,9 @@ function changeToMeso(iwannagraph) {
} }
} }
} }
EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
$("#colorGraph").show();
} }
if(iwannagraph=="sociosemantic") { if(iwannagraph=="sociosemantic") {
...@@ -1528,6 +1544,11 @@ function changeToMeso(iwannagraph) { ...@@ -1528,6 +1544,11 @@ function changeToMeso(iwannagraph) {
createEdgesForExistingNodes(iwannagraph); createEdgesForExistingNodes(iwannagraph);
socsemFlag=true; socsemFlag=true;
} }
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size")
EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
$("#colorGraph").hide();
} }
if(iwannagraph=="semantic") { if(iwannagraph=="semantic") {
...@@ -1581,6 +1602,10 @@ function changeToMeso(iwannagraph) { ...@@ -1581,6 +1602,10 @@ function changeToMeso(iwannagraph) {
} }
} }
} }
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size")
$("#colorGraph").hide();
} }
// highlightSelectedNodes(true); // highlightSelectedNodes(true);
// partialGraph.draw(); // partialGraph.draw();
...@@ -1589,8 +1614,22 @@ function changeToMeso(iwannagraph) { ...@@ -1589,8 +1614,22 @@ function changeToMeso(iwannagraph) {
// partialGraph.startForceAtlas2(); // partialGraph.startForceAtlas2();
MultipleSelection(Object.keys(selections)); MultipleSelection(Object.keys(selections));
// greyEverything(); // greyEverything();
// for(var i in selections) markAsSelected(i,true); // for(var i in selections) markAsSelected(i,true);
// overNodes=true; // overNodes=true;
...@@ -1674,7 +1713,33 @@ function changeToMacro(iwannagraph) { ...@@ -1674,7 +1713,33 @@ function changeToMacro(iwannagraph) {
unHide(e); unHide(e);
} }
} }
if (!is_empty(selections))
MultipleSelection(Object.keys(selections));
} }
$.doTimeout(30,function (){
if(iwannagraph=="social") {
EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
$("#colorGraph").show();
}
if(iwannagraph=="semantic") {
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size")
$("#colorGraph").hide();
}
if(iwannagraph=="sociosemantic") {
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size")
EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
$("#colorGraph").hide();
}
});
// highlightSelectedNodes(true); // highlightSelectedNodes(true);
// // partialGraph.stopForceAtlas2(); // // partialGraph.stopForceAtlas2();
// partialGraph.draw(); // partialGraph.draw();
......
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