Open arbitrary note in mermaid graph link on click

Things I have tried

I think you used to be able to do something like this:

graph LR

AAA(AAA Note) --> BBB(BBB Note)

click AAA "/testfile"

I could also do this:

graph LR
B-->E
click E "obsidian://open?vault=Personal&file=testfile"

That would allow me to have a node named “AAA Note” or “E” but it would like to “testfile” on click. With the new class E internal-link syntax, this no longer works. A node with the name “AAA Note” will always link to the note with name “AAA Note”. I have tried the above combinations with internal-link, like so.

graph LR
A-->E

click E "obsidian://open?vault=Personal&file=testfile"
class E internal-link

None of this works.

What I’m trying to do

I’m trying to simply link (on click) to a note (or even external URL) that does not match the name of the node text. This was previously possible with the click event, but does not appear to be anymore.

Hi, this is the way it works for me

but it does using mermaid flowchart, not graph.

So this should work for you:

flowchart LR
    B-->E
    click E "obsidian://open?vault=Personal&file=testfile"
1 Like

Try something this:

	graph LR
		A[Testfile] --> B
		B --> C[Testfile2]
		class A,C internal-link

EDIT: After a rereading, I realized that this is not what you intended.

@andrezgz you are my hero. It works with flowchart but not with graph, I guess it’s a bug in later versions of obsidian? Anyway, thanks for the help.

@mnvwvnm thanks for taking a look as well.

1 Like

@wpanther93, it feels good to help a fellow obsidian user!

If I have to guess I would say the reason for this is that Obsidian’s Mermaid version is not the last one… You can check this Mermaid Live Editor example I’ve made where it works with graph. Nowadays it’s working with Mermaid v8.10.2

1 Like

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