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 ) {
listener.bind('stop', function(event) {
var stillRunning = document.getElementById('noverlapwait')
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');
noverButton.style.cursor = 'auto'
stillRunning.remove()
......
......@@ -49,6 +49,28 @@ TW.gui.noverlapConf = {
// 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)
// contrasted color list for clusterColoring()
......@@ -422,11 +444,17 @@ function changeType(optionaltypeFlag) {
// 3 - define the projected selection (sourceNids => corresponding opposites)
let sourceNids = outgoing.selectionNids
// // when jutsu and no selection => by def nothing happens
// // otherwise POSS: all local graph is selection
// if (typeFlag == 'all' && !sourceNids.length) {
// sourceNids = TW.partialGraph.graph.nodes().map(function(n){return n.id})
// }
// 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)
if (typeFlag == 'all' && !sourceNids.length) {
sourceNids = []
for (var nid in TW.Nodes) {
if (! TW.Nodes[nid].hidden) {
sourceNids.push(nid)
break
}
}
}
let targetNids = {}
if (!mixedState) {
targetNids = getNeighbors(sourceNids, 'XR')
......@@ -1145,7 +1173,7 @@ function NodeWeightFilter( sliderDivID , tgtNodeKey) {
}
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)
return;
}
......@@ -1175,7 +1203,7 @@ function NodeWeightFilter( sliderDivID , tgtNodeKey) {
// console.warn('NodeWeightFilter: steps', steps)
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)
return;
}
......
......@@ -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)
// init FA2 for any future forceAtlas2 calls
......
......@@ -752,7 +752,7 @@ function prepareEdgesRenderingProperties(edgesDict, nodesDict) {
for (var eid in edgesDict) {
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/ ?
var rgbStr = sigmaTools.edgeRGB(nodesDict[e.source].color, nodesDict[e.target].color)
......
......@@ -190,7 +190,7 @@ var SigmaUtils = function () {
var baseRGB = edge.customAttrs.useAltColor ? edge.customAttrs.alt_rgb : edge.customAttrs.rgb
if (edge.customAttrs.activeEdge) {
size = (defSize * 2) + 1
size = (defSize * 1.5) + .5
// active edges look well with no opacity
color = `rgb(${baseRGB})`
......@@ -526,6 +526,7 @@ var SigmaUtils = function () {
}
catch(e) {console.log(e)}
// remove wait icon overlay on button
if(document.getElementById('layoutwait')) {
document.getElementById('layoutwait').remove()
}
......@@ -539,7 +540,6 @@ var SigmaUtils = function () {
// factorized: forceAtlas2 supervisor call with:
// - togglability (ie. turns FA2 off if called again)
// - custom expiration duration
// - conditions on graph size (£TODO use these to slowDown small graphs)
// - edges management (turns them off and restores them after finished)
this.smartForceAtlas = function (args) {
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