User Tools

Site Tools


learn:mkchart

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
learn:mkchart [2017/03/02 11:42]
soup created
learn:mkchart [2017/03/03 05:57] (current)
soup
Line 1: Line 1:
 ===== mermaid ===== ===== mermaid =====
  
 +项目地址:<​code>​http://​knsv.github.io/​mermaid/​ </​code>​
  
 mermaid依赖于phantomjs mermaid依赖于phantomjs
Line 6: Line 7:
 PhantomJS是一个无界面的,​可脚本编程的WebKit浏览器引擎。 PhantomJS是一个无界面的,​可脚本编程的WebKit浏览器引擎。
  
-mac 安装+====mac 安装====
 <​code>​ <​code>​
 npm install -g mermaid npm install -g mermaid
-npm install ​-g phantomjs+brew install phantomjs
 </​code>​ </​code>​
  
 +====使用====
 term 输入 ​ term 输入 ​
 mermaid --help mermaid --help
Line 33: Line 35:
   --version ​           Print version and quit   --version ​           Print version and quit
 </​code>​ </​code>​
 +
 +====时序图例子====
 +<​code>​
 +sequenceDiagram
 +    participant Alice
 +    participant Bob
 +    Alice->​John:​ Hello John, how are you?
 +    loop Healthcheck
 +        John->​John:​ Fight against hypochondria
 +    end
 +    Note right of John: Rational thoughts <​br/>​prevail...
 +    John-->​Alice:​ Great!
 +    John->​Bob:​ How about you?
 +    alt good
 +        Bob-->​John:​ Jolly good!
 +    else bad
 +        Bob-->​John:​ Jolly bad!
 +    end
 + </​code>​
 +
 +====流程图例子====
 +<​code>​
 +        graph LR
 +            A-->B
 +            B-->C
 +            C-->​|back|A
 +            D-.->​|dot|C
 + </​code>​
 +====甘特图例子====
 +<​code>​
 +gantt
 +        dateFormat ​ YYYY-MM-DD
 +        title Adding GANTT diagram functionality to mermaid
 +        section A section
 +        Completed task            :​done, ​   des1, 2014-01-06,​2014-01-08
 +        Active task               :​active, ​ des2, 2014-01-09, 3d
 +        Future task               : ​        des3, after des2, 5d
 +        Future task2               : ​        des4, after des3, 5d
 +        section Critical tasks
 +        Completed task in the critical line :crit, done, 2014-01-06,​24h
 +        Implement parser and jison          :crit, done, after des1, 2d
 +        Create tests for parser ​            :​crit,​ active, 3d
 +        Future task in critical line        :crit, 5d
 +        Create tests for renderer ​          :2d
 +        Add to mermaid ​                     :1d
 + </​code>​
 +
learn/mkchart.1488454951.txt.gz · Last modified: 2017/03/02 11:42 by soup