I am quite new to Javascript and Arbor and having some difficulties to draw a complete graph of nodes. I would like to start my question with showing my code:
var handler = {
clicked:function(e){
var pos = $(canvas).offset();
_mouseP = arbor.Point(e.pageX-pos.left, e.pageY-pos.top)
selected = nearest = dragged = particleSystem.nearest(_mouseP);
if (dragged.node !== null) dragged.node.fixed = true
$(canvas).bind('mousemove', handler.dragged)
$(window).bind('mouseup', handler.dropped)
$(canvas).bind('mouseup', handler.newFunction)
},
newFunction:function(e){
if (dragged===null || dragged.node===undefined) return
if (dragged.node !== null){
dragged.node.fixed = false
var id=dragged.node.name;
//alert('Node selected: ' + id);
}
return false
},
}
I have created one node on the canvas. My question is: how can I show the node ID, for example, or any information as text as soon as I move the mouse over the node? I want to show the text ONLY when I move the mouse over that node. Your help would be very much appreciated.