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]: Each addNode remounts the previous node HOT 3
- π [BUG]: deletKeyCode is reset after using the $reset function HOT 1
- π [BUG]: Node Resizer does not allow resizing from sides
- π [BUG]: FitViewOnInit doesn't work consistently in Repl when a dynamic size is assigned
- π [BUG]: <title>Change the position of the connection handle of the node. The connection line does not change HOT 3
- π [BUG]: 3 Handle for edge couldn't connect when i set sourceHandleId and targetHandleId HOT 4
- π [BUG]: VueFlow inside a modal has incorrect edge coordinates HOT 1
- π [BUG]: Uncaught TypeError: Cannot read properties of undefined (reading 'toLowerCase') HOT 12
- π [BUG]: Can no longer add classes to `MiniMap` in order to place other elements in the same `Panel` HOT 5
- π [BUG]: Canvas gets "stuck" on first load when using figma-style controls HOT 1
- π [BUG]: Connection Line Component is not using markers even if specified HOT 1
- π [BUG]: Using autocomplete in form inputs on a page with a vue-flow instance mounted causes crash in `isKeyMatch` HOT 4
- π [BUG]: `isRect` returns false for rectangles positioned on the origin (or on an axis) HOT 2
- π [BUG]: Pinia Example isn't working HOT 1
- π [BUG]: Not possible to easily extract offending edge/node ID from VueFlowError
- π [BUG]: Strange edge behaviour for type 'smoothstep' and 'step' HOT 2
- π [BUG]: multi-selection-key-code property error HOT 4
- π [BUG]: Background lines mode is invalid HOT 2
- π [BUG]: <title> HOT 1
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.