Commit 20f8ee97 authored by Romain Loth's avatar Romain Loth

restore changeType via add1Elem

parent d8d77bf7
......@@ -417,7 +417,7 @@
</div>
</div>
<div id="sidebar">
<div id="tab-container" class='tab-container' style="display: none;">
<div id="tab-container" class='tab-container'>
<ul class='etabs'>
<!-- for related elements from the combined graph (eg soc => sem) -->
......
......@@ -544,7 +544,7 @@ TinaWebJS = function ( sigmacanvas ) {
setTimeout(function(){
$('.etabs a[href="#tabs1"]').trigger('click');
},500)
ChangeGraphAppearanceByAtt(true)
console.log(" ############ / changeTYPE click");
console.log("")
});
......@@ -555,9 +555,6 @@ TinaWebJS = function ( sigmacanvas ) {
changeLevel();
// FIXME intention unclear
// $("#tabs1").click()
// ChangeGraphAppearanceByAtt(true) // cf. extras_explorer
console.log(" ############ / changeLEVEL click");
console.log("")
});
......
......@@ -63,16 +63,19 @@ function changeType() {
var prevnodes = {}
var prevedges = {}
for(var i in TW.partialGraph._core.graph.nodesIndex) {
anode = TW.partialGraph._core.graph.nodesIndex[i];
// for all possible nodes, which ones actually in the graph atm
for(var i in TW.nodeIds) {
anode = TW.partialGraph.graph.nodes(TW.nodeIds[i]);
if(anode) {
prevnodes[i] = true
}
}
var links_sels = {}
for(var i in TW.partialGraph._core.graph.edgesIndex) {
anedge = TW.partialGraph._core.graph.edgesIndex[i];
for(var i in TW.edgeIds) {
anedge = TW.partialGraph.graph.edges(TW.edgeIds[i]);
if(anedge) {
prevedges[i] = true;
if(anedge.customAttrs) {
......@@ -93,10 +96,12 @@ function changeType() {
if(present.level) { //If level=Global, fill all {X}-component
for(var nid in TW.Nodes) {
if(type_t1[TW.catDict[TW.Nodes[nid].type]])
add1Elem(nid)
if(type_t1[TW.catDict[TW.Nodes[nid].type]]) {
add1Elem(nid)
}
}
for(var eid in TW.Edges) {
if(TW.Edges[eid].categ==str_type_t1)
add1Elem(eid)
}
......@@ -269,7 +274,22 @@ function changeType() {
oppos: []
})
fa2enabled=true; TW.partialGraph.zoomTo(TW.partialGraph._core.width / 2, TW.partialGraph._core.height / 2, 0.8).draw();//.startForceAtlas2();
// REFA new sigma.js
TW.partialGraph.camera.goTo({x:0, y:0, ratio:0.5, angle: 0})
TW.partialGraph.refresh()
// recreates FA2 nodes array from new nodes
reInitFa2({
useSoftMethod: false,
callback: function() {
// when going local, it's nice to see the selected nodes rearrange
TW.partialGraph.startForceAtlas2();
setTimeout(function(){
TW.partialGraph.stopForceAtlas2();
},
fa2milliseconds)
}
})
}
......
......@@ -546,17 +546,17 @@ else {
if(!isUndef(sels)) this.selections = sels;
if(!isUndef(oppos)) this.opposites = oppos;
this.LouvainFait = false;
console.log("")
console.log(" % % % % % % % % % % ")
console.log("setState type: ", type);
console.log("bistate: "+bistate)
console.log("level: "+level);
console.log("selections: ");
console.log(sels)
console.log("selections len: ");
console.log(sels.length)
console.log("opposites: ");
console.log(oppos)
// console.log("")
// console.log(" % % % % % % % % % % ")
// console.log("setState type: ", type);
// console.log("bistate: "+bistate)
// console.log("level: "+level);
// console.log("selections: ");
// console.log(sels)
// console.log("selections len: ");
// console.log(sels.length)
// console.log("opposites: ");
// console.log(oppos)
var present = TW.partialGraph.states.slice(-1)[0]; // Last
var past = TW.partialGraph.states.slice(-2)[0] // avant Last
......@@ -704,7 +704,8 @@ else {
}
// TEST new strategy: TW.Clusters were prepared in parseCustom
// should prepare the colors/clusters menu once and for all
// (previously, needed to be called after changeType/changeLevel)
changeGraphAppearanceByFacets(true)
// set the default legend
......
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