Internal-links gantt in mermaid

What I’m trying to do

Create a GANTT or a diagram with
Mermaid does not naturally comes with links, but one can tweak as explained in the docs.

These work indeed for graph. Gantts however do not seem to work. There is a solution mentioned a year ago. But that requires defining all links by ‘hardcoding’ them, which is quite a task if you refer to a lot of headings in notes.

But that does not work anylonger for me, links not through the note. Further more, it does not allow to mention headings, and is tedious.

Things I have tried

  • Adding classes to gantt chart does not work
  • Adding click taskid is hard given many headings
3 Likes

Would love to figure this out, specially when using dataviewjs to generate the mermaid gantt chart.

In my case, even if I use click with “href” and an external url, it doesn’t work

Both examples below work fine in Mermaid’s live editor online (https://mermaid.live), including internal obsidian links.

But when I paste them in obsidian, the Gantt chart nodes show as links and the mouse pointer changes accordingly. However, clicking on the nodes doesn’t do anything.

This one uses a link to google

```mermaid
gantt
dateFormat YYYY-MM-DD

Example Task: active, ExampleTask, 2022-12-04, 3d

click ExampleTask href "https://google.com"

```


This one uses a link to obsidian

```mermaid
gantt
dateFormat YYYY-MM-DD

Example Task: active, ExampleTask, 2022-12-04, 3d

click ExampleTask href "obsidian://open?vault=TestVault&file=TestInbox/testGanttDoc.md"

```

Mermaid Live Opens the Obsidian Link just fine

Unfortunately, obsidian doesn’t :cry:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.