Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: customizable drag and select triggers #1767

Closed
rikkertkoppes opened this issue Dec 14, 2021 · 5 comments · Fixed by #2661
Closed

Feature request: customizable drag and select triggers #1767

rikkertkoppes opened this issue Dec 14, 2021 · 5 comments · Fixed by #2661
Assignees
Labels
feature request New feature or request

Comments

@rikkertkoppes
Copy link

rikkertkoppes commented Dec 14, 2021

I'd like to prioritize box selection over dragging the canvas, but allow both of them. To do that, I'd like to be able to appoint left mouse button drag to box selection (which is now shift-lmb-drag) and middle mouse button drag to canvas move (which is now lmb-drag).

I can imagine this being a configurable option though

@xtecox
Copy link

xtecox commented Apr 20, 2022

Got here looking for the same feature

@moklick moklick self-assigned this May 3, 2022
@moklick moklick added the feature request New feature or request label May 3, 2022
@rsdouglas
Copy link

+1

Middle mouse to pan the canvas would be super useful for us.

@chrtze
Copy link
Member

chrtze commented Aug 8, 2022

Thanks for this feature request. We could add a property for configuring the mouse button to drag the pane quite easily as d3-zoom already supports this. Open questions:

  • Should we really expose the option for the middle mouse button? This won't work on trackpads etc.
  • How should we call the new prop? Something like dragPaneMouseButton? Maybe there is a better idea.
  • What options should this prop accept? 0 (left), 1 (center), 2 (right)?

@aleib
Copy link

aleib commented Aug 8, 2022

Thanks for this feature request. We could add a property for configuring the mouse button to drag the pane quite easily as d3-zoom already supports this. Open questions:

  • Should we really expose the option for the middle mouse button? This won't work on trackpads etc.
  • How should we call the new prop? Something like dragPaneMouseButton? Maybe there is a better idea.
  • What options should this prop accept? 0 (left), 1 (center), 2 (right)?

Hi @chrtze, thanks for the response. For our use case we actually would want to use both the left mouse and the middle mouse to pan under slightly different circumstances.

  • Left mouse click & drag: this pans when clicking & dragging on the background canvas. Left clicking on a node moves the node around the canvas.
  • Middle mouse click & drag: this is an explicit pan & drag for mouse users, so clicking on a node and dragging does not move the node, it drags the entire canvas. For trackpad users they get this functionality from 2 finger swiping.

This seems to be a fairly common behaviour on canvas style apps, I think?

So for us, I suppose maybe the flag would be a boolean like panOnMiddleMouseDrag, but that seems pretty specific. Maybe panOnMouseDrag that accepts an array.
e.g. [0, 1, 2] with default as [1],
or ['left', 'middle', 'right'] with default ['left']. Naming is hard 😄

@rikkertkoppes
Copy link
Author

rikkertkoppes commented Aug 8, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants