Merlive

The library / Sequence diagrams

Sequence diagrams, drawn twice

Not boxes and links, so it has seven rules of its own: participants in one row an even step apart, one message to a row, words off every lifeline. Its page goes through the messages one at a time.

42 samples: 40 drawn as written, 2 drawn less something. Mermaid’s side is mermaid-cli 12.2.0 as it comes, on white. Merlive’s is 0.6.1 in its own look. What is read of a sequence diagram.

A participant with a type: boundary, control, entity, database, collections, queue

Drawn

Mermaid
A participant with a type: boundary, control, entity, database, collections, queue, as Mermaid draws it
Merlive
A participant with a type: boundary, control, entity, database, collections, queue, as Merlive draws it
The Mermaid
sequenceDiagram
  participant Shop@{ "type": "boundary" }
  participant Rules@{ "type": "control" }
  participant Order@{ "type": "entity" }
  participant Orders@{ "type": "database" }
  participant Lines@{ "type": "collections" }
  participant Jobs@{ "type": "queue" }
  Shop->>Rules: Check the order
  Rules->>Order: Make it
  Order->>Orders: Save
  Order->>Lines: Add lines
  Order->>Jobs: Queue the pick
Draw it yourself

A name written inside the braces

Drawn

Mermaid
A name written inside the braces, as Mermaid draws it
Merlive
A name written inside the braces, as Merlive draws it
The Mermaid
sequenceDiagram
  participant Shop@{ "type": "boundary", "alias": "Web shop" }
  participant Db@{ "type": "database", "alias": "Order book" }
  Shop->>Db: Save the order
  Db-->>Shop: Saved
Draw it yourself

Half arrows

Drawn

Mermaid
Half arrows, as Mermaid draws it
Merlive
Half arrows, as Merlive draws it
The Mermaid
sequenceDiagram
  Buyer-|\ERP: Top half
  ERP--|/Buyer: Bottom half
  Buyer-\\ERP: Top stick
  ERP--//Buyer: Bottom stick
Draw it yourself

A loop

Drawn

Mermaid
A loop, as Mermaid draws it
Merlive
A loop, as Merlive draws it
The Mermaid
sequenceDiagram
  Buyer->>ERP: Raise order
  loop Every morning
    ERP->>Supplier: Any news?
    Supplier-->>ERP: Not yet
  end
Draw it yourself

Things done at once: par and and

Drawn

Mermaid
Things done at once: par and and, as Mermaid draws it
Merlive
Things done at once: par and and, as Merlive draws it
The Mermaid
sequenceDiagram
  par To the supplier
    ERP->>Supplier: Send order
  and To the warehouse
    ERP->>Warehouse: Make room
  end
  Supplier-->>ERP: Confirmed
  Warehouse-->>ERP: Ready
Draw it yourself

A block inside a block

Drawn

Mermaid
A block inside a block, as Mermaid draws it
Merlive
A block inside a block, as Merlive draws it
The Mermaid
sequenceDiagram
  par To the supplier
    ERP->>Supplier: Send order
  and To the warehouse
    ERP->>Warehouse: Make room
    par Shelves
      Warehouse->>Picker: Clear a shelf
    and Dock
      Warehouse->>Driver: Book a dock
    end
  end
Draw it yourself

Where the sequence stops: break

Drawn

Mermaid
Where the sequence stops: break, as Mermaid draws it
Merlive
Where the sequence stops: break, as Merlive draws it
The Mermaid
sequenceDiagram
  Buyer-->ERP: Raise order
  ERP-->Supplier: Send order
  break When the supplier says no
    ERP-->Buyer: Order refused
  end
  ERP-->Warehouse: Make room
Draw it yourself

Rows highlighted with a coloured background, one inside another

Drawn

Mermaid
Rows highlighted with a coloured background, one inside another, as Mermaid draws it
Merlive
Rows highlighted with a coloured background, one inside another, as Merlive draws it
The Mermaid
sequenceDiagram
  participant Buyer
  participant ERP
  rect rgb(191, 223, 255)
  note right of Buyer: The buyer asks
  Buyer->>+ERP: Raise order
  rect rgb(200, 150, 255)
  Buyer->>+ERP: And one more
  ERP-->>-Buyer: Second order number
  end
  ERP-->>-Buyer: First order number
  end
  Buyer->>ERP: Thanks
Draw it yourself

Messages numbered

Drawn

Mermaid
Messages numbered, as Mermaid draws it
Merlive
Messages numbered, as Merlive draws it
The Mermaid
sequenceDiagram
  autonumber
  Buyer->>ERP: Raise order
  loop Until it is right
    ERP->>ERP: Check the lines
  end
  ERP-->>Buyer: Order number
Draw it yourself

A menu of links on a participant

Drawn, less something The menus are left out: a page of Merlive opens no links

Mermaid
A menu of links on a participant, as Mermaid draws it
Merlive
A menu of links on a participant, as Merlive draws it
The Mermaid
sequenceDiagram
  participant Buyer
  participant ERP
  link Buyer: Open orders @ https://example.com/orders
  links ERP: {"Status": "https://example.com/status", "Wiki": "https://example.com/wiki"}
  Buyer->>ERP: Raise order
  ERP-->>Buyer: Order number
Draw it yourself

A title and settings in front matter

Drawn, less something Mermaid's own settings are read past: the look and the numbering are the design's and the diagram's own

Mermaid
A title and settings in front matter, as Mermaid draws it
Merlive
A title and settings in front matter, as Merlive draws it
The Mermaid
---
title: Raising an order
config:
  sequence:
    mirrorActors: false
    showSequenceNumbers: true
---
sequenceDiagram
  Buyer->>ERP: Raise order
  ERP-->>Buyer: Order number
Draw it yourself