graphviz-如何创建“往返"流程 [英] graphviz - how to create a 'roundtrip' flow

查看:96
本文介绍了graphviz-如何创建“往返"流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用graphviz创建一个往返"图.鉴于下面的结果,我的目标是在NET和COM之间有一个PINK方块(从下图中注意,它们在NET之后被推到右侧).

I'm trying to create a 'round trip' graph using the graphviz. Given the result below, my objective is to have the PINK squares between the NET and the COM (note from the picture below that they are pushed to the right after the NET).

  • COM必须是LEFT上的第一个节点.

点号:

digraph { 
rankdir = LR;
graph [fontname = "helvetica" ];
node [fontname = "helvetica"];
edge [fontname = "helvetica"];

COM [shape = circle, fillcolor = yellow, style = filled];
NET [shape = circle, fillcolor = yellow, style = filled];

fn1 [shape = BOX, fillcolor = green, style = filled, label = "PORT006"];
clazz1 [shape = BOX, fillcolor = red, style = filled, label = "O"];
ddate1 [shape = BOX, fillcolor = red, style = filled, label = "21-Apr-13"];
status1 [shape = BOX, fillcolor = red, style = filled, label = "OJ3COM6M"];

clazz1exch [shape = BOX, fillcolor = green, style = filled, label = "G"];
ddate1exch [shape = BOX, fillcolor = green, style = filled, label = "13-May-13"];   
status1exch [shape = BOX, fillcolor = green, style = filled, label = "GJ3COM6M"];

fn2 [shape = BOX, fillcolor = pink, style = filled, label = "PORT005"];
rbd2 [shape = BOX, fillcolor = pink, style = filled, label = "O"];
ddate2 [shape = BOX, fillcolor = pink, style = filled, label = "29-Apr-13"];
fare2 [shape = BOX, fillcolor = pink, style = filled, label = "OJ3COM6M"];

{ rank=same; clazz1 -> clazz1exch; }
{ rank= same; ddate1 -> ddate1exch; }
{ rank=same; status1 -> status1exch; }

 COM -> fn1 -> clazz1exch -> ddate1exch -> status1exch -> NET;
 NET -> fn2 -> rbd2 -> ddate2 -> fare2 -> COM;

 }

推荐答案

如果您只是通过更改直线来反转边缘的方向(dir=back)

If you simply reverse the direction of the edges going back (dir=back) by changing the line

NET -> fn2 -> rbd2 -> ddate2 -> fare2 -> COM;

进入

edge[dir=back];
COM -> fare2 -> ddate2 -> rbd2 -> fn2 -> NET;

您应该得到:

这篇关于graphviz-如何创建“往返"流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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