graphviz for sublime text3 on Mac OS

graphviz是一个代码级的制图软件,程序员大爱啊~

1. 检测java环境 $: java -v 如果没有去sun下载安装
2. 安装graphviz $:brew install graphviz
3. 安装sublime插件
Command-Shift-
add repository
https://github.com/jvantuyl/sublime_diagram_plugin.git
Command-Shift-P
install package
sublime_diagram_plugi
修改Diagram快捷健(和markdown有冲突){ “keys”: [“alt+d”], “command”: “display_diagrams”}

语法:http://zh.plantuml.com/

下面是一个小项目的分析案例

@startuml

:Admin: --> (login)

rectangle System {
    (login) --> (User)
    (User) --> (Import)

    (login) --> (course)
    (course) --> (modify course)

    (login) --> (venue)
    (venue) --> (modify venue)

    (login) --> (user cert)
    (user cert) --> (confirm)
    (confirm) --> (ready)
    (confirm) --> (Yes)
    (confirm) --> (No)
}

@enduml

@startuml


:User: --> (login)

rectangle Operation {
    (login) --> (assessment)

    (assessment) --> (require cert) 
    (require cert)--> (select time) 
    (select time) --> (select venue) 
    (select venue)--> (pay)

    (assessment) --> (get result) 
    (get result) --> (pass)
    (pass) --> (get cert)
    (get result) --> (no pass) 
    (no pass)--> (require cert)
}

rectangle Operation {
    (login) --> (course)
    (course) --> (confirm)
    (confirm) --> (comments)
}

@enduml

@startuml

:Teache: --> (login)

rectangle Operation {
    (login) --> (Select course)
    (Select course) --> (Call name)
    (Call name) --> (confirm yes)
    (Call name) --> (confirm no)
}

rectangle Operation {
    (login) --> (Start cert)
    (Start cert) --> (Select user)
    (Select user) --> (give score)
}

@enduml

发表评论

电子邮件地址不会被公开。 必填项已用*标注