jerosoler / Drawflow

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

Get location of nodeMoved #518

Open ivancdechiara opened 2 years ago

ivancdechiara commented 2 years ago

Hello, congratulations for the project!

I am trying to save the location of the nodes on the database after nodeMoved, so when the page is reloaded, the nodes remember the last position, but the method don't return the new location {x : y}, only the id.

Is there a way to achieve this?

Thank you,

Ivan

jerosoler commented 2 years ago

You can get the location of the node with getNodeFromId(id). Returns all node information. https://github.com/jerosoler/Drawflow#methods

But it also has export/import methods. https://github.com/jerosoler/Drawflow#export--import