port more updates

This commit is contained in:
peterkogo
2024-12-17 17:40:18 +01:00
parent 39930e705d
commit 08b5f81cf5
2 changed files with 7 additions and 8 deletions

View File

@@ -18,7 +18,7 @@
custom: CustomNode
};
const nodes = $state.raw([
let nodes = $state.raw([
{
id: '1',
type: 'custom',
@@ -39,7 +39,7 @@
}
]);
const edges = $state.raw([
let edges = $state.raw([
{
id: '1-2',
source: '1',
@@ -60,7 +60,7 @@
</script>
<main>
<SvelteFlow {nodes} {edges} {nodeTypes} fitView>
<SvelteFlow bind:nodes bind:edges {nodeTypes} fitView>
<Controls />
<Background variant={BackgroundVariant.Dots} />
<MiniMap />

View File

@@ -1,5 +1,4 @@
<script lang="ts">
import { writable } from 'svelte/store';
import {
SvelteFlow,
Controls,
@@ -17,7 +16,7 @@
targetPosition: Position.Left
};
const nodes = writable([
let nodes = $state.raw([
{
id: '0',
position: { x: 0, y: 150 },
@@ -29,7 +28,7 @@
{ id: 'C', position: { x: 250, y: 300 }, data: { label: 'C' }, ...nodeDefaults }
]);
const edges = writable([]);
let edges = $state.raw([]);
const isValidConnection: IsValidConnection = (connection) => connection.target === 'B';
@@ -39,8 +38,8 @@
</script>
<SvelteFlow
{nodes}
{edges}
bind:nodes
bind:edges
fitView
minZoom={0.1}
maxZoom={2.5}