jerosoler / Drawflow

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

External Fields Synchronized with Nodes #269

Closed SilasNiewierra closed 2 years ago

SilasNiewierra commented 2 years ago

Hi @jerosoler ,

I have a question regarding the inputs of the Nodes. I would like to do something like the following:

image

Is that possible, and if so, how?

jerosoler commented 2 years ago

Hi @SilasNiewierra

You can use the data update method updateNodeDataFromId(5, { name: 'Drawflow' })

With this you could achieve your purpose.

View more: https://github.com/jerosoler/Drawflow/issues/215 and https://github.com/jerosoler/Drawflow/issues/197

SilasNiewierra commented 2 years ago

Great, thank you so much 😄 Is it possible to manually unselect a node? I would like to unselect the node, when I click a button in the upcoming dialog?

jerosoler commented 2 years ago

Good!! ;)

Yes with:

editor.node_selected.classList.remove("selected");
editor.node_selected  = null;

Or simulate click with javascript events.

SilasNiewierra commented 2 years ago

Thanks a lot 😄