gpt4 book ai didi

vertical-alignment - Force GraphViz 强制节点之间的距离

转载 作者:行者123 更新时间:2023-12-04 07:53:22 24 4
gpt4 key购买 nike

我将 GraphViz 与以下点文件一起使用:

digraph G
{
rankdir=LR;
subgraph commits
{
"5c071a6b2c" -> "968bda3251" -> "9754d40473" -> "9e59700d33" -> "2a3242efa4";
}
subgraph annotations
{
"V1.0" [shape=box];
"br/HEAD" [shape=box];
"V1.0" -> "9e59700d33" [weight=0];
"br/HEAD" -> "2a3242efa4" [weight=0];
}
}

它给了我类似的东西: Bag thing

但我想要这样的东西:

                                        V1.0         br/HEAD
| |
\/ \/

5c071a6b2c -> 968bda3251 -> 9754d40473 -> 9e59700d33 -> 2a3242efa4

我该怎么做?

为了您的帮助,提前致谢。

最佳答案

这将使注释与提交对齐:

digraph G
{
rankdir=LR;
subgraph commits
{
"5c071a6b2c" -> "968bda3251" -> "9754d40473" -> "9e59700d33" -> "2a3242efa4";
}
subgraph annotations1
{
rank="same";
"V1.0" [shape=box];
"V1.0" -> "9e59700d33" [weight=0];
}
subgraph annotations2
{
rank="same";
"br/HEAD" [shape=box];
"br/HEAD" -> "2a3242efa4" [weight=0];
}
}

由于 rank="same"; 影响整个子图,我不得不将注释拆分为两个不同的子图。

结果是: Result

关于vertical-alignment - Force GraphViz 强制节点之间的距离,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14236804/

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