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

[FEAT] ConnectionStart and ConnectionCancel events #113

Closed
BobBDE opened this issue Feb 10, 2021 · 4 comments
Closed

[FEAT] ConnectionStart and ConnectionCancel events #113

BobBDE opened this issue Feb 10, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@BobBDE
Copy link

BobBDE commented Feb 10, 2021

Hello,

I'm back with a new request, tell me what you think of it :)

It will be nice to have an event when the user start creating a new connection and another event when the user canceled the connection.

I think adding thses kind of event is a good idea because it makes the library more open to modificiation and more adaptable for different cases.

For me it will be useful to highlight the input/output that are compatible with the node where the connection started.

Do you think it is possible to add those events ?

Have a nice day :)

@jerosoler jerosoler self-assigned this Feb 10, 2021
@jerosoler
Copy link
Owner

Hello @BobBDE

How would you indicate the compatible inputs / outputs?
What I thought of your day: #45 (comment)
Although it is a bit complicated to implement.

Another option that may be better would be to cancel the creation of the connection.
View: #35 and #10 (comment)

Jero

@BobBDE
Copy link
Author

BobBDE commented Feb 13, 2021

I would like to event like ConnectionStart (triggered when starting a new connection with the input or output information) and a ConnectionCancel (triggered when the new connectoin is canceled with the input or output information).

If those events exist, the developer could add fonctionalities to his drawflow. For example for me I would be able to highlight the compatible input or output (because added a type to the input and outputs).

The hightlight is a specific need for me but those events could help other developper to develop new functionalities with drawflow.

What do you think ?

@jerosoler jerosoler added the enhancement New feature or request label Feb 14, 2021
@jerosoler
Copy link
Owner

Hello

Added new events on version 0.0.35

Event Return Description
connectionStart { output_id, output_class } id of nodes and ouput selected
connectionCancel true Connection Cancel
editor.on("connectionStart", function(e) {
      console.log("connectionStart");
      console.log(e);
})
editor.on("connectionCancel", function(e) {
      console.log("connectionCancel");
      console.log(e);
})

Jero

@BobBDE
Copy link
Author

BobBDE commented Feb 14, 2021

Hello Jero,

Waow, thank you for your reactivity. I hope this will help other developper :)

I will test it soon.

Thank you !

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

No branches or pull requests

2 participants