chore(svelte): cleanup examples

This commit is contained in:
moklick
2023-09-26 12:46:32 +02:00
parent 88e840ccc9
commit b3329253ed
2 changed files with 14 additions and 2 deletions
@@ -133,7 +133,7 @@
fitView fitView
fitViewOptions={{ fitViewOptions={{
padding: 0.1, padding: 0.1,
nodes: [{ id: '1' }] nodes: [{ id: '1' }, { id: '2' }, { id: '3' }]
}} }}
minZoom={0} minZoom={0}
maxZoom={Infinity} maxZoom={Infinity}
@@ -32,9 +32,21 @@
const edges = writable([]); const edges = writable([]);
const isValidConnection: IsValidConnection = (connection) => connection.target === 'B'; const isValidConnection: IsValidConnection = (connection) => connection.target === 'B';
const defaultEdgeOptions = {
animated: true
};
</script> </script>
<SvelteFlow {nodes} {edges} fitView minZoom={0.1} maxZoom={2.5} {isValidConnection}> <SvelteFlow
{nodes}
{edges}
fitView
minZoom={0.1}
maxZoom={2.5}
{isValidConnection}
{defaultEdgeOptions}
>
<Controls /> <Controls />
<Background variant={BackgroundVariant.Dots} /> <Background variant={BackgroundVariant.Dots} />
</SvelteFlow> </SvelteFlow>