强制子图与 newrank=true 对齐

Forcing subgraphs to align with newrank=true

这是我的图表:

是否可以将“User-facing 选项”子图向下移动,以便“User-facing 内容”位于该子图和“内部标签”子图之上?我尝试使用 中描述的技术强制 topicroletag 对齐,但出于某种原因,它真的很想将另一个节点放入其中子图 tag 节点之上,而不是在它之下。

我看到你也可以乱用 weight 参数来调整输出,就像 中那样,但这只会让行越来越短。

我想要的输出是像这样移动左边的子图:

当前源代码:

digraph G {
  compound=true;
  newrank=true;

  subgraph cluster_userFacing {
    label="User-facing options";
    labelloc="bottom";
    role [label="User Role\n(User Classification)"];
    topic [label="Topic\n(External Tag)"];
  }

  subgraph cluster_content {
    label="User-facing Content";
    article [label="Article"];
    podcastEpisode [label="Podcast Episode"];
  }
  
  subgraph cluster_internal {
    label="Internal tags";
    labelloc="bottom";
    tag [label="Tag\n(Internal Tag)"];
    tagCategory [label="Tag Category"];
    tag -> tagCategory;
  }

  role -> tag [dir="none"];
  topic -> tag [dir="none"];

  article -> tag;
  podcastEpisode -> tag;
  
  { rank="min"; podcastEpisode; article; }
  
  { rank="same"; topic; tag; }
}

将两个星团封闭在一个新的不可见 (peripheries=0) 星团中。 设置 constraint=false 以覆盖排名。并添加了一条不可见的边缘。

digraph G {

  node [height=.78]  // make all nodes same height
  subgraph clusterGroup{
    peripheries=0
  subgraph cluster_userFacing {
    peripheries=1
    label="User-facing options";
    labelloc="bottom";
    role [label="User Role\n(User Classification)" ]
    topic [label="Topic\n(External Tag)"];
  }
  subgraph cluster_internal {
    peripheries=1
    label="Internal tags";
    labelloc="bottom";
    tag [label="Tag\n(Internal Tag)" group=G];
    tagCategory [label="Tag Category"]; 
    tag -> tagCategory;
  }
 }

  subgraph cluster_content {
    label="User-facing Content";
    article [label="Article" ]
    podcastEpisode [label="Podcast Episode" group=G];
  }
  role  -> tag  [dir="none" constraint=false];
  topic -> tag  [dir="none" constraint=false];
  article -> tag  
  podcastEpisode -> tag;

  role -> topic [style=invis]
}

给予: