---
title: How Mermaid diagrams work in Obsidian - Ensley Tan - Medium
updated: 2023-04-12 08:40:57Z
created: 2023-04-12 08:40:57Z
tags:
  - IT
  - IT/Tools/Obsidian
source: >-
  https://medium.com/@ensleytan/how-mermaid-diagrams-work-in-obsidian-b7680fe00fa8
---

I’m a sucker for features that are native to an app that I’m using and recently I’ve been learning how mermaid diagrams work in Obsidian. (I have been told about Excalidraw, but I draw horribly with my mouse and you need to download the Excalidraw plugin for it to work in Obsidian.)

## What’s Mermaid

It’s a way of creating diagrams using simple markup language. No drawing skills needed! No additional installation is needed either. Most useful for quickly jotting down a sequence of steps or a set of interconnected relationships.

Here are the two diagrams I use the most, as the syntax and variables they require are easy to remember.

## **A Simple flowchart / graph**

![](1_W7UzXcGf-d9Ppg7I7qZJ8A_1add154ae7d34f2fb25257371.png)

The syntax used is:

![](1_YDfnTlW4wmtMxjlnGvnUzw_da63e8132b6348a3a1401934e.png)

The first thing to tell mermaid is that you want to create a flowchart. There are other types of charts, more on that below.

The second thing is to declare which direction the chart should progress. You have a choice of TB (Top-Bottom), LR (Left-Right) or their opposites, BT and RL.

![](1_uB5i1mwc_cfbKKHuupaXrQ_eddbd9e686e64f1192b77d608.png)

Charts can go BT, TB, LR, RL!

Then you can start adding the nodes you want and what sort of connection they have.

The most simple node consists of a single word. But if you want to have multiple words in one node, they need to be enclosed with square brackets and any alphanumeric string. I used “1” here, but even “Elephant” will work!

You also need to use an alphanumeric prefix and specific brackets if you want to change the shape of the node:

![](1_AB4EtiSyWA9b6Ue8NArjXQ_62758d7f7d16472881605e9e6.png)

Node types

Lastly, you can show different and multiple relationships between the nodes. You can change the thickness of the links and whether there should be arrows. You can also add text to state the nature of the link.

![](1_l8rdAhMWZcQ1IZYGrCRxUw_82e06f42fa9b4a38a94c265ff.png)
Different types of connections between nodes

## Pie chart

The pie chart works largely the same way, but with even fewer details needed. You just need to indicate groups and each group’s share of the pie.

![](1_3gTT4N5Ccku6W7byMx3e7A_5fe5191e6ddc41c58ca813d72.png)

## Other diagrams that work well in Obsidian

There are a whole list of other interesting charts in Mermaid. But I have found that the syntax becomes more complicated, meaning that I’m less likely to use them on the fly. More details on how to use them and the other diagram types I didn’t share [here](https://mermaid-js.github.io/mermaid/#/sequenceDiagram).

Below I’ve shared two other sorts of diagrams which I think work pretty well in Obsidian. All of the diagrams can have different colours, shapes etc if you feel like playing around with those.

## Sequence Diagram

![](1_5pLRtpL8bloj2jXz5VvqnA_2c201964f30f49bb9571657fe.png)

## Gantt Chart

![](1_eQRfeEnNnaZXRLv43kUYyg_5d367b4faa8c41c9bd801b573.png)

**Take a look at the rest of my articles on Obsidian:**

- [How to use Obsidian or any note-taking app for work (aka don’t fall for PKM candy)](https://medium.com/@ensleytan/how-to-use-obsidian-or-any-note-taking-app-for-work-aka-dont-fall-for-pkm-candy-d1f5396e4eb1)
- [When you should consider switching to Obsidian](https://medium.com/@ensleytan/when-should-you-consider-switching-to-obsidian-6f37a1a68ecf?source=friends_link&sk=69246013e5222bc1cee1c0597df74aa4)
- [Obsidian’s Graph Analysis plugin](https://medium.com/@ensleytan/obsidians-graph-analysis-plugin-c9c107da3331)
- [Using Obsidian’s Graph View for real](https://medium.com/@ensleytan/using-obsidians-graph-view-for-real-99fd94153514?source=friends_link&sk=d68022880cda9ebcced0b926b11670a5)
- [Using Obsidian for group KM](https://medium.com/@ensleytan/using-obsidian-for-group-km-145646068cd7?source=friends_link&sk=8c0b3dc4adaeadc8671b8da30ce7fa92)
- [Obsidian for making sense of things](https://medium.com/@ensleytan/obsidian-for-making-sense-of-things-7b407c572846?source=friends_link&sk=3fb7dfa421f644e9994766abdf3ffe39)