Commit 43d8dcfd authored by Romain Loth's avatar Romain Loth

Merge commit 'cd56ece' (integrate proportional labels normalization)

parents abf79e21 c4e0df50
......@@ -264,6 +264,7 @@ function SelectionEngine() {
for(var i in theSelection) {
let srcnid = theSelection[i]
var bipaNeighs = TW.Relations["XR"][srcnid];
activeRelations["XR"][srcnid] = {}
......@@ -276,8 +277,16 @@ function SelectionEngine() {
oppoSideNeighbors[bipaNeighs[k]] = 0 ;
}
// cumulated for all srcnids
oppoSideNeighbors[bipaNeighs[k]]++
// normalize sizes by special attribute "normfactor" if present
let normfactor = 1
if (TW.Nodes[bipaNeighs[k]]
&& TW.Nodes[bipaNeighs[k]].attributes
&& TW.Nodes[bipaNeighs[k]].attributes.normfactor) {
normfactor = parseFloat(TW.Nodes[bipaNeighs[k]].attributes.normfactor)
}
// cumulated weight for all srcnids
oppoSideNeighbors[bipaNeighs[k]] += 1 * normfactor
// and the details
activeRelations["XR"][srcnid][bipaNeighs[k]]++;
......
......@@ -459,11 +459,6 @@ function htmlProportionalLabels(elems , limit, selectableFlag) {
fontSize = 1
}
// normalize sizes by special attribute "normfactor" if present
if (TW.Nodes[id].attributes.normfactor) {
fontSize = fontSize * TW.Nodes[id].attributes.normfactor
}
// debug
// console.log('htmlfied_tagcloud (',id, TW.Nodes[id].label,') freq',frec,' fontSize', fontSize)
......
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