@@ -2,86 +2,86 @@ import { type Component, createSignal } from "solid-js";
22
33import { createEdgeStore , createNodeStore , SolidFlow , SolidFlowProvider } from "../../../src" ;
44
5- const [ nodesA ] = createNodeStore ( [
6- {
7- id : "1a" ,
8- type : "input" ,
9- data : { label : "Node 1" } ,
10- position : { x : 250 , y : 5 } ,
11- class : "light" ,
12- ariaLabel : "Input Node 1" ,
13- } ,
14- {
15- id : "2a" ,
16- type : "default" ,
17- data : { label : "Node 2" } ,
18- position : { x : 100 , y : 100 } ,
19- class : "light" ,
20- ariaLabel : "Default Node 2" ,
21- } ,
22- {
23- id : "3a" ,
24- type : "default" ,
25- data : { label : "Node 3" } ,
26- position : { x : 400 , y : 100 } ,
27- class : "light" ,
28- } ,
29- ] ) ;
5+ const SwitchFlow : Component = ( ) => {
6+ const [ nodesA ] = createNodeStore ( [
7+ {
8+ id : "1a" ,
9+ type : "input" ,
10+ data : { label : "Node 1" } ,
11+ position : { x : 250 , y : 5 } ,
12+ class : "light" ,
13+ ariaLabel : "Input Node 1" ,
14+ } ,
15+ {
16+ id : "2a" ,
17+ type : "default" ,
18+ data : { label : "Node 2" } ,
19+ position : { x : 100 , y : 100 } ,
20+ class : "light" ,
21+ ariaLabel : "Default Node 2" ,
22+ } ,
23+ {
24+ id : "3a" ,
25+ type : "default" ,
26+ data : { label : "Node 3" } ,
27+ position : { x : 400 , y : 100 } ,
28+ class : "light" ,
29+ } ,
30+ ] ) ;
3031
31- const [ edgesA ] = createEdgeStore ( [
32- { id : "e1-2" , source : "1a" , target : "2a" } ,
33- { id : "e1-3" , source : "1a" , target : "3a" } ,
34- ] ) ;
32+ const [ edgesA ] = createEdgeStore ( [
33+ { id : "e1-2" , source : "1a" , target : "2a" } ,
34+ { id : "e1-3" , source : "1a" , target : "3a" } ,
35+ ] ) ;
3536
36- const [ nodesB ] = createNodeStore ( [
37- {
38- id : "inputb" ,
39- type : "input" ,
40- data : { label : "Input" } ,
41- position : { x : 300 , y : 5 } ,
42- class : "light" ,
43- ariaLabel : "Input Node" ,
44- } ,
45- {
46- id : "1b" ,
47- type : "default" ,
48- data : { label : "Node 1" } ,
49- position : { x : 0 , y : 100 } ,
50- class : "light" ,
51- ariaLabel : "Node with id 1" ,
52- } ,
53- {
54- id : "2b" ,
55- type : "default" ,
56- data : { label : "Node 2" } ,
57- position : { x : 200 , y : 100 } ,
58- class : "light" ,
59- ariaLabel : "Node with id 2" ,
60- } ,
61- {
62- id : "3b" ,
63- type : "default" ,
64- data : { label : "Node 3" } ,
65- position : { x : 400 , y : 100 } ,
66- class : "light" ,
67- } ,
68- {
69- id : "4b" ,
70- type : "default" ,
71- data : { label : "Node 4" } ,
72- position : { x : 600 , y : 100 } ,
73- class : "light" ,
74- } ,
75- ] ) ;
37+ const [ nodesB ] = createNodeStore ( [
38+ {
39+ id : "inputb" ,
40+ type : "input" ,
41+ data : { label : "Input" } ,
42+ position : { x : 300 , y : 5 } ,
43+ class : "light" ,
44+ ariaLabel : "Input Node" ,
45+ } ,
46+ {
47+ id : "1b" ,
48+ type : "default" ,
49+ data : { label : "Node 1" } ,
50+ position : { x : 0 , y : 100 } ,
51+ class : "light" ,
52+ ariaLabel : "Node with id 1" ,
53+ } ,
54+ {
55+ id : "2b" ,
56+ type : "default" ,
57+ data : { label : "Node 2" } ,
58+ position : { x : 200 , y : 100 } ,
59+ class : "light" ,
60+ ariaLabel : "Node with id 2" ,
61+ } ,
62+ {
63+ id : "3b" ,
64+ type : "default" ,
65+ data : { label : "Node 3" } ,
66+ position : { x : 400 , y : 100 } ,
67+ class : "light" ,
68+ } ,
69+ {
70+ id : "4b" ,
71+ type : "default" ,
72+ data : { label : "Node 4" } ,
73+ position : { x : 600 , y : 100 } ,
74+ class : "light" ,
75+ } ,
76+ ] ) ;
7677
77- const [ edgesB ] = createEdgeStore ( [
78- { id : "e1b" , source : "inputb" , target : "1b" , ariaLabel : "edge to connect" } ,
79- { id : "e2b" , source : "inputb" , target : "2b" } ,
80- { id : "e3b" , source : "inputb" , target : "3b" } ,
81- { id : "e4b" , source : "inputb" , target : "4b" } ,
82- ] ) ;
78+ const [ edgesB ] = createEdgeStore ( [
79+ { id : "e1b" , source : "inputb" , target : "1b" , ariaLabel : "edge to connect" } ,
80+ { id : "e2b" , source : "inputb" , target : "2b" } ,
81+ { id : "e3b" , source : "inputb" , target : "3b" } ,
82+ { id : "e4b" , source : "inputb" , target : "4b" } ,
83+ ] ) ;
8384
84- const SwitchFlow : Component = ( ) => {
8585 const [ nodes , setNodes ] = createSignal ( nodesA ) ;
8686 const [ edges , setEdges ] = createSignal ( edgesA ) ;
8787
0 commit comments