【问题标题】:Missing border of graphviz cluster with rank带有等级的graphviz集群缺少边界
【发布时间】:2020-03-31 12:55:42
【问题描述】:

我们正在尝试将图表图像替换为 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
}

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

【问题讨论】:

    标签: border cluster-computing graphviz rank subgraph


    【解决方案1】:

    修正:

    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
    }
    

    【讨论】:

      猜你喜欢
      • 2011-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-25
      相关资源
      最近更新 更多