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

[Feature Request] Having text at the start, center and end of a line #4875

Open
enwi opened this issue Sep 26, 2023 · 7 comments
Open

[Feature Request] Having text at the start, center and end of a line #4875

enwi opened this issue Sep 26, 2023 · 7 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@enwi
Copy link

enwi commented Sep 26, 2023

Proposal

It would be nice to be able to have text right at the start and end of a line and not only at the center. The current syntax A ---|Text| B could be extended.

Example

Text at start:
A |Start|--- B

Text at center:
A -|Center|-- B or A --|Center|- B

Text at end:
A ---|End| B

Different combinations of the three should be allowed:
A |Start|-|Center|-- B
A -|Center|--|End| B
A |Start|---|End| B

Screenshots

No response

@enwi enwi added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Sep 26, 2023
@enwi enwi changed the title [Feature Request] Having text at the beginning, center and end of a line [Feature Request] Having text at the start, center and end of a line Sep 26, 2023
@RipulHandoo
Copy link

Hello, @enwi! I'm interested in contributing to this project and I noticed the issue you posted.
Could you please provide more details about what needs to be done for this issue? I'd like to understand it better before I start working on it.
Thank you!

@enwi
Copy link
Author

enwi commented Sep 26, 2023

Sure @RipulHandoo. Currently a line/arrow between two nodes can only have text right in the center:

graph LR
    Left ---|Center text| Right
Loading

With this feature I would like to be able to have text right next to the Left node, in between both nodes and right next to the Right node. This is helpful for adding some notes to the outside of the nodes kind of like in #1227 where you want to have the port number or network address:
example

If you have more questions please ask 🙂

@JaswanthJeethu18
Copy link

Hi @enwi

I understand your desire to have finer control over the placement of text in a diagram or mind map, including positioning text right next to the left node, in between both nodes, and right next to the right node. I will start working on this right away !

@shakthi2003-ice
Copy link

hey
where can we see the lines in the website

@enwi
Copy link
Author

enwi commented Nov 7, 2023

@RipulHandoo or @JaswanthJeethu18 is there any update so far or a way of seeing the progress made?

@jgreywolf jgreywolf added include and removed include labels Nov 16, 2023
@tedyoung
Copy link

any update on this, @JaswanthJeethu18 or @RipulHandoo ? It'd be great to have this for sequence diagrams.

@ysfaran
Copy link

ysfaran commented Jul 18, 2024

I wanted to get my hands on mermaid and this was the first issue i noticed.. I think this is very crucial.

In my case i want to put a 1 and n on a line to denote a 1:n relationship between two entities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants