don't highlight synapses when mouse is over a node

This commit is contained in:
Devin Howard 2013-01-05 23:12:32 -05:00
parent 5bd311ceea
commit 64e93c8326

View file

@ -50,12 +50,6 @@ function graphSettings(type) {
type: 'HTML',
onMouseMove: function(node, eventInfo, e) {
onMouseMoveHandler(node, eventInfo, e);
},
onMouseEnter: function () {
},
onMouseLeave: function () {
},
//Update node positions when dragged
onDragMove: function (node, eventInfo, e) {
@ -191,12 +185,6 @@ function graphSettings(type) {
type: 'HTML',
onMouseMove: function(node, eventInfo, e) {
onMouseMoveHandler(node, eventInfo, e);
},
onMouseEnter: function () {
},
onMouseLeave: function () {
},
//Update node positions when dragged
onDragMove: function (node, eventInfo, e) {
@ -235,7 +223,9 @@ function graphSettings(type) {
onClick: function (node, eventInfo, e) {
if (e.target.id != "infovis-canvas") return false;
//clicking on an edge, a node, or clicking on blank part of canvas?
if (eventInfo.getEdge() != false || node.nodeFrom) {
console.log(eventInfo);
console.log(eventInfo.getNode());
if (eventInfo.getNode() == false) {
if (eventInfo.getEdge() != false) selectEdgeOnClickHandler(eventInfo.getEdge(), e);
else if (node.nodeFrom) selectEdgeOnClickHandler(node, e);
}
@ -795,10 +785,20 @@ function onCreateLabelHandler(domElement, node) {
}//onCreateLabelHandler
//edge that the mouse is currently hovering over
var edgeHover = false;
function onMouseMoveHandler(node, eventInfo, e) {
var edge = eventInfo.getEdge();
var node = eventInfo.getNode();
//if we're on top of a node object, act like there aren't edges under it
if (node != false) {
if (edgeHover) {
onMouseLeave(edgeHover);
}
return;
}
if (edge == false && edgeHover != false) {
//mouse not on an edge, but we were on an edge previously