Skip to content

How Can I Set Two Labels In One Edge #442

Answered by bcakmakoglu
karahanoguzhan asked this question in Q&A
Discussion options

You must be logged in to vote

Default edges only support a single label.
You can use a custom edge and use as many labels as you want, that's up to your implementation.
Check the edges example to see how a custom edge is implemented.

As for the position: That's also up to you ^^ Utilities like getBezierPath will return you the centerX and centerY values for centering labels but if you want to have one at the source or target position of an edge, simply use the sourceX, sourceY, targetX and targetY values of the edge respectively to place your label.

Here's an example - pay attention to the style.transform value

<template>
  <!-- You can use the `BaseEdge` component to create your own custom edge more easily -->
  <Bas…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@karahanoguzhan
Comment options

Answer selected by karahanoguzhan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants