Commit 50ffa80b authored by Romain Loth's avatar Romain Loth

"merge" manually some of the small details from dev branch without the fixed positions stuff

parent 302d8a3d
...@@ -799,6 +799,12 @@ var TinaWebJS = function ( sigmacanvas ) { ...@@ -799,6 +799,12 @@ var TinaWebJS = function ( sigmacanvas ) {
listener.bind('stop', function(event) { listener.bind('stop', function(event) {
var stillRunning = document.getElementById('noverlapwait') var stillRunning = document.getElementById('noverlapwait')
if (stillRunning) { if (stillRunning) {
reInitFa2({
localZoneSettings: !TW.SystemState().level,
skipHidden: !TW.conf.stablePositions,
callback: function() {console.debug("noverlap: updated fa2 positions")}
})
TW.gui.elHtml.classList.remove('waiting'); TW.gui.elHtml.classList.remove('waiting');
noverButton.style.cursor = 'auto' noverButton.style.cursor = 'auto'
stillRunning.remove() stillRunning.remove()
......
...@@ -49,6 +49,28 @@ TW.gui.noverlapConf = { ...@@ -49,6 +49,28 @@ TW.gui.noverlapConf = {
// NB animation happens *after* processing // NB animation happens *after* processing
} }
TW.FA2Params = {
// adapting speed -------------
slowDown: 1.5,
startingIterations: 2, // keep it an even number to reduce visible oscillations at rendering
iterationsPerRender: 4, // idem
barnesHutOptimize: false,
// barnesHutTheta: .5,
// global behavior -----------
linLogMode: true,
edgeWeightInfluence: .3,
gravity: .8,
strongGravityMode: false,
scalingRatio: 1,
adjustSizes: false, // ~ messy but sort of in favor of overlap prevention
// favors global centrality
// (but rather not needed when data already shows topic-centered
// node groups and/nor when preferential attachment type of data)
outboundAttractionDistribution: false
}
// POSS: themed variants (ex: for dark bg vs light bg) // POSS: themed variants (ex: for dark bg vs light bg)
// contrasted color list for clusterColoring() // contrasted color list for clusterColoring()
...@@ -422,11 +444,17 @@ function changeType(optionaltypeFlag) { ...@@ -422,11 +444,17 @@ function changeType(optionaltypeFlag) {
// 3 - define the projected selection (sourceNids => corresponding opposites) // 3 - define the projected selection (sourceNids => corresponding opposites)
let sourceNids = outgoing.selectionNids let sourceNids = outgoing.selectionNids
// // when jutsu and no selection => by def nothing happens // when jutsu and no selection => we pick one selection at random (in meso mode we can't go to another meso with no selection, because nothing would appear)
// // otherwise POSS: all local graph is selection if (typeFlag == 'all' && !sourceNids.length) {
// if (typeFlag == 'all' && !sourceNids.length) { sourceNids = []
// sourceNids = TW.partialGraph.graph.nodes().map(function(n){return n.id}) for (var nid in TW.Nodes) {
// } if (! TW.Nodes[nid].hidden) {
sourceNids.push(nid)
break
}
}
}
let targetNids = {} let targetNids = {}
if (!mixedState) { if (!mixedState) {
targetNids = getNeighbors(sourceNids, 'XR') targetNids = getNeighbors(sourceNids, 'XR')
...@@ -1145,7 +1173,7 @@ function NodeWeightFilter( sliderDivID , tgtNodeKey) { ...@@ -1145,7 +1173,7 @@ function NodeWeightFilter( sliderDivID , tgtNodeKey) {
} }
if(TW.partialGraph.graph.nNodes() < 2) { if(TW.partialGraph.graph.nNodes() < 2) {
console.warn('not enough nodes for subsets: skipping GUI slider init') console.debug('not enough nodes for subsets: skipping GUI slider init')
showDisabledSlider(sliderDivID) showDisabledSlider(sliderDivID)
return; return;
} }
...@@ -1175,7 +1203,7 @@ function NodeWeightFilter( sliderDivID , tgtNodeKey) { ...@@ -1175,7 +1203,7 @@ function NodeWeightFilter( sliderDivID , tgtNodeKey) {
// console.warn('NodeWeightFilter: steps', steps) // console.warn('NodeWeightFilter: steps', steps)
if(steps<2) { if(steps<2) {
console.warn('no size steps for nodes: skipping GUI slider init') console.debug('no size steps for nodes: skipping GUI slider init')
showDisabledSlider(sliderDivID) showDisabledSlider(sliderDivID)
return; return;
} }
......
...@@ -564,29 +564,6 @@ function mainStartGraph(inFormat, inData, twInstance) { ...@@ -564,29 +564,6 @@ function mainStartGraph(inFormat, inData, twInstance) {
} }
} }
TW.FA2Params = {
// adapting speed -------------
slowDown: 1.5,
startingIterations: 2, // keep it an even number to reduce visible oscillations at rendering
iterationsPerRender: 4, // idem
barnesHutOptimize: false,
// barnesHutTheta: .5,
// global behavior -----------
linLogMode: true,
edgeWeightInfluence: .3,
gravity: .8,
strongGravityMode: false,
scalingRatio: 1,
adjustSizes: false, // ~ messy but sort of in favor of overlap prevention
// favors global centrality
// (but rather not needed when data already shows topic-centered
// node groups and/nor when preferential attachment type of data)
outboundAttractionDistribution: false
}
if (TW.conf.debug.logSettings) console.info("FA2 settings", TW.FA2Params) if (TW.conf.debug.logSettings) console.info("FA2 settings", TW.FA2Params)
// init FA2 for any future forceAtlas2 calls // init FA2 for any future forceAtlas2 calls
......
...@@ -752,7 +752,7 @@ function prepareEdgesRenderingProperties(edgesDict, nodesDict) { ...@@ -752,7 +752,7 @@ function prepareEdgesRenderingProperties(edgesDict, nodesDict) {
for (var eid in edgesDict) { for (var eid in edgesDict) {
var e = edgesDict[eid] var e = edgesDict[eid]
e.weight = Math.round(e.weight*1000)/1000 e.weight = Math.round(e.weight*100000)/100000
// e.size = e.weight // REFA s/weight/size/ ? // e.size = e.weight // REFA s/weight/size/ ?
var rgbStr = sigmaTools.edgeRGB(nodesDict[e.source].color, nodesDict[e.target].color) var rgbStr = sigmaTools.edgeRGB(nodesDict[e.source].color, nodesDict[e.target].color)
......
...@@ -190,7 +190,7 @@ var SigmaUtils = function () { ...@@ -190,7 +190,7 @@ var SigmaUtils = function () {
var baseRGB = edge.customAttrs.useAltColor ? edge.customAttrs.alt_rgb : edge.customAttrs.rgb var baseRGB = edge.customAttrs.useAltColor ? edge.customAttrs.alt_rgb : edge.customAttrs.rgb
if (edge.customAttrs.activeEdge) { if (edge.customAttrs.activeEdge) {
size = (defSize * 2) + 1 size = (defSize * 1.5) + .5
// active edges look well with no opacity // active edges look well with no opacity
color = `rgb(${baseRGB})` color = `rgb(${baseRGB})`
...@@ -526,6 +526,7 @@ var SigmaUtils = function () { ...@@ -526,6 +526,7 @@ var SigmaUtils = function () {
} }
catch(e) {console.log(e)} catch(e) {console.log(e)}
// remove wait icon overlay on button
if(document.getElementById('layoutwait')) { if(document.getElementById('layoutwait')) {
document.getElementById('layoutwait').remove() document.getElementById('layoutwait').remove()
} }
...@@ -539,7 +540,6 @@ var SigmaUtils = function () { ...@@ -539,7 +540,6 @@ var SigmaUtils = function () {
// factorized: forceAtlas2 supervisor call with: // factorized: forceAtlas2 supervisor call with:
// - togglability (ie. turns FA2 off if called again) // - togglability (ie. turns FA2 off if called again)
// - custom expiration duration // - custom expiration duration
// - conditions on graph size (£TODO use these to slowDown small graphs)
// - edges management (turns them off and restores them after finished) // - edges management (turns them off and restores them after finished)
this.smartForceAtlas = function (args) { this.smartForceAtlas = function (args) {
if (TW.conf.fa2Available) { if (TW.conf.fa2Available) {
......
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