Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add click interactions to MindMap #4099

Open
quan787 opened this issue Feb 16, 2023 · 15 comments
Open

Add click interactions to MindMap #4099

quan787 opened this issue Feb 16, 2023 · 15 comments

Comments

@quan787
Copy link

quan787 commented Feb 16, 2023

Proposal

There are features for interactions in some other types of diagrams, e.g. Flowchart, Class Diagram. This helps a lot for linking pages together as a intuitive and organized way.

However, MindMap does not have that yet. This type of diagram is particularly suitable for doc and wiki websites, where it really need to add url links to nodes.

I am using wiki.js to build a wiki website, and really want this kind of diagrams to be shown at the front page.

Right now, the link syntax similar to other types are ignored:

image

Example

Syntaxes like this are needed:

mindmap
root((Variable stars))
 Pulsation 
 link Pulsation "github.com" "something"
 Cataclysmic

Screenshots

No response

@quan787 quan787 added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Feb 16, 2023
@ishaan812
Copy link

Can I be assigned this issue?

@ZainGulbaz
Copy link

@jgreywolf Can you please assign this to me?

@jgreywolf
Copy link
Contributor

A month later - sorry for the delay. Are you still interested in working on this?

@spalukuri
Copy link

hi, I am really looking forward to this any update on this. Thanks for the great work!

@garwalsh
Copy link

Also hoping for this!

@baba43
Copy link

baba43 commented Feb 25, 2024

Please make this happen! 👍

@ShawnBrew
Copy link

This would be great.

@marabesi
Copy link

marabesi commented Apr 1, 2024

I was looking for the same thing, and this answer from stackoverflow did the trick.

@threedaysmore
Copy link

I was looking for the same thing, and this answer from stackoverflow did the trick.

Any chance you can provide how this answer achieved this for you for mindmaps? I've tried adding securityLevel: loose and adding in clicks or anchor tags in a node with no success.

@threedaysmore
Copy link

threedaysmore commented Apr 22, 2024

So I had to put something together that would get this off the ground for a small personal project. I made a small react app that takes in a mermaid mindmap doc with comments for each node's link and adds click listeners. It's by no means a particularly masterful solution since I am not a masterful JS dev 😅

A note for devs: this is just manipulating the DOM after render as best as the Mermaid package will allow me. This could be done smoother/better directly in the mermaid package/code I'm sure.

But hopefully this is a stepping stone for someone else who comes to this thread later.

Here is the example site deployed to Netlify
repo link

And here is the mermaid doc used to generate this mindmap

mindmap
  root((TV Shows))
    Frasier %% https://en.wikipedia.org/wiki/Frasier
      Frasier %%https://en.wikipedia.org/wiki/Frasier_Crane
      Daphne %%https://en.wikipedia.org/wiki/Daphne_Moon
      Niles  %%https://en.wikipedia.org/wiki/Niles_Crane
      Martin %%https://en.wikipedia.org/wiki/Martin_Crane
    Avatar the Last Airbender %%https://en.wikipedia.org/wiki/Avatar:_The_Last_Airbender
      Aang %%https://en.wikipedia.org/wiki/Aang
      Katara %%https://en.wikipedia.org/wiki/Katara_(Avatar:_The_Last_Airbender)
      Sokka %%https://en.wikipedia.org/wiki/Sokka
      Zuko %%https://en.wikipedia.org/wiki/Zuko
      Iroh %%https://en.wikipedia.org/wiki/Iroh
    Game of Thrones %%https://en.wikipedia.org/wiki/Game_of_Thrones
      Jon Snow %%https://en.wikipedia.org/wiki/Jon_Snow_(character)
      Ned Stark %%https://en.wikipedia.org/wiki/Ned_Stark
      Tyrion Lanister %%https://en.wikipedia.org/wiki/Tyrion_Lannister
    Scrubs %%https://en.wikipedia.org/wiki/Scrubs_(TV_series)
      Turk %%https://en.wikipedia.org/wiki/Christopher_Turk
      JD %%https://en.wikipedia.org/wiki/J.D._(Scrubs)
      Elliot %%https://en.wikipedia.org/wiki/Elliot_Reid
      Dr. Cox %%https://en.wikipedia.org/wiki/Perry_Cox

@baba43
Copy link

baba43 commented Apr 25, 2024

I was looking for the same thing, and this answer from stackoverflow did the trick.

Any chance you can provide how this answer achieved this for you for mindmaps? I've tried adding securityLevel: loose and adding in clicks or anchor tags in a node with no success.

Same here. Did you find a solution? Maybe this is just not working for the Mindmap in general?

@threedaysmore
Copy link

Same here. Did you find a solution? Maybe this is just not working for the Mindmap in general?

Best I can tell clickable links are not natively supported for Mindmaps. In this previous reply of mine I've got some code out there to show how to kind of shoehorn it in there for now until mermaid(hopefully) gets some support out there for this.

@sauron918
Copy link

Really hope for support. Links are quite often used in mind maps.

@marabesi
Copy link

marabesi commented Aug 6, 2024

update on my answer:

it worked just for flow diagrams but after trying to do that with mermaid js for mindmaps it didn't work

ping @threedaysmore

@AndrewBarfield
Copy link

Not working in v10.9.1. We really need this. How can I help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests