Arrows messing up flow chart

Hey everyone,

I have a flow chart that has a left-right topology. When I leafe out the arrows leaving from decision diamonds everything looks just the way I want it to look like. But as soon as I add them my output looks crazy. Does anyone have an advice for me? I really appreciate it.

This is the corresponding code for attached image:

digraph uart_flow{
rankdir=LR

node start [style = rounded, shape = rect, label="RX event"]
node handler [style = rounded, shape = rect, label="Call\nhandler"]
node header_done [shape=diamond, label="Header\nreceived?"]
node has_payload [shape=diamond, label="Has\npayload?"]
node payload_done [shape=diamond, label="Payload\nreceived?"]

start:s -> header_done:w
header_done:n -> start:e [label="No"]
header_done:e -> has_payload:w [label="Yes"]
has_payload:e -> payload_done:w [label="Yes"]
has_payload:s -> handler:w [label="No"]
payload_done:n -> start:e [label="No"]
payload_done:s -> handler:w [label="Yes"]

{rankdir=same header_done has_payload payload_done}
{rankdir=max start}
{rankdir=min handler}
}

AttachmentSize
dot_inline_dotgraph_1.png30.13 KB

I'm even more amazed that

I'm even more amazed that your input got through the parser. What version of Graphviz are you using?

In any case, first delete all of the "node" words. That will give you a legal dot file. See if that helps. If not, then make sure you are using a recent version of Graphviz. If you still have problems, please let us know, preferably with a bug report. Thanks.

Hey everyone,   I just

Hey everyone,

 

I just found out that using circles instead of diamond shapes brings me clean results with the attach points of the angles. But to have a nice flowchart I need to juse diamonds here with arrows leaving exactly at the edges of the diamond. Is this issue known?

strange arrows

Hey, I lately installed latest Graphviz, but mistakened when using the dot command. So the old version which was still on HDD was called. Now, this has been fixed and everything looks nicer now, sorry for the mess up. I use Graphvis 2.34.0 now. You can see the flow chart looks quite better now, also I deleted the node statements.

One thing bothers me though, how can I have a straight YES-decision-path? I tried subgraph command but that didn't change a thing.

Thanks for the help.

Greetings from Germany

Stefan

re: straight YES-decision-path

1) you could aid the layout engine by making the YES path consistently :e -> :w   (which is the default in LR graphs).

2) you can add "weight" to edges to indicate that you want them to be straighter than the unweighted egdes.

Try this:

 

digraph uart_flow {
rankdir=LR

start [style = rounded, shape = rect, label="RX event"]
handler [style = rounded, shape = rect, label="Call\nhandler"]
header_done [shape=diamond, label="Header\nreceived?"]
has_payload [shape=diamond, label="Has\npayload?"]
payload_done [shape=diamond, label="Payload\nreceived?"]

{ edge [weight=100]
start -> header_done
{ edge [label="Yes"]
header_done -> has_payload
has_payload -> payload_done
payload_done -> handler
}
}
{ edge [label="No"]
header_done:s -> start:s
has_payload:s -> handler:s
payload_done:n -> start:n
}
}

re: straight YES-decision-path

So you did advice #2 then, right?
Also you left out the superfluous east and west anchor points.

Actually this gives me a really nice result, where the arrows curve is a little too natural to me, but that's not a big deal.

Thanks so much for the help!

Keep it up.
Greetings from Germany
Stefan

 

Recent comments