Skip to content

[BUG] gitGraph TB: rotateCommitLabel: false, branches are too close, tags are rotated #7327

@Kochise

Description

@Kochise

Description

Hi, trying to tweak my Mermaid gitGraph rendering in Top Bottom fashion.

  • Before
%%{ init: { 'gitGraph': { 'mainBranchName': 'ST' }, 'theme': 'base' }}%%
gitGraph:
	commit id: "1.00 Disk" tag: "850529"
	commit id: "1.00 Mush" tag: "850620"
	branch "Mega STe"
	checkout "Mega STe"
	commit id: "2.05" tag: "901205"
%%{ init: { 'gitGraph': { 'mainBranchName': 'ST' }, 'theme': 'base' }}%%
gitGraph:
	commit id: "1.00 Disk" tag: "850529"
	commit id: "1.00 Mush" tag: "850620"
	branch "Mega STe"
	checkout "Mega STe"
	commit id: "2.05" tag: "901205"
Loading
  • After (just added TB:)

Now tag: are rotated 45° too, and no rotateTagLabel: false available.

%%{ init: { 'gitGraph': { 'mainBranchName': 'ST' }, 'theme': 'base' }}%%
gitGraph TB:
	commit id: "1.00 Disk" tag: "850529"
	commit id: "1.00 Mush" tag: "850620"
	branch "Mega STe"
	checkout "Mega STe"
	commit id: "2.05" tag: "901205"
%%{ init: { 'gitGraph': { 'mainBranchName': 'ST' }, 'theme': 'base' }}%%
gitGraph TB:
	commit id: "1.00 Disk" tag: "850529"
	commit id: "1.00 Mush" tag: "850620"
	branch "Mega STe"
	checkout "Mega STe"
	commit id: "2.05" tag: "901205"
Loading

While rotateCommitLabel: false works, the rendering of branches gets weird.

  • Before
%%{ init: { 'gitGraph': { 'mainBranchName': 'ST' }, 'theme': 'base' }}%%
gitGraph TB:
	commit id: "1.00 Disk" tag: "850529"
	commit id: "1.00 Mush" tag: "850620"
	branch "Mega STe"
	checkout "Mega STe"
	commit id: "2.05" tag: "901205"
%%{ init: { 'gitGraph': { 'mainBranchName': 'ST' }, 'theme': 'base' }}%%
gitGraph TB:
	commit id: "1.00 Disk" tag: "850529"
	commit id: "1.00 Mush" tag: "850620"
	branch "Mega STe"
	checkout "Mega STe"
	commit id: "2.05" tag: "901205"
Loading
  • After (added 'rotateCommitLabel': false)
%%{ init: { 'gitGraph': { 'mainBranchName': 'ST', 'rotateCommitLabel': false }, 'theme': 'base' }}%%
gitGraph TB:
	commit id: "1.00 Disk" tag: "850529"
	commit id: "1.00 Mush" tag: "850620"
	branch "Mega STe"
	checkout "Mega STe"
	commit id: "2.05" tag: "901205"
%%{ init: { 'gitGraph': { 'mainBranchName': 'ST', 'rotateCommitLabel': false }, 'theme': 'base' }}%%
gitGraph TB:
	commit id: "1.00 Disk" tag: "850529"
	commit id: "1.00 Mush" tag: "850620"
	branch "Mega STe"
	checkout "Mega STe"
	commit id: "2.05" tag: "901205"
Loading

Steps to reproduce

See above

Screenshots

See above

Code Sample

See above

Setup

On 2026/01/19 :

  • Mermaid version: mermaid@11.12.2
  • Browser and Version: Firefox 147.0.1 on Windows 10 (not going for 11, don't ask)

Suggested Solutions

  1. Add rotateTagLabel: false or don't rotate tags when in TB mode
  2. Don't get branches so close to each other in TB mode + rotateCommitLabel: true

Additional Context

https://github.com/Kochise/atari-emu/blob/main/ROMS/README.md

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions