Commit eeb7aca2 authored by PkSM3's avatar PkSM3

labels and cursorsize>0: OFF

parent 9f1b99a6
......@@ -15,7 +15,7 @@ var ForceAtlas2 = function(graph) {
jitterTolerance: 1,
barnesHutOptimize: false,
barnesHutTheta: 1.2,
speed: 1,
speed: 20,
outboundAttCompensation: 1,
totalSwinging: 0,
swingVSnode1: 0,
......
......@@ -88,6 +88,9 @@ function initiateMap(db,query,submodName){
attrsHover : {
fill: onHover, //Country on Hover
animDuration : 300
},
eventHandlers: {
dblclick: function(e, id, mapElem, textElem){console.log(id); console.log(partialGraph)}
}
},
afterInit : function($self, paper, areas, plots, options) {
......@@ -202,6 +205,7 @@ function initiateMap(db,query,submodName){
return false;
});
},
error: function(){
console.log("Page Not found.");
......
......@@ -15,37 +15,37 @@ function trackMouse() {
ctx.globalAlpha = 0.5;
ctx.beginPath();
if(partialGraph._core.mousecaptor.ratio>showLabelsIfZoom){
for(var i in partialGraph._core.graph.nodesIndex){
n=partialGraph._core.graph.nodesIndex[i];
if(n.hidden==false){
distance = Math.sqrt(
Math.pow((x-parseInt(n.displayX)),2) +
Math.pow((y-parseInt(n.displayY)),2)
);
if(parseInt(distance)<=cursor_size) {
partialGraph._core.graph.nodesIndex[i].forceLabel=true;
} else {
if(typeof(n.neighbour)!=="undefined") {
if(!n.neighbour) partialGraph._core.graph.nodesIndex[i].forceLabel=false;
} else partialGraph._core.graph.nodesIndex[i].forceLabel=false;
}
}
}
partialGraph.draw(2,2,2);
} else {
for(var i in partialGraph._core.graph.nodesIndex){
n=partialGraph._core.graph.nodesIndex[i];
if(!n.hidden){
partialGraph._core.graph.nodesIndex[i].forceLabel=false;
if(typeof(n.neighbour)!=="undefined") {
if(!n.neighbour) partialGraph._core.graph.nodesIndex[i].forceLabel=false;
else partialGraph._core.graph.nodesIndex[i].forceLabel=true;
} else partialGraph._core.graph.nodesIndex[i].forceLabel=false;
}
}
partialGraph.draw(2,2,2);
}
// if(partialGraph._core.mousecaptor.ratio>showLabelsIfZoom){
// for(var i in partialGraph._core.graph.nodesIndex){
// n=partialGraph._core.graph.nodesIndex[i];
// if(n.hidden==false){
// distance = Math.sqrt(
// Math.pow((x-parseInt(n.displayX)),2) +
// Math.pow((y-parseInt(n.displayY)),2)
// );
// if(parseInt(distance)<=cursor_size) {
// partialGraph._core.graph.nodesIndex[i].forceLabel=true;
// } else {
// if(typeof(n.neighbour)!=="undefined") {
// if(!n.neighbour) partialGraph._core.graph.nodesIndex[i].forceLabel=false;
// } else partialGraph._core.graph.nodesIndex[i].forceLabel=false;
// }
// }
// }
// partialGraph.draw(2,2,2);
// } else {
// for(var i in partialGraph._core.graph.nodesIndex){
// n=partialGraph._core.graph.nodesIndex[i];
// if(!n.hidden){
// partialGraph._core.graph.nodesIndex[i].forceLabel=false;
// if(typeof(n.neighbour)!=="undefined") {
// if(!n.neighbour) partialGraph._core.graph.nodesIndex[i].forceLabel=false;
// else partialGraph._core.graph.nodesIndex[i].forceLabel=true;
// } else partialGraph._core.graph.nodesIndex[i].forceLabel=false;
// }
// }
// partialGraph.draw(2,2,2);
// }
ctx.arc(x, y, cursor_size, 0, Math.PI * 2, true);
//ctx.arc(partialGraph._core.width/2, partialGraph._core.height/2, 4, 0, 2 * Math.PI, true);/*todel*/
ctx.closePath();
......
......@@ -21,7 +21,7 @@ sigma.forceatlas2.ForceAtlas2 = function(graph , V , E) {
jitterTolerance: 1,
barnesHutOptimize: false,
barnesHutTheta: 1.2,
speed: 1,
speed: 20,
outboundAttCompensation: 1,
totalSwinging: 0,
swingVSnode1: 0,
......
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