Skip to content

Commit

Permalink
refactored interactive node
Browse files Browse the repository at this point in the history
  • Loading branch information
NyashaMuusha committed Jul 24, 2024
1 parent e19bbdc commit 6df8866
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const InteractiveNode = () => {
endPlug: 'behind',
path: 'straight'
}
)

);
const newLine2 = new window.LeaderLine(
document.getElementById('end1'),
document.getElementById('start2'),
Expand All @@ -37,8 +36,7 @@ const InteractiveNode = () => {
endPlug: 'behind',
path: 'straight'
}
)

);
const newLine3 = new window.LeaderLine(
document.getElementById('start1'),
document.getElementById('start2'),
Expand All @@ -49,15 +47,19 @@ const InteractiveNode = () => {
endPlug: 'behind',
dash: true
}
)

setLine1(newLine1)
setLine2(newLine2)
setLine3(newLine3)
);
setLine1(newLine1);
setLine2(newLine2);
setLine3(newLine3);
return () => {
newLine1.remove();
newLine2.remove();
newLine3.remove();
};
} else {
console.error('LeaderLine library not loaded!')
console.error('LeaderLine library not loaded!');
}
}, [])
}, []);

const handleDrag = () => {
if (line1) line1.position()
Expand Down

0 comments on commit 6df8866

Please sign in to comment.