Skip to content

Is it possible to make the node editor state persistent? #351

Answered by hthomas92
hthomas92 asked this question in Q&A
Discussion options

You must be logged in to vote

I was able to achive this using pinia and vueuse, following this tutorial:
https://www.vuemastery.com/blog/refresh-proof-your-pinia-stores/

I restore the state in the setup function in App.vue using editor.load(JSON.parse(store.getEditorState)).

I also subscribe to the following events to save the editor state (store.save(JSON.stringify(editor.save()));):

  • graphEvents: addNode, removeNode, addConnection, removeConnection
  • nodeEvents: titleChanged, update

This seems to be working so far, and I couldn't find a better way to do it. Anyway, this might help others who would like to have this feature.

IMHO this would be a nice feature integrated into the baklava editor. Or at least it would be …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hthomas92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant