Commit 55110161 authored by pksm3's avatar pksm3

back to square 1

parent 5cd0728a
This diff is collapsed.
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -9,8 +9,7 @@ var getAdditionalInfo=false;//for topPapers div
var mainfile=false;
getUrlParam.file = $("#graphid").html();
//http://docs.delanoe.org/explorer_data.json
getUrlParam.file = "data/testgraph.json";
var dataFolderTree = {};
var gexfDict={};
......
......@@ -2,7 +2,7 @@
function scanDataFolder(){
$.ajax({
type: 'GET',
url: 'php/DirScan_main.php',
url: twjs+'php/DirScan_main.php',
//data: "type="+type+"&query="+jsonparams,
//contentType: "application/json",
//dataType: 'json',
......@@ -31,12 +31,12 @@ function jsActionOnGexfSelector(gexfLegend){
}
function listGexfs(){
divlen=$("#gexfs").length;
divlen=$("#gexf").length;
if(divlen>0) {
param = JSON.stringify(gexfDict);
$.ajax({
type: 'GET',
url: 'php/listFiles.php',
url: twjs+'php/listFiles.php',
//contentType: "application/json",
//dataType: 'json',
success : function(data){
......@@ -44,7 +44,7 @@ function listGexfs(){
javs='onchange="'+'jsActionOnGexfSelector(this.value);'+'"';
html+=javs;
html+=">";
html+='<option selected>[More Graphs]</option>';
html+='<option selected>[Select your Graph]</option>';
for(var i in data){
//pr("path: "+data[i]);
//pr("legend: "+getGexfLegend(data[i]));
......
......@@ -182,6 +182,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
// criteria = "size"
if(partialGraph._core.graph.edges.length==0) {
$(sliderDivID).freshslider({
range: true,
step:1,
......@@ -191,10 +192,11 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
console.log(low, high);
}
});
return;
}
var filterparams = AlgorithmForSliders ( Edges , type_attrb , type , criteria)
var filterparams = AlgorithmForSliders ( partialGraph._core.graph.edges , type_attrb , type , criteria)
var steps = filterparams["steps"]
var finalarray = filterparams["finalarray"]
......@@ -202,7 +204,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
var lastvalue=("0-"+(steps-1));
pushFilterValue( sliderDivID , lastvalue )
//finished
$(sliderDivID).freshslider({
range: true,
......@@ -328,7 +330,6 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
}
});
}
......@@ -342,7 +343,7 @@ function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) {
pr("\t\t\t\t\t\t[[ algorithm not applied "+sliderDivID+" ]]")
return;
}
// sliderDivID = "#sliderAEdgeWeight"
// type = "nodes1"
// type_attrb = "label"
......@@ -368,7 +369,7 @@ function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) {
return;
}
var filterparams = AlgorithmForSliders ( Nodes , type_attrb , type , criteria)
var filterparams = AlgorithmForSliders ( partialGraph._core.graph.nodes , type_attrb , type , criteria)
var steps = filterparams["steps"]
var finalarray = filterparams["finalarray"]
......@@ -429,7 +430,6 @@ function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) {
}
});
}
// Execution modes:
......@@ -440,16 +440,9 @@ function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) {
function AlgorithmForSliders( elements , type_attrb , type , criteria) {
// // ( 1 )
// // get visible sigma nodes|edges
var elems = [];/*=elements.filter(function(e) {
elems=elements.filter(function(e) {
return e[type_attrb]==type;
});*/
for(var e in elements) {
// pr(elements[e])
// pr("\t"+type_attrb)
if( elements[e][type_attrb]==type )
elems.push(elements[e])
}
});
// // ( 2 )
// // extract [ "edgeID" : edgeWEIGHT ] | [ "nodeID" : nodeSIZE ]
......
......@@ -21,7 +21,6 @@ if (mainfile) {
bringTheNoise( filename , "mono");
} else {
listGexfs();
parse(getUrlParam.file);
nb_cats = scanCategories();
pr("nb_cats: "+nb_cats);
......@@ -33,8 +32,7 @@ if (mainfile) {
if(!isUndef(gexfDict[getUrlParam.file])){
$("#currentGraph").html(gexfDict[getUrlParam.file]);
} else $("#currentGraph").html(getUrlParam.file);
scanDataFolder();
listGexfs();
// scanDataFolder();
});
}
});
......@@ -82,8 +80,9 @@ function sigmaLimits(){
altototal=$('#leftcolumn').height();
altofixtop=$('#fixedtop').height()
altodeftop=$('#defaultop').height()
$('#sigma-example').width(anchototal-sidebar);
$('#sigma-example').height(altototal-altofixtop-altodeftop-4);
if((anchototal-sidebar)>0)
$('#sigma-example').width(anchototal-sidebar);
$('#sigma-example').height(altototal-altofixtop-altodeftop-40);
pw=$('#sigma-example').width();
ph=$('#sigma-example').height();
......@@ -93,6 +92,7 @@ function sigmaLimits(){
function bringTheNoise(pathfile,type){
$("#semLoader").hide();
$('#modalloader').modal('show');
// $('.selectpicker').selectpicker();
......@@ -112,16 +112,9 @@ function bringTheNoise(pathfile,type){
// === resize topbar and tweakbar === //
var body=document.getElementsByTagName('body')[0];
body.style.paddingTop="41px";
body.style.paddingTop=$("#dafixedtop").height()+"px";
$('.etabs').click(function(){
$.doTimeout(500,function (){
$("#opossiteNodes").readmore({maxHeight:200});
$("#sameNodes").readmore({maxHeight:200});
});
});
$("#changetype").click(function(){
pr("")
pr(" ############ changeTYPE click");
......@@ -129,9 +122,6 @@ function bringTheNoise(pathfile,type){
changeType();
$.doTimeout(500,function (){
$('.etabs a[href="#tabs1"]').trigger('click');
});
printStates()
pr(" ############ / changeTYPE click");
......@@ -145,7 +135,6 @@ function bringTheNoise(pathfile,type){
printStates()
changeLevel();
// $("#tabs1").click()
printStates()
pr(" ############ / changeLEVEL click");
......@@ -215,17 +204,12 @@ function bringTheNoise(pathfile,type){
// < === EXTRACTING DATA === >
if(mainfile) {
pr("mainfile: "+mainfile)
if(gexfDict[pathfile]) $("#network").html(gexfDict[pathfile]);
else $("#network").html(pathfile);
// $('#modalloader').modal('show');
parse(decodeURIComponent(pathfile));
if(type=="mono") {
$("#changetype").hide();
if( pathfile.indexOf(".json") > -1 ) {
JSONFile( pathfile )
} else {
......@@ -233,12 +217,6 @@ function bringTheNoise(pathfile,type){
}
pushSWClick("social");
$("#taboppos").remove();
$.doTimeout(500,function (){
$('.etabs a[href="#tabs2"]').trigger('click');
});
pr(partialGraph._core.graph.nodes.length)
pr(partialGraph._core.graph.edges.length)
}
......@@ -253,7 +231,6 @@ function bringTheNoise(pathfile,type){
pr(partialGraph._core.graph.edges.length)
}
partialGraph.zoomTo(partialGraph._core.width / 2, partialGraph._core.height / 2, 0.8).draw(2,2,2);
theListeners();
$("#closeloader").click();
......@@ -262,8 +239,6 @@ function bringTheNoise(pathfile,type){
//
var theurl,thedata,thename;
$('#modalloader').modal('show');
if(type=="unique_id") {
pr("bring the noise, case: unique_id");
pr(getClientTime()+" : DataExt Ini");
......@@ -725,7 +700,7 @@ function SigmaLayouting( URL, DATA, NAME) {
dataType: 'jsonp',
async: true,
success : function(data) {
pr(data)
pr(data)
if(!isUndef(getUrlParam.seed))seed=getUrlParam.seed;
extractFromJson(data,seed);
......@@ -835,10 +810,9 @@ function SigmaLayouting( URL, DATA, NAME) {
// $("#sliderBEdgeWeight").html("");
// $("#sliderBNodeWeight").html("");
$("#category-B").show();
$("#colorGraph").hide();
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size");
$("#colorGraph").hide();
}
......
......@@ -30,7 +30,7 @@ function cancelSelection (fromTagCloud) {
if(fromTagCloud==false){
$("#names").html("");
$("#topPapers").html(""); $("#topPapers").hide();
$("#opossiteNodes").html(""); $("#tab-container").hide();
$("#opossiteNodes").html("");
$("#information").html("");
$("#searchinput").val("");
$("#switchbutton").hide();
......@@ -153,10 +153,7 @@ function RefreshState(newNOW){
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size");
});
} else {
$("#semLoader").css('visibility', 'visible');
$("#semLoader").show();
}
} else $("#semLoader").show();
}
if(NOW=="AaBb"){
......@@ -356,28 +353,6 @@ function htmlfied_alternodes(elems) {
return oppositesNodes
}
function manualForceLabel(nodeid,active) {
// pr("manual|"+nodeid+"|"+active)
partialGraph._core.graph.nodesIndex[nodeid].active=active;
partialGraph.draw();
}
function htmlfied_samenodes(elems) {
var sameNodes=[]
js1=' onmouseover="manualForceLabel(this.id,true);" ';
js2=' onmouseout="manualForceLabel(this.id,true);" ';
if(elems.length>0) {
var A = getVisibleNodes()
for (var a in A){
n = A[a]
if(!n.active && n.color.charAt(0)=="#" ) {
sameNodes.push('<li onmouseover="manualForceLabel(\''+n.id+'\',true)" onmouseout="manualForceLabel(\''+n.id+'\',false)" >'+ n.label+ '</li>')
}
}
}
return sameNodes
}
// nodes information div
function htmlfied_nodesatts(elems){
......@@ -411,9 +386,9 @@ function htmlfied_nodesatts(elems){
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="'+'img/google.png"></img></a>';
wiki = '<a href=http://en.wikipedia.org/wiki/'+node.label.replace(" ","_")+'><img src="'+'img/wikipedia.png"></img></a>';
flickr= '<a href=http://www.flickr.com/search/?w=all&q='+node.label.replace(" ","+")+'><img src="'+'img/flickr.png"></img></a>';
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)
}
......@@ -443,33 +418,17 @@ function updateLeftPanel_fix() {
alterNodesDIV+= '</div>';
}
sameNodesDIV = "";
sameNodesDIV+='<div id="sameNodes"><ul style="list-style: none;">';//tagcloud
sameNodesDIV += htmlfied_samenodes( getNodeIDs(selections) ).join("\n") ;
sameNodesDIV+= '</ul></div>';
// getTopPapers("semantic");
informationDIV += '<br><h4>Information:</h4><ul>';
informationDIV += htmlfied_nodesatts( getNodeIDs(selections) ).join("<br>\n")
informationDIV += '</ul><br>';
//using the readmore.js
// ive put a limit for nodes-name div
// and opposite-nodes div aka tagcloud div
// and im commenting now because github is not
// pushing my commit
// because i need more lines, idk
$("#names").html(namesDIV).readmore({maxHeight:100});
$("#tab-container").show();
$("#opossiteNodes").html(alterNodesDIV).readmore({maxHeight:200});
$("#sameNodes").html(sameNodesDIV).readmore({maxHeight:200});
$("#names").html(namesDIV);
$("#opossiteNodes").html(alterNodesDIV);
$("#information").html(informationDIV);
$("#tips").html("");
if(categoriesIndex.length==1) getTopPapers("semantic");
else getTopPapers(swclickActual);
// $("#topPapers").show();
}
function printStates() {
......@@ -623,19 +582,17 @@ function markAsSelected(n_id,sel) {
for(var i in neigh){
vec = partialGraph._core.graph.nodesIndex[neigh[i]];
if(vec) {
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;
}
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;
}
}
}
......@@ -1626,9 +1583,9 @@ function changeToMeso(iwannagraph) {
socsemFlag=true;
}
$("#category-B").show();
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size");
// EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
// NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size")
// EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
$("#colorGraph").hide();
}
......@@ -1734,9 +1691,6 @@ function changeToMeso(iwannagraph) {
}
}
$("#category-B").show();
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size");
// EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
// NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size")
$("#colorGraph").hide();
......@@ -1762,7 +1716,6 @@ function changeToMacro(iwannagraph) {
partialGraph.draw();
partialGraph.refresh();
$("#semLoader").css('visibility', 'visible');
$("#semLoader").show();
return;
......@@ -1784,11 +1737,6 @@ function changeToMacro(iwannagraph) {
createEdgesForExistingNodes(iwannagraph);
if(iwannagraph=="social") showMeSomeLabels(6);
else {
$("#category-B").show();
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size");
}
swMacro=true;
if (!is_empty(selections))
......
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