mermaid
mermaid copied to clipboard
Programmatically interacting with Mermaid diagrams
Hi there. I wonder if there is any way to interact with Mermaid diagrams by clicking over them. My goal is clear: I would like to programmatically generate a state diagram according to states stored inside my database. Each time I click on a state, I would like to send a post request to my Symfony controller to act according to that click and show an appropriate web page and dinamically stylize that state with a CSS style. Thanks.
State diagram doesn't support interaction right now.
https://mermaid-js.github.io/mermaid/#/classDiagram?id=interaction
PRs are welcome to add support.
Hi @sidharthv96 :wave: I would be happy to try but first wanna know why it's not supported. Is there some super difficult parsing problem or you just didn't have time for it yet?
@yurtsiv The state diagram was added a while back, I wasn't involved during that time.
But I think interaction support was simply not added. It should be relatively straightforward to refer flowchart/classdiagram code to add support.
You'll mainly have to make changes in the jison file, db and renderer. (I think)
Related https://github.com/mermaid-js/mermaid/issues/1139
I'll try to tackle this
Closing as Duplicate of #1139