0

I am using theJit as SpaceTree to visualize some information (Who'd guessed that...)

Problem is, when users are panning the graph and dragging the mouse outside of the canvas jit doesn't recognizes it and keeps on dragging. When the user comes back into the area of the canvas it is still in drag-mode and keeps on panning. This behavior is also observable in their Space-Tree-Example.

(Just to clarify - I am panning the whole graph; I am not dragging a node to some target location...)

I can bind to $('#container').mouseleave() via jQuery, but how to I tell jit to stop dragging?

(The mouseOver and mouseLeave handlers provided by jit (jit.Events.*) itself are bound to the individual nodes and thus not really helpful in this case)

Anybody got an Idea?

Cheers,

Corelgott_

Tobias Boschek
  • 2,158
  • 3
  • 18
  • 22

1 Answers1

0

I finally figured out a way to do it... definitely not the cleanest / nicest way of doing it, but it works at least:

When the mouse leaves the the box of the jit canvas I simulate a complete mouse-out event and send it to jit.

By using this code "How to simulate a mouse click using JavaScript?" like this:

    $('#infovis').mouseleave(function(e) {
        simulate($('canvas')[0], 'mouseup')            
    });

it stops when the mouse exists the info-vis-<div>

Hopefully that saves somebody some time in the future!

Cheers,

Corelgott

Community
  • 1
  • 1
Tobias Boschek
  • 2,158
  • 3
  • 18
  • 22