Spaces in Mermaid

泄露秘密 提交于 2019-12-11 07:53:59

问题


I have a .md file saved and I am viewing it using Atom and the Mermaid Preview package. I am going off the example on their GitHub page:

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

That renders fine, but how do I add spaces the text? For example:

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

The previewer goes blank when I put spaces in. I tried adding quotations, but that did not help.


回答1:


Try this (haven't tried it in Atom but it worked fine in VisualStudio Code with Mermaid Plugin):

graph TD;
  id1[A F]-->B;
  A-->C;
  B-->D;
  C-->D;

Instead of id1 you can use whatever id you want.

Depending on the type of braces you use, you can change the look of the rendered Node.

  • Box with round edges - id1(A F)
  • Circle - id1((A F))
  • Asymetric Shape - id1>A F]
  • Rhombus - id1{A F}

This can be found on the mermaid documentation site



来源:https://stackoverflow.com/questions/54311261/spaces-in-mermaid

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