From 395ee5ef067d9faea102777c491cadadf0cc6b09 Mon Sep 17 00:00:00 2001 From: Guy Pursey Date: Tue, 3 Oct 2023 17:53:46 +0100 Subject: [PATCH 1/3] Update notes on orientation in GitGraph documentation Attempt to make the documentation around left-right and top-down orientation clearer than it currently is, addressing issue #4885. --- packages/mermaid/src/docs/syntax/gitgraph.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/mermaid/src/docs/syntax/gitgraph.md b/packages/mermaid/src/docs/syntax/gitgraph.md index 87f43afdde..8ff4057364 100644 --- a/packages/mermaid/src/docs/syntax/gitgraph.md +++ b/packages/mermaid/src/docs/syntax/gitgraph.md @@ -513,18 +513,19 @@ Here, we have changed the default main branch name to `MetroLine1`. ## Orientation (v10.3.0+) -In Mermaid, the default orientation is Left to Right. The branches are lined vertically. +In Mermaid, the default orientation is for commits to run from **left to right** and for branches to be stacked on top of one another. + +You can set this explicitly with `LR:` after `gitGraph`. Usage example: ```mermaid-example - gitGraph + gitGraph LR: commit commit branch develop commit commit - commit checkout main commit commit @@ -533,9 +534,11 @@ Usage example: commit ``` -Sometimes we may want to change the orientation. Currently, Mermaid supports two orientations: **Left to Right**(default) and **Top to Bottom**. +Sometimes, we may want to change the orientation of the graph. -In order to change the orientation from top to bottom i.e. branches lined horizontally, you need to add `TB` along with `gitGraph`. +Mermaid also supports a **top to bottom** orientation. In this mode, the commits run from top to bottom of the graph and branches are arranged side-by-side. + +To orient the graph in this way, you need to add `TB:` after gitGraph. Usage example: @@ -546,7 +549,6 @@ Usage example: branch develop commit commit - commit checkout main commit commit From 80af0e7ec780d030b6445787339a3d961a937476 Mon Sep 17 00:00:00 2001 From: guypursey Date: Wed, 4 Oct 2023 14:43:00 +0000 Subject: [PATCH 2/3] Update docs --- docs/syntax/gitgraph.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/syntax/gitgraph.md b/docs/syntax/gitgraph.md index f2609e31c5..c62e001198 100644 --- a/docs/syntax/gitgraph.md +++ b/docs/syntax/gitgraph.md @@ -827,18 +827,19 @@ Here, we have changed the default main branch name to `MetroLine1`. ## Orientation (v10.3.0+) -In Mermaid, the default orientation is Left to Right. The branches are lined vertically. +In Mermaid, the default orientation is for commits to run from **left to right** and for branches to be stacked on top of one another. + +You can set this explicitly with `LR:` after `gitGraph`. Usage example: ```mermaid-example - gitGraph + gitGraph LR: commit commit branch develop commit commit - commit checkout main commit commit @@ -848,13 +849,12 @@ Usage example: ``` ```mermaid - gitGraph + gitGraph LR: commit commit branch develop commit commit - commit checkout main commit commit @@ -863,9 +863,11 @@ Usage example: commit ``` -Sometimes we may want to change the orientation. Currently, Mermaid supports two orientations: **Left to Right**(default) and **Top to Bottom**. +Sometimes, we may want to change the orientation of the graph. + +Mermaid also supports a **top to bottom** orientation. In this mode, the commits run from top to bottom of the graph and branches are arranged side-by-side. -In order to change the orientation from top to bottom i.e. branches lined horizontally, you need to add `TB` along with `gitGraph`. +To orient the graph in this way, you need to add `TB:` after gitGraph. Usage example: @@ -876,7 +878,6 @@ Usage example: branch develop commit commit - commit checkout main commit commit @@ -892,7 +893,6 @@ Usage example: branch develop commit commit - commit checkout main commit commit From 97487acbc39daf2b1845e60949110c54f4605af9 Mon Sep 17 00:00:00 2001 From: Guy Pursey Date: Thu, 5 Oct 2023 12:13:12 +0100 Subject: [PATCH 3/3] Updated GitGraph doc amendment based on feedback in PR. --- docs/syntax/gitgraph.md | 16 +++++++++++----- packages/mermaid/src/docs/syntax/gitgraph.md | 16 +++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/docs/syntax/gitgraph.md b/docs/syntax/gitgraph.md index c62e001198..8d39ddbcbd 100644 --- a/docs/syntax/gitgraph.md +++ b/docs/syntax/gitgraph.md @@ -827,9 +827,15 @@ Here, we have changed the default main branch name to `MetroLine1`. ## Orientation (v10.3.0+) -In Mermaid, the default orientation is for commits to run from **left to right** and for branches to be stacked on top of one another. +Mermaid supports two graph orientations: **Left-to-Right** (default) and **Top-to-Bottom**. -You can set this explicitly with `LR:` after `gitGraph`. +You can set this with either `LR:` (for [**Left-to-Right**](#left-to-right-default-lr)) or `TB:` (for [**Top-to-Bottom**](#top-to-bottom-tb)) after `gitGraph`. + +### Left to Right (default, `LR:`) + +In Mermaid, the default orientation is for commits to run from left to right and for branches to be stacked on top of one another. + +However, you can set this explicitly with `LR:` after `gitGraph`. Usage example: @@ -863,11 +869,11 @@ Usage example: commit ``` -Sometimes, we may want to change the orientation of the graph. +### Top to Bottom (`TB:`) -Mermaid also supports a **top to bottom** orientation. In this mode, the commits run from top to bottom of the graph and branches are arranged side-by-side. +In `TB` (**Top-to-Bottom**) orientation, the commits run from top to bottom of the graph and branches are arranged side-by-side. -To orient the graph in this way, you need to add `TB:` after gitGraph. +To orient the graph this way, you need to add `TB:` after gitGraph. Usage example: diff --git a/packages/mermaid/src/docs/syntax/gitgraph.md b/packages/mermaid/src/docs/syntax/gitgraph.md index 8ff4057364..5fa09cb225 100644 --- a/packages/mermaid/src/docs/syntax/gitgraph.md +++ b/packages/mermaid/src/docs/syntax/gitgraph.md @@ -513,9 +513,15 @@ Here, we have changed the default main branch name to `MetroLine1`. ## Orientation (v10.3.0+) -In Mermaid, the default orientation is for commits to run from **left to right** and for branches to be stacked on top of one another. +Mermaid supports two graph orientations: **Left-to-Right** (default) and **Top-to-Bottom**. -You can set this explicitly with `LR:` after `gitGraph`. +You can set this with either `LR:` (for [**Left-to-Right**](#left-to-right-default-lr)) or `TB:` (for [**Top-to-Bottom**](#top-to-bottom-tb)) after `gitGraph`. + +### Left to Right (default, `LR:`) + +In Mermaid, the default orientation is for commits to run from left to right and for branches to be stacked on top of one another. + +However, you can set this explicitly with `LR:` after `gitGraph`. Usage example: @@ -534,11 +540,11 @@ Usage example: commit ``` -Sometimes, we may want to change the orientation of the graph. +### Top to Bottom (`TB:`) -Mermaid also supports a **top to bottom** orientation. In this mode, the commits run from top to bottom of the graph and branches are arranged side-by-side. +In `TB` (**Top-to-Bottom**) orientation, the commits run from top to bottom of the graph and branches are arranged side-by-side. -To orient the graph in this way, you need to add `TB:` after gitGraph. +To orient the graph this way, you need to add `TB:` after gitGraph. Usage example: