Commit f11872b1 authored by Romain Loth's avatar Romain Loth

fix nodes/edges subset sliders

cursor positioning, neigbors only if not hidden, wait timer for expensive dropEdge loop, classic debouncing, add1Elem for edges
parent 09c12d64
...@@ -16,7 +16,7 @@ color: #000; ...@@ -16,7 +16,7 @@ color: #000;
.fsslider { .fsslider {
text-align: center; text-align: center;
line-height: 8px; line-height: 8px;
font-size: 8px; font-size: 10px;
font-family: "Lucida Grande", "Trebuchet MS"; font-family: "Lucida Grande", "Trebuchet MS";
} }
.fsslider > * { .fsslider > * {
......
...@@ -107,7 +107,7 @@ html, body { ...@@ -107,7 +107,7 @@ html, body {
margin: 10px 0 0 0 ; margin: 10px 0 0 0 ;
} }
#defaultop .settingslider { #defaultop .settingslider {
max-width: 120px !important; max-width: 90px !important;
display: inline-block ; display: inline-block ;
} }
...@@ -344,3 +344,17 @@ p.micromessage{ ...@@ -344,3 +344,17 @@ p.micromessage{
} }
} }
/* freshslider right-side cursor positioning fix
* (cf. freshslider.js l. 125)
*/
.fss-right {
margin-left: 0 !important ;
}
/* to display wait cursor
*/
html.waiting {
cursor: wait;
}
...@@ -120,6 +120,9 @@ ...@@ -120,6 +120,9 @@
caretRight.css({ caretRight.css({
left:values[1] * realWidth + caretRightWidth / 2, left:values[1] * realWidth + caretRightWidth / 2,
// this line is a mistake by freshslider dev but instead of
// modifying it here we override it in our own css with "important"
"margin-left": -(caretRightWidth/2), "margin-left": -(caretRightWidth/2),
'z-index':isRight?1:0 'z-index':isRight?1:0
}); });
...@@ -299,4 +302,4 @@ ...@@ -299,4 +302,4 @@
return this; return this;
} }
}(jQuery)); }(jQuery));
\ No newline at end of file
...@@ -185,21 +185,33 @@ function SelectionEngine() { ...@@ -185,21 +185,33 @@ function SelectionEngine() {
else ndsids=nodes; else ndsids=nodes;
for(var i in ndsids) { for(var i in ndsids) {
var s = ndsids[i]; var s = ndsids[i];
if(TW.Relations[typeNow] && TW.Relations[typeNow][s] ) { if(TW.Relations[typeNow] && TW.Relations[typeNow][s] ) {
var neigh = TW.Relations[typeNow][s] var neigh = TW.Relations[typeNow][s]
if(neigh) { if(neigh) {
for(var j in neigh) { for(var j in neigh) {
var t = neigh[j] var t = neigh[j]
// we add as neighbor to color it (except if already in targeted) // highlight edges (except if n hidden or e dropped (<=> lock))
if (!nodes_2_colour[t]) nodes_2_colour[t]=false; // POSS: use sigma's own index to avoid checking if edge dropped
edges_2_colour[s+";"+t]=true; if (! TW.partialGraph.graph.nodes(t).hidden
edges_2_colour[t+";"+s]=true; && (
(TW.Edges[s+";"+t] && !TW.Edges[s+";"+t].lock)
// since we're there we keep the info ||
if (typeof sameSideNeighbors[t] == 'undefined') { (TW.Edges[t+";"+s] && !TW.Edges[t+";"+s].lock)
sameSideNeighbors[t]=0 )
) {
edges_2_colour[s+";"+t]=true;
edges_2_colour[t+";"+s]=true;
// we add as neighbor to color it (except if already in targeted)
if (!nodes_2_colour[t]) nodes_2_colour[t]=false;
// since we're there we keep the neighbors info
if (typeof sameSideNeighbors[t] == 'undefined') {
sameSideNeighbors[t]=0
}
sameSideNeighbors[t]++
} }
sameSideNeighbors[t]++
} }
} }
} }
......
This diff is collapsed.
...@@ -456,11 +456,11 @@ if(RES["OK"]) { ...@@ -456,11 +456,11 @@ if(RES["OK"]) {
$("#changetype").hide(); $("#changetype").hide();
$("#taboppos").remove(); $("#taboppos").remove();
if (TW.catSem && TW.catSoc) { // if (TW.catSem && TW.catSoc) {
setTimeout(function () { setTimeout(function () {
document.querySelector('.etabs a[href="#tabs2"]').click() document.querySelector('.etabs a[href="#tabs2"]').click()
}, 500); }, 500);
} // }
} }
ChangeGraphAppearanceByAtt(true) ChangeGraphAppearanceByAtt(true)
...@@ -479,4 +479,9 @@ document.getElementById("graph-panels").style.display = "block" ...@@ -479,4 +479,9 @@ document.getElementById("graph-panels").style.display = "block"
// grey message in the search bar from settings // grey message in the search bar from settings
$("#searchinput").attr('placeholder', TW.strSearchBar) ; $("#searchinput").attr('placeholder', TW.strSearchBar) ;
setTimeout( function() {
theHtml.classList.remove('waiting')
}, 20)
console.log("finish") console.log("finish")
...@@ -671,17 +671,25 @@ function add1Elem(id) { ...@@ -671,17 +671,25 @@ function add1Elem(id) {
} }
} else { // It's an edge! } else { // It's an edge!
if(!isUndef(TW.partialGraph.graph.edges(id))) return; if(!isUndef(TW.partialGraph.graph.edges(id))) return;
if(TW.Edges[id] && !TW.Edges[id].lock){ var e = TW.Edges[id]
if(e && !e.lock){
var computedColorInfo = sigmaTools.edgeColor(e.source, e.target, TW.Nodes)
// var present = TW.partialGraph.states.slice(-1)[0]; // var present = TW.partialGraph.states.slice(-1)[0];
var anedge = { var anedge = {
id: id, id: id,
sourceID: TW.Edges[id].source, source: e.source,
targetID: TW.Edges[id].target, target: e.target,
lock : false, lock : false,
label: TW.Edges[id].label, hidden: false,
type: TW.Edges[id].type, label: e.label,
categ: TW.Edges[id].categ, type: e.type,
weight: TW.Edges[id].weight // categ: e.categ,
weight: e.weight,
customAttrs : {
grey: 0,
true_color : computedColorInfo.res,
rgb : computedColorInfo.rgb_array
}
}; };
TW.partialGraph.graph.addEdge(anedge); TW.partialGraph.graph.addEdge(anedge);
......
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