Problems with floating edges #966
-
Hi :) Currently I'm migrating from react-flow to vue-flow and stumbled upon a problem with floating edges support. I've basically copied the example from here https://codesandbox.io/s/vue-flow-floating-edges-zfxdok into my codebase with small adjustments, I'm using the same createElements() just to see how it works on my local machine and I'm observing the given behavior: edges are rendered correctly but there is a flood of error messages in the webbrowser console like this:
It's literally a flood. Another thing is that when I switch to my own dataset the edges are rendered chaotically like on the screenshot attached. I use an ES6 syntax, not TypeScript, so I had to modify the floating-edge-utils file to make the syntax valid. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
You're trying to use a heavily outdated example (no idea where you even found the sandbox still 🤣). |
Beta Was this translation helpful? Give feedback.
-
Oh, right, I've aligned my code to the latest repo version and the errors are no longer there :) |
Beta Was this translation helpful? Give feedback.
-
Heh, I've noticed something super interesting :) My diagram consist of one parent node where the majority of the nodes are inside (only one is outside the parent), when you move nodes inside the parent the edges are rendered all fine, they switch places according to nodes position and everything looks all fine, but, when you just move parent node it all breaks. Please see the video attached. edges-2023-05-29_10.31.45.mp4 |
Beta Was this translation helpful? Give feedback.
Alright, so the problem is somewhat related to nested nodes.
With nested nodes, we have to rely on
computedPosition
instead of justposition
.So you will have to update the utils to use that property instead of the
position
prop.