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