feat(svelte): add Provider

This commit is contained in:
moklick
2023-03-09 13:10:19 +01:00
parent 7bd8032ea4
commit 3a39876383
12 changed files with 115 additions and 130 deletions
@@ -5,55 +5,13 @@
BackgroundVariant,
Minimap,
Panel,
createNodes,
createEdges,
useSvelteFlow
} from '../../lib/index';
const nodes = createNodes([
{
id: '1',
type: 'input',
data: { label: 'Input Node' },
position: { x: 150, y: 5 }
},
{
id: '2',
type: 'default',
data: { label: 'Node' },
position: { x: 0, y: 150 }
},
{
id: '3',
type: 'output',
data: { label: 'Output Node' },
position: { x: 300, y: 150 }
}
]);
const edges = createEdges([
{
id: '1-2',
type: 'default',
source: '1',
target: '2',
label: 'Edge Text'
},
{
id: '1-3',
type: 'smoothstep',
source: '1',
target: '3'
}
]);
const svelteFlow = useSvelteFlow();
</script>
<SvelteFlow
{nodes}
{edges}
>
<SvelteFlow>
<Controls />
<Background variant={BackgroundVariant.Dots} />
<Minimap />