-
-
Notifications
You must be signed in to change notification settings - Fork 778
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
Add for input/output type and single connection for typed inputs #122
Conversation
Just pushed an update that add possibility to customize connection style based on the output's type. Also I switched the style from being class, to attribute. This is simply achieved using following css:
|
Hello @raph74 👏👏👏👏 Good work! This is one of the things the library was missing. I will check your code. I see that there are many lines. I keep you informed. Thanks and regards Jero Jero |
Hello @jerosoler Thanks! Sorry about so much changes but I had to rollback at some point because I did change all the indent. I just pushed another small update which allow to have custom style for outputs/inputs that have a connection. Here is a screenshot of what can be achieved: Css example:
|
Wow!!! Take a look at this and tell me what you think. You could detect if it is an array or a number in addNode ... Jero |
Hey, it really is what I would like to have implemented for my project! |
Hey, I put the PR as draft for now because I kept adding stuff... With this update I have added possibility to add labels next to inputs/ouputs. Example of json for inputs:
Here is the result I have still with the demo page: Now instead of having only the field "html" for node content at the center, we also have a header and a footer and the json should look like this:
You can still contact me if you need help I will try to help as much as I can. Thanks again for bringing this awesome library to life. I hope my contribution will be of use for others even if it doesn't end in the main "master". I will keep the fork up. Raphael |
Hello 👋 👏👏👏👏 Thanks for all the input and PR. And above all your time. There are very interesting things in your PR. What happens to me like you, I don't have much time. Who can take a look at everything. Again, thank you very much. If I have any questions I will comment. Regards, Jero |
Heya. What was the status of this? Tried out raph's branch, but the minified javascript files throws errors about exports :). |
Hi, @raph74 . I managed to set up the gulp file to allow for use of your changes. I also tested through trial and error setting up so the test page ran. It still has some visual bugs and things out of place though, and the demo page on your branch is kindof broken and does not include samples for your functionality. I tried poking you on a couple of messaging services, but guessing it looked like spam or scary. If you want to talk about your changes and team up to make it a bit more accessible, hit me up. Your changes satisfy everything I am after, so was psyched to see your screenshots :) |
Hi there, I'd like to join @magnusjjj request to work on the features added by @raph74. Are there any plans for a Drawflow release with input/output types and lables? Thank you for the good work! |
I'm also working on / with raph74's additions. |
Hey,
For my project I had to add possibilities to have typed inputs/ouputs so I added the boolean "checkInOutType". Doing so allow me to have a better control of what data is transfered. It also allows me to add custom css style for each type of input/output for different color. If the output type isn't the same as the input type, then no connection is created.
I also added a new boolean "singleConnectionForTypedInput". If this one is set to true, then a typed input can only be linked to one connection. I am using this so by default inputs/outputs define the "flow" of executions, and the typed inputs/outputs are the data transfered. This is similar to what you'll see in UE4 editor with blueprints.
The new function "checkConnectionTypes" can be overriden to defined if the input/output can form a connection. By default it just checks if the 2 have the same type. But we can imagine any logic here to determine if the 2 can form a connection.
Think it could be a great addition to the plugin. You're free to change/refactor the way I did it before including this.
For example I did not change the addNode function to type the inputs/outputs from here. I just added 2 new functions: "changeNodeInputType" and "changeNodeOutputType".
Edit: added 2 new functions "addNodeInput(id, type)" and "addNodeOutput(id, type)"
Here is a simple screenshot with different types for input/output.
![image](https://user-images.githubusercontent.com/11688737/108600207-23edae80-7396-11eb-83a7-eb50164f1fb2.png)