Skip to content

How to export state to JSON #1096

Answered by bcakmakoglu
sultaniman asked this question in Q&A
Discussion options

You must be logged in to vote

There are two methods you can use for this purpose

  1. toObject - returns an object with the necessary info to save and restore a graph (i.e. nodes, edges and viewport position + zoom)
  2. fromObject - takes an object that is returned by toObject and restores the graph to the state was was given

Both of these methods are available from useVueFlow

Replies: 1 comment

Comment options

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