等级属性令我感到困惑 [英] Rank attribute is confusing to me

查看:86
本文介绍了等级属性令我感到困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

边缘的等级属性具有五个值"same","min","source","max","sink". 除了相同"之外,我不知道何时使用其他值.

Rank attribute on edge has five values "same", "min", "source", "max", "sink". Except "same", I have no idea when to use other values.

min
\begin{dotpic}
  rankdir=LR;
  size="7,5";
  node[shape=circle];
  C->A;
  {rank=min;A;B}
  B->D
  A->B;
\end{dotpic}

max
\begin{dotpic}
  rankdir=LR;
  size="7,5";
  node[shape=circle];
  C->A;
  {rank=max;A;B}
  B->D
  A->B;
\end{dotpic}

source
\begin{dotpic}
  rankdir=LR;
  size="7,5";
  node[shape=circle];
  C->A;
  {rank=source;A;B}
  B->D
  A->B;
\end{dotpic}

sink
\begin{dotpic}
  rankdir=LR;
  size="7,5";
  node[shape=circle];
  C->A;
  {rank=sink;A;B}
  B->D
  A->B;
\end{dotpic}

在我的vim环境中进行测试,我可以意识到这些值之间存在一些差异. 但是不知道它们到底是干什么的.

With test on my vim environment, I can realize there is some difference btw these values. But don't know exactly what they are for.

推荐答案

使等级为空或使用rank = same的使用频率更高.这另外四个通常仅在特殊情况下使用.

Leaving the rank empty or using rank=same are used far more often. These other four are usually only used in special circumstances.

单独使用时,min和source具有相同的功能:将所有这些节点置于最小等级(TB图的第一行).它们之间的区别在于,min将允许其他子图处于最低排名.源不会. Source仅允许min或source的其他子图处于最小等级.

When used alone, min and source have the same function: putting all those nodes on the minimum rank (the top row of a TB graph). The difference between them is that min will allow other subgraphs in the minimum rank. Source will not. Source only allows other subgraphs of min or source to be on the minimum rank.

考虑以下图形片段:

{ rank=source; a -> b; }
{ rank=same;   c -> d; }

您最终将获得2行. a-> b将在c-> d之上.

You will end up with 2 rows. a -> b will be above c -> d.

如果将源更改为最小值,则只会得到一行. a-> b将在c-> d的左侧,全部在最小等级中.

If you change source to min, you will only get one row. a -> b will be to left of c -> d, all in the min rank.

{ rank=min;    a -> b; }
{ rank=same;   c -> d; }

最大值和下沉是图形底部的等效项.

Max and sink are the equivalents for the bottom of the graph.

这篇关于等级属性令我感到困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆