Mermaid: Flowchart click url open in new window

Created on 10 Jun 2020  路  3Comments  路  Source: mermaid-js/mermaid

I use https://github.com/jdbranham/grafana-diagram plugin on grafana which is based on mermaid, and I use click url utility of flowchart for drill down.

I want to open url in new window instead of refreshing current window, because user may need current window and drill down window at same time.

I've read the doc of mermaid and found that callback can be used in click. But as mermaid is used by grafana-diagram as a grafana plugin, so there is no appropriate time to define and execute a callback.

Is possible to support this?
click "http://www.google.com" "this is a tooltip" _blank
p.s. I borrow target=_blank from tag in html to represent open this url in new window.

Most helpful comment

Hi @pirDOL, I think we can add an optional target parameter. I'll take a look at it. I think we don't really need the frame-based options here, like _top or parent, but it won't hurt to let these pass as well just in case someone needs them.

All 3 comments

Hi @pirDOL, I think we can add an optional target parameter. I'll take a look at it. I think we don't really need the frame-based options here, like _top or parent, but it won't hurt to let these pass as well just in case someone needs them.

Great idea, indeed. I often use some flowcharts based on mermaid within documentation (mkdocs / rtfd ).
The general rule I use is : when it is an interne link, open it in the same window, otherwise (external links) open a new window. Unfortunately mermaid flowchart links break this rule :(

I'm going to finish this in the upcoming week. It works but I still need to add or modify the unit tests for this change.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zumdahl76 picture zumdahl76  路  5Comments

visualcurrent picture visualcurrent  路  3Comments

tylerlong picture tylerlong  路  5Comments

yk-liu picture yk-liu  路  4Comments

michaeltlombardi picture michaeltlombardi  路  3Comments