【问题标题】:Force GraphViz force distance between nodesForce GraphViz 强制节点之间的距离
【发布时间】:2013-01-09 13:55:00
【问题描述】:

我将 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];
    }
}

它给了我类似的东西:

但我想要这样的东西:

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

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

我该怎么做?

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

【问题讨论】:

    标签: vertical-alignment nodes graphviz


    【解决方案1】:

    这将使注释与提交对齐:

    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"; 影响整个子图,我不得不将注释拆分为两个不同的子图。

    结果是:

    【讨论】:

      猜你喜欢
      • 2017-12-19
      • 1970-01-01
      • 2021-03-25
      • 1970-01-01
      • 1970-01-01
      • 2014-04-05
      • 2021-10-27
      • 1970-01-01
      • 2018-10-04
      相关资源
      最近更新 更多