Simple mermaid graph fails

ぐ巨炮叔叔 提交于 2019-12-12 16:28:15

问题


I tried to run the example from the mermaid site (a working copy is on codepen.io):

<script src="https://cdn.rawgit.com/knsv/mermaid/0.5.1/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad:true});</script>

<div class="mermaid">

graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;

</div>

The output is:

At the same time, a sequence diagram works great.

Where is the problem with the basic example?

Update

The issue was with Chrome 48 compatibility. It is fixed by using the latest js file:

<script src="https://cdn.rawgit.com/knsv/mermaid/master/dist/mermaid.min.js"></script>
<link rel="stylesheet" href="https://cdn.rawgit.com/knsv/mermaid/master/dist/mermaid.css">

回答1:


It looks ok in Safari:

The only thing that was missing for me was the line colour, but adding this css fixed that:

path {
  stroke: black;
}


来源:https://stackoverflow.com/questions/35156863/simple-mermaid-graph-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!