Commit 0e775d1b authored by Romain Loth's avatar Romain Loth

various fixes: servermenu, serverfile, json parse step

parent 77dd4d0a
...@@ -16,6 +16,19 @@ ...@@ -16,6 +16,19 @@
} }
} }
}, },
"data/comexjsons": {
"first" : "graph_example.json",
"gexfs": {
"graph_example.json": {},
"graph_example_attrs.json": {}
}
},
"data/test": {
"first" : "test_with_various_atts.gexf",
"gexfs": {
"test_with_various_atts.gexf": {}
}
},
"data/AXA": { "data/AXA": {
"dbname":"data.db", "dbname":"data.db",
"title":"ISITITLE", "title":"ISITITLE",
...@@ -35,7 +48,6 @@ ...@@ -35,7 +48,6 @@
"social": { "table":"ISIAUTHOR" , "textCol":"data","forkeyCol":"id"}, "social": { "table":"ISIAUTHOR" , "textCol":"data","forkeyCol":"id"},
"semantic": { "table":"ISItermsAxa_2015" , "textCol":"data","forkeyCol":"id"} "semantic": { "table":"ISItermsAxa_2015" , "textCol":"data","forkeyCol":"id"}
} }
} }
}, },
"data/ClimateChange": { "data/ClimateChange": {
......
...@@ -84,7 +84,7 @@ function changeGraphAppearanceByFacets( manualflag ) { ...@@ -84,7 +84,7 @@ function changeGraphAppearanceByFacets( manualflag ) {
color_menu_info += `<li><a href="#" onclick='clusterColoring("clust_louvain")'>By Louvain clustering (${TW.partialGraph.graph.nNodes()})</a></li>` color_menu_info += `<li><a href="#" onclick='clusterColoring("clust_louvain")'>By Louvain clustering (${TW.partialGraph.graph.nNodes()})</a></li>`
// for debug // for debug
console.warn('color_menu_info', color_menu_info) // console.warn('color_menu_info', color_menu_info)
$("#colorgraph-menu").html(color_menu_info) $("#colorgraph-menu").html(color_menu_info)
} }
......
...@@ -67,9 +67,9 @@ TW.conf = (function(TW){ ...@@ -67,9 +67,9 @@ TW.conf = (function(TW){
// attribute | coloring | number | binning // attribute | coloring | number | binning
// title | function | of bins | mode // title | function | of bins | mode
// -------------------------------------------------------------------- // --------------------------------------------------------------------
'age' : {'col': "gradient", 'n': 2, 'binmode': 'samerange'}, 'age' : {'col': "gradient", 'n': 4, 'binmode': 'samerange'},
'growth_rate' : {'col': "heatmap", 'n': 11, 'binmode': 'samepop' }, 'growth_rate' : {'col': "heatmap", 'n': 5, 'binmode': 'samepop' },
'PageRank' : {'col': "gradient", 'n': 8, 'binmode': 'samepop' }, 'PageRank' : {'col': "gradient", 'n': 4, 'binmode': 'samerange' },
'numuniform' : {'col': "heatmap", 'n': 7, 'binmode': 'samepop' }, 'numuniform' : {'col': "heatmap", 'n': 7, 'binmode': 'samepop' },
'numpareto' : {'col': "gradient", 'n': 5, 'binmode': 'samerange'}, 'numpareto' : {'col': "gradient", 'n': 5, 'binmode': 'samerange'},
'intfewvalues' : {'col': "cluster" , 'n': 4, 'binmode': 'samerange'}, 'intfewvalues' : {'col': "cluster" , 'n': 4, 'binmode': 'samerange'},
......
...@@ -162,7 +162,7 @@ function SelectionEngine() { ...@@ -162,7 +162,7 @@ function SelectionEngine() {
var tMS2_deb = performance.now() var tMS2_deb = performance.now()
console.log("IN SelectionEngine.MultipleSelection2:") console.log("IN SelectionEngine.MultipleSelection2:")
console.log("nodes", args.nodes) console.log("args", args)
} }
greyEverything(); greyEverything();
...@@ -243,7 +243,7 @@ function SelectionEngine() { ...@@ -243,7 +243,7 @@ function SelectionEngine() {
} }
} }
// FIXME: could be done in previous loop // separate loop to allow nodes_2_colour without nodes as args (only used in changeType)
for(var nid in nodes_2_colour) { for(var nid in nodes_2_colour) {
if(nid) { if(nid) {
n = TW.partialGraph.graph.nodes(nid) n = TW.partialGraph.graph.nodes(nid)
......
...@@ -167,10 +167,7 @@ function createFilechooserEl () { ...@@ -167,10 +167,7 @@ function createFilechooserEl () {
TW.instance.clearSigma() TW.instance.clearSigma()
// run // run
if (theFormat == 'json') mainStartGraph(theFormat, rdr.result, TW.instance)
mainStartGraph(theFormat, JSON.parse(rdr.result), TW.instance)
else
mainStartGraph(theFormat, rdr.result, TW.instance)
writeLabel(`Local file: ${clientLocalGraphFile.name}`) writeLabel(`Local file: ${clientLocalGraphFile.name}`)
} }
...@@ -1083,7 +1080,8 @@ function jsActionOnGexfSelector(gexfBasename){ ...@@ -1083,7 +1080,8 @@ function jsActionOnGexfSelector(gexfBasename){
if (pathcomponents[i] != 'explorerjs.html') if (pathcomponents[i] != 'explorerjs.html')
serverPrefix += '/'+pathcomponents[i] serverPrefix += '/'+pathcomponents[i]
} }
var newDataRes = AjaxSync({ URL: window.location.origin+serverPrefix+gexfPath });
var newDataRes = AjaxSync({ "url": window.location.origin+serverPrefix+gexfPath });
// remove any previous instance // remove any previous instance
TW.instance.clearSigma() TW.instance.clearSigma()
......
...@@ -268,12 +268,14 @@ function syncRemoteGraphData () { ...@@ -268,12 +268,14 @@ function syncRemoteGraphData () {
if (TW.conf.debug.logFetchers) if (TW.conf.debug.logFetchers)
console.log("\t\t\t"+gexfBasename+ " -> table:" +theGexfs[aGexf]["semantic"]["table"] ) console.log("\t\t\t"+gexfBasename)
// -------------------------->8------------------------------------------ // -------------------------->8------------------------------------------
// £TODO this part is underspecified // £TODO this part is underspecified
// if used in some usecases, port it to nodetypes // if used in some usecases, port it to nodetypes
// otherwise remove // otherwise remove
// console.log("\t\t\ttable:"+theGexfs[aGexf]["semantic"]["table"])
// TW.field[path+"/"+aGexf] = theGexfs[aGexf]["semantic"]["table"] // TW.field[path+"/"+aGexf] = theGexfs[aGexf]["semantic"]["table"]
// ex : data/AXA/RiskV2PageRank5000.gexf:"ISItermsAxa_2015" // ex : data/AXA/RiskV2PageRank5000.gexf:"ISItermsAxa_2015"
// -------------------------->8------------------------------------------ // -------------------------->8------------------------------------------
......
...@@ -9,7 +9,7 @@ var ParseCustom = function ( format , data ) { ...@@ -9,7 +9,7 @@ var ParseCustom = function ( format , data ) {
this.data = $.parseXML(data) this.data = $.parseXML(data)
} }
else { else {
this.data = data this.data = JSON.parse(data)
} }
this.format = format; this.format = format;
this.nbCats = 0; this.nbCats = 0;
...@@ -486,7 +486,7 @@ function facetsBinning (valuesIdx) { ...@@ -486,7 +486,7 @@ function facetsBinning (valuesIdx) {
// FIXME why still NaN sometimes ? // FIXME why still NaN sometimes ?
// NB: however skipping them is enough for work // NB: however skipping them is enough for work
else if (isNaN(val)) { else if (isNaN(val)) {
console.debug('skipped undetected NaN ? attribute, lastCursor, k, sortedDistinctVals[k], nodes:', at, lastCursor, k, val, valuesIdx[cat][at].map[sortedDistinctVals[k]]) // console.debug('skipped undetected NaN ? attribute, lastCursor, k, sortedDistinctVals[k], nodes:', at, lastCursor, k, val, valuesIdx[cat][at].map[sortedDistinctVals[k]])
continue continue
} }
...@@ -1081,6 +1081,7 @@ function scanJSON( data ) { ...@@ -1081,6 +1081,7 @@ function scanJSON( data ) {
// Level-00 // Level-00
// for {1,2}partite graphs // for {1,2}partite graphs
function dictfyJSON( data , categories ) { function dictfyJSON( data , categories ) {
if (TW.conf.debug.logParsers) if (TW.conf.debug.logParsers)
console.log("ParseCustom json 2nd loop, main data extraction, with categories", categories) console.log("ParseCustom json 2nd loop, main data extraction, with categories", categories)
......
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