Commit a272535a authored by Romain Loth's avatar Romain Loth

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

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