When sigInst.configProperties: { drawHoverNodes: false } -- 'overnodes', 'downnodes', etc do not fire #68

Open
klebba opened this Issue Jan 25, 2013 · 3 comments

Projects

None yet

3 participants

@klebba
klebba commented Jan 25, 2013

Mouse events do not fire when drawHoverNodes is set to false.

According to this function here https://github.com/jacomyal/sigma.js/blob/master/src/core/sigma.js#L437
It's exactly what this option if here for.

klebba commented Jan 25, 2013

No -- the problem is that if I try to bind event handlers like:

sigmaInstance.bind('overnodes', function(event) { ... }); 

The events will not fire if the drawHoverNodes option is false, but they will fire if it's true. Event dispatching probably shouldn't be affected by drawing configuration options.

I somehow had a similar problem... but it was because my call to
sigmaInstance.init().configProperties() was not properly formatted.

This worked out for me :

this.graph = sigma.init(document.getElementById(anchorDiv)).configProperties().drawingProperties({
  labelThreshold: 10000,
  defaultEdgeType: 'curve'
}).mouseProperties({
  mouseEnabled: true
}).graphProperties({
  scalingMode: 'outside'
}); 

function onClick(event) {
    window.console.log("clicked!");
} 
this.graph.bind('downnodes',onClick).draw();

Could you post the code of your constructor please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment