Comments (15)
Hi! @MehbubRashid
mmmmm not cloning object correctment.
Try:
const info = JSON.parse(JSON.stringify(editor.getNodeFromId(5)));
editor.removeNodeId('node-5');
console.log(info);
I look to correct it
from drawflow.
Okay, after searching in google, i found out its a proper way of cloning objects.Learned a new thing.Thanks again
from drawflow.
Hello
I would like to add.
- addNodeOutput
- addNodeInput
- deleteNodeOutput
- deleteNodeInput
I haven't had time to look at it yet.
from drawflow.
I just added addNodeOutput and addNodeInput. 1f84ede
I've also fixed the getNodeFromId export. a62cdb0
I have doubts about how to implement deleteNodeOutput/Input.
For example the node with 3 outputs.
[output_1, output_2, output3]
Execute delete output_2 function.
How would it look?
one:
[output_1, output_2]
Oh
two:
[output_1, output_3]
The first option seems the most logical. What do you think?
Another option is to always remove the last output.
How have you implemented it?
from drawflow.
Added functions removeNodeInput(id, input_class)
and removeNodeOutput(id, output_class)
Commit: af83a12
Try please ;)
from drawflow.
Thank you so much for adding these features!!
from drawflow.
Hello Thanks!
You mean?
from drawflow.
Yes,exactly.Is it possible?
from drawflow.
Currently does not allow it.
It can be a good feature. Take note.
If you need it maybe you could do something like this: view setTimeout
editor.start();
var html = `
<div><input type="text" df-name></div>
`;
var data = { "name": '' };
var html = document.createElement("div");
html.innerHTML= '<div><input type="text" df-name></div>';
editor.registerNode('test', html);
editor.addNode('github', 0, 1, -300, 300, 'github', data, 'test', true);
editor.addNode('github', 2, 3, 150, 300, 'github', data, 'test', true);
editor.addConnection(1, 2, 'output_1', 'input_2')
setTimeout(function(){
const info = editor.getNodeFromId(1);
editor.addNode(info.name, Object.keys(info.inputs).length, Object.keys(info.outputs).length +1, info.pos_x, info.pos_y, info.class, info.data, info.html, info.typenode);
editor.removeNodeId('node-1');
// REDRAW connections with
//editor.addConnection(....)
}, 1500);
from drawflow.
Thanks.i thought of something like that.
But it would be so great if you add support for this function.There might be case where users need to add button on the node and on adding a new button,a new output also added for that button (just like manychat message flow builder)
from drawflow.
Hi, @jerosoler i have tried the method you mentioned.everything works fine.but when i try to get the connections from the old node,there is no connection in the array.even if i called const info = editor.getNodeFromId(1);
before removing the node using editor.removeNodeId('node-1');
0 connection in the info array.Strange
To produce the error,you can visually connect two nodes in the browser.then in the console if you enter these two commands console.log(editor.getNodeFromId(1));editor.removeNodeId('node-1');
at once,you will see 0 connection even if you connected two nodes.
why does it happen?
from drawflow.
Yes, after adding JSON.parse(JSON.stringify())
, it works...But why does it work?Can you tell me the reason behind it? I wish to learn the theory behind it.
i think editor.getNodeFromId(5)
and JSON.parse(JSON.stringify(editor.getNodeFromId(5)));
this two are same thing.but first one works and second one does not.Why? :D
from drawflow.
Hi, @jerosoler , do you have plan to add the (deleteSpecificOutput) function anytime soon?
from drawflow.
Great,though i have manually implemented them.but would like to see official implementation soon.thanks
from drawflow.
Yes,i also have implemented the first option.This will give additional benefits.
from drawflow.
Related Issues (20)
- How to disable movement of a Node [QUESTION] HOT 1
- How Can i show cross icon using click instated of right click. In line between two node HOT 4
- How can i make only single input and single output for all node. HOT 7
- drawflow NODES connections HOT 7
- Adding event listener to button inside drawflow node HOT 1
- Suggestion to get exact mouse position
- "view" editor mode disables translate click/drag HOT 2
- Is it possible to create a drawflow connection with a different curvature than the others? HOT 1
- Can we have a before node delete event in angular? HOT 2
- Cannot read properties of undefined (reading 'inputs') HOT 3
- After setting zoom out manually and then zoomrefresh() so the connected lines of each node gets disconnected. HOT 3
- When input type = "password" the node can't be drag from list HOT 4
- [question] How to dynamically add point? HOT 1
- How to lock the full screen nodes and move into the area HOT 1
- Component return click event goes out of the canvas HOT 1
- Mouse gets stuck when leaving parent container HOT 1
- How to do a right click context menu on the connection links HOT 2
- How to place Inputs/Outputs at top & bottom instead of left and right HOT 1
- how can distribute flow in 2 part HOT 4
- Any way to designate True/False outputs for custom nodes? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drawflow.