具有等级的 graphviz 集群缺少边界

Missing border of graphviz cluster with rank

我们正在尝试将图表图像替换为 graphviz 图表:

当前状态如下图:

digraph pipeline {
    node [shape=record fontname=Helvetica fontsize=10 style=filled color="#4c7aa4" fillcolor="#5b9bd5" fontcolor="white"];
    edge [color="#62a8e7"];
    splines=ortho;
    capture [label="Capture\nDecode"];
    resize [label="Resize\nConvert"];
    detect [label="Detect faces"];
    show [label="Visualize\nDisplay"];
    temp_3 [style=invis shape=point width=0];
    subgraph cluster_tmp {
      graph[style=dashed];
      postproc_1 [label="Crop\nResize\nConvert"];
      postproc_2 [label="Crop\nResize\nConvert"];
      age_gender [label="Classify\nAge/gender"];
      emo [label="Classify\nEmotions"];
      temp_1 [style=invis shape=point width=0];
      temp_2 [style=invis shape=point width=0];
      { rank=same; temp_2 postproc_2 emo }
      label="(for each face)";
    }
    { rank=same; capture resize detect temp_1 postproc_1 age_gender temp_3 show }
    capture -> resize -> detect
    detect -> temp_1 [arrowhead=none]
    temp_1 -> postproc_1 -> age_gender
    temp_1 -> temp_2 [arrowhead=none]
    capture -> temp_2 [arrowhead=none]
    temp_2 -> postproc_2 -> emo
    capture -> postproc_1

    age_gender -> temp_3 [arrowhead=none]
    emo -> temp_3 [arrowhead=none]
    temp_3 -> show

    edge[style=invis];
    postproc_1 -> postproc_2
    age_gender -> emo
}

是否可以按照中间子图具有完整边框的方式对齐节点?

修正了:

digraph pipeline {
  node [shape=record fontname=Helvetica fontsize=10 style=filled color="#4c7aa4" fillcolor="#5b9bd5" fontcolor="white"];
  edge [color="#62a8e7"];
  splines=ortho;

  rankdir = LR;
  subgraph cluster_0 {
    color=invis;
    capture [label="Capture\nDecode"];
    resize [label="Resize\nConvert"];
    detect [label="Detect faces"];
    capture -> resize -> detect
  }

  subgraph cluster_1 {
    graph[style=dashed];

    subgraph cluster_2 {
      color=invis;
      temp_4 [style=invis shape=point width=0];
      postproc_1 [label="Crop\nResize\nConvert"];
      age_gender [label="Classify\nAge/gender"];
      postproc_1 -> age_gender [constraint=true]
      temp_4 -> postproc_1 [constraint=none]
    }

    subgraph cluster_3 {
      color=invis;
      postproc_2 [label="Crop\nResize\nConvert"];
      emo [label="Classify\nEmotions"];
      postproc_2 -> emo [constraint=true]
    }
    label="(for each face)";
  }

  temp_1 [style=invis shape=point width=0];
  temp_2 [style=invis shape=point width=0];
  detect -> temp_1 [arrowhead=none]
  temp_1 -> postproc_1

  capture -> {temp_4, temp_2} [arrowhead=none constraint=false]
  temp_2 -> postproc_2

  temp_1 -> temp_2 [arrowhead=none constraint=false]

  temp_3 [style=invis shape=point width=0];
  show [label="Visualize\nDisplay"];

  {age_gender, emo} -> temp_3 [arrowhead=none]
  temp_3 -> show
}