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

An unofficial way making the sequence chart interactive? #919

Closed
pavlo opened this issue Sep 1, 2019 · 5 comments
Closed

An unofficial way making the sequence chart interactive? #919

pavlo opened this issue Sep 1, 2019 · 5 comments
Labels
Graph: Sequence Status: Approved Is ready to be worked on

Comments

@pavlo
Copy link

pavlo commented Sep 1, 2019

Currently there is no official way to make a sequence chart interactive, meaning you can not make a message clickable, for instance.

I was wondering if there's an unofficial way to achieve that? Is there a walk-around or a trick to make the interactivity happen?

Thanks guys for the excellent product!
Pavlo

@knsv
Copy link
Collaborator

knsv commented Sep 1, 2019

Not as of now but it makes sense to add interaction there as a means to divide large sequence diagrams into smaller pieces. Stay tuned. @edumicse, what do you think?

@edumicse
Copy link
Contributor

edumicse commented Sep 1, 2019

Sounds tempting @knsv.

@yongchaoo
Copy link

yongchaoo commented Sep 5, 2019

try this:
html:

  <div class="mermaid" id="diagram">
        sequenceDiagram
        Alice->>John: Hello John, how are you?
   </div>

js:

      document.getElementById("diagram").addEventListener("click", e => {
            // get messageText
            if (e.srcElement.className.baseVal === 'messageText') {
                const textContent = e.srcElement.textContent;
                console.log(textContent);
            }
            // do something
        });

@IOrlandoni IOrlandoni added Graph: Sequence Type: Other Not an enhancement or a bug labels Sep 24, 2019
@jgreywolf jgreywolf added the Status: Triage Needs to be verified, categorized, etc label Feb 1, 2021
@jgreywolf
Copy link
Contributor

This is the same underlying issue as #1139 - interactions were not added to these diagrams when originally created.

If anyone wants to take this work on, look at how interactions are handled in flowchart/class diagrams

@jgreywolf jgreywolf added Status: Approved Is ready to be worked on and removed Type: Other Not an enhancement or a bug Status: Triage Needs to be verified, categorized, etc labels Mar 7, 2023
@jgreywolf
Copy link
Contributor

Closing this in favor of #1279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graph: Sequence Status: Approved Is ready to be worked on
Projects
None yet
Development

No branches or pull requests

6 participants