jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.7k stars 728 forks source link

How to addNodeToDrawFlow with group node #533

Open maxkaoppp opened 2 years ago

maxkaoppp commented 2 years ago

hello @jerosoler ,I want to add the grouped node and the node inside group to Drawflow.How can I do that?

jerosoler commented 2 years ago

By default drawflow has no groups.

Here is one way to create groups:

maxkaoppp commented 2 years ago

Sorry @jerosoler, I say it wrong.I mean that I want to copy group node and the node inside group, then paste it to drawflow.How can I do that?

maxkaoppp commented 2 years ago

image

jerosoler commented 2 years ago

You should be able to copy a node's information with:

const copy = editor.getNodeFromId(id)

And paste it by adding a new node with the selected information.