refactor(intersections): use passed node values for calculations

This commit is contained in:
moklick
2024-03-14 16:14:48 +01:00
parent 9e30f3b2cd
commit b1c30ee653
4 changed files with 47 additions and 44 deletions
@@ -17,28 +17,34 @@ const onNodeDragStop = (_: MouseEvent, node: Node) => console.log('drag stop', n
const onNodeClick = (_: MouseEvent, node: Node) => console.log('click', node);
const initialNodes: Node[] = [
{
id: '0',
data: { label: 'rectangle' },
position: { x: 0, y: 0 },
width: 100,
height: 100,
draggable: false,
style: {
opacity: 0.5,
},
},
{
id: '1',
type: 'input',
data: { label: 'Node 1' },
position: { x: 0, y: 0 },
className: 'light',
style: {
width: 200,
height: 100,
},
width: 200,
height: 100,
},
{
id: '2',
data: { label: 'Node 2' },
position: { x: 0, y: 150 },
className: 'light',
},
{
id: '3',
data: { label: 'Node 3' },
position: { x: 250, y: 0 },
className: 'light',
},
{
id: '4',
@@ -48,7 +54,6 @@ const initialNodes: Node[] = [
width: 50,
height: 50,
},
className: 'light',
},
];