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

Re-render graph #709

Closed
mstrop opened this issue Aug 9, 2018 · 4 comments
Closed

Re-render graph #709

mstrop opened this issue Aug 9, 2018 · 4 comments
Labels
Type: New Shape Request for new shape

Comments

@mstrop
Copy link

mstrop commented Aug 9, 2018

I need to change graph definition based on a user action. My initial sequence follows the documentation:

        <div id="schema_cont" class="mermaid">
            graph TD;
            entry((Entry));
            click entry nodeClick;
        </div>
....

        mermaid.initialize({ startOnLoad: true });

It works fine. Later on I need to change the graph ( add / remove node etc. ). I tried to implement an example form the documentation using render function:

    var cb = function (svgGraph) {
        $("#schema_cont").html(svgGraph);
    }

    $("#schema_cont").html("");

    mermaid.render("id1", "graph TD;\nentry((New entry));\nclick entry nodeClick;", cb);

Doing it this way the graph is reloaded with the new definition, but the click callback is never called. Am I doing anything wrong?

@sudhakar-sekar
Copy link

Hi @mstrop,

I am also trying same, have you found any solutions for the rendering issue based on user action?
If you found the solution and resolved, will you please tell me that.

Thanks,
Sudhakar.

@GDFaber
Copy link
Member

GDFaber commented Jul 23, 2019

I think this is what you are looking for:
#311 (comment)

I am using this solution with mermaid 8.2.1 and it still does the trick.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you are still interested in it, and it is still relevant, you can comment or remove the label to revive it.

@github-actions github-actions bot added the Type: New Shape Request for new shape label Sep 24, 2019
@stale
Copy link

stale bot commented Oct 8, 2019

This issue has been been automatically closed due to a lack of activity. This is done to maintain a clean list of issues that the community is interested in developing.

@stale stale bot closed this as completed Oct 8, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: New Shape Request for new shape
Projects
None yet
Development

No branches or pull requests

3 participants