带有graphviz的优先图方法

问题描述 投票:0回答:0

我想用graphviz画一个优先级图

这是我有问题的代码,应该在优先级图中显示一个节点:

digraph D {
    node [shape=record]
    8 [ label = <
    <table border="1" bgcolor="white" color="black">
       <tr>
         <td colspan="1">Nr</td>
         <td colspan="2">Name</td>
       </tr>
       <tr>
         <td colspan="1">D</td>
         <td colspan="1">GP</td>
         <td colspan="1">FP</td>
      </tr>
    </table>
  > ]
}

它应该看起来像在这个网站上看到的:https://t2informatik.de/wissen-kompakt/netzplan/

这只是为了获得更多上下文以了解我要存档的内容:

digraph D {
    node [shape=record]
    1 [label="{1 | Planung} | {1 | 0 | 0 }"];
    2 [label="{1 | Vorbereitung} | {1 | 0 | 0 }"];
    3 [label="{1 | Geräte kaufen} | {1 | 0 | 0 }"];
    4 [label="{1 | Geräte bestellen} | {1 | 0 | 0 }"];
    5 [label="{1 | Geräte aufbauen} | {1 | 0 | 0 }"];
    6 [label="{1 | Geräte prüfen} | {1 | 0 | 0 }"];
    7 [label="{1 | Abnahme durch Kunden} | {1 | 0 | 0 }"];
    8 [ label = <
    <table border="1" bgcolor="white" color="black">
       <tr>
         <td colspan="1">Nr</td>
         <td colspan="2">Name</td>
       </tr>
       <tr>
         <td colspan="1">D</td>
         <td colspan="1">GP</td>
         <td colspan="1">FP</td>
      </tr>
    </table>
  > ]
    rankdir=LR;
1 -> 2;
2 -> {3,4};
3 -> 6;
4 -> {5,7};
5 -> 6;
6 -> 7;
}

欢迎任何帮助。也许类似 HTML 的表格不是可行的方法。如果有更好的方法,请随时告诉我。 (我想知道优先级图不能开箱即用,或者我确实错过了那个选项)

graphviz dot
© www.soinside.com 2019 - 2024. All rights reserved.