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

[Question] Draggable arrowheads, is it possible? #87

Closed
koskiniko opened this issue Feb 22, 2024 · 3 comments
Closed

[Question] Draggable arrowheads, is it possible? #87

koskiniko opened this issue Feb 22, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@koskiniko
Copy link

koskiniko commented Feb 22, 2024

I'm trying to figure out how to make edits to existing connections, so that user could just drag from an arrowhead and change the target of the connection. Currently I need to delete the existing connection and start a new connection from the source.

Unless I'm missing something?

image

@koskiniko koskiniko added the question Further information is requested label Feb 22, 2024
@koskiniko koskiniko changed the title Draggable arrowheads, is it possible? [Question] Draggable arrowheads, is it possible? Feb 22, 2024
@miroiu
Copy link
Owner

miroiu commented Feb 22, 2024

Hi. I can't suggest a good solution for implementing this functionality and I also believe that it may not be possible without heavy modifications to the library.

The way it works right now is that each connection (wire) has a Source and a Target point. Each of these two points is usually bound to and updated by a connector's Anchor point.

Nonetheless, I can think of two approaches:

  1. Bind the Target point of the connection to the mouse location on the mouse down event. Then, find the Connector at the mouse location on the mouse up event and bind the connection to its Anchor.
  2. Remove the original connection and start a new PendingConnection by raising the Connector.PendingConnectionStartedEvent on the mouse down event and Connector.PendingConnectionDragEvent on the mouse move event. To complete the connection, the Connector.PendingConnectionCompletedEvent must be raised on mouse up event.

@miroiu
Copy link
Owner

miroiu commented Apr 16, 2024

There's no straightforward way of implementing this. Please feel free to reopen the issue if you need more information.

@miroiu miroiu closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
@miroiu miroiu reopened this Dec 19, 2024
@miroiu
Copy link
Owner

miroiu commented Dec 19, 2024

Retargeting connections is now possible (see PR: #183). While this is not provided as built-in functionality, the editor exposes the necessary APIs to implement it. Please re-open the issue if you need more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants