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

Regarding the interaction of the flow chart, add a js callback function mechanism for clicking on the node, and report an error when clicking on the node. #5074

Closed
life2022 opened this issue Nov 27, 2023 · 2 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@life2022
Copy link

Description

Regarding the interaction of the flow chart, add a js callback function mechanism for clicking on the node, and report an error when clicking on the node.

Steps to reproduce

Bug:jsfiddle

Screenshots

image

Code Sample

No response

Setup

  • Mermaid version:
  • Browser and Version: Chrome

Suggested Solutions

No response

Additional Context

No response

@life2022 life2022 added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Nov 27, 2023
@sidharthv96
Copy link
Member

sidharthv96 commented Nov 27, 2023

Please add a window.callback = callback; at the end, to attach your function to the window.

image

@reckertz
Copy link

reckertz commented May 6, 2024

As a generic approach I use $(document).on("click", ".nodeLabel", function (evt) { ... }); to capture a click on a node, $(this).text(); gives the node-information that is needed in the event - function. I use it for submodels starting with the clicked node. Mermaid is a great tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

3 participants