gpt4 book ai didi

plantuml - PlantUML 图的缩放部分

转载 作者:行者123 更新时间:2023-12-04 15:40:10 25 4
gpt4 key购买 nike

缩放由 scale 关键字控制。我很好奇是否有可能以某种方式或至少缩放 PlantUML 图的部分:缩放部分图的字体大小。

scale 似乎不能局限于图表的一部分(而且我还没有找到任何表明这是可能的示例)。可以想象它可能以下列方式使用,但这个例子缩放了整个图像:

@startuml

package "Some Group" {
scale 0.5
HTTP - [First Component]
[Another Component]
}

node "Other Groups" {
FTP - [Second Component]
[First Component] --> FTP
}

@enduml

最佳答案

我认为目前没有办法实现它。来自 the source code PlantUML scale 命令:

protected CommandExecutionResult executeArg(AbstractPSystem diagram, LineLocation location, RegexResult arg) {
double scale = Double.parseDouble(arg.get("SCALE", 0));
if (scale == 0) {
return CommandExecutionResult.error("Scale cannot be zero");
}
if (arg.get("DIV", 0) != null) {
final double div = Double.parseDouble(arg.get("DIV", 0));
if (div == 0) {
return CommandExecutionResult.error("Scale cannot be zero");
}
scale /= div;
}
diagram.setScale(new ScaleSimple(scale));
return CommandExecutionResult.ok();
}

没有使用scale的位置,PlantUML只是通过diagram.setScale(new ScaleSimple(scale))设置图的scale >.

您可以通过以下方式验证此类操作:

@startuml

package "Some Group" {
scale 0.5
HTTP - [First Component]
[Another Component]
}

node "Other Groups" {
scale 5
FTP - [Second Component]
[First Component] --> FTP
}

@enduml

scale 0.5scale 5 命令覆盖。

关于plantuml - PlantUML 图的缩放部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58088748/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com