Commit 9e96eeda authored by PkSM3's avatar PkSM3

monograph ok

parent 7313845f
...@@ -62,7 +62,6 @@ function callGeomap(){ ...@@ -62,7 +62,6 @@ function callGeomap(){
// $("#CurrentView").hide(); // $("#CurrentView").hide();
} }
function clickInCountry( CC ) { function clickInCountry( CC ) {
// pr("in extras.js: you've clicked "+CC) // pr("in extras.js: you've clicked "+CC)
var results = [] var results = []
...@@ -177,78 +176,6 @@ function getTopPapers(type){ ...@@ -177,78 +176,6 @@ function getTopPapers(type){
} }
} }
//very obsolete: please renew!
//For UNI-PARTITE
function updateLeftPanel_uni(){//Uni-partite graph
pr("\t ** in updateLeftPanel_uni() ** ");
var names='';
var information='';
counter=0;
names+='<div id="selectionsBox">';
names += '<h4>';
for(var i in selections){
if(counter==4){
names += '<h4>[...]</h4>';
break;
}
names += Nodes[i].label+', ';
counter++;
}
names += '</h4>';
names=names.replace(", </h4>","</h4>");
names=names.replace(", <h4>","<h4>");
names+='</div>';
minFont=12;
//maxFont=(minFont+oposMAX)-1;
maxFont=20;
getTopPapers("semantic");
js2='\');"';
information += '<br><h4>Information:</h4>';
information += '<ul>';
for(var i in selections){
information += '<div id="opossitesBox">';
information += '<li><b>' + Nodes[i].label.toUpperCase() + '</b></li>';
//for(var j in Nodes[i].attributes){
// if(Nodes[i].attributes[j].attr=="period"||
// Nodes[i].attributes[j].attr=="cluster_label"
// )
information +=
'<li><b>Topic' +
'</b>:&nbsp;'+Nodes[i].attributes["cluster_label"]+'</li>';
information += '<a href="https://www.google.com/#q='+Nodes[i].label+'" target=blank>'+'www</a>';
//}
information += '</div>';
information += '</ul><br>';
}
$("#names").html(names); //Information extracted, just added
$("#information").html(information); //Information extracted, just added
$("#tips").html("");
$("#topPapers").show();
/***** The animation *****/
_cG = $("#leftcolumn");
_cG.animate({
"left" : "0px"
}, function() {
$("#aUnfold").attr("class","leftarrow");
$("#zonecentre").css({
left: _cG.width() + "px"
});
});
i=0; for(var s in selections) i++;
if(is_empty(selections)==true || i==0){
cancelSelection(false);
partialGraph.draw();
}
}
//FOR UNI-PARTITE //FOR UNI-PARTITE
function selectionUni(currentNode){ function selectionUni(currentNode){
...@@ -381,7 +308,7 @@ function getTips(){ ...@@ -381,7 +308,7 @@ function getTips(){
//da hell is this //both obsolete
function closeDialog () { function closeDialog () {
$('#windowTitleDialog').modal('hide'); $('#windowTitleDialog').modal('hide');
} }
......
...@@ -17,7 +17,7 @@ if (mainfile) { ...@@ -17,7 +17,7 @@ if (mainfile) {
parse(getUrlParam.file); parse(getUrlParam.file);
nb_cats = scanCategories(); nb_cats = scanCategories();
pr("nb_cats: "+nb_cats); pr("nb_cats: "+nb_cats);
listGexfs(); // listGexfs();
graphtype=(nb_cats==1)?"mono":"bi"; graphtype=(nb_cats==1)?"mono":"bi";
bringTheNoise(getUrlParam.file,graphtype); bringTheNoise(getUrlParam.file,graphtype);
...@@ -194,13 +194,14 @@ function bringTheNoise(pathfile,type){ ...@@ -194,13 +194,14 @@ function bringTheNoise(pathfile,type){
// < === EXTRACTING DATA === > // < === EXTRACTING DATA === >
if(mainfile) { if(mainfile) {
pr("mainfile: "+mainfile) pr("mainfile: "+mainfile)
parse(decodeURIComponent(pathfile)); parse(decodeURIComponent(pathfile));
if(type=="mono") { if(type=="mono") {
$("#changetype").hide();
onepartiteExtract(); onepartiteExtract();
$("#left").hide(); pushSWClick("social");
pr(partialGraph._core.graph.nodes.length)
pr(partialGraph._core.graph.edges.length)
} }
if(type=="bi") { if(type=="bi") {
...@@ -208,8 +209,6 @@ function bringTheNoise(pathfile,type){ ...@@ -208,8 +209,6 @@ function bringTheNoise(pathfile,type){
semanticConverged=true; semanticConverged=true;
pr("here in fullextract") pr("here in fullextract")
fullExtract(); fullExtract();
$("#closeloader").click();
pushSWClick("social"); pushSWClick("social");
pr(partialGraph._core.graph.nodes.length) pr(partialGraph._core.graph.nodes.length)
pr(partialGraph._core.graph.edges.length) pr(partialGraph._core.graph.edges.length)
...@@ -217,9 +216,10 @@ function bringTheNoise(pathfile,type){ ...@@ -217,9 +216,10 @@ function bringTheNoise(pathfile,type){
partialGraph.zoomTo(partialGraph._core.width / 2, partialGraph._core.height / 2, 0.8).draw(2,2,2); partialGraph.zoomTo(partialGraph._core.width / 2, partialGraph._core.height / 2, 0.8).draw(2,2,2);
theListeners(); theListeners();
$("#closeloader").click();
} else { } else {
//
var theurl,thedata,thename; var theurl,thedata,thename;
if(type=="unique_id") { if(type=="unique_id") {
...@@ -240,6 +240,7 @@ function bringTheNoise(pathfile,type){ ...@@ -240,6 +240,7 @@ function bringTheNoise(pathfile,type){
thename = false; thename = false;
} }
// Assigning name for the network
if (thename) thename = getUrlParam.nodeidparam.replace(/\_/g, ' ').toUpperCase(); if (thename) thename = getUrlParam.nodeidparam.replace(/\_/g, ' ').toUpperCase();
else { else {
elements = [] elements = []
...@@ -251,8 +252,8 @@ function bringTheNoise(pathfile,type){ ...@@ -251,8 +252,8 @@ function bringTheNoise(pathfile,type){
} }
} }
thename = '"'+elements.join('" , "')+'"'; thename = '"'+elements.join('" , "')+'"';
} }
SigmaLayouting( theurl , thedata , thename ); SigmaLayouting( theurl , thedata , thename );
} }
} }
......
...@@ -365,22 +365,33 @@ function htmlfied_nodesatts(elems){ ...@@ -365,22 +365,33 @@ function htmlfied_nodesatts(elems){
var id=elems[i] var id=elems[i]
var node = Nodes[id] var node = Nodes[id]
if(node.type==catSoc){ if (mainfile) {
information += '<li><b>' + node.label + '</b></li>'; information += '<li><b>' + node.label + '</b></li>';
if(node.htmlCont==""){ for (var i in node.attributes) {
if (!isUndef(node.level)) information += '<li>' + node.level + '</li>'; information += '<li>&nbsp;&nbsp;'+i +" : " + node.attributes[i] + '</li>';
} else { }
information += '<li>' + $("<div/>").html(node.htmlCont).text() + '</li>'; socnodes.push(information);
} } else {
socnodes.push(information) if(node.type==catSoc){
} information += '<li><b>' + node.label + '</b></li>';
if(node.type==catSem){ if(node.htmlCont==""){
information += '<li><b>' + node.label + '</b></li>'; if (!isUndef(node.level)) {
google='<a href=http://www.google.com/#hl=en&source=hp&q=%20'+node.label.replace(" ","+")+'%20><img src="'+twjs+'img/google.png"></img></a>'; information += '<li>' + node.level + '</li>';
wiki = '<a href=http://en.wikipedia.org/wiki/'+node.label.replace(" ","_")+'><img src="'+twjs+'img/wikipedia.png"></img></a>'; }
flickr= '<a href=http://www.flickr.com/search/?w=all&q='+node.label.replace(" ","+")+'><img src="'+twjs+'img/flickr.png"></img></a>'; } else {
information += '<li>'+google+"&nbsp;"+wiki+"&nbsp;"+flickr+'</li><br>'; information += '<li>' + $("<div/>").html(node.htmlCont).text() + '</li>';
semnodes.push(information) }
socnodes.push(information)
}
if(node.type==catSem){
information += '<li><b>' + node.label + '</b></li>';
google='<a href=http://www.google.com/#hl=en&source=hp&q=%20'+node.label.replace(" ","+")+'%20><img src="'+twjs+'img/google.png"></img></a>';
wiki = '<a href=http://en.wikipedia.org/wiki/'+node.label.replace(" ","_")+'><img src="'+twjs+'img/wikipedia.png"></img></a>';
flickr= '<a href=http://www.flickr.com/search/?w=all&q='+node.label.replace(" ","+")+'><img src="'+twjs+'img/flickr.png"></img></a>';
information += '<li>'+google+"&nbsp;"+wiki+"&nbsp;"+flickr+'</li><br>';
semnodes.push(information)
}
} }
} }
return socnodes.concat(semnodes) return socnodes.concat(semnodes)
...@@ -1039,8 +1050,10 @@ function MultipleSelection(nodes){ ...@@ -1039,8 +1050,10 @@ function MultipleSelection(nodes){
if(!checkBox) { if(!checkBox) {
checkBox=true; checkBox=true;
pr("IN MULTIPLE SELECTION: past="+PAST)
if(!is_empty(prevsels) && (PAST==NOW || PAST=="--")) { pr("IN MULTIPLE SELECTION: now="+NOW)
if(!is_empty(prevsels) && (PAST=="--" || PAST==NOW )) {
var blacklist = {}; var blacklist = {};
for(var i in ndsids) { for(var i in ndsids) {
ID = ndsids[i]; ID = ndsids[i];
...@@ -1061,6 +1074,10 @@ function MultipleSelection(nodes){ ...@@ -1061,6 +1074,10 @@ function MultipleSelection(nodes){
ndsids = tmparr; ndsids = tmparr;
} }
} }
// bug in first A* to a*
pr("IN MULTIPLE SELECTION: ndsids=")
pr(ndsids)
pr("")
if (ndsids.length>0) { if (ndsids.length>0) {
for(var i in ndsids) { for(var i in ndsids) {
...@@ -1092,8 +1109,9 @@ function MultipleSelection(nodes){ ...@@ -1092,8 +1109,9 @@ function MultipleSelection(nodes){
partialGraph.draw(); partialGraph.draw();
if(categoriesIndex.length==1) updateLeftPanel_uni(); updateLeftPanel_fix();
if(categoriesIndex.length==2) updateLeftPanel_fix(); // if(categoriesIndex.length==1) updateLeftPanel_uni();
// if(categoriesIndex.length==2) updateLeftPanel_fix();
RefreshState("") RefreshState("")
} }
...@@ -1303,8 +1321,8 @@ function hideEverything(){ ...@@ -1303,8 +1321,8 @@ function hideEverything(){
} }
function unHide(id){ function unHide(id){
pr("unhide "+id)
// pr("in unhide "+iwantograph+" | swMacro: "+swMacro) id = ""+id;
if(id.split(";").length==1) { if(id.split(";").length==1) {
// i've received a NODE // i've received a NODE
if(!isUndef(getn(id))) return; if(!isUndef(getn(id))) return;
......
...@@ -115,9 +115,9 @@ function onepartiteExtract(){ ...@@ -115,9 +115,9 @@ function onepartiteExtract(){
window.NODE = nodeNode; window.NODE = nodeNode;
var id = nodeNode.getAttribute('id'); var id = ""+nodeNode.getAttribute('id');
var label = nodeNode.getAttribute('label') || id; var label = nodeNode.getAttribute('label') || id;
//viz //viz
var size=1; var size=1;
sizeNodes = nodeNode.getElementsByTagName('size'); sizeNodes = nodeNode.getElementsByTagName('size');
...@@ -281,7 +281,6 @@ function onepartiteExtract(){ ...@@ -281,7 +281,6 @@ function onepartiteExtract(){
} }
} }
$("#closeloader").click();
} }
function fullExtract(){ function fullExtract(){
...@@ -348,7 +347,6 @@ function fullExtract(){ ...@@ -348,7 +347,6 @@ function fullExtract(){
var id = nodeNode.getAttribute('id'); var id = nodeNode.getAttribute('id');
var label = nodeNode.getAttribute('label') || id; var label = nodeNode.getAttribute('label') || id;
//viz
var size=1; var size=1;
sizeNodes = nodeNode.getElementsByTagName('size'); sizeNodes = nodeNode.getElementsByTagName('size');
...@@ -422,8 +420,7 @@ function fullExtract(){ ...@@ -422,8 +420,7 @@ function fullExtract(){
numberOfDocs++; numberOfDocs++;
//node.size=desirableScholarSize; //node.size=desirableScholarSize;
if(typeof(node.size)==="undefined") node.size=nodew; if(typeof(node.size)==="undefined") node.size=nodew;
} } else {
else {
node.type=catSem; node.type=catSem;
node.id = "N::"+node.id; node.id = "N::"+node.id;
numberOfNGrams++; numberOfNGrams++;
...@@ -439,14 +436,16 @@ function fullExtract(){ ...@@ -439,14 +436,16 @@ function fullExtract(){
} }
} }
//New scale for node size: now, between 2 and 5 instead [1,70] //New scale for node size: now, between 2 and 5 instead [1,70]
for(var i in Nodes){ for(var i in Nodes){
normalizedSize=desirableNodeSizeMIN+(Nodes[i].size-1)*((desirableNodeSizeMAX-desirableNodeSizeMIN)/(parseInt(maxNodeSize)-parseInt(minNodeSize))); normalizedSize=desirableNodeSizeMIN+(Nodes[i].size-1)*((desirableNodeSizeMAX-desirableNodeSizeMIN)/(parseInt(maxNodeSize)-parseInt(minNodeSize)));
Nodes[i].size = ""+normalizedSize; Nodes[i].size = ""+normalizedSize;
nodeK = Nodes[i]; nodeK = Nodes[i];
if(Nodes[i].type==catSoc) partialGraph.addNode(i,nodeK); if(Nodes[i].type==catSoc) {
nodeK.shape="square";
partialGraph.addNode(i,nodeK);
}
// pr(nodeK)
} }
...@@ -465,7 +464,6 @@ function fullExtract(){ ...@@ -465,7 +464,6 @@ function fullExtract(){
target = (Nodes["D::"+target])? ("D::"+target):("N::"+target) target = (Nodes["D::"+target])? ("D::"+target):("N::"+target)
var indice=source+";"+target; var indice=source+";"+target;
var edge = { var edge = {
id: indice, id: indice,
...@@ -507,6 +505,9 @@ function fullExtract(){ ...@@ -507,6 +505,9 @@ function fullExtract(){
idT=Nodes[edge.targetID].type; idT=Nodes[edge.targetID].type;
Edges[indice] = edge; Edges[indice] = edge;
if(idS==idT)
pr(edge.sourceID+"|"+idS+" <-> "+idT+"|"+edge.targetID)
if(idS==catSoc && idT==catSoc){ if(idS==catSoc && idT==catSoc){
// pr("anything here?") // pr("anything here?")
...@@ -600,7 +601,6 @@ function fullExtract(){ ...@@ -600,7 +601,6 @@ function fullExtract(){
} }
} }
$("#closeloader").click();
} }
......
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