mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
72.62k stars 6.62k forks source link

Error in startOnLoad documentation? #616

Closed stanhu closed 6 years ago

stanhu commented 6 years ago

With mermaid 7.1.2 on npm (https://www.npmjs.com/package/mermaid), adding the startOnLoad as mentioned in https://github.com/knsv/mermaid/issues/291#issuecomment-287673609 did not make that issue away for me:

  var config = {
        startOnLoad: false
    };
    mermaid.initialize(config);

After testing https://github.com/mermaidjs/mermaid-live-editor and setting a breakpoint in https://github.com/knsv/mermaid/blob/6cd5ffe637d88525b93417bf3954e9c0e5a4deb8/src/mermaid.js#L118-L124, I saw that startOnLoad was not being set properly.

Instead, I had to do this:

mermaid.initialize({
  mermaid: {
     startOnLoad: false
  }
});

Is there a documentation error here?

tylerlong commented 6 years ago

Yes, the documentation is pretty dated.

But I just tested, both code work.

Could you please test the latest mermaid code? Thanks