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

event diagrams #5852

Open
darin-lead opened this issue Sep 9, 2024 · 1 comment
Open

event diagrams #5852

darin-lead opened this issue Sep 9, 2024 · 1 comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request Type: New Diagram

Comments

@darin-lead
Copy link

Proposal

None of the current diagrams in Mermaid is very suitable to model time-causal relationship between processes. The Lamport diagrams, also known as logical clock diagrams or causal separation diagram or event diagrams are extremely useful for diagraming distributed algorithms or causal relationship between processes in relation to time.

Use Cases

modeling distributed mutual exclusion algorithms, database transaction ordering, algorithms based on logical and physical clocks, distributed computing, timing of events, illustrating consensus algorithms - raft, paxos, etc, synhronization, message ordering

Screenshots

Most of these are adequate to simple diagraming although Lesani. at al 2016 also allows showing labeled durations on the time axis.
image
this is from https://arxiv.org/html/2307.10484v2
image
from https://dev-discuss.pytorch.org/t/fsdp-cudacachingallocator-an-outsider-newb-perspective/1486

image
https://people.cs.rutgers.edu/~pxk/417/notes/clocks/index.html

A quick google search also yields a top of variations of the same idea in the images section https://www.google.com/search?q=lamport+diagrams

Syntax

The currently implemented sequence diagrams are very similar so I would think that the syntax will look close to what they use. Perhaps you can imagine that all timelines are quantized and you will list the points where each participant has a dot like P1[3] or a line P1[3..5] as well as links like P1[3]->>P2[5]

image


eventDiagram
    participant P1 as P1->>t
    participant P2 as P2->>t
    P1 {
       a1[1], a2[3], a3[8], a4[11]
    }
    P2 {
       b1[1], b2[5], b3[7], b4[9]
    }
    P1[3]->>P2[5]
    P2[9]->>P1[11]

Implementation

This is a proposal which I'd love to see built into mermaid by the wonderful community.

@darin-lead darin-lead added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request Type: New Diagram labels Sep 9, 2024
@HikaruHokkyokusei
Copy link

This diagram should be added. None of the existing ones can be used to substitute this one.

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 Type: New Diagram
Projects
None yet
Development

No branches or pull requests

2 participants