How to use the mermaid.mermaidAPI.parseError function in mermaid

To help you get started, we’ve selected a few mermaid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github crubier / code-to-graph / docs-source / src / attina.js View on Github external
function getDiagram(title, input, callback) {
  try {
    mermaidAPI.initialize({
      startOnLoad: true
    });

    mermaidAPI.parseError = function(err, hash) {
      // console.log("parseError");
      // console.log(err.messsage);
    };
    // console.log("Rendering");
    // console.log(input);
    // mermaidAPI.render(title, "graph TB;Loading;", diagram => {
    //   console.log("Rendered");
    //   setTimeout(
    //     () =>
    //       mermaidAPI.render(title, input, diagram => {
    //         console.log("Rendered");
    //         console.log(diagram);
    //         callback(diagram);
    //       }),
    //     200
    //   );