PlantUML教程及主题模板

  • Post author:
  • Post category:其他


plantuml教程:

https://plantuml.com/zh/sequence-diagram


plantuml在线工具:

https://www.planttext.com


FRLH主题:

https://puml.littletools.ml/theme/frlh.style




时序图

在这里插入图片描述

@startuml
autonumber "0."

' 引入主题
!include https://puml.littletools.ml/theme/frlh.style

' 定义角色
actor User
participant "微服务A" as a
box "Internal Service" #LightBlue
participant "微服务B" as b $c1
participant "微服务C" as c
end box

' 开始流程

[->User: 开始
User-[#red]>a ++: 发出指令\n这是一个很长的指令

== 初始化 ==
a->b ++ #E1F5A9: 第一步

|||
|||
loop 3次
b->c --++: 第二步
end

c->c ++ : 第三步

alt#Gold #yellow 如果成功,则直接返回
c-->>a --
else #Pink 失败
c->c ++ : 重试一次
c-->>a --
end
deactivate c

a-->>User: bye

group 随便框一下 [哈哈哈]
User-->>]: 结束
end

note left of User #aqua
这是一个note
欢迎使用时序图
end note

@enduml



流程图

在这里插入图片描述

@startuml

' 引入主题
!include https://puml.littletools.ml/theme/frlh.style

' 开始流程
|外部调用|
start
:第一步;
:<b>第二步
可以换行

或者空一行;

|$c1|内部处理|

if (是否继续进行) then ()
partition 循环处理 {
  repeat :<b>循环第一步;
    $c1 :循环第二步;
  repeat while (继续循环)  is () not ()
}
else ()
endif

|外部调用|
:最后一步;

stop

@enduml



状态图

在这里插入图片描述

@startuml

' 引入主题
!include https://puml.littletools.ml/theme/frlh.style

state 1 $c1: there is some info

' 开始流程
[*]-d[$c2]->1
1-r->2
2-d->3
3-l->4
4-[#red]>5
5-[#red]->6
6-u->[*]

@enduml



附录:样式表

ActivityBackgroundColor
ActivityBarColor
ActivityBorderColor
ActivityBorderThickness
ActivityDiamondBackgroundColor
ActivityDiamondBorderColor
ActivityDiamondFontColor
ActivityDiamondFontName
ActivityDiamondFontSize
ActivityDiamondFontStyle
ActivityEndColor
ActivityFontColor
ActivityFontName
ActivityFontSize
ActivityFontStyle
ActivityStartColor
ActorBackgroundColor
ActorBorderColor
ActorFontColor
ActorFontName
ActorFontSize
ActorFontStyle
ActorStereotypeFontColor
ActorStereotypeFontName
ActorStereotypeFontSize
ActorStereotypeFontStyle
AgentBackgroundColor
AgentBorderColor
AgentBorderThickness
AgentFontColor
AgentFontName
AgentFontSize
AgentFontStyle
AgentStereotypeFontColor
AgentStereotypeFontName
AgentStereotypeFontSize
AgentStereotypeFontStyle
ArchimateBackgroundColor
ArchimateBorderColor
ArchimateBorderThickness
ArchimateFontColor
ArchimateFontName
ArchimateFontSize
ArchimateFontStyle
ArchimateStereotypeFontColor
ArchimateStereotypeFontName
ArchimateStereotypeFontSize
ArchimateStereotypeFontStyle
ArrowColor
ArrowFontColor
ArrowFontName
ArrowFontSize
ArrowFontStyle
ArrowHeadColor
ArrowLollipopColor
ArrowMessageAlignment
ArrowThickness
ArtifactBackgroundColor
ArtifactBorderColor
ArtifactFontColor
ArtifactFontName
ArtifactFontSize
ArtifactFontStyle
ArtifactStereotypeFontColor
ArtifactStereotypeFontName
ArtifactStereotypeFontSize
ArtifactStereotypeFontStyle
BackgroundColor
BiddableBackgroundColor
BiddableBorderColor
BoundaryBackgroundColor
BoundaryBorderColor
BoundaryFontColor
BoundaryFontName
BoundaryFontSize
BoundaryFontStyle
BoundaryStereotypeFontColor
BoundaryStereotypeFontName
BoundaryStereotypeFontSize
BoundaryStereotypeFontStyle
BoxPadding
CaptionFontColor
CaptionFontName
CaptionFontSize
CaptionFontStyle
CardBackgroundColor
CardBorderColor
CardBorderThickness
CardFontColor
CardFontName
CardFontSize
CardFontStyle
CardStereotypeFontColor
CardStereotypeFontName
CardStereotypeFontSize
CardStereotypeFontStyle
CircledCharacterFontColor
CircledCharacterFontName
CircledCharacterFontSize
CircledCharacterFontStyle
CircledCharacterRadius
ClassAttributeFontColor
ClassAttributeFontName
ClassAttributeFontSize
ClassAttributeFontStyle
ClassAttributeIconSize
ClassBackgroundColor
ClassBorderColor
ClassBorderThickness
ClassFontColor
ClassFontName
ClassFontSize
ClassFontStyle
ClassHeaderBackgroundColor
ClassStereotypeFontColor
ClassStereotypeFontName
ClassStereotypeFontSize
ClassStereotypeFontStyle
CloudBackgroundColor
CloudBorderColor
CloudFontColor
CloudFontName
CloudFontSize
CloudFontStyle
CloudStereotypeFontColor
CloudStereotypeFontName
CloudStereotypeFontSize
CloudStereotypeFontStyle
CollectionsBackgroundColor
CollectionsBorderColor
ColorArrowSeparationSpace
ComponentBackgroundColor
ComponentBorderColor
ComponentBorderThickness
ComponentFontColor
ComponentFontName
ComponentFontSize
ComponentFontStyle
ComponentStereotypeFontColor
ComponentStereotypeFontName
ComponentStereotypeFontSize
ComponentStereotypeFontStyle
ComponentStyle
ConditionEndStyle
ConditionStyle
ControlBackgroundColor
ControlBorderColor
ControlFontColor
ControlFontName
ControlFontSize
ControlFontStyle
ControlStereotypeFontColor
ControlStereotypeFontName
ControlStereotypeFontSize
ControlStereotypeFontStyle
DatabaseBackgroundColor
DatabaseBorderColor
DatabaseFontColor
DatabaseFontName
DatabaseFontSize
DatabaseFontStyle
DatabaseStereotypeFontColor
DatabaseStereotypeFontName
DatabaseStereotypeFontSize
DatabaseStereotypeFontStyle
DefaultFontColor
DefaultFontName
DefaultFontSize
DefaultFontStyle
DefaultMonospacedFontName
DefaultTextAlignment
DesignedBackgroundColor
DesignedBorderColor
DesignedDomainBorderThickness
DesignedDomainFontColor
DesignedDomainFontName
DesignedDomainFontSize
DesignedDomainFontStyle
DesignedDomainStereotypeFontColor
DesignedDomainStereotypeFontName
DesignedDomainStereotypeFontSize
DesignedDomainStereotypeFontStyle
DiagramBorderColor
DiagramBorderThickness
DomainBackgroundColor
DomainBorderColor
DomainBorderThickness
DomainFontColor
DomainFontName
DomainFontSize
DomainFontStyle
DomainStereotypeFontColor
DomainStereotypeFontName
DomainStereotypeFontSize
DomainStereotypeFontStyle
Dpi
EntityBackgroundColor
EntityBorderColor
EntityFontColor
EntityFontName
EntityFontSize
EntityFontStyle
EntityStereotypeFontColor
EntityStereotypeFontName
EntityStereotypeFontSize
EntityStereotypeFontStyle
EnumBackgroundColor
FileBackgroundColor
FileBorderColor
FileFontColor
FileFontName
FileFontSize
FileFontStyle
FileStereotypeFontColor
FileStereotypeFontName
FileStereotypeFontSize
FileStereotypeFontStyle
FixCircleLabelOverlapping
FolderBackgroundColor
FolderBorderColor
FolderFontColor
FolderFontName
FolderFontSize
FolderFontStyle
FolderStereotypeFontColor
FolderStereotypeFontName
FolderStereotypeFontSize
FolderStereotypeFontStyle
FooterFontColor
FooterFontName
FooterFontSize
FooterFontStyle
FrameBackgroundColor
FrameBorderColor
FrameFontColor
FrameFontName
FrameFontSize
FrameFontStyle
FrameStereotypeFontColor
FrameStereotypeFontName
FrameStereotypeFontSize
FrameStereotypeFontStyle
GenericDisplay
Guillemet
Handwritten
HeaderFontColor
HeaderFontName
HeaderFontSize
HeaderFontStyle
HexagonBackgroundColor
HexagonBorderColor
HexagonBorderThickness
HexagonFontColor
HexagonFontName
HexagonFontSize
HexagonFontStyle
HexagonStereotypeFontColor
HexagonStereotypeFontName
HexagonStereotypeFontSize
HexagonStereotypeFontStyle
HyperlinkColor
HyperlinkUnderline
IconIEMandatoryColor
IconPackageBackgroundColor
IconPackageColor
IconPrivateBackgroundColor
IconPrivateColor
IconProtectedBackgroundColor
IconProtectedColor
IconPublicBackgroundColor
IconPublicColor
InterfaceBackgroundColor
InterfaceBorderColor
InterfaceFontColor
InterfaceFontName
InterfaceFontSize
InterfaceFontStyle
InterfaceStereotypeFontColor
InterfaceStereotypeFontName
InterfaceStereotypeFontSize
InterfaceStereotypeFontStyle
LabelFontColor
LabelFontName
LabelFontSize
LabelFontStyle
LabelStereotypeFontColor
LabelStereotypeFontName
LabelStereotypeFontSize
LabelStereotypeFontStyle
LegendBackgroundColor
LegendBorderColor
LegendBorderThickness
LegendFontColor
LegendFontName
LegendFontSize
LegendFontStyle
LexicalBackgroundColor
LexicalBorderColor
LifelineStrategy
Linetype
MachineBackgroundColor
MachineBorderColor
MachineBorderThickness
MachineFontColor
MachineFontName
MachineFontSize
MachineFontStyle
MachineStereotypeFontColor
MachineStereotypeFontName
MachineStereotypeFontSize
MachineStereotypeFontStyle
MaxAsciiMessageLength
MaxMessageSize
MinClassWidth
Monochrome
NodeBackgroundColor
NodeBorderColor
NodeFontColor
NodeFontName
NodeFontSize
NodeFontStyle
NodeStereotypeFontColor
NodeStereotypeFontName
NodeStereotypeFontSize
NodeStereotypeFontStyle
Nodesep
NoteBackgroundColor
NoteBorderColor
NoteBorderThickness
NoteFontColor
NoteFontName
NoteFontSize
NoteFontStyle
NoteShadowing
NoteTextAlignment
ObjectAttributeFontColor
ObjectAttributeFontName
ObjectAttributeFontSize
ObjectAttributeFontStyle
ObjectBackgroundColor
ObjectBorderColor
ObjectBorderThickness
ObjectFontColor
ObjectFontName
ObjectFontSize
ObjectFontStyle
ObjectStereotypeFontColor
ObjectStereotypeFontName
ObjectStereotypeFontSize
ObjectStereotypeFontStyle
PackageBackgroundColor
PackageBorderColor
PackageBorderThickness
PackageFontColor
PackageFontName
PackageFontSize
PackageFontStyle
PackageStereotypeFontColor
PackageStereotypeFontName
PackageStereotypeFontSize
PackageStereotypeFontStyle
PackageStyle
PackageTitleAlignment
Padding
PageBorderColor
PageExternalColor
PageMargin
ParticipantBackgroundColor
ParticipantBorderColor
ParticipantFontColor
ParticipantFontName
ParticipantFontSize
ParticipantFontStyle
ParticipantPadding
ParticipantStereotypeFontColor
ParticipantStereotypeFontName
ParticipantStereotypeFontSize
ParticipantStereotypeFontStyle
PartitionBackgroundColor
PartitionBorderColor
PartitionBorderThickness
PartitionFontColor
PartitionFontName
PartitionFontSize
PartitionFontStyle
PathHoverColor
PersonBackgroundColor
PersonBorderColor
PersonBorderThickness
PersonFontColor
PersonFontName
PersonFontSize
PersonFontStyle
PersonStereotypeFontColor
PersonStereotypeFontName
PersonStereotypeFontSize
PersonStereotypeFontStyle
QueueBackgroundColor
QueueBorderColor
QueueBorderThickness
QueueFontColor
QueueFontName
QueueFontSize
QueueFontStyle
QueueStereotypeFontColor
QueueStereotypeFontName
QueueStereotypeFontSize
QueueStereotypeFontStyle
Ranksep
RectangleBackgroundColor
RectangleBorderColor
RectangleBorderThickness
RectangleFontColor
RectangleFontName
RectangleFontSize
RectangleFontStyle
RectangleStereotypeFontColor
RectangleStereotypeFontName
RectangleStereotypeFontSize
RectangleStereotypeFontStyle
RequirementBackgroundColor
RequirementBorderColor
RequirementBorderThickness
RequirementFontColor
RequirementFontName
RequirementFontSize
RequirementFontStyle
RequirementStereotypeFontColor
RequirementStereotypeFontName
RequirementStereotypeFontSize
RequirementStereotypeFontStyle
ResponseMessageBelowArrow
RoundCorner
SameClassWidth
SequenceActorBorderThickness
SequenceArrowThickness
SequenceBoxBackgroundColor
SequenceBoxBorderColor
SequenceBoxFontColor
SequenceBoxFontName
SequenceBoxFontSize
SequenceBoxFontStyle
SequenceDelayFontColor
SequenceDelayFontName
SequenceDelayFontSize
SequenceDelayFontStyle
SequenceDividerBackgroundColor
SequenceDividerBorderColor
SequenceDividerBorderThickness
SequenceDividerFontColor
SequenceDividerFontName
SequenceDividerFontSize
SequenceDividerFontStyle
SequenceGroupBackgroundColor
SequenceGroupBodyBackgroundColor
SequenceGroupBorderColor
SequenceGroupBorderThickness
SequenceGroupFontColor
SequenceGroupFontName
SequenceGroupFontSize
SequenceGroupFontStyle
SequenceGroupHeaderFontColor
SequenceGroupHeaderFontName
SequenceGroupHeaderFontSize
SequenceGroupHeaderFontStyle
SequenceLifeLineBackgroundColor
SequenceLifeLineBorderColor
SequenceLifeLineBorderThickness
SequenceMessageAlignment
SequenceMessageTextAlignment
SequenceNewpageSeparatorColor
SequenceParticipant
SequenceParticipantBorderThickness
SequenceReferenceAlignment
SequenceReferenceBackgroundColor
SequenceReferenceBorderColor
SequenceReferenceBorderThickness
SequenceReferenceFontColor
SequenceReferenceFontName
SequenceReferenceFontSize
SequenceReferenceFontStyle
SequenceReferenceHeaderBackgroundColor
SequenceStereotypeFontColor
SequenceStereotypeFontName
SequenceStereotypeFontSize
SequenceStereotypeFontStyle
Shadowing
StackBackgroundColor
StackBorderColor
StackFontColor
StackFontName
StackFontSize
StackFontStyle
StackStereotypeFontColor
StackStereotypeFontName
StackStereotypeFontSize
StackStereotypeFontStyle
StateAttributeFontColor
StateAttributeFontName
StateAttributeFontSize
StateAttributeFontStyle
StateBackgroundColor
StateBorderColor
StateEndColor
StateFontColor
StateFontName
StateFontSize
StateFontStyle
StateMessageAlignment
StateStartColor
StereotypeABackgroundColor
StereotypeABorderColor
StereotypeCBackgroundColor
StereotypeCBorderColor
StereotypeEBackgroundColor
StereotypeEBorderColor
StereotypeIBackgroundColor
StereotypeIBorderColor
StereotypeNBackgroundColor
StereotypeNBorderColor
StereotypePosition
StorageBackgroundColor
StorageBorderColor
StorageFontColor
StorageFontName
StorageFontSize
StorageFontStyle
StorageStereotypeFontColor
StorageStereotypeFontName
StorageStereotypeFontSize
StorageStereotypeFontStyle
Style
SvglinkTarget
SwimlaneBorderColor
SwimlaneBorderThickness
SwimlaneTitleBackgroundColor
SwimlaneTitleFontColor
SwimlaneTitleFontName
SwimlaneTitleFontSize
SwimlaneTitleFontStyle
SwimlaneWidth
SwimlaneWrapTitleWidth
TabSize
TimingFontColor
TimingFontName
TimingFontSize
TimingFontStyle
TitleBackgroundColor
TitleBorderColor
TitleBorderRoundCorner
TitleBorderThickness
TitleFontColor
TitleFontName
TitleFontSize
TitleFontStyle
UsecaseBackgroundColor
UsecaseBorderColor
UsecaseBorderThickness
UsecaseFontColor
UsecaseFontName
UsecaseFontSize
UsecaseFontStyle
UsecaseStereotypeFontColor
UsecaseStereotypeFontName
UsecaseStereotypeFontSize
UsecaseStereotypeFontStyle
WrapWidth



附录:颜色表

在这里插入图片描述



版权声明:本文为u012107143原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。