Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Graphviz 水平子图及其节点垂直对齐_Graphviz - Fatal编程技术网

Graphviz 水平子图及其节点垂直对齐

Graphviz 水平子图及其节点垂直对齐,graphviz,Graphviz,我在水平组织子图和垂直组织子图中的节点时遇到问题。所有这些(子图和节点)仅在一条线上(水平或垂直) 我还尝试了{rank=same;N1;N3;…;}。这将从子图中删除节点 您可以使用类似的方法: digraph G { rankdir = LR; subgraph cluster_0 { {rank=same N1 N2} label = "Title 1"; N1 -> N2; } subgraph cluster_1 { {rank=s

我在水平组织子图和垂直组织子图中的节点时遇到问题。所有这些(子图和节点)仅在一条线上(水平或垂直)


我还尝试了
{rank=same;N1;N3;…;}
。这将从子图中删除节点

您可以使用类似的方法:

digraph G {
  rankdir = LR;
  subgraph cluster_0 {
    {rank=same N1 N2}
    label = "Title 1";
    N1 -> N2;
  }
  subgraph cluster_1 {
    {rank=same N3 N4 N5}
    label = "Title 2";
    N3 -> N4 -> N5;
  }
  subgraph cluster_2 {
    node [style=filled];
    label = "Title 3";
    N6;
  }

  N2 -> N3;
  N5 -> N6;
  N1 [label = "BA_A", fillcolor="green", shape="Msquare"]
  N2 [label = "W2", fillcolor="green", shape="octagon"]
  N3 [label = "BA_A", fillcolor="green", shape="Msquare"]
  N4 [label = "W2", fillcolor="green", shape="octagon"]
  N5 [label = "W2_ERROR", fillcolor="red", shape="octagon"]
  N6 [label = "W3", fillcolor="green", shape="invtriangle"]
}

在你的情况下,我更喜欢顶部而不是底部的布局

digraph G {
  rankdir = TB;
  node [style=filled];
  subgraph cluster_0 {
    N1 N2
    label = "Title 1";
    edge [dir = back]
    N2 -> N1;
  }
  subgraph cluster_1 {
    N3 N4 N5
    label = "Title 2";
    edge [dir = back]
    N5 -> N4 -> N3;
  }
  subgraph cluster_2 {
    label = "Title 3";
    N6
  }
  N2 -> N3 [constraint=none];
  N5 -> N6 [constraint=none];
  N1 [label = "BA_A", fillcolor="green", shape="Msquare"]
  N2 [label = "W2", fillcolor="green", shape="octagon"]
  N3 [label = "BA_A", fillcolor="green", shape="Msquare"]
  N4 [label = "W2", fillcolor="green", shape="octagon"]
  N5 [label = "W2_ERROR", fillcolor="red", shape="octagon"]
  N6 [label = "W3", fillcolor="green", shape="invtriangle"]
}

谢谢!你知道我怎样才能把所有的子图都放到最上面吗?子图之间的边将具有曲线连接,而不是直接连接
digraph G {
  rankdir = TB;
  node [style=filled];
  subgraph cluster_0 {
    N1 N2
    label = "Title 1";
    edge [dir = back]
    N2 -> N1;
  }
  subgraph cluster_1 {
    N3 N4 N5
    label = "Title 2";
    edge [dir = back]
    N5 -> N4 -> N3;
  }
  subgraph cluster_2 {
    label = "Title 3";
    N6
  }
  N2 -> N3 [constraint=none];
  N5 -> N6 [constraint=none];
  N1 [label = "BA_A", fillcolor="green", shape="Msquare"]
  N2 [label = "W2", fillcolor="green", shape="octagon"]
  N3 [label = "BA_A", fillcolor="green", shape="Msquare"]
  N4 [label = "W2", fillcolor="green", shape="octagon"]
  N5 [label = "W2_ERROR", fillcolor="red", shape="octagon"]
  N6 [label = "W3", fillcolor="green", shape="invtriangle"]
}