fxgraph icon indicating copy to clipboard operation
fxgraph copied to clipboard

Cannot Pan Graph with primary mouse button

Open VersusF opened this issue 5 years ago • 5 comments

Hello, thanks for your work, it's the best graph visualization library tried so far. My current problem is that i cannot pan the pane of the graph, even the main app does not work (Currently using openjdk14 on Ubuntu 19.10 with javafx 13).

Moreover it would be great to be able to pan the graph around using the arrow keys on the keyboard.

I hope it's an easy fix, thank you again

-- EDIT --

I discovered that the mouse panning is actually implemented and it works correctly, but it has to be done with the secondary mouse button. This is very uncomfortable for a laptop user, so in my opinion it should be done with the primary mouse button. This can cause a problem when dragging a node, because both cell and graph start moving around. The simple solution I found is to consume the node dragging event. If this sounds good for you I can add this feature to my pull request, it's an easy fix.

VersusF avatar Feb 20 '20 16:02 VersusF

May want to rename this since it is implemented, but is not done so in the expected way.

Perhaps a user could specify which mouse button to use for panning actions?

Col-E avatar Feb 27 '20 17:02 Col-E

May want to rename this since it is implemented, but is not done so in the expected way.

Perhaps a user could specify which mouse button to use for panning actions?

It could be an idea, but that would change the node click handler too accordingly to the mouse button. Nevertheless it should not be so difficult.

VersusF avatar Feb 27 '20 17:02 VersusF

Minus the keyboard point which is still an open PR, the panning should work now and can be bound to any button.

Col-E avatar Mar 06 '21 22:03 Col-E

@Col-E I forked your latest version and am working on a couple improvements, including allowing any mouse button for dragging nodes and dragging the viewport. See the issue in my fork for details.

I will leave arrow key panning alone for now, but might incorporate that as well, using what was done in PR 8.

ogallagher avatar Aug 16 '21 19:08 ogallagher

https://github.com/ogallagher/fxgraph/issues/5 - My implementation didn't intend for multiple binds to the same button. Looking good so far with those demos though 👍

Col-E avatar Aug 16 '21 21:08 Col-E