Comments (5)
Alas, this is not a bug but expected to happen since both labels use the same position.
Youβll have to either use different edges with non overlapping paths or offer labels if they overlap.
Thereβs not a built in solution for this sorry
from vue-flow.
Alas, this is not a bug but expected to happen since both labels use the same position. Youβll have to either use different edges with non overlapping paths or offer labels if they overlap. Thereβs not a built in solution for this sorry
Understood. Thanks.
from vue-flow.
@mwessendorf Sorry I have to disappoint you about a built-in helper or sth and sorry that my response was a little short; I responded from my phone π .
To expand a bit on this - the default edge labels (meaning edge.label
) will always be rendered at the center position.
So if two edges follow the same path or a path that would make their centers cross, the labels will, by default, inadvertently overlap. There's really no way around it unless you modify your handles in a way that edges don't overlap/cross.
If you're using a custom edge, you can use the EdgeLabelRenderer
to place a label as a div
on an edge.
This EdgeLabelRenderer
needs you to apply some styles for the label to be centered, like transform
.
The transformation is given an X and Y position so that the label gets centered, these positions are (usually) taken from the utils like getBezierPath
-> const [path, centerX, centerY] = getBezierPath(params)
.
But in this case you have the option of just offsetting these center positions by whatever you deem adequate so that the labels do not overlap anymore.
Again, there's no built-in mechanism that would catch this overlap and reposition edges but you can build this sort of logic yourself.
from vue-flow.
You can find an example of how to use the EdgeLabelRenderer
here.
Just open up the file CustomEdge.vue
and check the template :)
from vue-flow.
@bcakmakoglu Many thanks for explanation. That helps a lot. Will dive in there again and play with the positioning =)
from vue-flow.
Related Issues (20)
- π [BUG]: some event Types are missing (nodeClick, nodeDoubleClick, ...) HOT 6
- π [BUG]: Register a custom component for repeated rendering HOT 2
- π [BUG]: Nuxt3 Hydration attribute mismatch HOT 9
- π [BUG]: Node added in `onMounted()` is not rendered HOT 2
- π [BUG]: Canvas captures scroll even when all scroll-related features are disabled HOT 16
- π [BUG]: useNodesData is not available in "@vue-flow/core" library, but is refernced in the documentaion, and also in examples
- π [BUG]: Devtool throws warning when using node resizer HOT 2
- π [BUG]: `pathOptions` for default edges aren't applied HOT 1
- π [BUG]: flickering on some phone browsers HOT 4
- π [BUG]: Wrong edge position with dynamic handle id HOT 5
- π [BUG]: When typing, CMD + Backspace or Shift + Backspace can delete selected element HOT 1
- π [BUG]: Docs (vueflow.dev) hangs and never loads on iOS Safari HOT 2
- π [BUG]: Auto-generated Handle ids change with position HOT 1
- π [BUG]: <title> manual control <Handle /> graph line confusion HOT 1
- π [BUG]: manual control <Handle /> graph line confusion HOT 2
- π [BUG]: `autoPanOnConnect` does not disable panning during connections HOT 1
- Feature Request: Support for Multiple Handles on Nodes HOT 5
- π [BUG]: Wrong useVueFlow context within pinia HOT 2
- π [BUG]: PanelPositionType not exported HOT 1
- π [BUG]: `useHandleConnections` does not call `onConnect` and `onDisconnect` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-flow.