Pan canvas when dragging a link to a node outside of viewport

When dragging a link from a visible node on the canvas to another node outside of the current viewport, is there a property in the LinkingTool or PanningTool that can auto pan in the direction the mouse is moving, so the target node pans into view?

The default behavior of the LinkingTool is to autoscroll when the mouse/finger is just inside the edge of the viewport (i.e. the visible area of the diagram).

So what I think you want is already built-in standard behavior.

Thanks Walter. I was moving the mouse too close to the window border and or outside of the viewport all together. Is the proximity to the viewport edge to initiate the scrolling configurable?

Yes, you can set the Diagram.autoScrollRegion.

Thanks, appreciate for the help.

Was looking through the API specs for a setting that will decrease the lag between getting the mouse into the scroll region and the initiation of the scrolling…doesn’t appear to be configurable.

Are you asking how frequently it scrolls? Currently the timer is for 250 milliseconds, and there’s no way to set that. Also, the method that computes the new autoscroll position is not overridable. Sorry about that. Which do you need to customize?

After testing some more, it looks like the scrolling starts pretty quickly once the mouse enters the auto-scroll area, so I don’t think I there’s a big need to start the scrolling sooner. But the frequency it scrolls, you’ve already indicated that it can’t be customized. So it looks like we’ll have to deal with jerky style of movement of the diagram.

A long time ago we found that causing the autoscrolling to go too fast was annoying to users, because it would scroll too far too quickly. So we slowed it down. But perhaps we should expose it as another property on Diagram and also make the distance calculation customizable somehow.

Would be good to have that flexibility.

Thanks again for the info.

OK, in the next release we’ll add an undocumented property, Diagram.autoScrollInterval, to go along with the already documented property Diagram.autoScrollRegion.