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 more than one port #33

Open
AhmadQudah opened this issue Feb 4, 2019 · 6 comments
Open

add more than one port #33

AhmadQudah opened this issue Feb 4, 2019 · 6 comments

Comments

@AhmadQudah
Copy link

how can I make many ports at the same node multiple in-ports and out-ports
I made it but the link still goes out from the default port

@Smitgamit
Copy link

Please check this file

1.Node Model

this.addPort(new RJD.DefaultPortModel(false, 'output', ''));
this.addPort(new RJD.DefaultPortModel(true, 'input', ''));

getInPort() {
return this.ports.input;
}

getOutPort() {
return this.ports.output;
}

2.Node Widgets

getInPort() {
const { node, color, displayOnly } = this.props;
let inputNode = node;

if (displayOnly) {
  inputNode = new OutputNodeModel( color);
}

return inputNode.getInPort ? <RJD.DefaultPortLabel model={inputNode.getInPort()} key='in-port' /> : null;

}

getOutPort() {
const { node, color, displayOnly } = this.props;
let outputNode = node;

if (displayOnly) {
  outputNode = new OutputNodeModel( color);
}

return outputNode.getOutPort ? <RJD.DefaultPortLabel model={outputNode.getOutPort()} key='out-port' /> : null;

}

@Smitgamit
Copy link

note : OutputNodeModel should be your object name

@AhmadQudah
Copy link
Author

@Smitgamit thats good , put I think that this way is for adding just one input port and one output port
my point is how to add like 3 input ports and 3 output ports

@Smitgamit
Copy link

ok

do you have any suggestion for below query
when i click on node add new node on canvas
lilke i click on connection node add new connection node on canvas

@AhmadQudah
Copy link
Author

not really, but I made this
also I'm searching for a way to save my diagram so I can use the previous flows in the future ....
do you have any idea for that ??
capture

@quocvan1311
Copy link

Any new update for this? I would like to add a Node with mutliple in-ports, but it seems multiple call addPort function leave only 1 port each type.

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

No branches or pull requests

3 participants