gpt4 book ai didi

version-control - 如何在graphviz中绘制分支架构图

转载 作者:行者123 更新时间:2023-12-04 16:44:30 25 4
gpt4 key购买 nike

任何有关如何根据附加图像的精神绘制分支架构的提示都值得欢迎。
请注意,我想在graphviz中进行此操作,以进行快速编辑和将来的更改。

最佳答案

This particular diagram was made with inkscape,因此很难将其与graphviz的输出进行匹配。

这是您如何将其中一些与graphviz进行匹配的方法:

  • 为每个分支使用不同的group属性,以获取每个分支的直线(这是另一个example of using group one using weight )
  • 以正确的顺序定义分支,使它们从上到下出现
  • 使用shapestylewidthheight使某些节点脱颖而出,并隐藏其他节点
  • 使用一些\n换行符来使标签位于节点顶部(您也可以尝试使用labelloc="t",或者使用xlabel代替label)

    digraph g{
    rankdir="LR";
    pad=0.5;
    nodesep=0.6;
    ranksep=0.5;
    forcelabels=true;

    node [width=0.12, height=0.12, fixedsize=true,
    shape=circle, style=filled, color="#909090",
    fontcolor="deepskyblue", font="Arial bold", fontsize="14pt" ];
    edge [arrowhead=none, color="#909090", penwidth=3];

    node [group="release3"];
    s3 [label="release 3\n\n", width=0.03, height=0.03, shape=box];
    r30 [label=" R3.0\n\n\n"];
    e3 [label="", width=0.03, height=0.03, shape=box];
    e3f [label="", width=0.03, height=0.03, shape=circle, color="#b0b0b0"];
    s3 -> r30 -> e3;
    e3 -> e3f [color="#b0b0b0", style=dashed];

    node [group="release2"];
    s2 [label="release 2\n\n", width=0.03, height=0.03, shape=box];
    b2 [label="", width=0.03, height=0.03, shape=box];
    r20 [label=" R2.0\n\n\n"];
    e2 [label="", width=0.03, height=0.03, shape=box];
    e2f [label="", width=0.03, height=0.03, shape=circle, color="#b0b0b0"];
    s2 -> b2 -> r20 -> e2;
    e2 -> e2f [color="#b0b0b0", style=dashed];

    node [group="release1"];
    s1 [label="release 1\n\n", width=0.03, height=0.03, shape=box];
    ttest [label=" test\n\n\n"];
    b1 [label="", width=0.03, height=0.03, shape=box];
    r10 [label=" R1.0\n\n\n"];
    r11 [label=" R1.1\n\n\n"];
    e1 [label="", width=0.03, height=0.03, shape=box];
    e1f [label="", width=0.03, height=0.03, shape=circle, color="#b0b0b0"];
    s1 -> ttest -> b1 -> r10 -> r11 -> e1;
    e1 -> e1f [color="#b0b0b0", style=dashed];

    b1 -> s2;
    b2 -> s3;

    }

  • 关于version-control - 如何在graphviz中绘制分支架构图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21716736/

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