docs: document new syntax for half-arrow message and central connection

on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
omkarht
2025-08-07 12:47:31 +05:30
parent bd47c57eaf
commit 74c96db3e2
2 changed files with 132 additions and 2 deletions

View File

@@ -209,7 +209,11 @@ Messages can be of two displayed either solid or with a dotted line.
[Actor][Arrow][Actor]:Message text
```
There are ten types of arrows currently supported:
Lines can be solid or dotted, and can end with various types of arrowheads, crosses, or open arrows.
#### Supported Arrow Types
**Standard Arrow Types**
| Type | Description |
| -------- | ---------------------------------------------------- |
@@ -224,6 +228,76 @@ There are ten types of arrows currently supported:
| `-)` | Solid line with an open arrow at the end (async) |
| `--)` | Dotted line with a open arrow at the end (async) |
**New Half-Arrows**
The following half-arrow types are now supported for more expressive sequence diagrams. Both solid and dotted variants are available by increasing the number of dashes (`-` → `--`).
---
\| Type | Description |
\| ------- | ---------------------------------------------------- | ---------------------------------------------- |
\| `-\|\` | Solid line with top half arrowhead |
\| `--\|\` | Dotted line with top half arrowhead |
\| `-\|/` | Solid line with bottom half arrowhead |
\| `--\|/` | Dotted line with bottom half arrowhead |
\| `/\|-` | Solid line with reverse top half arrowhead |
\| `/\|--` | Dotted line with reverse top half arrowhead |
\| `\\ | -` | Solid line with reverse bottom half arrowhead |
\| `\\ | --` | Dotted line with reverse bottom half arrowhead |
\| `-\\` | Solid line with top stick half arrowhead |
\| `--\\` | Dotted line with top stick half arrowhead |
\| `-//` | Solid line with bottom stick half arrowhead |
\| `--//` | Dotted line with bottom stick half arrowhead |
\| `//-` | Solid line with reverse top stick half arrowhead |
\| `//--` | Dotted line with reverse top stick half arrowhead |
\| `\\-` | Solid line with reverse bottom stick half arrowhead |
\| `\\--` | Dotted line with reverse bottom stick half arrowhead |
## Central Connections
Mermaid sequence diagrams now support **central lifeline connections** using a `()`.\
This is useful to represent messages or signals that connect to a central point, rather than from one actor directly to another.
To indicate a central connection, append `()` to the arrow syntax.
#### Basic Syntax
```mermaid-example
sequenceDiagram
participant Alice
participant John
Alice->>()John: Hello John
Alice()->>John: How are you?
John()->>()Alice: Great!
```
```mermaid
sequenceDiagram
participant Alice
participant John
Alice->>()John: Hello John
Alice()->>John: How are you?
John()->>()Alice: Great!
```
```mermaid-example
sequenceDiagram
participant Alice
participant John
Alice->>()John: Hello John
Alice()->>John: How are you?
John()->>()Alice: Great!
```
```mermaid
sequenceDiagram
participant Alice
participant John
Alice->>()John: Hello John
Alice()->>John: How are you?
John()->>()Alice: Great!
```
## Activations
It is possible to activate and deactivate an actor. (de)activation can be dedicated declarations: