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;
.fsslider {
text-align: center;
line-height: 8px;
font-size: 8px;
font-size: 10px;
font-family: "Lucida Grande", "Trebuchet MS";
}
.fsslider > * {
......
......@@ -107,7 +107,7 @@ html, body {
margin: 10px 0 0 0 ;
}
#defaultop .settingslider {
max-width: 120px !important;
max-width: 90px !important;
display: inline-block ;
}
......@@ -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 @@
caretRight.css({
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),
'z-index':isRight?1:0
});
......@@ -299,4 +302,4 @@
return this;
}
}(jQuery));
\ No newline at end of file
}(jQuery));
......@@ -185,21 +185,33 @@ function SelectionEngine() {
else ndsids=nodes;
for(var i in ndsids) {
var s = ndsids[i];
if(TW.Relations[typeNow] && TW.Relations[typeNow][s] ) {
var neigh = TW.Relations[typeNow][s]
if(neigh) {
for(var j in neigh) {
var t = neigh[j]
// we add as neighbor to color it (except if already in targeted)
if (!nodes_2_colour[t]) nodes_2_colour[t]=false;
edges_2_colour[s+";"+t]=true;
edges_2_colour[t+";"+s]=true;
// since we're there we keep the info
if (typeof sameSideNeighbors[t] == 'undefined') {
sameSideNeighbors[t]=0
// highlight edges (except if n hidden or e dropped (<=> lock))
// POSS: use sigma's own index to avoid checking if edge dropped
if (! TW.partialGraph.graph.nodes(t).hidden
&& (
(TW.Edges[s+";"+t] && !TW.Edges[s+";"+t].lock)
||
(TW.Edges[t+";"+s] && !TW.Edges[t+";"+s].lock)
)
) {
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"]) {
$("#changetype").hide();
$("#taboppos").remove();
if (TW.catSem && TW.catSoc) {
// if (TW.catSem && TW.catSoc) {
setTimeout(function () {
document.querySelector('.etabs a[href="#tabs2"]').click()
}, 500);
}
// }
}
ChangeGraphAppearanceByAtt(true)
......@@ -479,4 +479,9 @@ document.getElementById("graph-panels").style.display = "block"
// grey message in the search bar from settings
$("#searchinput").attr('placeholder', TW.strSearchBar) ;
setTimeout( function() {
theHtml.classList.remove('waiting')
}, 20)
console.log("finish")
......@@ -671,17 +671,25 @@ function add1Elem(id) {
}
} else { // It's an edge!
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 anedge = {
id: id,
sourceID: TW.Edges[id].source,
targetID: TW.Edges[id].target,
source: e.source,
target: e.target,
lock : false,
label: TW.Edges[id].label,
type: TW.Edges[id].type,
categ: TW.Edges[id].categ,
weight: TW.Edges[id].weight
hidden: false,
label: e.label,
type: e.type,
// categ: e.categ,
weight: e.weight,
customAttrs : {
grey: 0,
true_color : computedColorInfo.res,
rgb : computedColorInfo.rgb_array
}
};
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