Open murphyke opened 11 months ago
sure, the d2 is cool looking. however, mermaid's sequenceDiagram is easy to write and understand.
sequenceDiagram
autonumber
actor alice
actor bob
alice ->> bob: A physicist is an atom's way of knowing about
Note left of bob: shower thoughts
alice ->> bob: Today is the first day of the rest of your life.
Note left of bob: shower thoughts
bob ->> alice: If all else fails, lower your standards.
Note right of alice: life advice
alice ->> mary: It’s rubbish, nothing but a gnib gnab.
Note left of mary: life advice
sequenceDiagram
autonumber
actor alice
actor bob
alice ->> bob: A physicist is an atom's way of knowing about
Note left of bob: shower thoughts
alice ->> bob: Today is the first day of the rest of your life.
Note left of bob: shower thoughts
bob ->> alice: If all else fails, lower your standards.
Note right of alice: life advice
alice ->> mary: It’s rubbish, nothing but a gnib gnab.
Note left of mary: life advice
shape: sequence_diagram
# Predefine actors
alice
bob
mary # <-- add this
shower thoughts: {
alice -> bob: A physicist is an atom's way of knowing about atoms.
alice -> bob: Today is the first day of the rest of your life.
}
life advice: {
bob -> alice: If all else fails, lower your standards.
alice -> mary: It’s rubbish, nothing but a gnib gnab.
}
This applies to d2 0.6.0 and whatever previous version I was on.
To reproduce, I'm going to add one line involving an undefined actor (
mary
) to the d2lang example for sequence diagram groups:There is no error, but
life advice
changes from a group to an actor, and the new line results inalice
pointing to a span. This is very confusing. Here is the rendering: