# Mermaid with Obsidian capabilities

**URL:** <https://forum.obsidian.md/t/mermaid-with-obsidian-capabilities/6426>\
**Category:** Plugins ideas (Archival in progress)\
**Created:** [October 1, 2020, 6:33am UTC](https://forum.obsidian.md/t/mermaid-with-obsidian-capabilities/6426 "2020-10-01T06:33:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![I-d-as](https://forum.obsidian.md/user_avatar/forum.obsidian.md/i-d-as/32/59965_2.png) [@I-d-as](https://forum.obsidian.md/u/I-d-as)\
**Post date:** [October 1, 2020, 6:33am UTC](https://forum.obsidian.md/t/mermaid-with-obsidian-capabilities/6426/1 "2020-10-01T06:33:31Z")

</div>

Mermaid diagrams are great to look at, but I sometimes feel disconnected while editing them. Could we give them an interactive boost by integrating Obsidian functionality?

With notes selected via search, the click of a button could produce a rendered diagram complete with directly editable links syncing to the graph. To be clear, in this proposal, the initial Mermaid diagram would be built based on the selected note names and their links, essentially being a curated slice of the vault’s graph.

Maybe, pick-whipping from node to node would define Mermaid connections, with these added links and note/tag changes propagated throughout Obsidian. Might this all even be potentially accessible directly through hovering a note’s links and the graph’s nodes?

Thanks.

---

<div class="post-metadata">

**Author:** ![I-d-as](https://forum.obsidian.md/user_avatar/forum.obsidian.md/i-d-as/32/59965_2.png) [@I-d-as](https://forum.obsidian.md/u/I-d-as)\
**Post date:** [February 17, 2023, 2:22am UTC](https://forum.obsidian.md/t/mermaid-with-obsidian-capabilities/6426/2 "2023-02-17T02:22:27Z")

</div>

See this related workaround:

> [@Dataview JS Getting The Tree Root](https://forum.obsidian.md/t/dataview-js-getting-the-tree-root/54538/9):
>
> I think I’ve mentioned it once (or twice) before, but one of the things which drives me when solving stuff, is personal interest. And whilst doing it the “normal” way is interesting enough, doing it using a mermaid graph, just peaked my interest. A lot. So no matter what you feel grinning , the first solution to this request is the mermaid variant. It works for me, and I’m hoping it’ll work for you, as well. I built the data set matching my example in the previous reply, and lo and behold, h…

Make sure to also see the lower post where a bug is corrected. This is awesome stuff!

---

<div class="post-metadata">

**Author:** ![holroy](https://forum.obsidian.md/user_avatar/forum.obsidian.md/holroy/32/77699_2.png) [@holroy](https://forum.obsidian.md/u/holroy)\
**Post date:** [February 17, 2023, 2:28am UTC](https://forum.obsidian.md/t/mermaid-with-obsidian-capabilities/6426/3 "2023-02-17T02:28:52Z")

</div>

Hmm… Come to think of it. I the link above, I’m only targeting notes and I’m only using the default square element. It should be possible to alter the mermaid graph so as tags could have a different box around them. And it’s also possible to introduce subgraphs if one has common folders. I think it’s doable, at least. Not sure how much coding it would require…

On a related side note, Ji11ard has made a more generic approach to a similar theme here: [GitHub - Ji11ard/Dataview-to-Mermaid-Flowchart: This dataviewjs script dynamically renders DQL queries into a Mermaid flow diagram based on links and formatting instructions contained in the file's YAML.](https://github.com/Ji11ard/Dataview-to-Mermaid-Flowchart)

In that setup they’ve made a thingy where you can define various queries to be shown as nodes in a mermaid chart, and then other queries to define the links between these nodes.

The examples look slightly overwhelming, and I’m not quite sure how to reuse it, but I thought I should mention it, as I came across it when researching for the link above. I chose a different path, but their path is also an interesting path.
