Commit 53a568d8 authored by Romain Loth's avatar Romain Loth

graphexplorer: remove debug comments used to trace functions during the summer

parent 1683883d
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
*/ */
function newPopup(url) { function newPopup(url) {
console.log('FUN extras_explorerjs:newPopup') // console.log('FUN extras_explorerjs:newPopup')
popupWindow = window.open(url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no') popupWindow = window.open(url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
} }
function getIDFromURL( item ) { function getIDFromURL( item ) {
console.log('FUN extras_explorerjs:getIDFromURL') // console.log('FUN extras_explorerjs:getIDFromURL')
var pageurl = window.location.href.split("/") var pageurl = window.location.href.split("/")
var cid; var cid;
for(var i in pageurl) { for(var i in pageurl) {
...@@ -22,7 +22,7 @@ function getIDFromURL( item ) { ...@@ -22,7 +22,7 @@ function getIDFromURL( item ) {
} }
function modify_ngrams( classname ) { function modify_ngrams( classname ) {
console.log('FUN extras_explorerjs:modify_ngrams') // console.log('FUN extras_explorerjs:modify_ngrams')
console.clear() console.clear()
var corpus_id = getIDFromURL( "corpora" ) // not used var corpus_id = getIDFromURL( "corpora" ) // not used
...@@ -102,7 +102,7 @@ $(document).on('keyup keydown', function(e){ ...@@ -102,7 +102,7 @@ $(document).on('keyup keydown', function(e){
// then, add the button in the html with the sigmaUtils.clustersBy(x) listener. // then, add the button in the html with the sigmaUtils.clustersBy(x) listener.
//TODO: move to ClustersPlugin.js or smntng //TODO: move to ClustersPlugin.js or smntng
function ChangeGraphAppearanceByAtt( manualflag ) { function ChangeGraphAppearanceByAtt( manualflag ) {
console.log('FUN extras_explorerjs:ChangeGraphAppearanceByAtt') // console.log('FUN extras_explorerjs:ChangeGraphAppearanceByAtt')
if ( !isUndef(manualflag) && !colorByAtt ) colorByAtt = manualflag; if ( !isUndef(manualflag) && !colorByAtt ) colorByAtt = manualflag;
if(!colorByAtt) return; if(!colorByAtt) return;
...@@ -242,7 +242,7 @@ $(document).on('keyup keydown', function(e){ ...@@ -242,7 +242,7 @@ $(document).on('keyup keydown', function(e){
// then, it runs external library jLouvain() // then, it runs external library jLouvain()
//TODO: move to ClustersPlugin.js or smntng //TODO: move to ClustersPlugin.js or smntng
function RunLouvain() { function RunLouvain() {
console.log('FUN extras_explorerjs:RunLouvain') // console.log('FUN extras_explorerjs:RunLouvain')
var node_realdata = [] var node_realdata = []
var nodesV = getVisibleNodes() var nodesV = getVisibleNodes()
...@@ -269,7 +269,7 @@ $(document).on('keyup keydown', function(e){ ...@@ -269,7 +269,7 @@ $(document).on('keyup keydown', function(e){
// Highlight nodes belonging to cluster_i when you click in thecluster_i of the legend // Highlight nodes belonging to cluster_i when you click in thecluster_i of the legend
//TODO: move to ClustersPlugin.js or smntng //TODO: move to ClustersPlugin.js or smntng
function HoverCluster( ClusterCode ) { function HoverCluster( ClusterCode ) {
console.log('FUN extras_explorerjs:HoverCluster') // console.log('FUN extras_explorerjs:HoverCluster')
console.log( ClusterCode ) console.log( ClusterCode )
var raw = ClusterCode.split("||") var raw = ClusterCode.split("||")
...@@ -357,7 +357,7 @@ $(document).on('keyup keydown', function(e){ ...@@ -357,7 +357,7 @@ $(document).on('keyup keydown', function(e){
// daclass = "clust_default" | "clust_louvain" | "clust_x" ... // daclass = "clust_default" | "clust_louvain" | "clust_x" ...
//TODO: move to ClustersPlugin.js or smntng //TODO: move to ClustersPlugin.js or smntng
function set_ClustersLegend ( daclass ) { function set_ClustersLegend ( daclass ) {
console.log('FUN extras_explorerjs:set_ClustersLegend') // console.log('FUN extras_explorerjs:set_ClustersLegend')
//partialGraph.states.slice(-1)[0].LouvainFait = true //partialGraph.states.slice(-1)[0].LouvainFait = true
if( daclass=="clust_default" && Clusters.length==0) if( daclass=="clust_default" && Clusters.length==0)
...@@ -419,7 +419,7 @@ $(document).on('keyup keydown', function(e){ ...@@ -419,7 +419,7 @@ $(document).on('keyup keydown', function(e){
// PHP-mode when you've a cortext db. // PHP-mode when you've a cortext db.
function getTopPapers_OriginalVersion(type){ function getTopPapers_OriginalVersion(type){
console.log('FUN extras_explorerjs:getTopPapers_OriginalVersion') // console.log('FUN extras_explorerjs:getTopPapers_OriginalVersion')
if(getAdditionalInfo){ if(getAdditionalInfo){
jsonparams=JSON.stringify(getSelections()); jsonparams=JSON.stringify(getSelections());
bi=(Object.keys(categories).length==2)?1:0; bi=(Object.keys(categories).length==2)?1:0;
...@@ -451,7 +451,7 @@ function getTopPapers_OriginalVersion(type){ ...@@ -451,7 +451,7 @@ function getTopPapers_OriginalVersion(type){
// PHP-mode when you've a cortext db. // PHP-mode when you've a cortext db.
function getTopProposals(type , jsonparams , thisgexf) { function getTopProposals(type , jsonparams , thisgexf) {
console.log('FUN extras_explorerjs:getTopProposals') // console.log('FUN extras_explorerjs:getTopProposals')
type = "semantic"; type = "semantic";
if(swclickActual=="social") { if(swclickActual=="social") {
nodesA = [] nodesA = []
...@@ -507,7 +507,7 @@ function getTopProposals(type , jsonparams , thisgexf) { ...@@ -507,7 +507,7 @@ function getTopProposals(type , jsonparams , thisgexf) {
// Just for Garg // Just for Garg
function genericGetTopPapers(theids , corpus_id , thediv) { function genericGetTopPapers(theids , corpus_id , thediv) {
console.log('FUN extras_explorerjs:genericGetTopPapers') // console.log('FUN extras_explorerjs:genericGetTopPapers')
if(getAdditionalInfo) { if(getAdditionalInfo) {
$("#"+thediv).show(); $("#"+thediv).show();
$.ajax({ $.ajax({
...@@ -568,7 +568,7 @@ function genericGetTopPapers(theids , corpus_id , thediv) { ...@@ -568,7 +568,7 @@ function genericGetTopPapers(theids , corpus_id , thediv) {
// Just for Garg: woops, override // Just for Garg: woops, override
function getTopPapers(type){ function getTopPapers(type){
console.log('FUN extras_explorerjs:getTopPapers') // console.log('FUN extras_explorerjs:getTopPapers')
if(getAdditionalInfo){ if(getAdditionalInfo){
$("#topPapers").show(); $("#topPapers").show();
...@@ -680,7 +680,7 @@ function getTopPapers(type){ ...@@ -680,7 +680,7 @@ function getTopPapers(type){
} }
function getCookie(name) { function getCookie(name) {
console.log('FUN extras_explorerjs:getCookie') // console.log('FUN extras_explorerjs:getCookie')
var cookieValue = null; var cookieValue = null;
if (document.cookie && document.cookie != '') { if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';'); var cookies = document.cookie.split(';');
...@@ -697,7 +697,7 @@ function getCookie(name) { ...@@ -697,7 +697,7 @@ function getCookie(name) {
} }
// Just for Garg // Just for Garg
function printCorpuses() { function printCorpuses() {
console.log('FUN extras_explorerjs:printCorpuses') // console.log('FUN extras_explorerjs:printCorpuses')
console.clear() console.clear()
console.log( "!!!!!!!! Corpus chosen, going to make the diff !!!!!!!! " ) console.log( "!!!!!!!! Corpus chosen, going to make the diff !!!!!!!! " )
pr(corpusesList) pr(corpusesList)
...@@ -819,7 +819,7 @@ function printCorpuses() { ...@@ -819,7 +819,7 @@ function printCorpuses() {
// Just for Garg // Just for Garg
function GetUserPortfolio() { function GetUserPortfolio() {
console.log('FUN extras_explorerjs:GetUserPortfolio') // console.log('FUN extras_explorerjs:GetUserPortfolio')
//http://localhost:8000/api/corpusintersection/1a50317a50145 //http://localhost:8000/api/corpusintersection/1a50317a50145
var pageurl = window.location.href.split("/") var pageurl = window.location.href.split("/")
var pid; var pid;
...@@ -937,7 +937,7 @@ function GetUserPortfolio() { ...@@ -937,7 +937,7 @@ function GetUserPortfolio() {
} }
function camaraButton(){ function camaraButton(){
console.log('FUN extras_explorerjs:camaraButton') // console.log('FUN extras_explorerjs:camaraButton')
$("#PhotoGraph").click(function (){ $("#PhotoGraph").click(function (){
//canvas=partialGraph._core.domElements.nodes; //canvas=partialGraph._core.domElements.nodes;
...@@ -991,7 +991,7 @@ function camaraButton(){ ...@@ -991,7 +991,7 @@ function camaraButton(){
function getTips(){ function getTips(){
console.log('FUN extras_explorerjs:getTips') // console.log('FUN extras_explorerjs:getTips')
param=''; param='';
text = text =
......
function scanDataFolder(){ function scanDataFolder(){
console.log('FUN t.DataScanner:scanDataFolder') // console.log('FUN t.DataScanner:scanDataFolder')
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: 'php/DirScan_main.php', url: 'php/DirScan_main.php',
...@@ -18,19 +18,19 @@ function scanDataFolder(){ ...@@ -18,19 +18,19 @@ function scanDataFolder(){
} }
function getGexfPath(v){ function getGexfPath(v){
console.log('FUN t.DataScanner:getGexfPath') // console.log('FUN t.DataScanner:getGexfPath')
gexfpath=(gexfDictReverse[v])?gexfDictReverse[v]:v; gexfpath=(gexfDictReverse[v])?gexfDictReverse[v]:v;
return gexfpath; return gexfpath;
} }
function getGexfLegend(gexfPath){ function getGexfLegend(gexfPath){
console.log('FUN t.DataScanner:getGexfLegend') // console.log('FUN t.DataScanner:getGexfLegend')
legend=(gexfDict[gexfPath])?gexfDict[gexfPath]:gexfPath; legend=(gexfDict[gexfPath])?gexfDict[gexfPath]:gexfPath;
return legend; return legend;
} }
function jsActionOnGexfSelector(gexfLegend){ function jsActionOnGexfSelector(gexfLegend){
console.log('FUN t.DataScanner:jsActionOnGexfSelector') // console.log('FUN t.DataScanner:jsActionOnGexfSelector')
if(getGexfPath[gexfLegend]) if(getGexfPath[gexfLegend])
window.location=window.location.origin+window.location.pathname+"?file="+encodeURIComponent(getGexfPath(gexfLegend)); window.location=window.location.origin+window.location.pathname+"?file="+encodeURIComponent(getGexfPath(gexfLegend));
else else
...@@ -38,7 +38,7 @@ function jsActionOnGexfSelector(gexfLegend){ ...@@ -38,7 +38,7 @@ function jsActionOnGexfSelector(gexfLegend){
} }
function listGexfs(){ function listGexfs(){
console.log('FUN t.DataScanner:listGexfs') // console.log('FUN t.DataScanner:listGexfs')
divlen=$("#gexfs").length; divlen=$("#gexfs").length;
if(divlen>0) { if(divlen>0) {
param = JSON.stringify(gexfDict); param = JSON.stringify(gexfDict);
......
// Function.prototype.index // Function.prototype.index
(function(reComments, reParams, reNames) { (function(reComments, reParams, reNames) {
Function.prototype.index = function(arrParamNames) { Function.prototype.index = function(arrParamNames) {
console.log('FUN t.TinawebJS:Function=>index') // console.log('FUN t.TinawebJS:Function=>index')
var fnMe = this; var fnMe = this;
arrParamNames = arrParamNames arrParamNames = arrParamNames
|| (((fnMe + '').replace(reComments, '') || (((fnMe + '').replace(reComments, '')
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
// on window resize // on window resize
// @param canvasdiv: id of the div (without '#') // @param canvasdiv: id of the div (without '#')
function sigmaLimits( canvasdiv, SidecolumnIsInvisible ) { function sigmaLimits( canvasdiv, SidecolumnIsInvisible ) {
console.log('FUN t.TinawebJS:sigmaLimits (div=' + canvasdiv + ')') ; // console.log('FUN t.TinawebJS:sigmaLimits (div=' + canvasdiv + ')') ;
var canvas = document.getElementById(canvasdiv) ; var canvas = document.getElementById(canvasdiv) ;
var sidecolumn = document.getElementById('sidecolumn') ; var sidecolumn = document.getElementById('sidecolumn') ;
...@@ -52,10 +52,10 @@ function sigmaLimits( canvasdiv, SidecolumnIsInvisible ) { ...@@ -52,10 +52,10 @@ function sigmaLimits( canvasdiv, SidecolumnIsInvisible ) {
SelectionEngine = function() { SelectionEngine = function() {
console.log('FUN t.TinawebJS:SelectionEngine:new') // console.log('FUN t.TinawebJS:SelectionEngine:new')
// Selection Engine!! finally... // Selection Engine!! finally...
this.SelectorEngine_part01 = (function(cursorsize, area ) { this.SelectorEngine_part01 = (function(cursorsize, area ) {
console.log('FUN t.TinawebJS:SelectionEngine:SelectorEngine_part01') // console.log('FUN t.TinawebJS:SelectionEngine:SelectorEngine_part01')
var clickedNodes = [] var clickedNodes = []
if(cursorsize>0) { if(cursorsize>0) {
clickedNodes = this.SelectThis2( area ) clickedNodes = this.SelectThis2( area )
...@@ -70,7 +70,7 @@ SelectionEngine = function() { ...@@ -70,7 +70,7 @@ SelectionEngine = function() {
}).index(); }).index();
this.SelectorEngine_part02 = (function( addvalue , clicktype , prevsels , currsels ) { this.SelectorEngine_part02 = (function( addvalue , clicktype , prevsels , currsels ) {
console.log('FUN t.TinawebJS:SelectionEngine:SelectorEngine_part02') // console.log('FUN t.TinawebJS:SelectionEngine:SelectorEngine_part02')
print("Add[]:") print("Add[]:")
print(addvalue) print(addvalue)
print("clicktype:") print("clicktype:")
...@@ -127,7 +127,7 @@ SelectionEngine = function() { ...@@ -127,7 +127,7 @@ SelectionEngine = function() {
}).index(); }).index();
this.SelectorEngine = (function( cursorsize , area , addvalue , clicktype , prevsels , currsels ) { this.SelectorEngine = (function( cursorsize , area , addvalue , clicktype , prevsels , currsels ) {
console.log('FUN t.TinawebJS:SelectionEngine:SelectorEngine') // console.log('FUN t.TinawebJS:SelectionEngine:SelectorEngine')
var targeted = [] var targeted = []
var buffer = Object.keys(prevsels).map(Number).sort(this.sortNumber); var buffer = Object.keys(prevsels).map(Number).sort(this.sortNumber);
...@@ -199,7 +199,7 @@ SelectionEngine = function() { ...@@ -199,7 +199,7 @@ SelectionEngine = function() {
// uses: SelectorEngine() and MultipleSelection2() // uses: SelectorEngine() and MultipleSelection2()
this.search = function(string) { this.search = function(string) {
console.log('FUN t.TinawebJS:SelectionEngine:search') // console.log('FUN t.TinawebJS:SelectionEngine:search')
var id_node = ''; var id_node = '';
var results = find(string) var results = find(string)
...@@ -230,7 +230,7 @@ SelectionEngine = function() { ...@@ -230,7 +230,7 @@ SelectionEngine = function() {
//Util //Util
this.intersect_safe = function(a, b) { this.intersect_safe = function(a, b) {
console.log('FUN t.TinawebJS:SelectionEngine:intersect_safe') // console.log('FUN t.TinawebJS:SelectionEngine:intersect_safe')
var ai=0, bi=0; var ai=0, bi=0;
var result = new Array(); var result = new Array();
...@@ -249,7 +249,7 @@ SelectionEngine = function() { ...@@ -249,7 +249,7 @@ SelectionEngine = function() {
// return Nodes-ids under the clicked Area // return Nodes-ids under the clicked Area
// external usage : partialGraph // external usage : partialGraph
this.SelectThis2 = function( area ) { this.SelectThis2 = function( area ) {
console.log('FUN t.TinawebJS:SelectionEngine:SelectThis2') // console.log('FUN t.TinawebJS:SelectionEngine:SelectThis2')
var x1 = area.x1; var x1 = area.x1;
var y1 = area.y1; var y1 = area.y1;
...@@ -273,7 +273,7 @@ SelectionEngine = function() { ...@@ -273,7 +273,7 @@ SelectionEngine = function() {
// external usage : partialGraph , updateLeftPanel_fix(); // external usage : partialGraph , updateLeftPanel_fix();
this.MultipleSelection2 = (function(nodes,nodesDict,edgesDict) { this.MultipleSelection2 = (function(nodes,nodesDict,edgesDict) {
console.log('FUN t.TinawebJS:SelectionEngine:MultipleSelection2') // console.log('FUN t.TinawebJS:SelectionEngine:MultipleSelection2')
// pr("IN SelectionEngine.MultipleSelection2:") // pr("IN SelectionEngine.MultipleSelection2:")
print(nodes) print(nodes)
greyEverything(); greyEverything();
...@@ -370,7 +370,7 @@ SelectionEngine = function() { ...@@ -370,7 +370,7 @@ SelectionEngine = function() {
}; };
TinaWebJS = function ( sigmacanvas ) { TinaWebJS = function ( sigmacanvas ) {
console.log('FUN t.TinawebJS:TinaWebJS:new') // console.log('FUN t.TinawebJS:TinaWebJS:new')
// '#canvasid' // '#canvasid'
this.sigmacanvas = sigmacanvas; this.sigmacanvas = sigmacanvas;
...@@ -380,12 +380,12 @@ TinaWebJS = function ( sigmacanvas ) { ...@@ -380,12 +380,12 @@ TinaWebJS = function ( sigmacanvas ) {
} }
this.getSigmaCanvas = function () { this.getSigmaCanvas = function () {
console.log('FUN t.TinawebJS:getSigmaCanvas') // console.log('FUN t.TinawebJS:getSigmaCanvas')
return this.sigmacanvas; return this.sigmacanvas;
} }
this.AdjustSigmaCanvas = function ( canvasdiv ) { this.AdjustSigmaCanvas = function ( canvasdiv ) {
console.log('FUN t.TinawebJS:AdjustSigmaCanvas') // console.log('FUN t.TinawebJS:AdjustSigmaCanvas')
if (! canvasdiv) if (! canvasdiv)
// '#canvasid' => 'canvasid' // '#canvasid' => 'canvasid'
canvasdiv = sigmacanvas.substring(1); canvasdiv = sigmacanvas.substring(1);
...@@ -394,7 +394,7 @@ TinaWebJS = function ( sigmacanvas ) { ...@@ -394,7 +394,7 @@ TinaWebJS = function ( sigmacanvas ) {
} }
this.SearchListeners = function () { this.SearchListeners = function () {
console.log('FUN t.TinawebJS:SearchListeners') // console.log('FUN t.TinawebJS:SearchListeners')
var SelInst = new SelectionEngine(); var SelInst = new SelectionEngine();
$.ui.autocomplete.prototype._renderItem = function(ul, item) { $.ui.autocomplete.prototype._renderItem = function(ul, item) {
...@@ -516,7 +516,7 @@ TinaWebJS = function ( sigmacanvas ) { ...@@ -516,7 +516,7 @@ TinaWebJS = function ( sigmacanvas ) {
// external usage: SelectorEngine*() , MultipleSelection2() , // external usage: SelectorEngine*() , MultipleSelection2() ,
// enviroment.js:changeType()|changeLevel()|NodeWeightFilter()|EdgeWeightFilter // enviroment.js:changeType()|changeLevel()|NodeWeightFilter()|EdgeWeightFilter
this.initListeners = function (categories, partialGraph) { this.initListeners = function (categories, partialGraph) {
console.log('FUN t.TinawebJS:initListeners') // console.log('FUN t.TinawebJS:initListeners')
var SelInst = new SelectionEngine(); var SelInst = new SelectionEngine();
$("#semLoader").hide(); $("#semLoader").hide();
......
// Mathieu Jacomy @ Sciences Po Médialab & WebAtlas // Mathieu Jacomy @ Sciences Po Médialab & WebAtlas
var ForceAtlas2 = function(graph) { var ForceAtlas2 = function(graph) {
console.log('FUN t.asyncFA2:ForceAtlas2') // console.log('FUN t.asyncFA2:ForceAtlas2')
var self = this; var self = this;
this.graph = graph; this.graph = graph;
...@@ -32,7 +32,7 @@ var ForceAtlas2 = function(graph) { ...@@ -32,7 +32,7 @@ var ForceAtlas2 = function(graph) {
// Runtime (the ForceAtlas2 itself) // Runtime (the ForceAtlas2 itself)
this.init = function() { this.init = function() {
console.log('FUN t.asyncFA2:init') // console.log('FUN t.asyncFA2:init')
self.state = {step: 0, index: 0}; self.state = {step: 0, index: 0};
self.graph.nodes.forEach(function(n) { self.graph.nodes.forEach(function(n) {
n.fa2 = { n.fa2 = {
...@@ -48,12 +48,12 @@ var ForceAtlas2 = function(graph) { ...@@ -48,12 +48,12 @@ var ForceAtlas2 = function(graph) {
} }
this.go = function() { this.go = function() {
console.log('FUN t.asyncFA2:go') // console.log('FUN t.asyncFA2:go')
while (self.onebucle()) {} while (self.onebucle()) {}
} }
this.onebucle = function() { this.onebucle = function() {
console.log('FUN t.asyncFA2:onebucle') // console.log('FUN t.asyncFA2:onebucle')
var graph = self.graph; var graph = self.graph;
var nodes = graph.nodes; var nodes = graph.nodes;
var edges = graph.edges; var edges = graph.edges;
...@@ -350,7 +350,7 @@ var ForceAtlas2 = function(graph) { ...@@ -350,7 +350,7 @@ var ForceAtlas2 = function(graph) {
} }
this.end = function() { this.end = function() {
console.log('FUN t.asyncFA2:end') // console.log('FUN t.asyncFA2:end')
this.graph.nodes.forEach(function(n) { this.graph.nodes.forEach(function(n) {
n.fa2 = null; n.fa2 = null;
}); });
...@@ -358,7 +358,7 @@ var ForceAtlas2 = function(graph) { ...@@ -358,7 +358,7 @@ var ForceAtlas2 = function(graph) {
// Auto Settings // Auto Settings
this.setAutoSettings = function() { this.setAutoSettings = function() {
console.log('FUN t.asyncFA2:setAutoSettings') // console.log('FUN t.asyncFA2:setAutoSettings')
var graph = this.graph; var graph = this.graph;
// Tuning // Tuning
...@@ -839,7 +839,7 @@ var ForceAtlas2 = function(graph) { ...@@ -839,7 +839,7 @@ var ForceAtlas2 = function(graph) {
var updateMassAndGeometry = function() { var updateMassAndGeometry = function() {
console.log('FUN t.asyncFA2:updateMassAndGeometry') // console.log('FUN t.asyncFA2:updateMassAndGeometry')
if (this.nodes.length > 1) { if (this.nodes.length > 1) {
// Compute Mass // Compute Mass
var mass = 0; var mass = 0;
...@@ -892,7 +892,7 @@ var Region = function(nodes, depth) { ...@@ -892,7 +892,7 @@ var Region = function(nodes, depth) {
var buildSubRegions = function() { var buildSubRegions = function() {
console.log('FUN t.asyncFA2:buildSubRegions') // console.log('FUN t.asyncFA2:buildSubRegions')
if (this.nodes.length > 1) { if (this.nodes.length > 1) {
var leftNodes = []; var leftNodes = [];
var rightNodes = []; var rightNodes = [];
...@@ -944,7 +944,7 @@ var buildSubRegions = function() { ...@@ -944,7 +944,7 @@ var buildSubRegions = function() {
}; };
var applyForce = function(n, Force, theta) { var applyForce = function(n, Force, theta) {
console.log('FUN t.asyncFA2:applyForce') // console.log('FUN t.asyncFA2:applyForce')
if (this.nodes.length < 2) { if (this.nodes.length < 2) {
var regionNode = this.nodes[0]; var regionNode = this.nodes[0];
Force.apply_nn(n, regionNode); Force.apply_nn(n, regionNode);
...@@ -967,7 +967,7 @@ var applyForce = function(n, Force, theta) { ...@@ -967,7 +967,7 @@ var applyForce = function(n, Force, theta) {
}; };
var startForceAtlas2 = function(graph,limit_it) { var startForceAtlas2 = function(graph,limit_it) {
console.log('FUN t.asyncFA2:startForceAtlas2') // console.log('FUN t.asyncFA2:startForceAtlas2')
// pr("inside FA2") // pr("inside FA2")
//// if(!this.forceatlas2) { //// if(!this.forceatlas2) {
// pr(graph); // pr(graph);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
//============================ < NEW BUTTONS > =============================// //============================ < NEW BUTTONS > =============================//
function changeType_old() { function changeType_old() {
console.log('FUN t.enviroment:changeType_old') // console.log('FUN t.enviroment:changeType_old')
pr("***swclickActual:"+swclickActual+" , swMacro:"+swMacro); pr("***swclickActual:"+swclickActual+" , swMacro:"+swMacro);
if(swclickActual=="social") { if(swclickActual=="social") {
...@@ -119,7 +119,7 @@ function changeType_old() { ...@@ -119,7 +119,7 @@ function changeType_old() {
function changeType() { function changeType() {
console.log('FUN t.enviroment:changeType') // console.log('FUN t.enviroment:changeType')
var present = partialGraph.states.slice(-1)[0]; // Last var present = partialGraph.states.slice(-1)[0]; // Last
var past = partialGraph.states.slice(-2)[0] // avant Last var past = partialGraph.states.slice(-2)[0] // avant Last
var lastpos = partialGraph.states.length-1; var lastpos = partialGraph.states.length-1;
...@@ -377,7 +377,7 @@ function changeType() { ...@@ -377,7 +377,7 @@ function changeType() {
} }
function changeLevel() { function changeLevel() {
console.log('FUN t.enviroment:changeLevel') // console.log('FUN t.enviroment:changeLevel')
var present = partialGraph.states.slice(-1)[0]; // Last var present = partialGraph.states.slice(-1)[0]; // Last
var past = partialGraph.states.slice(-2)[0] // avant Last var past = partialGraph.states.slice(-2)[0] // avant Last
var lastpos = partialGraph.states.length-1; var lastpos = partialGraph.states.length-1;
...@@ -504,7 +504,7 @@ function changeLevel() { ...@@ -504,7 +504,7 @@ function changeLevel() {
} }
function changeLevel_old() { function changeLevel_old() {
console.log('FUN t.enviroment:changeLevel_old') // console.log('FUN t.enviroment:changeLevel_old')
bf=swclickActual bf=swclickActual
pushSWClick(swclickActual); pushSWClick(swclickActual);
pr("swMacro: "+swMacro+" - [swclickPrev: "+bf+"] - [swclickActual: "+swclickActual+"]") pr("swMacro: "+swMacro+" - [swclickPrev: "+bf+"] - [swclickActual: "+swclickActual+"]")
...@@ -553,7 +553,7 @@ function changeLevel_old() { ...@@ -553,7 +553,7 @@ function changeLevel_old() {
// EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight"); // EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
// EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight"); // EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) { function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
console.log('FUN t.enviroment:EdgeWeightFilter') // console.log('FUN t.enviroment:EdgeWeightFilter')
// console.log("") // console.log("")
// console.log("") // console.log("")
// console.log(" - - - - EdgeWeightFilter - - - ") // console.log(" - - - - EdgeWeightFilter - - - ")
...@@ -765,7 +765,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) { ...@@ -765,7 +765,7 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
// NodeWeightFilter ( "#sliderANodeWeight" , "Document" , "type" , "size") // NodeWeightFilter ( "#sliderANodeWeight" , "Document" , "type" , "size")
// NodeWeightFilter ( "#sliderBNodeWeight" , "NGram" , "type" , "size") // NodeWeightFilter ( "#sliderBNodeWeight" , "NGram" , "type" , "size")
function NodeWeightFilter( categories , sliderDivID , type_attrb , type , criteria) { function NodeWeightFilter( categories , sliderDivID , type_attrb , type , criteria) {
console.log('FUN t.enviroment:NodeWeightFilter') // console.log('FUN t.enviroment:NodeWeightFilter')
// 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+" ]]")
...@@ -879,7 +879,7 @@ function NodeWeightFilter( categories , sliderDivID , type_attrb , type , crit ...@@ -879,7 +879,7 @@ function NodeWeightFilter( categories , sliderDivID , type_attrb , type , crit
} }
function getGraphElement(elem) { function getGraphElement(elem) {
console.log('FUN t.enviroment:getGraphElement') // console.log('FUN t.enviroment:getGraphElement')
if(elem.split(";").length==1) return partialGraph._core.graph.nodesIndex[elem]; if(elem.split(";").length==1) return partialGraph._core.graph.nodesIndex[elem];
else { else {
if(!isUndef(partialGraph._core.graph.edgesIndex[elem])) if(!isUndef(partialGraph._core.graph.edgesIndex[elem]))
...@@ -896,7 +896,7 @@ function getGraphElement(elem) { ...@@ -896,7 +896,7 @@ function getGraphElement(elem) {
// 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")
function AlgorithmForSliders( elements , type_attrb , type , criteria) { function AlgorithmForSliders( elements , type_attrb , type , criteria) {
console.log('FUN t.enviroment:AlgorithmForSliders') // console.log('FUN t.enviroment:AlgorithmForSliders')
// console.clear() // console.clear()
// console.log( "\t - - - - - AlgorithmForSliders - - - - -" ) // console.log( "\t - - - - - AlgorithmForSliders - - - - -" )
// console.log( "" ) // console.log( "" )
...@@ -1003,7 +1003,7 @@ function AlgorithmForSliders( elements , type_attrb , type , criteria) { ...@@ -1003,7 +1003,7 @@ function AlgorithmForSliders( elements , type_attrb , type , criteria) {
//============================= < SEARCH > =============================// //============================= < SEARCH > =============================//
function updateSearchLabels(id,name,type){ function updateSearchLabels(id,name,type){
console.log('FUN t.enviroment:updateSearchLabels') // console.log('FUN t.enviroment:updateSearchLabels')
labels.push({ labels.push({
'id' : id, 'id' : id,
'label' : name, 'label' : name,
...@@ -1012,7 +1012,7 @@ function updateSearchLabels(id,name,type){ ...@@ -1012,7 +1012,7 @@ function updateSearchLabels(id,name,type){
} }
function extractContext(string, context) { function extractContext(string, context) {
console.log('FUN t.enviroment:extractContext') // console.log('FUN t.enviroment:extractContext')
var matched = string.toLowerCase().indexOf(context.toLowerCase()); var matched = string.toLowerCase().indexOf(context.toLowerCase());
if (matched == -1) if (matched == -1)
...@@ -1043,7 +1043,7 @@ function extractContext(string, context) { ...@@ -1043,7 +1043,7 @@ function extractContext(string, context) {
} }
function searchLabel(string){ function searchLabel(string){
console.log('FUN t.enviroment:searchLabel') // console.log('FUN t.enviroment:searchLabel')
var id_node = ''; var id_node = '';
var n; var n;
......
...@@ -10,7 +10,7 @@ function print(msg) { ...@@ -10,7 +10,7 @@ function print(msg) {
//to general utils //to general utils
function getClientTime(){ function getClientTime(){
console.log('FUN t.globalUtils:getClientTime') // console.log('FUN t.globalUtils:getClientTime')
var totalSec = new Date().getTime() / 1000; var totalSec = new Date().getTime() / 1000;
var d = new Date(); var d = new Date();
var hours = d.getHours(); var hours = d.getHours();
...@@ -21,13 +21,13 @@ function getClientTime(){ ...@@ -21,13 +21,13 @@ function getClientTime(){
} }
function compareNumbers(a, b) { function compareNumbers(a, b) {
console.log('FUN t.globalUtils:compareNumbers') // console.log('FUN t.globalUtils:compareNumbers')
return a - b; return a - b;
} }
//python range(a,b) | range(a) //python range(a,b) | range(a)
function calc_range(begin, end) { function calc_range(begin, end) {
console.log('FUN t.globalUtils:calc_range') // console.log('FUN t.globalUtils:calc_range')
if (typeof end === "undefined") { if (typeof end === "undefined") {
end = begin; begin = 0; end = begin; begin = 0;
} }
...@@ -41,7 +41,7 @@ function calc_range(begin, end) { ...@@ -41,7 +41,7 @@ function calc_range(begin, end) {
//to general utils (not used btw) //to general utils (not used btw)
function cloneObject(source) { function cloneObject(source) {
console.log('FUN t.globalUtils:cloneObject') // console.log('FUN t.globalUtils:cloneObject')
for (i in source) { for (i in source) {
if (typeof source[i] == 'source') { if (typeof source[i] == 'source') {
this[i] = new cloneObject(source[i]); this[i] = new cloneObject(source[i]);
...@@ -53,14 +53,14 @@ function cloneObject(source) { ...@@ -53,14 +53,14 @@ function cloneObject(source) {
} }
function isUndef(variable){ function isUndef(variable){
// console.log('FUN t.globalUtils:isUndef') // // console.log('FUN t.globalUtils:isUndef')
if(typeof(variable)==="undefined") return true; if(typeof(variable)==="undefined") return true;
else return false; else return false;
} }
$.fn.toggleClick = function(){ $.fn.toggleClick = function(){
console.log('FUN t.globalUtils:toggleClick') // console.log('FUN t.globalUtils:toggleClick')
methods = arguments, // store the passed arguments for future reference methods = arguments, // store the passed arguments for future reference
count = methods.length; // cache the number of methods count = methods.length; // cache the number of methods
...@@ -77,7 +77,7 @@ $.fn.toggleClick = function(){ ...@@ -77,7 +77,7 @@ $.fn.toggleClick = function(){
getUrlParam = (function () { getUrlParam = (function () {
console.log('FUN t.globalUtils:getUrlParam') // console.log('FUN t.globalUtils:getUrlParam')
var get = { var get = {
push:function (key,value){ push:function (key,value){
var cur = this[key]; var cur = this[key];
...@@ -108,7 +108,7 @@ getUrlParam = (function () { ...@@ -108,7 +108,7 @@ getUrlParam = (function () {
function ArraySortByValue(array, sortFunc){ function ArraySortByValue(array, sortFunc){
console.log('FUN t.globalUtils:ArraySortByValue') // console.log('FUN t.globalUtils:ArraySortByValue')
var tmp = []; var tmp = [];
oposMAX=0; oposMAX=0;
for (var k in array) { for (var k in array) {
...@@ -130,7 +130,7 @@ function ArraySortByValue(array, sortFunc){ ...@@ -130,7 +130,7 @@ function ArraySortByValue(array, sortFunc){
function ArraySortByKey(array, sortFunc){ function ArraySortByKey(array, sortFunc){
console.log('FUN t.globalUtils:ArraySortByKey') // console.log('FUN t.globalUtils:ArraySortByKey')
var tmp = []; var tmp = [];
for (var k in array) { for (var k in array) {
if (array.hasOwnProperty(k)) { if (array.hasOwnProperty(k)) {
...@@ -149,7 +149,7 @@ function ArraySortByKey(array, sortFunc){ ...@@ -149,7 +149,7 @@ function ArraySortByKey(array, sortFunc){
function is_empty(obj) { function is_empty(obj) {
console.log('FUN t.globalUtils:is_empty') // console.log('FUN t.globalUtils:is_empty')
// Assume if it has a length property with a non-zero value // Assume if it has a length property with a non-zero value
// that that property is correct. // that that property is correct.
if (obj.length && obj.length > 0) return false; if (obj.length && obj.length > 0) return false;
...@@ -163,14 +163,14 @@ function is_empty(obj) { ...@@ -163,14 +163,14 @@ function is_empty(obj) {
function getByID(elem) { function getByID(elem) {
console.log('FUN t.globalUtils:getByID') // console.log('FUN t.globalUtils:getByID')
return document.getElementById(elem); return document.getElementById(elem);
} }
function hex2rga(sent_hex) { function hex2rga(sent_hex) {
// console.log('FUN t.globalUtils:hex2rga') // // console.log('FUN t.globalUtils:hex2rga')
result = [] result = []
hex = ( sent_hex.charAt(0) === "#" ? sent_hex.substr(1) : sent_hex ); hex = ( sent_hex.charAt(0) === "#" ? sent_hex.substr(1) : sent_hex );
// check if 6 letters are provided // check if 6 letters are provided
...@@ -185,7 +185,7 @@ function hex2rga(sent_hex) { ...@@ -185,7 +185,7 @@ function hex2rga(sent_hex) {
} }
function calculateFull(hex) { function calculateFull(hex) {
// console.log('FUN t.globalUtils:calculateFull') // // console.log('FUN t.globalUtils:calculateFull')
var r = parseInt(hex.substring(0, 2), 16); var r = parseInt(hex.substring(0, 2), 16);
var g = parseInt(hex.substring(2, 4), 16); var g = parseInt(hex.substring(2, 4), 16);
var b = parseInt(hex.substring(4, 6), 16); var b = parseInt(hex.substring(4, 6), 16);
...@@ -195,7 +195,7 @@ function calculateFull(hex) { ...@@ -195,7 +195,7 @@ function calculateFull(hex) {
// function for calculating 3 letters hex value // function for calculating 3 letters hex value
function calculatePartial(hex) { function calculatePartial(hex) {
console.log('FUN t.globalUtils:calculatePartial') // console.log('FUN t.globalUtils:calculatePartial')
var r = parseInt(hex.substring(0, 1) + hex.substring(0, 1), 16); var r = parseInt(hex.substring(0, 1) + hex.substring(0, 1), 16);
var g = parseInt(hex.substring(1, 2) + hex.substring(1, 2), 16); var g = parseInt(hex.substring(1, 2) + hex.substring(1, 2), 16);
var b = parseInt(hex.substring(2, 3) + hex.substring(2, 3), 16); var b = parseInt(hex.substring(2, 3) + hex.substring(2, 3), 16);
...@@ -203,13 +203,13 @@ function calculatePartial(hex) { ...@@ -203,13 +203,13 @@ function calculatePartial(hex) {
} }
function componentToHex(c) { function componentToHex(c) {
console.log('FUN t.globalUtils:componentToHex') // console.log('FUN t.globalUtils:componentToHex')
var hex = c.toString(16); var hex = c.toString(16);
return hex.length == 1 ? "0" + hex : hex; return hex.length == 1 ? "0" + hex : hex;
} }
function rgbToHex(r, g, b) { function rgbToHex(r, g, b) {
console.log('FUN t.globalUtils:rgbToHex') // console.log('FUN t.globalUtils:rgbToHex')
return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b); return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
} }
...@@ -218,7 +218,7 @@ function rgbToHex(r, g, b) { ...@@ -218,7 +218,7 @@ function rgbToHex(r, g, b) {
* function to load a given css file * function to load a given css file
*/ */
loadCSS = function(href) { loadCSS = function(href) {
console.log('FUN t.globalUtils:loadCSS') // console.log('FUN t.globalUtils:loadCSS')
var cssLink = $("<link rel='stylesheet' type='text/css' href='"+href+"'>"); var cssLink = $("<link rel='stylesheet' type='text/css' href='"+href+"'>");
$("head").append(cssLink); $("head").append(cssLink);
}; };
...@@ -227,7 +227,7 @@ function rgbToHex(r, g, b) { ...@@ -227,7 +227,7 @@ function rgbToHex(r, g, b) {
* function to load a given js file * function to load a given js file
*/ */
loadJS = function(src) { loadJS = function(src) {
console.log('FUN t.globalUtils:loadJS') // console.log('FUN t.globalUtils:loadJS')
var jsLink = $("<script type='text/javascript' src='"+src+"'>"); var jsLink = $("<script type='text/javascript' src='"+src+"'>");
$("head").append(jsLink); $("head").append(jsLink);
}; };
...@@ -8,7 +8,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview ...@@ -8,7 +8,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview
*/ */
(function(){ (function(){
jLouvain = function(){ jLouvain = function(){
console.log('FUN t.jLouvain:jLouvain') // console.log('FUN t.jLouvain:jLouvain')
//Constants //Constants
var __PASS_MAX = -1 var __PASS_MAX = -1
var __MIN = 0.0000001 var __MIN = 0.0000001
...@@ -116,7 +116,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview ...@@ -116,7 +116,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview
//Core-Algorithm Related //Core-Algorithm Related
function init_status(graph, status, part){ function init_status(graph, status, part){
console.log('FUN t.jLouvain:init_status') // console.log('FUN t.jLouvain:init_status')
status['nodes_to_com'] = {}; status['nodes_to_com'] = {};
status['total_weight'] = 0; status['total_weight'] = 0;
status['internals'] = {}; status['internals'] = {};
...@@ -271,7 +271,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview ...@@ -271,7 +271,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview
} }
function induced_graph(partition, graph){ function induced_graph(partition, graph){
console.log('FUN t.jLouvain:induced_graph') // console.log('FUN t.jLouvain:induced_graph')
var ret = {nodes:[], edges:[], _assoc_mat: {}}; var ret = {nodes:[], edges:[], _assoc_mat: {}};
var w_prec, weight; var w_prec, weight;
//add nodes from partition values //add nodes from partition values
...@@ -289,7 +289,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview ...@@ -289,7 +289,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview
} }
function partition_at_level(dendogram, level){ function partition_at_level(dendogram, level){
console.log('FUN t.jLouvain:partition_at_level') // console.log('FUN t.jLouvain:partition_at_level')
var partition = clone(dendogram[0]); var partition = clone(dendogram[0]);
for(var i = 1; i < level + 1; i++ ) for(var i = 1; i < level + 1; i++ )
Object.keys(partition).forEach(function(key,j){ Object.keys(partition).forEach(function(key,j){
...@@ -302,7 +302,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview ...@@ -302,7 +302,7 @@ Based on https://bitbucket.org/taynaud/python-louvain/overview
function generate_dendogram(graph, part_init){ function generate_dendogram(graph, part_init){
console.log('FUN t.jLouvain:generate_dendogram') // console.log('FUN t.jLouvain:generate_dendogram')
if(graph.edges.length == 0){ if(graph.edges.length == 0){
var part = {}; var part = {};
......
...@@ -89,7 +89,7 @@ $.ajax({ ...@@ -89,7 +89,7 @@ $.ajax({
}); });
function showDialog(url, hasError, status, msg) { function showDialog(url, hasError, status, msg) {
console.log('FUN t.main:showDialog' + 'hasError:'+hasError) // console.log('FUN t.main:showDialog' + 'hasError:'+hasError)
// hide loader gif etc // hide loader gif etc
$("#semLoader").hide(); $("#semLoader").hide();
$("#closeloader").click(); $("#closeloader").click();
...@@ -111,7 +111,7 @@ function showDialog(url, hasError, status, msg) { ...@@ -111,7 +111,7 @@ function showDialog(url, hasError, status, msg) {
function MainFunction( RES ) { function MainFunction( RES ) {
console.log(' ------------') console.log(' ------------')
console.log('FUN t.main:MainFunction') // console.log('FUN t.main:MainFunction')
console.log(' ------------') console.log(' ------------')
var fileparam;// = { db|api.json , somefile.json|gexf } var fileparam;// = { db|api.json , somefile.json|gexf }
var the_data = RES["data"]; var the_data = RES["data"];
......
...@@ -71,7 +71,7 @@ else { ...@@ -71,7 +71,7 @@ else {
//just CSS //just CSS
function sigmaLimits(){ function sigmaLimits(){
console.log('FUN t.main_backup:sigmaLimits') // console.log('FUN t.main_backup:sigmaLimits')
pr("\t*** sigmaLimits()") pr("\t*** sigmaLimits()")
pw=$('#sigma-example').width(); pw=$('#sigma-example').width();
...@@ -92,7 +92,7 @@ function sigmaLimits(){ ...@@ -92,7 +92,7 @@ function sigmaLimits(){
} }
function bringTheNoise(pathfile,type){ function bringTheNoise(pathfile,type){
console.log('FUN t.main_backup:bringTheNoise') // console.log('FUN t.main_backup:bringTheNoise')
$("#semLoader").hide(); $("#semLoader").hide();
...@@ -307,7 +307,7 @@ function bringTheNoise(pathfile,type){ ...@@ -307,7 +307,7 @@ function bringTheNoise(pathfile,type){
function theListeners(){ function theListeners(){
console.log('FUN t.main_backup:theListeners') // console.log('FUN t.main_backup:theListeners')
pr("in THELISTENERS"); pr("in THELISTENERS");
// leftPanel("close"); // leftPanel("close");
$("#closeloader").click();//modal.hide doesnt work :c $("#closeloader").click();//modal.hide doesnt work :c
...@@ -692,7 +692,7 @@ function theListeners(){ ...@@ -692,7 +692,7 @@ function theListeners(){
// Social Spatialization // Social Spatialization
// Semantic Spatialization // Semantic Spatialization
function SigmaLayouting( URL, DATA, NAME) { function SigmaLayouting( URL, DATA, NAME) {
console.log('FUN t.main_backup:SigmaLayouting') // console.log('FUN t.main_backup:SigmaLayouting')
pr(URL+"?"+DATA) pr(URL+"?"+DATA)
return $.ajax({ return $.ajax({
type: 'GET', type: 'GET',
......
function cancelSelection (fromTagCloud) { function cancelSelection (fromTagCloud) {
console.log('FUN t.methods:cancelSelection') // console.log('FUN t.methods:cancelSelection')
pr("\t***in cancelSelection"); pr("\t***in cancelSelection");
highlightSelectedNodes(false); //Unselect the selected ones :D highlightSelectedNodes(false); //Unselect the selected ones :D
opossites = []; opossites = [];
...@@ -55,7 +55,7 @@ function cancelSelection (fromTagCloud) { ...@@ -55,7 +55,7 @@ function cancelSelection (fromTagCloud) {
} }
function highlightSelectedNodes(flag){ function highlightSelectedNodes(flag){
console.log('FUN t.methods:highlightSelectedNodes') // console.log('FUN t.methods:highlightSelectedNodes')
pr("\t***methods.js:highlightSelectedNodes(flag)"+flag+" selEmpty:"+is_empty(selections)) pr("\t***methods.js:highlightSelectedNodes(flag)"+flag+" selEmpty:"+is_empty(selections))
if(!is_empty(selections)){ if(!is_empty(selections)){
for(var i in selections) { for(var i in selections) {
...@@ -78,7 +78,7 @@ function highlightSelectedNodes(flag){ ...@@ -78,7 +78,7 @@ function highlightSelectedNodes(flag){
} }
function alertCheckBox(eventCheck){ function alertCheckBox(eventCheck){
console.log('FUN t.methods:alertCheckBox') // console.log('FUN t.methods:alertCheckBox')
if(!isUndef(eventCheck.checked)) checkBox=eventCheck.checked; if(!isUndef(eventCheck.checked)) checkBox=eventCheck.checked;
} }
...@@ -91,7 +91,7 @@ function alertCheckBox(eventCheck){ ...@@ -91,7 +91,7 @@ function alertCheckBox(eventCheck){
// b : Meso-Semantic // b : Meso-Semantic
// AaBb: Socio-Semantic // AaBb: Socio-Semantic
function RefreshState(newNOW){ function RefreshState(newNOW){
console.log('FUN t.methods:RefreshState') // console.log('FUN t.methods:RefreshState')
pr("\t\t\tin RefreshState newNOW:_"+newNOW+"_.") pr("\t\t\tin RefreshState newNOW:_"+newNOW+"_.")
if (newNOW!="") { if (newNOW!="") {
...@@ -178,7 +178,7 @@ function RefreshState(newNOW){ ...@@ -178,7 +178,7 @@ function RefreshState(newNOW){
} }
function pushSWClick(arg){ function pushSWClick(arg){
console.log('FUN t.methods:pushSWClick') // console.log('FUN t.methods:pushSWClick')
swclickPrev = swclickActual; swclickPrev = swclickActual;
swclickActual = arg; swclickActual = arg;
} }
...@@ -186,7 +186,7 @@ function pushSWClick(arg){ ...@@ -186,7 +186,7 @@ function pushSWClick(arg){
function manualForceLabel(nodeid,active) { function manualForceLabel(nodeid,active) {
console.log('FUN t.methods:manualForceLabel') // console.log('FUN t.methods:manualForceLabel')
// pr("manual|"+nodeid+"|"+active) // pr("manual|"+nodeid+"|"+active)
partialGraph._core.graph.nodesIndex[nodeid].active=active; partialGraph._core.graph.nodesIndex[nodeid].active=active;
partialGraph.draw(); partialGraph.draw();
...@@ -195,7 +195,7 @@ function manualForceLabel(nodeid,active) { ...@@ -195,7 +195,7 @@ function manualForceLabel(nodeid,active) {
// nodes information div // nodes information div
function htmlfied_nodesatts(elems){ function htmlfied_nodesatts(elems){
console.log('FUN t.methods:htmlfied_nodesatts') // console.log('FUN t.methods:htmlfied_nodesatts')
var socnodes=[] var socnodes=[]
var semnodes=[] var semnodes=[]
for(var i in elems) { for(var i in elems) {
...@@ -242,14 +242,14 @@ function htmlfied_nodesatts(elems){ ...@@ -242,14 +242,14 @@ function htmlfied_nodesatts(elems){
function manualSelectNode ( nodeid ) { function manualSelectNode ( nodeid ) {
console.log('FUN t.methods:manualSelectNode') // console.log('FUN t.methods:manualSelectNode')
cancelSelection(false); cancelSelection(false);
var SelInst = new SelectionEngine(); var SelInst = new SelectionEngine();
SelInst.MultipleSelection2({nodes:[nodeid]}); SelInst.MultipleSelection2({nodes:[nodeid]});
} }
function htmlfied_tagcloud(elems , limit) { function htmlfied_tagcloud(elems , limit) {
console.log('FUN t.methods:htmlfied_tagcloud') // console.log('FUN t.methods:htmlfied_tagcloud')
if(elems.length==0) return false; if(elems.length==0) return false;
var termNodes=[] var termNodes=[]
js1="" //'onclick="graphTagCloudElem(\''; js1="" //'onclick="graphTagCloudElem(\'';
...@@ -282,7 +282,7 @@ function htmlfied_tagcloud(elems , limit) { ...@@ -282,7 +282,7 @@ function htmlfied_tagcloud(elems , limit) {
//missing: getTopPapers for both node types //missing: getTopPapers for both node types
//considering complete graphs case! <= maybe i should mv it //considering complete graphs case! <= maybe i should mv it
function updateLeftPanel_fix( sels , oppos ) { function updateLeftPanel_fix( sels , oppos ) {
console.log('FUN t.methods:updateLeftPanel_fix') // console.log('FUN t.methods:updateLeftPanel_fix')
pr("updateLeftPanel() corrected version** ") pr("updateLeftPanel() corrected version** ")
var namesDIV='' var namesDIV=''
var alterNodesDIV='' var alterNodesDIV=''
...@@ -354,7 +354,7 @@ function updateLeftPanel_fix( sels , oppos ) { ...@@ -354,7 +354,7 @@ function updateLeftPanel_fix( sels , oppos ) {
} }
function printStates() { function printStates() {
console.log('FUN t.methods:printStates') // console.log('FUN t.methods:printStates')
pr("\t\t\t\t---------"+getClientTime()+"---------") pr("\t\t\t\t---------"+getClientTime()+"---------")
pr("\t\t\t\tswMacro: "+swMacro) pr("\t\t\t\tswMacro: "+swMacro)
pr("\t\t\t\tswActual: "+swclickActual+" | swPrev: "+swclickPrev) pr("\t\t\t\tswActual: "+swclickActual+" | swPrev: "+swclickPrev)
...@@ -370,13 +370,13 @@ function printStates() { ...@@ -370,13 +370,13 @@ function printStates() {
//true: button disabled //true: button disabled
//false: button enabled //false: button enabled
function LevelButtonDisable( TF ){ function LevelButtonDisable( TF ){
console.log('FUN t.methods:LevelButtonDisable') // console.log('FUN t.methods:LevelButtonDisable')
$('#changelevel').prop('disabled', TF); $('#changelevel').prop('disabled', TF);
} }
//Fixed! apres: refactor! //Fixed! apres: refactor!
function graphTagCloudElem(nodes) { function graphTagCloudElem(nodes) {
console.log('FUN t.methods:graphTagCloudElem') // console.log('FUN t.methods:graphTagCloudElem')
pr("in graphTagCloudElem, nodae_id: "+nodes); pr("in graphTagCloudElem, nodae_id: "+nodes);
cancelSelection(); cancelSelection();
partialGraph.emptyGraph(); partialGraph.emptyGraph();
...@@ -486,7 +486,7 @@ function graphTagCloudElem(nodes) { ...@@ -486,7 +486,7 @@ function graphTagCloudElem(nodes) {
function greyEverything(){ function greyEverything(){
console.log('FUN t.methods:greyEverything') // console.log('FUN t.methods:greyEverything')
nds = partialGraph._core.graph.nodes.filter(function(n) { nds = partialGraph._core.graph.nodes.filter(function(n) {
return !n['hidden']; return !n['hidden'];
}); });
...@@ -515,7 +515,7 @@ function greyEverything(){ ...@@ -515,7 +515,7 @@ function greyEverything(){
function graphResetColor(){ function graphResetColor(){
console.log('FUN t.methods:graphResetColor') // console.log('FUN t.methods:graphResetColor')
nds = partialGraph._core.graph.nodes.filter(function(x) { nds = partialGraph._core.graph.nodes.filter(function(x) {
return !x['hidden']; return !x['hidden'];
}); });
...@@ -538,7 +538,7 @@ function graphResetColor(){ ...@@ -538,7 +538,7 @@ function graphResetColor(){
function hideEverything(){ function hideEverything(){
console.log('FUN t.methods:hideEverything') // console.log('FUN t.methods:hideEverything')
pr("\thiding all"); pr("\thiding all");
nodeslength=0; nodeslength=0;
for(var n in partialGraph._core.graph.nodesIndex){ for(var n in partialGraph._core.graph.nodesIndex){
...@@ -555,7 +555,7 @@ function hideEverything(){ ...@@ -555,7 +555,7 @@ function hideEverything(){
function add1Elem(id) { function add1Elem(id) {
console.log('FUN t.methods:add1Elem') // console.log('FUN t.methods:add1Elem')
id = ""+id; id = ""+id;
if(id.split(";").length==1) { // i've received a NODE if(id.split(";").length==1) { // i've received a NODE
id = parseInt(id) id = parseInt(id)
...@@ -605,7 +605,7 @@ function add1Elem(id) { ...@@ -605,7 +605,7 @@ function add1Elem(id) {
function pushFilterValue(filtername,arg){ function pushFilterValue(filtername,arg){
console.log('FUN t.methods:pushFilterValue') // console.log('FUN t.methods:pushFilterValue')
if(lastFilter[filtername]["orig"]=="-") { if(lastFilter[filtername]["orig"]=="-") {
lastFilter[filtername]["orig"] = arg; lastFilter[filtername]["orig"] = arg;
lastFilter[filtername]["last"] = arg; lastFilter[filtername]["last"] = arg;
...@@ -618,7 +618,7 @@ function pushFilterValue(filtername,arg){ ...@@ -618,7 +618,7 @@ function pushFilterValue(filtername,arg){
function saveGraph() { function saveGraph() {
console.log('FUN t.methods:saveGraph') // console.log('FUN t.methods:saveGraph')
size = getByID("check_size").checked size = getByID("check_size").checked
color = getByID("check_color").checked color = getByID("check_color").checked
atts = {"size":size,"color":color} atts = {"size":size,"color":color}
...@@ -635,7 +635,7 @@ function saveGraph() { ...@@ -635,7 +635,7 @@ function saveGraph() {
} }
function saveGEXF(nodes,edges,atts){ function saveGEXF(nodes,edges,atts){
console.log('FUN t.methods:saveGEXF') // console.log('FUN t.methods:saveGEXF')
gexf = '<?xml version="1.0" encoding="UTF-8"?>\n'; gexf = '<?xml version="1.0" encoding="UTF-8"?>\n';
gexf += '<gexf xmlns="http://www.gexf.net/1.1draft" xmlns:viz="http://www.gephi.org/gexf/viz" version="1.1">\n'; gexf += '<gexf xmlns="http://www.gexf.net/1.1draft" xmlns:viz="http://www.gephi.org/gexf/viz" version="1.1">\n';
gexf += '<graph defaultedgetype="undirected" type="static">\n'; gexf += '<graph defaultedgetype="undirected" type="static">\n';
...@@ -695,7 +695,7 @@ function saveGEXF(nodes,edges,atts){ ...@@ -695,7 +695,7 @@ function saveGEXF(nodes,edges,atts){
} }
function saveGraphIMG(){ function saveGraphIMG(){
console.log('FUN t.methods:saveGraphIMG') // console.log('FUN t.methods:saveGraphIMG')
var strDownloadMime = "image/octet-stream" var strDownloadMime = "image/octet-stream"
var nodesDiv = partialGraph._core.domElements.nodes; var nodesDiv = partialGraph._core.domElements.nodes;
......
function draw1Circle(ctx , x , y , color) { function draw1Circle(ctx , x , y , color) {
console.log('FUN t.minimap:draw1Circle') // console.log('FUN t.minimap:draw1Circle')
ctx.strokeStyle = '#000'; ctx.strokeStyle = '#000';
ctx.lineWidth = 1; ctx.lineWidth = 1;
ctx.fillStyle = color; ctx.fillStyle = color;
...@@ -15,7 +15,7 @@ function draw1Circle(ctx , x , y , color) { ...@@ -15,7 +15,7 @@ function draw1Circle(ctx , x , y , color) {
function trackMouse() { function trackMouse() {
console.log('FUN t.minimap:trackMouse') // console.log('FUN t.minimap:trackMouse')
if(!shift_key) { if(!shift_key) {
// $.doTimeout(300,function (){ // $.doTimeout(300,function (){
var ctx = partialGraph._core.domElements.mouse.getContext('2d'); var ctx = partialGraph._core.domElements.mouse.getContext('2d');
...@@ -76,7 +76,7 @@ function trackMouse() { ...@@ -76,7 +76,7 @@ function trackMouse() {
}; };
function changeGraphPosition(evt, echelle) { function changeGraphPosition(evt, echelle) {
console.log('FUN t.minimap:changeGraphPosition') // console.log('FUN t.minimap:changeGraphPosition')
document.body.style.cursor = "move"; document.body.style.cursor = "move";
var _coord = { var _coord = {
x : evt.pageX, x : evt.pageX,
...@@ -89,7 +89,7 @@ function changeGraphPosition(evt, echelle) { ...@@ -89,7 +89,7 @@ function changeGraphPosition(evt, echelle) {
} }
function onOverviewMove(evt) { function onOverviewMove(evt) {
console.log('FUN t.minimap:onOverviewMove') // console.log('FUN t.minimap:onOverviewMove')
/* /*
pageX: 1247 pageY: 216 pageX: 1247 pageY: 216
screenX: 1188 screenY: 307 screenX: 1188 screenY: 307
...@@ -104,7 +104,7 @@ function onOverviewMove(evt) { ...@@ -104,7 +104,7 @@ function onOverviewMove(evt) {
} }
function startMove(evt){ function startMove(evt){
console.log('FUN t.minimap:startMove') // console.log('FUN t.minimap:startMove')
evt.preventDefault(); evt.preventDefault();
partialGraph.dragOn = true; partialGraph.dragOn = true;
partialGraph.lastMouse = { partialGraph.lastMouse = {
...@@ -115,14 +115,14 @@ function startMove(evt){ ...@@ -115,14 +115,14 @@ function startMove(evt){
} }
function endMove(evt){ function endMove(evt){
console.log('FUN t.minimap:endMove') // console.log('FUN t.minimap:endMove')
document.body.style.cursor = "default"; document.body.style.cursor = "default";
partialGraph.dragOn = false; partialGraph.dragOn = false;
partialGraph.mouseHasMoved = false; partialGraph.mouseHasMoved = false;
} }
function onGraphScroll(evt, delta) { function onGraphScroll(evt, delta) {
console.log('FUN t.minimap:onGraphScroll') // console.log('FUN t.minimap:onGraphScroll')
$("#zoomSlider").slider("value",partialGraph.position().ratio); $("#zoomSlider").slider("value",partialGraph.position().ratio);
// partialGraph.totalScroll += delta; // partialGraph.totalScroll += delta;
// if (Math.abs(partialGraph.totalScroll) >= 1) { // if (Math.abs(partialGraph.totalScroll) >= 1) {
...@@ -178,7 +178,7 @@ function onGraphScroll(evt, delta) { ...@@ -178,7 +178,7 @@ function onGraphScroll(evt, delta) {
} }
function initializeMap() { function initializeMap() {
console.log('FUN t.minimap:initializeMap') // console.log('FUN t.minimap:initializeMap')
clearInterval(partialGraph.timeRefresh); clearInterval(partialGraph.timeRefresh);
partialGraph.oldParams = {}; partialGraph.oldParams = {};
...@@ -196,7 +196,7 @@ function initializeMap() { ...@@ -196,7 +196,7 @@ function initializeMap() {
} }
function updateMap(){ function updateMap(){
console.log('FUN t.minimap:updateMap') // console.log('FUN t.minimap:updateMap')
if(minimap){ if(minimap){
partialGraph.imageMini=""; partialGraph.imageMini="";
partialGraph.ctxMini=""; partialGraph.ctxMini="";
...@@ -222,7 +222,7 @@ function updateMap(){ ...@@ -222,7 +222,7 @@ function updateMap(){
} }
function traceMap() { function traceMap() {
console.log('FUN t.minimap:traceMap') // console.log('FUN t.minimap:traceMap')
//pr("\ttracingmap"); //pr("\ttracingmap");
partialGraph.echelleGenerale = Math.pow( Math.SQRT2, partialGraph.position().ratio ); partialGraph.echelleGenerale = Math.pow( Math.SQRT2, partialGraph.position().ratio );
partialGraph.ctxMini.putImageData(partialGraph.imageMini, 0, 0); partialGraph.ctxMini.putImageData(partialGraph.imageMini, 0, 0);
...@@ -242,7 +242,7 @@ function traceMap() { ...@@ -242,7 +242,7 @@ function traceMap() {
} }
function startMiniMap(){ function startMiniMap(){
console.log('FUN t.minimap:startMiniMap') // console.log('FUN t.minimap:startMiniMap')
if(minimap){ if(minimap){
partialGraph.ctxMini = document.getElementById('overview').getContext('2d'); partialGraph.ctxMini = document.getElementById('overview').getContext('2d');
partialGraph.ctxMini.clearRect(0, 0, overviewWidth, overviewHeight); partialGraph.ctxMini.clearRect(0, 0, overviewWidth, overviewHeight);
......
...@@ -6,7 +6,7 @@ var first_time=true; ...@@ -6,7 +6,7 @@ var first_time=true;
sigma.forceatlas2 = sigma.forceatlas2 || {}; sigma.forceatlas2 = sigma.forceatlas2 || {};
sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) { sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
console.log('FUN t.sigma.forceatlas2:ForceAtlas2') // console.log('FUN t.sigma.forceatlas2:ForceAtlas2')
sigma.classes.Cascade.call(this); sigma.classes.Cascade.call(this);
var self = this; var self = this;
this.graph = graph; this.graph = graph;
...@@ -983,7 +983,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) { ...@@ -983,7 +983,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
// The Region class, as used by the Barnes Hut optimization // The Region class, as used by the Barnes Hut optimization
sigma.forceatlas2.Region = function(nodes, depth) { sigma.forceatlas2.Region = function(nodes, depth) {
console.log('FUN t.sigma.forceatlas2:Region') // console.log('FUN t.sigma.forceatlas2:Region')
sigma.classes.Cascade.call(this); sigma.classes.Cascade.call(this);
this.depthLimit = 20; this.depthLimit = 20;
this.size = 0; this.size = 0;
...@@ -1001,7 +1001,7 @@ sigma.forceatlas2.Region = function(nodes, depth) { ...@@ -1001,7 +1001,7 @@ sigma.forceatlas2.Region = function(nodes, depth) {
} }
sigma.forceatlas2.Region.prototype.updateMassAndGeometry = function() { sigma.forceatlas2.Region.prototype.updateMassAndGeometry = function() {
console.log('FUN t.sigma.forceatlas2:updateMassAndGeometry') // console.log('FUN t.sigma.forceatlas2:updateMassAndGeometry')
if (this.nodes.length > 1) { if (this.nodes.length > 1) {
// Compute Mass // Compute Mass
var mass = 0; var mass = 0;
...@@ -1037,7 +1037,7 @@ sigma.forceatlas2.Region.prototype.updateMassAndGeometry = function() { ...@@ -1037,7 +1037,7 @@ sigma.forceatlas2.Region.prototype.updateMassAndGeometry = function() {
}; };
sigma.forceatlas2.Region.prototype.buildSubRegions = function() { sigma.forceatlas2.Region.prototype.buildSubRegions = function() {
console.log('FUN t.sigma.forceatlas2:buildSubRegions') // console.log('FUN t.sigma.forceatlas2:buildSubRegions')
if (this.nodes.length > 1) { if (this.nodes.length > 1) {
var leftNodes = []; var leftNodes = [];
var rightNodes = []; var rightNodes = [];
...@@ -1089,7 +1089,7 @@ sigma.forceatlas2.Region.prototype.buildSubRegions = function() { ...@@ -1089,7 +1089,7 @@ sigma.forceatlas2.Region.prototype.buildSubRegions = function() {
}; };
sigma.forceatlas2.Region.prototype.applyForce = function(n, Force, theta) { sigma.forceatlas2.Region.prototype.applyForce = function(n, Force, theta) {
console.log('FUN t.sigma.forceatlas2:applyForce') // console.log('FUN t.sigma.forceatlas2:applyForce')
if (this.nodes.length < 2) { if (this.nodes.length < 2) {
var regionNode = this.nodes[0]; var regionNode = this.nodes[0];
Force.apply_nn(n, regionNode); Force.apply_nn(n, regionNode);
...@@ -1114,7 +1114,7 @@ sigma.forceatlas2.Region.prototype.applyForce = function(n, Force, theta) { ...@@ -1114,7 +1114,7 @@ sigma.forceatlas2.Region.prototype.applyForce = function(n, Force, theta) {
sigma.publicPrototype.startForceAtlas2 = function() { sigma.publicPrototype.startForceAtlas2 = function() {
console.log('FUN t.sigma.forceatlas2:applyForce') // console.log('FUN t.sigma.forceatlas2:applyForce')
//if(!this.forceatlas2) { //if(!this.forceatlas2) {
if(fa2enabled) { if(fa2enabled) {
...@@ -1159,7 +1159,7 @@ sigma.publicPrototype.startForceAtlas2 = function() { ...@@ -1159,7 +1159,7 @@ sigma.publicPrototype.startForceAtlas2 = function() {
}; };
sigma.publicPrototype.stopForceAtlas2 = function() { sigma.publicPrototype.stopForceAtlas2 = function() {
console.log('FUN t.sigma.forceatlas2:stopForceAtlas2') // console.log('FUN t.sigma.forceatlas2:stopForceAtlas2')
var present = partialGraph.states.slice(-1)[0] var present = partialGraph.states.slice(-1)[0]
if(this.forceatlas2) { if(this.forceatlas2) {
if(this.forceatlas2.count) { if(this.forceatlas2.count) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Level-01 // Level-01
ParseCustom = function ( format , data ) { ParseCustom = function ( format , data ) {
console.log('FUN t.sigma.parseCustom:ParseCustom') // console.log('FUN t.sigma.parseCustom:ParseCustom')
this.data = data; this.data = data;
this.format = format; this.format = format;
this.nbCats = 0; this.nbCats = 0;
...@@ -39,7 +39,7 @@ ParseCustom = function ( format , data ) { ...@@ -39,7 +39,7 @@ ParseCustom = function ( format , data ) {
// Level-02 // Level-02
ParseCustom.prototype.scanFile = function() { ParseCustom.prototype.scanFile = function() {
console.log('FUN t.sigma.parseCustom:scanFile') // console.log('FUN t.sigma.parseCustom:scanFile')
switch (this.format) { switch (this.format) {
case "api.json": case "api.json":
pr("scanFile: "+this.format) pr("scanFile: "+this.format)
...@@ -66,7 +66,7 @@ ParseCustom.prototype.scanFile = function() { ...@@ -66,7 +66,7 @@ ParseCustom.prototype.scanFile = function() {
// Level-02 // Level-02
ParseCustom.prototype.makeDicts = function(categories) { ParseCustom.prototype.makeDicts = function(categories) {
console.log('FUN t.sigma.parseCustom:makeDicts') // console.log('FUN t.sigma.parseCustom:makeDicts')
console.warn("this.format:", this.format) console.warn("this.format:", this.format)
switch (this.format) { switch (this.format) {
case "api.json": case "api.json":
...@@ -97,7 +97,7 @@ ParseCustom.prototype.makeDicts = function(categories) { ...@@ -97,7 +97,7 @@ ParseCustom.prototype.makeDicts = function(categories) {
// Level-00 // Level-00
function scanGexf(gexf) { function scanGexf(gexf) {
console.log('FUN t.sigma.parseCustom:scanGexf') // console.log('FUN t.sigma.parseCustom:scanGexf')
var categoriesDict={}, categories=[]; var categoriesDict={}, categories=[];
nodesNodes = gexf.getElementsByTagName('nodes'); nodesNodes = gexf.getElementsByTagName('nodes');
for(i=0; i<nodesNodes.length; i++){ for(i=0; i<nodesNodes.length; i++){
...@@ -146,7 +146,7 @@ function scanGexf(gexf) { ...@@ -146,7 +146,7 @@ function scanGexf(gexf) {
// Level-00 // Level-00
// for {1,2}partite graphs // for {1,2}partite graphs
function dictfyGexf( gexf , categories ) { function dictfyGexf( gexf , categories ) {
console.log('FUN t.sigma.parseCustom:dictfyGexf') // console.log('FUN t.sigma.parseCustom:dictfyGexf')
var catDict = {} var catDict = {}
var catCount = {} var catCount = {}
...@@ -482,7 +482,7 @@ function dictfyGexf( gexf , categories ) { ...@@ -482,7 +482,7 @@ function dictfyGexf( gexf , categories ) {
// Level-00 // Level-00
function scanJSON( data, format ) { function scanJSON( data, format ) {
console.log('FUN t.sigma.parseCustom:scanJSON') // console.log('FUN t.sigma.parseCustom:scanJSON')
var categoriesDict={}, categories=[]; var categoriesDict={}, categories=[];
var nodes = data.nodes; var nodes = data.nodes;
...@@ -530,7 +530,7 @@ function scanJSON( data, format ) { ...@@ -530,7 +530,7 @@ function scanJSON( data, format ) {
// Level-00 // Level-00
// for {1,2}partite graphs // for {1,2}partite graphs
function dictfyJSON( data , categories, isCompact ) { function dictfyJSON( data , categories, isCompact ) {
console.log('FUN t.sigma.parseCustom:dictfyJSON') // console.log('FUN t.sigma.parseCustom:dictfyJSON')
console.clear() console.clear()
console.log("IN DICTIFY JSON") console.log("IN DICTIFY JSON")
var catDict = {} var catDict = {}
...@@ -765,7 +765,7 @@ function dictfyJSON( data , categories, isCompact ) { ...@@ -765,7 +765,7 @@ function dictfyJSON( data , categories, isCompact ) {
// to move // to move
function buildInitialState( categories ) { function buildInitialState( categories ) {
console.log('FUN t.sigma.parseCustom:buildInitialState') // console.log('FUN t.sigma.parseCustom:buildInitialState')
var firstState = [] var firstState = []
for(var i=0; i<categories.length ; i++) { for(var i=0; i<categories.length ; i++) {
if(i==0) firstState.push(true) if(i==0) firstState.push(true)
...@@ -776,7 +776,7 @@ function buildInitialState( categories ) { ...@@ -776,7 +776,7 @@ function buildInitialState( categories ) {
//to move //to move
function makeSystemStates (cats) { function makeSystemStates (cats) {
console.log('FUN t.sigma.parseCustom:makeSystemStates') // console.log('FUN t.sigma.parseCustom:makeSystemStates')
var systemstates = {} var systemstates = {}
var N=Math.pow(2 , cats.length); var N=Math.pow(2 , cats.length);
...@@ -810,7 +810,7 @@ function makeSystemStates (cats) { ...@@ -810,7 +810,7 @@ function makeSystemStates (cats) {
//to_del //to_del
function parse(gexfPath) { function parse(gexfPath) {
console.log('FUN t.sigma.parseCustom:parse') // console.log('FUN t.sigma.parseCustom:parse')
var gexfhttp; var gexfhttp;
gexfhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); gexfhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');
gexfhttp.open('GET', gexfPath, false); gexfhttp.open('GET', gexfPath, false);
...@@ -820,7 +820,7 @@ function parse(gexfPath) { ...@@ -820,7 +820,7 @@ function parse(gexfPath) {
//to_del //to_del
function scanCategories() { function scanCategories() {
console.log('FUN t.sigma.parseCustom:scanCategories') // console.log('FUN t.sigma.parseCustom:scanCategories')
nodesNodes = gexf.getElementsByTagName('nodes'); nodesNodes = gexf.getElementsByTagName('nodes');
for(i=0; i<nodesNodes.length; i++){ for(i=0; i<nodesNodes.length; i++){
var nodesNode = nodesNodes[i]; // Each xml node 'nodes' (plural) var nodesNode = nodesNodes[i]; // Each xml node 'nodes' (plural)
...@@ -853,7 +853,7 @@ function scanCategories() { ...@@ -853,7 +853,7 @@ function scanCategories() {
//to_del //to_del
function onepartiteExtract(){ function onepartiteExtract(){
console.log('FUN t.sigma.parseCustom:onepartiteExtract') // console.log('FUN t.sigma.parseCustom:onepartiteExtract')
var i, j, k; var i, j, k;
// partialGraph.emptyGraph(); // partialGraph.emptyGraph();
// Parse Attributes // Parse Attributes
...@@ -1097,7 +1097,7 @@ function onepartiteExtract(){ ...@@ -1097,7 +1097,7 @@ function onepartiteExtract(){
//to_del //to_del
function fullExtract(){ function fullExtract(){
console.log('FUN t.sigma.parseCustom:fullExtract') // console.log('FUN t.sigma.parseCustom:fullExtract')
var i, j, k; var i, j, k;
// Parse Attributes // Parse Attributes
// This is confusing, so I'll comment heavily // This is confusing, so I'll comment heavily
...@@ -1426,7 +1426,7 @@ function fullExtract(){ ...@@ -1426,7 +1426,7 @@ function fullExtract(){
//to_del //to_del
function JSONFile( URL ) { function JSONFile( URL ) {
console.log('FUN t.sigma.parseCustom:JSONFile') // console.log('FUN t.sigma.parseCustom:JSONFile')
return $.ajax({ return $.ajax({
...@@ -1452,7 +1452,7 @@ function JSONFile( URL ) { ...@@ -1452,7 +1452,7 @@ function JSONFile( URL ) {
//to_del //to_del
function parseSimpleJSON( data , seed ) { function parseSimpleJSON( data , seed ) {
console.log('FUN t.sigma.parseCustom:parseSimpleJSON') // console.log('FUN t.sigma.parseCustom:parseSimpleJSON')
var i, j, k; var i, j, k;
rand=new RVUniformC(seed); rand=new RVUniformC(seed);
//partialGraph.emptyGraph(); //partialGraph.emptyGraph();
...@@ -1547,7 +1547,7 @@ function parseSimpleJSON( data , seed ) { ...@@ -1547,7 +1547,7 @@ function parseSimpleJSON( data , seed ) {
//to_del //to_del
// For CommunityExplorer API // For CommunityExplorer API
function extractFromJson(data,seed){ function extractFromJson(data,seed){
console.log('FUN t.sigma.parseCustom:extractFromJson') // console.log('FUN t.sigma.parseCustom:extractFromJson')
var i, j, k; var i, j, k;
rand=new RVUniformC(seed); rand=new RVUniformC(seed);
//partialGraph.emptyGraph(); //partialGraph.emptyGraph();
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
SigmaUtils = function () { SigmaUtils = function () {
console.log('FUN t.SigmaUtils:SigmaUtils:new') // console.log('FUN t.SigmaUtils:SigmaUtils:new')
this.nbCats = 0; this.nbCats = 0;
// input = GEXFstring // input = GEXFstring
this.FillGraph = function( initialState , catDict , nodes, edges , graph ) { this.FillGraph = function( initialState , catDict , nodes, edges , graph ) {
console.log('FUN t.SigmaUtils:SigmaUtils:FillGraph') // console.log('FUN t.SigmaUtils:SigmaUtils:FillGraph')
print("Filling the graaaaph:") print("Filling the graaaaph:")
print(catDict) print(catDict)
...@@ -66,7 +66,7 @@ SigmaUtils = function () { ...@@ -66,7 +66,7 @@ SigmaUtils = function () {
//for socialgraph //for socialgraph
function showMeSomeLabels(N){ function showMeSomeLabels(N){
console.log('FUN t.sigmaUtils:showMeSomeLabels') // console.log('FUN t.sigmaUtils:showMeSomeLabels')
/*======= Show some labels at the beginning =======*/ /*======= Show some labels at the beginning =======*/
minIn=50, minIn=50,
maxIn=0, maxIn=0,
...@@ -108,34 +108,34 @@ function showMeSomeLabels(N){ ...@@ -108,34 +108,34 @@ function showMeSomeLabels(N){
} }
function getnodes(){ function getnodes(){
console.log('FUN t.sigmaUtils:getnodes') // console.log('FUN t.sigmaUtils:getnodes')
return partialGraph._core.graph.nodes; return partialGraph._core.graph.nodes;
} }
function getnodesIndex(){ function getnodesIndex(){
console.log('FUN t.sigmaUtils:getnodesIndex') // console.log('FUN t.sigmaUtils:getnodesIndex')
return partialGraph._core.graph.nodesIndex; return partialGraph._core.graph.nodesIndex;
} }
function getedges(){ function getedges(){
console.log('FUN t.sigmaUtils:getedges') // console.log('FUN t.sigmaUtils:getedges')
return partialGraph._core.graph.edges; return partialGraph._core.graph.edges;
} }
function getedgesIndex(){ function getedgesIndex(){
console.log('FUN t.sigmaUtils:getedgesIndex') // console.log('FUN t.sigmaUtils:getedgesIndex')
return partialGraph._core.graph.edgesIndex; return partialGraph._core.graph.edgesIndex;
} }
function getVisibleEdges() { function getVisibleEdges() {
console.log('FUN t.sigmaUtils:getVisibleEdges') // console.log('FUN t.sigmaUtils:getVisibleEdges')
return partialGraph._core.graph.edges.filter(function(e) { return partialGraph._core.graph.edges.filter(function(e) {
return !e['hidden']; return !e['hidden'];
}); });
} }
function getVisibleNodes() { function getVisibleNodes() {
console.log('FUN t.sigmaUtils:getVisibleNodes') // console.log('FUN t.sigmaUtils:getVisibleNodes')
return partialGraph._core.graph.nodes.filter(function(n) { return partialGraph._core.graph.nodes.filter(function(n) {
return !n['hidden']; return !n['hidden'];
}); });
...@@ -143,25 +143,25 @@ function getVisibleNodes() { ...@@ -143,25 +143,25 @@ function getVisibleNodes() {
function getNodesByAtt(att) { function getNodesByAtt(att) {
console.log('FUN t.sigmaUtils:getNodesByAtt') // console.log('FUN t.sigmaUtils:getNodesByAtt')
return partialGraph._core.graph.nodes.filter(function(n) { return partialGraph._core.graph.nodes.filter(function(n) {
return n['type']==att; return n['type']==att;
}); });
} }
function getn(id){ function getn(id){
console.log('FUN t.sigmaUtils:getn') // console.log('FUN t.sigmaUtils:getn')
return partialGraph._core.graph.nodesIndex[id]; return partialGraph._core.graph.nodesIndex[id];
} }
function gete(id){ function gete(id){
console.log('FUN t.sigmaUtils:gete') // console.log('FUN t.sigmaUtils:gete')
return partialGraph._core.graph.edgesIndex[id]; return partialGraph._core.graph.edgesIndex[id];
} }
function find(label){ function find(label){
console.log('FUN t.sigmaUtils:find') // console.log('FUN t.sigmaUtils:find')
var results=[]; var results=[];
var nds=getnodesIndex(); var nds=getnodesIndex();
label=label.toLowerCase() label=label.toLowerCase()
...@@ -178,7 +178,7 @@ function find(label){ ...@@ -178,7 +178,7 @@ function find(label){
} }
function exactfind(label) { function exactfind(label) {
console.log('FUN t.sigmaUtils:exactfind') // console.log('FUN t.sigmaUtils:exactfind')
nds=getnodesIndex(); nds=getnodesIndex();
for(var i in nds){ for(var i in nds){
n=nds[i]; n=nds[i];
...@@ -193,7 +193,7 @@ function exactfind(label) { ...@@ -193,7 +193,7 @@ function exactfind(label) {
function getNodeLabels(elems){ function getNodeLabels(elems){
console.log('FUN t.sigmaUtils:getNodeLabels') // console.log('FUN t.sigmaUtils:getNodeLabels')
var labelss=[] var labelss=[]
for(var i in elems){ for(var i in elems){
var id=(!isUndef(elems[i].key))?elems[i].key:i var id=(!isUndef(elems[i].key))?elems[i].key:i
...@@ -203,13 +203,13 @@ function getNodeLabels(elems){ ...@@ -203,13 +203,13 @@ function getNodeLabels(elems){
} }
function getNodeIDs(elems){ function getNodeIDs(elems){
console.log('FUN t.sigmaUtils:getNodeIDs') // console.log('FUN t.sigmaUtils:getNodeIDs')
return Object.keys(elems) return Object.keys(elems)
} }
function getSelections(){ function getSelections(){
console.log('FUN t.sigmaUtils:getSelections') // console.log('FUN t.sigmaUtils:getSelections')
params=[]; params=[];
for(var i in selections){ for(var i in selections){
params.push(Nodes[i].label); params.push(Nodes[i].label);
...@@ -221,7 +221,7 @@ function getSelections(){ ...@@ -221,7 +221,7 @@ function getSelections(){
//This receives an array not a dict! //This receives an array not a dict!
// i added an excpt... why // i added an excpt... why
function getNeighs(sels,arr) { function getNeighs(sels,arr) {
console.log('FUN t.sigmaUtils:getNeighs') // console.log('FUN t.sigmaUtils:getNeighs')
neighDict={}; neighDict={};
for(var i in sels) { for(var i in sels) {
id = sels[i] id = sels[i]
...@@ -240,7 +240,7 @@ function getNeighs(sels,arr) { ...@@ -240,7 +240,7 @@ function getNeighs(sels,arr) {
//Using bipartiteN2D or bipartiteD2N //Using bipartiteN2D or bipartiteD2N
//This receives an array not a dict! //This receives an array not a dict!
function getNeighs2(sels,arr){ function getNeighs2(sels,arr){
console.log('FUN t.sigmaUtils:getNeighs2') // console.log('FUN t.sigmaUtils:getNeighs2')
neighDict={}; neighDict={};
for(var i in sels) { for(var i in sels) {
id = sels[i] id = sels[i]
...@@ -257,7 +257,7 @@ function getNeighs2(sels,arr){ ...@@ -257,7 +257,7 @@ function getNeighs2(sels,arr){
//to general utils //to general utils
function getArrSubkeys(arr,id) { function getArrSubkeys(arr,id) {
console.log('FUN t.sigmaUtils:getArrSubkeys') // console.log('FUN t.sigmaUtils:getArrSubkeys')
var result = [] var result = []
for(var i in arr) { for(var i in arr) {
result.push(arr[i][id]) result.push(arr[i][id])
...@@ -266,7 +266,7 @@ function getArrSubkeys(arr,id) { ...@@ -266,7 +266,7 @@ function getArrSubkeys(arr,id) {
} }
function getCountries(){ function getCountries(){
console.log('FUN t.sigmaUtils:getCountries') // console.log('FUN t.sigmaUtils:getCountries')
var nodes = getVisibleNodes(); var nodes = getVisibleNodes();
var countries = {} var countries = {}
...@@ -285,7 +285,7 @@ function getCountries(){ ...@@ -285,7 +285,7 @@ function getCountries(){
function getAcronyms() { function getAcronyms() {
console.log('FUN t.sigmaUtils:getAcronyms') // console.log('FUN t.sigmaUtils:getAcronyms')
var nodes = getVisibleNodes(); var nodes = getVisibleNodes();
var acrs = {} var acrs = {}
pr("in getAcronyms") pr("in getAcronyms")
...@@ -302,7 +302,7 @@ function getAcronyms() { ...@@ -302,7 +302,7 @@ function getAcronyms() {
function clustersBy(daclass , att2change ) { function clustersBy(daclass , att2change ) {
console.log('FUN t.sigmaUtils:clustersBy') // console.log('FUN t.sigmaUtils:clustersBy')
cancelSelection(false); cancelSelection(false);
var v_nodes = getVisibleNodes(); var v_nodes = getVisibleNodes();
...@@ -422,7 +422,7 @@ function clustersBy(daclass , att2change ) { ...@@ -422,7 +422,7 @@ function clustersBy(daclass , att2change ) {
function colorsBy(daclass, att2change ) { function colorsBy(daclass, att2change ) {
console.log('FUN t.sigmaUtils:colorsBy') // console.log('FUN t.sigmaUtils:colorsBy')
pr("") pr("")
pr(" = = = = = = = = = = = = = = = = = ") pr(" = = = = = = = = = = = = = = = = = ")
pr(" = = = = = = = = = = = = = = = = = ") pr(" = = = = = = = = = = = = = = = = = ")
...@@ -471,7 +471,7 @@ function colorsBy(daclass, att2change ) { ...@@ -471,7 +471,7 @@ function colorsBy(daclass, att2change ) {
//just for fun //just for fun
function makeEdgeWeightUndef() { function makeEdgeWeightUndef() {
console.log('FUN t.sigmaUtils:makeEdgeWeightUndef') // console.log('FUN t.sigmaUtils:makeEdgeWeightUndef')
for(var e in partialGraph._core.graph.edges) { for(var e in partialGraph._core.graph.edges) {
partialGraph._core.graph.edges[e].weight=1; partialGraph._core.graph.edges[e].weight=1;
} }
......
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