From 2b58df9665ad15679a960ca0ce845f1d417286f0 Mon Sep 17 00:00:00 2001 From: omkarht Date: Tue, 19 Aug 2025 14:53:08 +0530 Subject: [PATCH] fix: refactored documentation on-behalf-of: @Mermaid-Chart --- docs/syntax/sequenceDiagram.md | 56 +++++++------------ .../mermaid/src/diagrams/sequence/svgDraw.js | 1 - .../src/docs/syntax/sequenceDiagram.md | 17 ++---- 3 files changed, 23 insertions(+), 51 deletions(-) diff --git a/docs/syntax/sequenceDiagram.md b/docs/syntax/sequenceDiagram.md index d3d5808bb..0b5b038e2 100644 --- a/docs/syntax/sequenceDiagram.md +++ b/docs/syntax/sequenceDiagram.md @@ -228,30 +228,30 @@ Lines can be solid or dotted, and can end with various types of arrowheads, cros | `-)` | Solid line with an open arrow at the end (async) | | `--)` | Dotted line with a open arrow at the end (async) | -**New Half-Arrows** +**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 | +| 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 @@ -280,24 +280,6 @@ sequenceDiagram 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: diff --git a/packages/mermaid/src/diagrams/sequence/svgDraw.js b/packages/mermaid/src/diagrams/sequence/svgDraw.js index 4d2a574d1..17c5f9185 100644 --- a/packages/mermaid/src/diagrams/sequence/svgDraw.js +++ b/packages/mermaid/src/diagrams/sequence/svgDraw.js @@ -1192,7 +1192,6 @@ export default { getNoteRect, fixLifeLineHeights, sanitizeUrl, - insertSolidTopArrowHead, insertSolidBottomArrowHead, insertStickTopArrowHead, diff --git a/packages/mermaid/src/docs/syntax/sequenceDiagram.md b/packages/mermaid/src/docs/syntax/sequenceDiagram.md index 5112227a0..c0e927dae 100644 --- a/packages/mermaid/src/docs/syntax/sequenceDiagram.md +++ b/packages/mermaid/src/docs/syntax/sequenceDiagram.md @@ -163,22 +163,22 @@ Lines can be solid or dotted, and can end with various types of arrowheads, cros | `-)` | Solid line with an open arrow at the end (async) | | `--)` | Dotted line with a open arrow at the end (async) | -**New Half-Arrows** +**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 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 | @@ -206,15 +206,6 @@ sequenceDiagram 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: