如何实现graphviz点的严格反向排名? [英] How can I achieve strict reverse ranking of graphviz dot?

查看:110
本文介绍了如何实现graphviz点的严格反向排名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:如果发布了新问题以取代此问题. 在Graphviz中对齐排名

Edit: If posted a new question to supersede this question. Align Ranks in Graphviz

首先,让我为发明/滥用标题中的某些术语表示歉意. 严格"是指相同等级的所有节点在输出图像中都需要相同的y位置,而默认情况下它们会稍微移位.第二,反向"是指所有叶子的等级相同,出现在图的底部同一行,其所有祖先都进行了排名和对齐(不反转边缘方向).我正在使用的图是有界半格,因此没有循环部分,并且所有节点都具有明确定义的等级.

First, let me apologize for inventing/abusing some terminology in the title. By "strict" I mean all nodes of the same rank need the same y position in the output image, whereas by default they are shifted around slightly. Second, by "reverse" I mean all the leafs are the same rank, appearing at the same row at the bottom of the graph, and all of their ancestors to be ranked and aligned accordingly (without reversing the edge directions). The graphs I'm working with are bounded semilattices, so there's no cyclical portions and all nodes have a well defined rank.

我尝试反转边缘方向("dir = back"可以使边缘看起来像原始方向一样),但是严格"部分仍然是一个问题

I tried reversing the edge direction (and "dir=back" can make the edges look like the original direction), but the "strict" part is still a problem

推荐答案

我最终更改了生成graphviz的算法,以在输出中放置多个{ rank = same; ... }

I ended up changing the algorithm that generates the graphviz to place several { rank = same; ... } items in the output

这篇关于如何实现graphviz点的严格反向排名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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