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

Add ability of multiple inputs or outputs to each operator. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add ability of multiple inputs or outputs to each operator. #1

wants to merge 1 commit into from

Conversation

kasra-ansari
Copy link

Now if user define multipleLinksOnOutput or multipleLinksOnInput on operator, the desired operator can have multiple output or input. For example, if we define multipleLinksOnOutput on Example 2 of http://sebastien.drouyer.com/jquery.flowchart-demo

operator1: {
    top: 20,
    left: 20,
    properties: {
        title: 'Operator 1',
        multipleLinksOnOutput: true, // Add ability of multiple output to this operator.
        inputs: {},
        outputs: {
            output_1: {
                label: 'Output 1',
            }
        }
    }
},

Operator 1 can have multiple outputs, but others are as usual.

@@ -210,16 +210,17 @@ $(function() {
if (!multipleLinksOnOutput || !multipleLinksOnInput) {
for (var linkId2 in this.data.links) {
var currentLink = this.data.links[linkId2];
var currentOperator = this.data.operators[currentLink.fromOperator];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: replace the name of the variable to fromOperator, and add "toOperator = this.data.operators[currentLink.toOperator];", because of my remark below...

@sdrdis
Copy link
Owner

sdrdis commented May 24, 2016

Hi,

Sorry for my late answer and thank you for your pull request. I think this is a good idea. There is one small problem though in you pull request, could you take a look at my notes?

Thanks,

@bish25
Copy link

bish25 commented Jul 28, 2017

@kasra-ansari how can i implement this? Does the allow me to put more the one link to an input ? However this still deletes the previous link.

var data = {
        multipleLinksOnInput: true,
        multipleLinksOnOutput: true,
        operators: {
            operator1: {
                top: 20,
                left: 20,
                properties: {
                    title: 'Start',
                    inputs: {},
                    outputs: {
                        output_1: {
                            label: 'Output',
                        },
                        output_2: {
                            label: 'Output',
                        }
                    }
                }
            },
            operator2: {
                top: 80,
                left: 300,
                properties: {
                    title: 'Send Message',
                    inputs: {
                        input_1: {
                            label: 'Input',
                        },
                        input_2: {
                            label: 'Input',
                        }
                    },
                    outputs: {}
                }
            },
        },
        links: {
        link_1: {
            fromOperator: 'operator1',
            fromConnector: 'output_1',
            toOperator: 'operator2',
            toConnector: 'input_2',
        },
        link_2: {
            fromOperator: 'operator1',
            fromConnector: 'output_2',
            toOperator: 'operator2',
            toConnector: 'input_2',
        },
}
    };

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

Successfully merging this pull request may close these issues.

3 participants