Skip to main content

Diagram Examples

Invalid Diagrams​

Those errors should not crash the whole page

Invalid type​

No diagram type detected matching given configuration for text: badType

Invalid content​

Parse error on line 2:

Sequence Diagram​

JohnBobAliceJohnBobAliceloop[Health check]Rational thoughts prevail!Hello John, how are you?Fight against hypochondriaGreat!How about you?Jolly good!

Sequence Diagram (forest theme directive)​

It is possible to override default config locally with Mermaid text directives such as:

%%{init: { "theme": "forest" } }%%
JohnBobAliceJohnBobAliceloop[Health check]Rational thoughts prevail!Hello John, how are you?Fight against hypochondriaGreat!How about you?Jolly good!

Gantt Chart​

2014-01-072014-01-092014-01-112014-01-132014-01-152014-01-172014-01-192014-01-212014-01-23Completed task Active task Future task Future task2 A sectionAdding GANTT diagram to mermaid

Flow Chart​

Yes

No

Start

Is it?

OK

Rethink

End

With Markdown:​

This is Markdown

Line1
Line 2
Line 3

Class Diagram​

Animal

+int age

+String gender

+isMammal()

+mate()

Duck

+String beakColor

+swim()

+quack()

Fish

-int sizeInFeet

-canEat()

Zebra

+bool is_wild

+run()

State Diagram​

Active

EvNumLockPressed

EvNumLockPressed

EvCapsLockPressed

EvCapsLockPressed

EvScrollLockPressed

EvScrollLockPressed

NumLockOff

NumLockOn

CapsLockOff

CapsLockOn

ScrollLockOff

ScrollLockOn

Entity Relationship Diagram​

allows

is

CAR

string

registrationNumber

string

make

string

model

NAMED-DRIVER

PERSON

string

firstName

string

lastName

int

age

User Journey​

CatMe
Go to work
Go to work
Me
Make tea
Make tea
Me
Go upstairs
Go upstairs
MeCat
Do work
Do work
Go home
Go home
Me
Go downstairs
Go downstairs
Me
Sit down
Sit down
My working day
note

If there's too much space above it's due to a Mermaid bug

Pie Chart​

40%46%9%5%Key elements in Product XCalcium [42.96]Potassium [50.05]Magnesium [10.01]Iron [5]

Requirement Diagram​

<<satisfies>>

<<traces>>

<<contains>>

<<contains>>

<<derives>>

<<refines>>

<<verifies>>

<<copies>>

<<Requirement>>

test_req

ID: 1

Text: the test text.

Risk: High

Verification: Test

<<Functional Requirement>>

test_req2

ID: 1.1

Text: the second test text.

Risk: Low

Verification: Inspection

<<Performance Requirement>>

test_req3

ID: 1.2

Text: the third test text.

Risk: Medium

Verification: Demonstration

<<Interface Requirement>>

test_req4

ID: 1.2.1

Text: the fourth test text.

Risk: Medium

Verification: Analysis

<<Physical Requirement>>

test_req5

ID: 1.2.2

Text: the fifth test text.

Risk: Medium

Verification: Analysis

<<Design Constraint>>

test_req6

ID: 1.2.3

Text: the sixth test text.

Risk: Medium

Verification: Analysis

<<Element>>

test_entity

Type: simulation

<<Element>>

test_entity2

Type: word doc

Doc Ref: reqs/test_entity

<<Element>>

test_entity3

Type: test suite

Doc Ref: github.com/all_the_tests

Gitgraph (Git) Diagram​

mainhotfixdevelopfeatureBfeatureArelease0-41f16041-dcd8bfdashabc3-75b857e4-324f6be5-cfe9cf56-d913ee18-865b6529-065a94511-7edbfbd12-179b6a114-b27db3a15-ffb6ba3

Mermaid in tabs​

The following mermaid diagram is shown:

a

10

b

Mindmap​

conda-forge

Repos

Package building

*-feedstock

staged-recipes

cdt-builds

msys2-recipes

Maintenance

admin-requests

repodata-patches

Configuration

.github

.cirun

conda-forge-pinning

conda-forge-ci-setup

docker-images

conda-smithy

Automations

admin-migrations

artifact-validation

regro/cf-scripts

conda-forge-webservices

regro/cf-graph-countyfair

regro/libcfgraph + regro/libcflib

feedstock-outputs

Communications

conda-forge.github.io

blog

status

by-the-numbers

conda-forge-status-monitor

feedstocks

Bots & apps

conda-forge-admin

conda-forge-bot

conda-forge-coordinator

conda-forge-daemon

conda-forge-linter

conda-forge-manager

conda-forge-status

regro-cf-autotick-bot

conda-forge-curator

conda-forge-webservices

Delivery

anaconda.org

ghcr.io

quay.io

Installers

Miniforge

Mambaforge

CI for builds

Azure Pipelines

Travis CI

cirun.io

Infra

Heroku

Github Actions

Circle CI

Quadrant Chart​

We should expandNeed to promoteRe-evaluateMay be improvedCampaign FCampaign ECampaign DCampaign CCampaign BCampaign ALow ReachHigh ReachLow EngagementHigh EngagementReach and engagement of campaigns

Architecture Diagram​

DatabaseStorageStorageServerAPI

ELK Styling​

Mermaid provides an ELK layout

Dagre​

This diagram explicitly uses the Dagre layout.

has

undertakes

operates_in

serves

employs

manages

allocated

works_on

lives_at

has

supports

for

contains

COMPANY

DEPARTMENT

PROJECT

LOCATION

CLIENT

EMPLOYEE

BUDGET

ADDRESS

SKILL

DEPENDENT

TASK

ELK er diagram layout​

This ER diagram should look different, using the ELK layout.

has

undertakes

operates_in

serves

employs

manages

allocated

works_on

lives_at

has

supports

for

contains

COMPANY

DEPARTMENT

PROJECT

LOCATION

CLIENT

EMPLOYEE

BUDGET

ADDRESS

SKILL

DEPENDENT

TASK

Mermaid also provides a way of setting config parameters using a directive %%{init:{"layout":"elk"}}%%

has

undertakes

operates_in

serves

employs

manages

allocated

works_on

lives_at

has

supports

for

contains

COMPANY

DEPARTMENT

PROJECT

LOCATION

CLIENT

EMPLOYEE

BUDGET

ADDRESS

SKILL

DEPENDENT

TASK