Commit 180e3f09 authored by Romain Loth's avatar Romain Loth

WIP minor: reconnected monopartite louvain and fixed zoom handler typo

parent 69e7c039
......@@ -61,7 +61,12 @@ function changeGraphAppearanceByFacets( manualflag ) {
}
// POSS add cumulated degree via TW.partialGraph.graph.degree(nid)
}
// we also add clust_louvain in all cases
color_menu_info += `<li><a href="#" onclick='colorsBy("clust_louvain")'>By Louvain clustering (${TW.partialGraph.graph.nNodes()})</a></li>`
$("#colorgraph-menu").html(color_menu_info)
}
......
......@@ -994,7 +994,7 @@ TinaWebJS = function ( sigmacanvas ) {
step: .2,
value: 1,
slide: function( event, ui ) {
partialGraph.camera.goTo({
TW.partialGraph.camera.goTo({
// POSS: make a transform to increase detail around x = 1
ratio: 1 / ui.value
});
......
......@@ -1203,10 +1203,20 @@ function colorsBy(daclass) {
for(var j in TW.nodeIds) {
var the_node = TW.Nodes[ TW.nodeIds[j] ]
var attval = ( isUndef(the_node.attributes) || isUndef(the_node.attributes[daclass]) )? TW.partialGraph.graph.nodes(TW.nodeIds[j])[daclass]: the_node.attributes[daclass];
TW.partialGraph.graph.nodes(TW.nodeIds[j]).color = randomColorList[ attval ]
TW.partialGraph.graph.nodes(TW.nodeIds[j]).customAttrs.alt_color = randomColorList[ attval ]
TW.partialGraph.graph.nodes(TW.nodeIds[j]).customAttrs.altgrey_color = false
// ££TODO put louvain in graph.nodes() like other attrs ??
// then possible to use TW.partialGraph.graph.nodes(TW.nodeIds[j])
if (j< 15)
console.log(` ${TW.nodeIds[j]} : hidden?${the_node.hidden} the_node.attributes[daclass] = ${the_node.attributes[daclass]}`) // final val=${attval}
if (! the_node.hidden) {
console.log(the_node)
var attval = ( !isUndef(the_node.attributes) && !isUndef(the_node.attributes[daclass]) )? the_node.attributes[daclass] : TW.partialGraph.graph.nodes(TW.nodeIds[j])[daclass];
TW.partialGraph.graph.nodes(TW.nodeIds[j]).color = randomColorList[ attval ]
TW.partialGraph.graph.nodes(TW.nodeIds[j]).customAttrs.alt_color = randomColorList[ attval ]
TW.partialGraph.graph.nodes(TW.nodeIds[j]).customAttrs.altgrey_color = false
}
}
// set the global state
TW.handpickedcolor = true
......
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