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

Manual numbering of sequence diagrams #2543

Open
LuPro opened this issue Dec 8, 2021 · 2 comments
Open

Manual numbering of sequence diagrams #2543

LuPro opened this issue Dec 8, 2021 · 2 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@LuPro
Copy link

LuPro commented Dec 8, 2021

Is your feature request related to a problem? Please describe.
Autonumber on sequence diagrams is a great feature for 99% of use cases, however I'm finding myself in need of manually numbering sequence diagrams sometimes.

Describe the solution you'd like
An extra section on a transition in the sequence diagram for number, eg: #1 A ->> B: Text

Describe alternatives you've considered
What I really need is sequence numbering based on various algorithms, in the current specific case, sequence number for a Lamport Logical Clock (or Lamport Timestamping). Being able to select different numbering algorithms would be cool, but I feel like wouldn't really cover this; it's both way more complex to implement (at least I'd imagine it to be) and there'd never be all the algorithms implemented that someone may need.

Additional context
In specific, I'm trying to recreate this graph:
image

I know this isn't really the core target for a sequence diagram, but apart from the numbering issue it does (almost*) everything to a satisfactory degree, so I'd like to use it.

*It's only almost everything because I can't have simple "points" on the sequence without a looping arrow, but that's not really an issue for me right now so I don't mind.

PS: This is about the best I could manage right now using mermaid and utilizing the notes feature in the sequence diagrams, but the styling is kinda bad with how big the notes are:
image

@LuPro LuPro added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Dec 8, 2021
@fairking
Copy link

fairking commented Aug 2, 2023

I would simply love to see something like manual numeration.

For example:

:::mermaid
sequenceDiagram;
    #1 A->>B: Enter Details
    #2 B->>C: Update Database
    opt If Notification required
        #2a C->>B: Send `notification required`
        #2b B->>A: Notify user
    end
    #3 C->>A: Return promo code
:::

as a workaround I am using the following approach:

:::mermaid
sequenceDiagram;
    A->>B: 1. Enter Details
    B->>C: 2. Update Database
    opt If Notification required
        C->>B: 2a. Send `notification required`
        B->>A: 2b. Notify user
    end
    C->>A: 3. Return promo code
:::

@ZcuBa
Copy link

ZcuBa commented Aug 6, 2024

Are you aware that #2952 - has been solved?
you can use:
autonumber xx
to reset autonumber to count from a manual value.

e.g.

`
autonumber

alt is remote
User ->>+ Browser: Open https://
else is local
autonumber 1
Browser ->>+ Browser: Open LocalHost after reboot
end
`

in which both "branches" of the sequence will re-initialize the autonumber and count from 1
you would need to go in, and do something like:

sequenceDiagram
    autonumber
    P1 -->>+ P1: 

    autonumber 1
    P2 -->>+ P2: 

    autonumber 1
    P3 -->>+ P3: 
    P1 ->>+ P2: 
    P2 -->>+ P2: 
    P2 -->>+ P2: 

    autonumber 3
    P1 -->>+ P1: 
Loading

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

3 participants