5

我正在尝试使用 Plantuml 组件图构建“硬件架构”图,但我正在为布局而苦苦挣扎。

我的图表变得非常复杂,我注意到 Plantuml 不断从左到右添加帧,使图表水平增长。

例如从这段代码

@startuml

' -----------------------------------------------------
skinparam defaultTextAlignment center
' -----------------------------------------------------
top to bottom direction


frame Pippo as pippo {

frame "Pippo Deploy" {
node "xxx1\nfoo" <<windows 7>>
}

frame "Pippo Core" {

node "===xxx2\nbar" <<amiga>> 
node "===xxx2\nbar" <<amiga>>
node "===xxx3\nbar" <<amiga>>
node "===xxx4\nbar" <<amiga>>
node "===xxx5\nbar" <<amiga>>
node "===xxx6\nbar" <<amiga>>
node "===xxx7\nbar" <<amiga>>

}

frame "Pippo Additional Servers" {

node "===xxx8\nfoo" <<windows 7>> 
node "===xxx9\nfoo" <<windows 7>>
node "===xxx10\nfoo" <<windows 7>>
node "===xxx11\nfoo" <<windows 7>>
node "===xxx12\nfoo" <<windows 7>>
node "===xxx13\nbar" <<amiga>>
}

frame "Pippo other"  {
node "===xxx14\nfoo" <<windows server 2003>>
}

}

frame "Pluto" as pluto {

frame "Pluto 1" {

node "===xxx15\nfoo" <<windows server 2012>>
node "===xxx16\nfoo" <<windows 7>>
node "===xxx17\nbar" <<amiga>>

}

frame "Pluto 2" {

node "===xxx18\nfoo" <<windows server 2003>>
node "===xxx19\nfoo" <<windows 7>>
node "===xxx20\nfoo" <<windows 7>>
}


}

pippo --[hidden]> pluto


@enduml

我得到这张图在此处输入图像描述

我想在“Pippo”框架下放置“Pluto”框架

看到我已经使用了隐藏链接,并top to bottom direction试图强制这种布局,但没有结果。

4

1 回答 1

4

这个怎么样:

替换top to bottom directionleft to right direction评论pippo --[hidden]> pluto让我得到这个:

在此处输入图像描述

完整代码:

@startuml

' -----------------------------------------------------
skinparam defaultTextAlignment center
' -----------------------------------------------------
'top to bottom direction
left to right direction

frame Pippo as pippo {

frame "Pippo Deploy" {
node "xxx1\nfoo" <<windows 7>>
}

frame "Pippo Core" {

node "===xxx2\nbar" <<amiga>> 
node "===xxx2\nbar" <<amiga>>
node "===xxx3\nbar" <<amiga>>
node "===xxx4\nbar" <<amiga>>
node "===xxx5\nbar" <<amiga>>
node "===xxx6\nbar" <<amiga>>
node "===xxx7\nbar" <<amiga>>

}

frame "Pippo Additional Servers" {

node "===xxx8\nfoo" <<windows 7>> 
node "===xxx9\nfoo" <<windows 7>>
node "===xxx10\nfoo" <<windows 7>>
node "===xxx11\nfoo" <<windows 7>>
node "===xxx12\nfoo" <<windows 7>>
node "===xxx13\nbar" <<amiga>>
}

frame "Pippo other"  {
node "===xxx14\nfoo" <<windows server 2003>>
}

}

frame "Pluto" as pluto {

frame "Pluto 1" {

node "===xxx15\nfoo" <<windows server 2012>>
node "===xxx16\nfoo" <<windows 7>>
node "===xxx17\nbar" <<amiga>>

}

frame "Pluto 2" {

node "===xxx18\nfoo" <<windows server 2003>>
node "===xxx19\nfoo" <<windows 7>>
node "===xxx20\nfoo" <<windows 7>>
}


}

'pippo --[hidden]> pluto


@enduml
于 2018-07-26T18:29:36.117 回答