-
-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node and editor position not included in state object #261
Comments
The panning and scaling of the view weren't saved, that is correct. That will be fixed in the next release. However, the position of the nodes is saved and in my playground, it works. How do you initialize the |
The baklava instance is initialized the method described in the documentation, using the Is the function correct? or there is other correct way to do it |
Can you please explain how to include the positioning in the graph / how to include useBaklavaView and use it? I have an example here https://codesandbox.io/s/baklava-v2-test-forked-sqhsz5?file=/src/App.vue At the bottom of the page is a save button that console.logs the graph. But there is no mention of positioning. So when I reload it as hardcoded in the example its all in the top left. I also kind of expected the output of the first node to be the 2 numbers added together? |
@galipmedia please update to the latest version (2.0.2-beta.4), I just tested it and it seems to work. In case the version isn't available in the CodeSandbox version dropdown, just set the version inside the
For that you need to set up the engine. |
From the API documentation, the
save()
function returns aIEditorState
containingIGraphState
for root graph andIGraphTemplateState[]
for subgraphs.However *none of the objects persist the position of each nodes, and also the field of view of the editor, making the graph looks like a compressed spaghetti when loaded back from database for editing.
Below is a short GIF to demonstrate the problem. Observe the
IEditorState
being printed, every time it is the same object even after some relocation and zooming.The text was updated successfully, but these errors were encountered: