jerosoler / Drawflow

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

Could you explain better the node data function? #803

Open JTorresConsulta opened 6 months ago

JTorresConsulta commented 6 months ago

Could you explain better the node data function? I cant understand and I think I am lossing something interesting of your work :)

https://github.com/jerosoler/Drawflow?tab=readme-ov-file#node-example

Exctly how to use df-*-*... parents vars

Thanks ! :))

JTorresConsulta commented 6 months ago

Taking your "template" node example: How could I send the var "df-template" value to the next node connected by it output?

jerosoler commented 6 months ago

Drawflow does not send the data to other nodes.

But it could modify the data of the connected nodes. Listening for "connectionCreated", "connectionRemoved" and "nodeDataChanged" events.

And updating the values with the "updateNodeDataFromId" function.

You can get the nodes information with the "getNodeFromId" function.