C4-Model 布局

本文章描述基于 C4-Model + PlantUML + VSCode 开发设计软件架构,相关环境搭建参看:C4-Model 开发环境搭建

1. Rel_

在这里插入图片描述

函数名
Rel_($e_index, $alias1, $alias2, $label, $direction): C4_Dynamic
Rel_($e_index, $alias1, $alias2, $label, $techn, $direction):C4_Dynamic
Rel_($alias1, $alias2, $label, $direction):C4
Rel_($alias1, $alias2, $label, $techn, $direction):C4
参数
e_index用于设置链接的序号
alias1(必须)链接的起始节点
alias2(必须)链接的目标节点
label为链接增加标签
techn为链接增加一个技术栈如:[C/C++]
direction为链接增加一个方向
"-U->>"
"-D->>"
"-L->>"
"-R->>"
link增加一个链接,实现点击跳转的功能

2. (Bi)Rel(Index)_ (Back)_(Neighbor)

在这里插入图片描述

Bi.*函数名中包含Bi为双向链接,否则为单向链接
.*RelIndex.*函数名中包含Index则第一个参数为索引设置,可以通过这个参数设置序号
.*Rel.*Back.*函数中包含Back则链接为逆向链接
.*Rel.*Neighbor函数中包含Neighbor则链接为水平链接,两个节点在一条水平线上,默认左右关系
函数名
Rel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
BiRel($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_Back($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
RelIndex($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
RelIndex_Back($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_Back_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
BiRel_Neighbor($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
RelIndex_Neighbor($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
RelIndex_Back_Neighbor($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
参数
e_index当函数名中包含Index,此参数为必须参数,通过这个参数可以自定义序号
from(必须)链接节点的起始节点
to链接节点的目标节点
label为链接增加一个标签
techn为链接增加一个技术栈如:[C/C++]
descr为链接增加一个描述
sprite为链接设置一个自定义的样式
tags为链接设置一个自定义的标签
link增加一个链接,实现点击跳转的功能

3. (Bi)Rel(Index)_(Back) _方向

在这里插入图片描述

Bi.*函数名中包含Bi为双向链接,否则为单向链接
.*RelIndex.*函数名中包含Index则第一个参数为索引设置,可以通过这个参数设置序号
.*Rel.*Back.*函数中包含Back则链接为逆向链接
方向
D / Down ⬇️
U / Up ⬆️
L / Left ⬅️
R / Right ➡️
函数名
Rel_D / Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
RelIndex_D / Down($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
BiRel_D / Down($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_U / Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
RelIndex_U / Up($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
BiRel_U / Up($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_L / Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
RelIndex_L / Left($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
BiRel_L / Left($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
Rel_R / Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
RelIndex_R / Right($e_index, $from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
BiRel_R / Right($from, $to, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
参数参见 :(Bi)Rel(Index)_ (Back)_(Neighbor)

4. Lay_**

在这里插入图片描述

函数名
Lay_D / Down($from, $to)
Lay_U / Up($from, $to)
Lay_L / Left($from, $to)
Lay_R / Right($from, $to)
参数
from两个节点位置的起始节点
to两个节点位置的目标节点

5. Lay_Distance

在这里插入图片描述
由于PlantUML Bug,这个方法无法设置方向,如果要设置方向需要使用 Lay_… 方法

函数名
Lay_Distance($from, $to, $distance="0")
参数
from两个节点位置的起始节点
to两个节点位置的目标节点
distance设置两个节点间的距离

6. LAYOUT_LEFT_RIGHT

左右布局
在这里插入图片描述


7. LAYOUT_TOP_DOWN

上下布局,上下布局为默认布局
在这里插入图片描述


8. LAYOUT_LANDSCAPE

自由布局
在这里插入图片描述


9. LAYOUT_WITH_LEGEND

显示所有图例
在这里插入图片描述


10. SHOW_LEGEND

显示用到的图例,
SHOW_LEGEND(true) : 显示图例,隐藏标签
在这里插入图片描述


SHOW_LEGEND(false) : 显示图例,显示标签
在这里插入图片描述


11. SHOW_FLOATING_LEGEND

在制定位置显示图例
在person后,container前显示图例
在这里插入图片描述


12. LAYOUT_AS_SKETCH

手绘风格
在这里插入图片描述


13. HIDE_STEREOTYPE

隐藏标签
在这里插入图片描述


14. HIDE_PERSON_SPRITE

隐藏成员的图标,不隐藏其他节点的图标
在这里插入图片描述


15. SHOW_PERSON_SPRITE

显示成员的图标
第一个成员隐藏图标,第二个成员显示图标
在这里插入图片描述


16. SHOW_PERSON_PORTRAIT

调用SHOW_PERSON_PORTRAIT后成员节点不显示背景色
在这里插入图片描述


17. SHOW_PERSON_OUTLINE

将属性显示在图标内
在这里插入图片描述

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值