Commit e0e0f171 authored by PkSM3's avatar PkSM3

[exceptions at reading the graph]

parent 198d068c
...@@ -210,7 +210,50 @@ function genericGetTopPapers(theids , corpus_id , thediv) { ...@@ -210,7 +210,50 @@ function genericGetTopPapers(theids , corpus_id , thediv) {
}); });
} }
//DataFolderMode function TestFunction() {
//http://localhost:8000/api/corpusintersection/1a50317a50145
var jquerytemplatenb = $("#jquerytemplatenb").html()
var corpuses = $('input[name=optradio]:checked')[0];
if(isUndef(corpuses))
return false;
var pageurl = window.location.href.split("/")
var cid;
for(var i in pageurl) {
if(pageurl[i]=="corpus") {
cid=parseInt(i);
break;
}
}
var corpus_id = pageurl[cid+1];
pr("")
pr("!!!!!!! DEBUGGING !!!!!!!")
// pr(jquerytemplatenb)
// pr(corpuses.id)
// pr(corpus_id)
var theids = [jquerytemplatenb , corpus_id , corpuses.id]
var query_url = window.location.origin+'/api/corpusintersection/'+corpus_id+'/'+theids.join("a")
pr(query_url)
pr("!!!!!!! !!!!!!! !!!!!!! !!!!!!!")
pr("")
// $.ajax({
// type: 'GET',
// url: window.location.origin+'/api/corpusintersection/'+corpus_id+'/'+theids.join("a"),
// //contentType: "application/json",
// //dataType: 'json',
// success : function(data){
// console.log(data)
// },
// error: function(){
// pr('Page Not found: TestFunction()');
// }
// });
}
// Uses: genericGetTopPapers()
function getTopPapers(type){ function getTopPapers(type){
if(getAdditionalInfo){ if(getAdditionalInfo){
...@@ -238,6 +281,13 @@ function getTopPapers(type){ ...@@ -238,6 +281,13 @@ function getTopPapers(type){
pr("the IDs of the selectioons") pr("the IDs of the selectioons")
pr(theids) pr(theids)
pr("")
pr("!!!!!!! DEBUGGING !!!!!!!")
pr(window.location.origin+'/api/tfidf/'+corpus_id+'/'+theids.join("a"))
pr("!!!!!!! !!!!!!! !!!!!!! !!!!!!!")
pr("")
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: window.location.origin+'/api/tfidf/'+corpus_id+'/'+theids.join("a"), url: window.location.origin+'/api/tfidf/'+corpus_id+'/'+theids.join("a"),
...@@ -307,7 +357,9 @@ function getTopPapers(type){ ...@@ -307,7 +357,9 @@ function getTopPapers(type){
} }
} }
// NOT-USED
function printCorpuses() { function printCorpuses() {
console.log( "!!!!!!!! in printCorpuses() !!!!!!!! " )
var corpuses = $('input[name=optradio]:checked'); var corpuses = $('input[name=optradio]:checked');
var count = 3 var count = 3
for(var c in corpuses) { for(var c in corpuses) {
...@@ -351,6 +403,51 @@ function printCorpuses() { ...@@ -351,6 +403,51 @@ function printCorpuses() {
console.log(" - - -- -- - ") console.log(" - - -- -- - ")
console.log(corpusesList) console.log(corpusesList)
var theids = []
var pageurl = window.location.href.split("/")
var cid;
for(var i in pageurl) {
if(pageurl[i]=="corpus") {
cid=parseInt(i);
break;
}
}
var corpus_id = pageurl[cid+1];
theids.push( corpus_id )
for(var corpora in corpusesList) {
console.log("other corpus_id:")
console.log( corpora )
theids.push( corpora )
break
}
console.log("the two corpuses:")
console.log( theids )
$.ajax({
type: 'GET',
url: window.location.origin+'/api/corpusintersection/'+theids.join("a"),
//contentType: "application/json",
//dataType: 'json',
success : function(data){
var nodes = getVisibleNodes()
for(var n in nodes) {
if(data[nodes[n].id]) {
nodes[n].color = "#ff0000";
}
}
partialGraph.draw()
},
error: function(){
pr('Page Not found: printCorpuses()');
}
});
} }
......
...@@ -9,7 +9,7 @@ var getAdditionalInfo=true;//for topPapers div ...@@ -9,7 +9,7 @@ var getAdditionalInfo=true;//for topPapers div
var mainfile=false; var mainfile=false;
getUrlParam.file = window.location.origin+"/"+$("#graphid").html(); getUrlParam.file = window.location.origin+"/static/node_link.json";//window.location.origin+"/"+$("#graphid").html();
var corpusesList = {} var corpusesList = {}
var dataFolderTree = {}; var dataFolderTree = {};
......
...@@ -680,8 +680,8 @@ function parseSimpleJSON( data , seed ) { ...@@ -680,8 +680,8 @@ function parseSimpleJSON( data , seed ) {
pk = (isUndef(nodesNodes[i].pk))?"":nodesNodes[i].pk; pk = (isUndef(nodesNodes[i].pk))?"":nodesNodes[i].pk;
color = (isUndef(nodesNodes[i].color))?"#800000":nodesNodes[i].color; color = (isUndef(nodesNodes[i].color))?"#800000":nodesNodes[i].color;
label = (isUndef(nodesNodes[i].label)) ? ("node_"+i): nodesNodes[i].label; label = ((isUndef(nodesNodes[i].label)) ? ("node_"+i): nodesNodes[i].label)+"";
size = (isUndef(nodesNodes[i].size))?1:nodesNodes[i].size; size = Number((isUndef(nodesNodes[i].size))?1:nodesNodes[i].size);
group = (isUndef(nodesNodes[i].group))?1:nodesNodes[i].group; group = (isUndef(nodesNodes[i].group))?1:nodesNodes[i].group;
// iscluster = (isUndef(nodesNodes[i].hidden))?false:nodesNodes[i].hidden; // iscluster = (isUndef(nodesNodes[i].hidden))?false:nodesNodes[i].hidden;
// if (iscluster==1) { // if (iscluster==1) {
...@@ -692,7 +692,7 @@ function parseSimpleJSON( data , seed ) { ...@@ -692,7 +692,7 @@ function parseSimpleJSON( data , seed ) {
var node = ({ var node = ({
id: pk , id: pk ,
label:label, label:label,
size:Math.log(size), size: Math.log(size+1),
x:rand.getRandom(), x:rand.getRandom(),
y:rand.getRandom(), y:rand.getRandom(),
type:catSoc, type:catSoc,
...@@ -703,13 +703,13 @@ function parseSimpleJSON( data , seed ) { ...@@ -703,13 +703,13 @@ function parseSimpleJSON( data , seed ) {
lock:false, lock:false,
iscluster: false iscluster: false
}); // The graph node }); // The graph node
// pr(node) pr(node.color)
Nodes[pk] = node; Nodes[pk] = node;
if(parseInt(node.size) < parseInt(minNodeSize)) minNodeSize= node.size; if(parseInt(node.size) < parseInt(minNodeSize)) minNodeSize= node.size;
if(parseInt(node.size) > parseInt(maxNodeSize)) maxNodeSize= node.size; if(parseInt(node.size) > parseInt(maxNodeSize)) maxNodeSize= node.size;
} }
pr("IMAFJAIJOAJSODJASKJD 01")
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)));
...@@ -748,7 +748,6 @@ function parseSimpleJSON( data , seed ) { ...@@ -748,7 +748,6 @@ function parseSimpleJSON( data , seed ) {
idS=Nodes[edge.sourceID].type; idS=Nodes[edge.sourceID].type;
idT=Nodes[edge.targetID].type; idT=Nodes[edge.targetID].type;
if(idS==catSoc && idT==catSoc) { if(idS==catSoc && idT==catSoc) {
edge.label = "nodes1"; edge.label = "nodes1";
...@@ -768,9 +767,10 @@ function parseSimpleJSON( data , seed ) { ...@@ -768,9 +767,10 @@ function parseSimpleJSON( data , seed ) {
nodes1[source].neighbours.push(target); nodes1[source].neighbours.push(target);
nodes1[target].neighbours.push(source); nodes1[target].neighbours.push(source);
if(Nodes[source].color && Nodes[target].color) {
Edges[indice] = edge; Edges[indice] = edge;
partialGraph.addEdge(indice,source,target,edge); partialGraph.addEdge(indice,source,target,edge);
}
} }
} }
......
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