之前写了一篇关于 Graphviz 的绘图方法,如今认识到 Plantuml 才发现它可以更强大 。
能兼容 Graphviz 的 Dot 语言,并支持更多的图表类型。话不多少先上一个时序图:
如上是用VSCode编译、实时预览的效果(装Plantuml插件),如下是源码鉴赏:
@startuml
title ** 多环境功能测试数据示意图 ** \n\n
skinparam backgroundColor #azure
skinparam handwritten true
skinparam sequence {
ArrowColor #DeepSkyBlue
ActorBorderColor #DeepSkyBlue
LifeLineBorderColor blue
LifeLineBackgroundColor #DeepSkyBlue
ParticipantBorderColor #DeepSkyBlue
ParticipantBackgroundColor #DodgerBlue
ParticipantFontName Impact
ParticipantFontSize 17
ParticipantFontColor #Cyan
ActorBackgroundColor #aqua
ActorFontColor #DeepSkyBlue
ActorFontSize 17
ActorFontName Aapex
}
actor "客户端" as Client
control "代理服务" as Proxy
note over Proxy #LightYellow
"配置DNS和染色规则"
end note
participant "容器SLB" as DockerSLB
note over DockerSLB #LightYellow
"按染色规则转发"
end note
box "容器染色发布" #LightYellow
collections "集成环境" as UAT4Test #DarkRed
collections "功能环境-1" as FAT14Test #Green
collections "功能环境-2" as FAT24Test #SteelBlue
collections "功能环境..." as FAT...4Test #MediumBlue
collections "功能环境-N" as FATN4Test #MidnightBlue
end box
Client [#gray]--> Client : 本地Hosts
Client [#red]--> Proxy : DNS查询
Client <--[#blue] Proxy : 解析域名对应的IP
||||
Client [#red]-> Proxy : 正常接口-访问
Proxy [#red]-> DockerSLB : 正常接口-透传
DockerSLB [#red]->o UAT4Test : 稳定集成版本
Client [#blue]-> Proxy : 染色接口-访问
Proxy [#blue]-> DockerSLB : 染色接口-透传
DockerSLB [#blue]->o FAT...4Test : 功能测试版本
@enduml
官网已经做得很不错了,喜欢就赶紧试用吧:
http://plantuml.com/
转载于:https://my.oschina.net/higkoo/blog/2878950