jerosoler / Drawflow

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

Check currently how many nodes are there in the canvas #616

Closed Ashvi213 closed 1 year ago

Ashvi213 commented 1 year ago

I have dynamic popup on each nodes. So I need to drag one node and on double click need to fill the pop up. If I don't fill the popup the dragging of next node must be restricted. If there any provision to check how many nodes are there in the canvas before I am dragging the next node.

paulohenriquesg commented 1 year ago

I'm not sure if this is the definitive answer, but you can use the following to get a nodeList:

document.querySelectorAll(".drawflow-node ");
jerosoler commented 1 year ago

Hi!

Other alternative to get nodes from module.

console.log(editor.drawflow.drawflow[editor.module].data);