Closed Co-Maheshh closed 1 year ago
Please read documentation in readme: (Opened 9 issues.)
https://github.com/jerosoler/Drawflow#methods
Method - addNodeOutput - To increase outputs.
Can't I dynamically generate output?
Example:
editor.addNodeOutput(5);
How to restrict one input is connected to multiple output ? means input is need to connected to only one output ?
Before asking please try searching the issues.
i used this method.but after that we need to initialize editor again or directly it added 5 outputs.
editor.addNodeOutput(5);
i am used this but it does not worked for me getting error like this.
Number 5 it's id of node to add ouput.
can you provide one sample example ?
Example addoutput to node with id: 1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jerosoler/Drawflow/dist/drawflow.min.css"/>
<script src="https://cdn.jsdelivr.net/gh/jerosoler/Drawflow/dist/drawflow.min.js"></script>
</head>
<div id="drawflow"></div>
<button onclick="addOuptutToNode()">add</button>
<style>
#drawflow {
position: relative;
text-align:initial;
width: 100%;
height: 800px;
border: 1px solid red;
}
</style>
<script>
var id = document.getElementById("drawflow");
const editor = new Drawflow(id);
editor.start();
editor.addNode('test1', 1, 1, 200, 300, 'test1', {}, 'Hello World');
editor.addNode('test1', 1, 1, 400, 300, 'test1', {}, 'Hello World2');
editor.addNode('test1', 1, 1, 500, 300, 'test1', {}, 'Hello World3');
function addOuptutToNode() {
editor.addNodeOutput(1);
editor.updateConnectionNodes('node-1');
}
</script>
</body>
</html>
Thanks for your constanr support.
My scenerio is that i have a one node in editor when i click on that node one popup is opened. in that pop up we are given number like 2 or 3. if i am added 3 then.it will be immediately add 3 output on that node. how we can do like this.
Thank you in advance.