Commit b2bb0ba6 authored by Romain Loth's avatar Romain Loth

remove most init comments

parent c2449196
......@@ -410,22 +410,25 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
// type_attrb = "type"
// criteria = "size"
if(TW.partialGraph.nEdges<3) {
$(sliderDivID).freshslider({
range: true,
step:1,
value:[10, 60],
enabled: false,
onchange:function(low, high){
console.log(low, high);
}
});
return;
}
// if(TW.partialGraph.nEdges<3) {
// $(sliderDivID).freshslider({
// range: true,
// step:1,
// value:[10, 60],
// enabled: false,
// onchange:function(low, high){
// console.log(low, high);
// }
// });
// return;
// }
var filterparams = AlgorithmForSliders ( TW.Edges , type_attrb , type , criteria) //OK
console.log("EdgeWeightFilter: "+type)
console.log(filterparams)
// TODO make an index
// console.log("EdgeWeightFilter: "+type)
// console.log(filterparams)
var steps = filterparams["steps"]
var finalarray = filterparams["finalarray"]
if(steps<3) {
......@@ -435,7 +438,9 @@ function EdgeWeightFilter(sliderDivID , type_attrb , type , criteria) {
value:[10, 60],
enabled: false,
onchange:function(low, high){
console.log(low, high);
// TODO REFA fix edge selector
// console.log(low, high);
}
});
return;
......@@ -618,9 +623,10 @@ function NodeWeightFilter( categories , sliderDivID , type_attrb , type , crit
return;
}
// £TODO make this into a type_attrb index (eg weight index) instead of recalculating each time
var filterparams = AlgorithmForSliders ( TW.Nodes , type , type_attrb , criteria)
console.log("NodeWeightFilter: "+type)
console.log(filterparams)
// console.log("NodeWeightFilter: "+type)
// console.log(filterparams)
var steps = filterparams["steps"]
var finalarray = filterparams["finalarray"]
......
......@@ -98,8 +98,7 @@ if(RES["OK"]) {
var fileparam;// = { db|api.json , somefile.json|gexf }
var the_data = RES["data"];
console.log('RES', RES)
// console.log('initial AjaxSync result RES', RES)
var the_file = "";
if ( !isUndef(getUrlParam.mode) && getUrlParam.mode=="db.json") {
......@@ -122,20 +121,22 @@ if(RES["OK"]) {
var files_selector = '<select onchange="jsActionOnGexfSelector(this.value , true);">'
for( var path in the_data ) {
console.log("\t"+path+" has:")
console.log(the_data[path])
var the_gexfs = the_data[path]["gexfs"]
console.log("\t\tThese are the available Gexfs:")
for(var gexf in the_gexfs) {
var gexfBasename = gexf.replace(/\.gexf$/, "") // more human-readable in the menu
console.log("\t\t\t"+gexf+ " -> table:" +the_gexfs[gexf]["semantic"]["table"] )
TW.field[path+"/"+gexf] = the_gexfs[gexf]["semantic"]["table"]
// ex : data/AXA/RiskV2PageRank5000.gexf:"ISItermsAxa_2015"
TW.gexfDict[path+"/"+gexf] = gexf
// ex : data/AXA/RiskV2PageRank1000.gexf:"RiskV2PageRank1000.gexf"
var selected = (the_file==(path+"/"+gexf))?"selected":""
files_selector += '<option '+selected+'>'+gexfBasename+'</option>'
}
console.log( files_selector )
// console.log( files_selector )
break;
}
files_selector += "</select>"
......@@ -143,19 +144,19 @@ if(RES["OK"]) {
console.log("\n============================\n")
console.log(TW.field)
console.log(TW.gexfDict)
// console.log("\n============================\n")
// console.log(TW.field)
// console.log(TW.gexfDict)
var sub_RES = AjaxSync({ URL: fileparam });
the_data = sub_RES["data"]
fileparam = sub_RES["format"]
console.log(the_data.length)
console.log(fileparam)
// console.log(the_data.length)
// console.log(fileparam)
getUrlParam.file=the_file;
console.log(" . .. . -. - .- . - -.")
console.log(getUrlParam.file)
console.log("\n============================\n")
// console.log("\n============================\n")
}
......@@ -170,8 +171,8 @@ if(RES["OK"]) {
console.log("parsing the data")
var start = new ParseCustom( fileparam , the_data );
categories = start.scanFile(); //user should choose the order of categories
console.log("Categories: ")
console.log(categories)
// console.log("Categories: ")
// console.log(categories)
var possibleStates = makeSystemStates( categories )
var initialState = buildInitialState( categories ) //[true,false]//
......@@ -183,8 +184,8 @@ if(RES["OK"]) {
TW.nodes1 = dicts.n1;//not used
var catDict = dicts.catDict
console.log("CategoriesDict: ")
console.log(catDict)
// console.log("CategoriesDict: ")
// console.log(catDict)
TW.categoriesIndex = categories;//to_remove
TW.catSoc = categories[0];//to_remove
......@@ -208,8 +209,8 @@ if(RES["OK"]) {
// NB new sigma.js: autoResize (no need for AdjustSigmaCanvas + sigmaLimits)
console.log("categories: "+categories)
console.log("initial state: "+initialState)
// console.log("categories: "+categories)
// console.log("initial state: "+initialState)
// [ Poblating the Sigma-Graph ]
var sigma_utils = new SigmaUtils();
......@@ -253,7 +254,7 @@ if(RES["OK"]) {
sigmaJsMouseProperties
)
console.log("customSettings", customSettings)
console.info("sigma settings", customSettings)
// custom nodes rendering
if (customSettings['twNodeRendBorder']) {
......
......@@ -138,7 +138,7 @@ function scanGexf(gexf) {
// for {1,2}partite graphs
function dictfyGexf( gexf , categories ){
console.warn("ParseCustom gexf 2nd loop, main data extraction")
console.log("ParseCustom gexf 2nd loop, main data extraction")
var catDict = {}
......@@ -202,9 +202,9 @@ function dictfyGexf( gexf , categories ){
numberOfNGrams=0;
// debug: for local stats
let allSizes = []
let sumSizes = 0
let sizeStats = {'mean':null, 'median':null, 'max':0, 'min':1000000000}
// let allSizes = []
// let sumSizes = 0
// let sizeStats = {'mean':null, 'median':null, 'max':0, 'min':1000000000}
for(i=0; i<nodesNodes.length; i++) {
var nodesNode = nodesNodes[i]; // Each xml node 'nodes' (plural)
......@@ -230,10 +230,10 @@ function dictfyGexf( gexf , categories ){
size = parseFloat(sizeNode.getAttribute('value'));
// debug: for stats ---------------------------
allSizes.push(size)
sumSizes += size
if (size < sizeStats.min) sizeStats.min = size
if (size > sizeStats.max) sizeStats.max = size
// allSizes.push(size)
// sumSizes += size
// if (size < sizeStats.min) sizeStats.min = size
// if (size > sizeStats.max) sizeStats.max = size
// --------------------------------------------
}// [ / get Size ]
......@@ -311,12 +311,12 @@ function dictfyGexf( gexf , categories ){
}
// -------------- debug: for local stats ----------------
allSizes.sort();
let N = allSizes.length
sizeStats.median = allSizes[Math.round(N/2)]
sizeStats.mean = Math.round(sumSizes/N * 100)/100
console.log("parseCustom(gexf) sizeStats:", sizeStats)
// allSizes.sort();
// let N = allSizes.length
// sizeStats.median = allSizes[Math.round(N/2)]
// sizeStats.mean = Math.round(sumSizes/N * 100)/100
//
// console.log("parseCustom(gexf) sizeStats:", sizeStats)
// ------------- /debug: for local stats ----------------
var attention = false
......
......@@ -7,7 +7,7 @@ SigmaUtils = function () {
this.FillGraph = function( initialState , catDict , nodes, edges , graph ) {
console.log("Filling the graaaaph:")
console.log(catDict)
// console.log(catDict)
for(var i in nodes) {
var n = nodes[i];
......@@ -31,7 +31,7 @@ SigmaUtils = function () {
if(n.shape) node.shape = n.shape;
// console.log("FillGraph, created new node:", node)
if(Number(n.id)==287) console.log("node 287:", n, node)
if(Number(n.id)==287) console.log("node 287:", node)
// REFA new way => no separate id
graph.nodes.push( node);
......
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