Skip to content

Save Layout of Nodes #336

Answered by briangregoryholmes
jkanel asked this question in Q&A
Discussion options

You must be logged in to vote

A native method for save and restore will likely be part of the next major release.

In v7.0.47, you can bind to the position prop on a Node. Except for the initial setting of the position, the binding is currently read only.

<script lang="ts">
	import { Svelvet, Node } from 'svelvet';
	let position = { x: 300, y: 300 };
        $: console.log(position)
</script>

<body>
	<Svelvet >
		<Node bind:position />
	</Svelvet>
</body>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jkanel
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