Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move text labels above lines? #1977

Open
tedyoung opened this issue Jun 10, 2024 · 1 comment
Open

Move text labels above lines? #1977

tedyoung opened this issue Jun 10, 2024 · 1 comment

Comments

@tedyoung
Copy link

I'm trying to use D2 for sequence diagrams, but I find the labeling of messages hard to read and prefer the text to be above the line (as in PlantUML and Mermaid) instead of in it. I tried the following:

shape: sequence_diagram
Player1 -> UI: Join game {
  label.near: outside-top-center
}

but the label.near doesn't seem to have an effect on the text label. Is this not supported?

@bo-ku-ra
Copy link
Contributor

0.65 would not do it.

shape: sequence_diagram

Player1 -> UI:  Join game

Player1 -> UI:  {
source-arrowhead: Join game
}
Player1 -> UI:  {
target-arrowhead: Join game
}

https://play.d2lang.com/?l=&script=Ks5ILEi1UihOLSxNzUtOjU_JTEwvSszl4grISaxMLTJU0LVTCPW0UlDwys_MU0hPzE3FlKrmKs4vLUpO1U0sKsovz0hNTLFCUl6LRX1JYlF6agku9VyAAAAA__8%3D&

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants