jerosoler / Drawflow

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

Create node with both drag and click #521

Closed maxkaoppp closed 2 years ago

maxkaoppp commented 2 years ago

hello @jerosoler ,I want to create the nodes with both click and drag.Is it possible?

jerosoler commented 2 years ago

Click and drag is the natural behavior of moving the canvas. Do you want to remove this function?

maxkaoppp commented 2 years ago

no,I mean i want to addNode with both click and drag,not just drag.

jerosoler commented 2 years ago

I don't understand. Can you share an example page?

maxkaoppp commented 2 years ago

image (1) now addnode to drawflow using drag.How can I addnode to drawflow using click?

jerosoler commented 2 years ago

You can use the click event, to detect the position. I add the node as when dragging with the addNode function.

maxkaoppp commented 2 years ago

OK.I'll try it. Thanks a lot.

maxkaoppp commented 2 years ago

Thanks @jerosoler , it works very successful. What a great project! 🙏