Skip to content

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.

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