Layout for software flow

Hello everybody. I am a rookie willing to draw a simple software flow, but after various attempts, I’m not able to get things lined up and well squared as expected.
What I have is a sequence of “procedural” phases and there should be added red lines for software jumps (see attached picture).
Please give me a hint: I don’t pretend to waste anyone’s time, but a hint would get me out of troubles.

This is a basic list of nodes:
digraph G {
fontname=“Helvetica,Arial,sans-serif”
rankdir=TB
splines=false

node [fontname=“Helvetica,Arial,sans-serif”,fontsize = “16”,shape = “box”]
edge [fontname=“Helvetica,Arial,sans-serif”]

subgraph cluster_fasi { 
  edge [shape=box 
        color=blue]
  
  label="Software Phases" 
        
  fakephase
  fakephase ->fase1

  fase1 -> fase2 -> fase3 -> fase4 -> fase5 -> fase6
            
  fase_record [shape = "record"
  label=<
    <table>
      <tr><td>code jump cases</td></tr>
      <tr><td align="left" bgcolor="white" port="p1" colspan="100%">case 1</td></tr>
      <tr><td align="left" bgcolor="white" port="p2" colspan="100%">case 2</td></tr>
      <tr><td align="left" bgcolor="white" port="p3" colspan="100%">case 3</td></tr>
      <tr><td align="left" bgcolor="white" port="p4" colspan="100%">case 4</td></tr>
    </table>
  >] 
  fase6 -> fase_record
} //subgraph cluster_fasi 

}

Thanks

It is not clear what your issue/problem is.

But note:

  • Some of your double-quotes are not ASCII characters, causing the dot program to get confused
  • According to the documentation, colspan=100% is not legal (Node Shapes | Graphviz), but it is accepted!! Out of curiosity, what are you trying to do, since all rows only have one column?
  • Providing part of an input file, is sub-optimal. Please show the entire input and explain what you are trying to achieve. It seems to do with the missing red edges, but it is not clear what is wrong with the attached result.

Thanks a lot for the quick reply, Steve.

“Some of your double-quotes are not ASCII characters, causing the dot program to get confused”

Ok, it resulted from cut&paste! This is the corrected code:

digraph G {
fontname=“Helvetica,Arial,sans-serif”
rankdir=TB
splines=false

node [fontname=“Helvetica,Arial,sans-serif”,fontsize = “16”,shape = “box”]
edge [fontname=“Helvetica,Arial,sans-serif”]

subgraph cluster_fasi {
edge [shape=box
color=blue]

label=“Software Phases”

fakephase
fakephase ->fase1

fase1 → fase2 → fase3 → fase4 → fase5 → fase6

fase_record [shape = “record”
label=<

code jump cases
case 1
case 2
case 3
case 4
>] fase6 -> fase_record } //subgraph cluster_fasi

}

"According to the documentation, colspan=100% is not legal (Node Shapes | Graphviz), but it is accepted!! Out of curiosity, what are you trying to do, since all rows only have one column?

I was trying to get a list of “case” conditions that would cause the logical software flow to jump to a software phase (red squared line pointing to a box), and using a shape = "record"

with ports seemed to be a good idea, but it’s not mandatory and any different solution will be welcome.

Providing part of an input file, is sub-optimal. Please show the entire input and explain what you are trying to achieve. It seems to do with the missing red edges, but it is not clear what is wrong with the attached result.

I just aimed to focus on the problematic part that I couln’t solve, without including other misleading code from my failed experiments. Basically what I have now is a bare vertical list of nodes (the software’s pocedures). The attached code does it. What I want to do is add the red edges (the ones in the picture were manually added using Photoshop, only for visually describing what result should be achieved). I’ve tried using invisible nodes for squaring the red edges, and also edge “weight” attibute, but no luck. Maybe I should have drawn the red lines in a “hand writing” way, that will not be confused with DOT output :wink: : see attached picture.

The resulting subgraph will be included into a bigger graph of my customer’s company software, which I’m not permitted to disclose. I’m generating DOT source files programmatically, based on a database that describes the algorythms . It’s a documentation tool.

Francesco

Though a seemingly simple request, I find it impossible(?) to do without some serious tweaks (automated post-processing).
[splines=ortho seems the obvious solution, but ortho and ports do not play nicely (e.g spline = ortho produces unexpected output with ports (#1415) · Issues · graphviz / graphviz · GitLab)]

Here is a “pretty close” result, but it is missing arrowheads. When (if) I get arrowheads to work, I will post more.

Hi! The version you proposed is higly acceptable, in my opinion. The lack of arrowheads is of almost no importance. Great thanks!
This was my idea for hacking the red edges: trying to “line up” multiple invisible nodes, ranked at the same level of phase boxes and called “Hack1”, “Hack2” and so on. Maybe edges between them could be drawn, mimicking a continuous edge.
Layout for software flow.gv (2.0 KB)
The attached file is what I got after experiments: maybe it can be useful.
It seems to be on a good way, until I try to draw an edge to the real phase or to the real condition: all things get repositioned from that moment on. I’ve also tried to act on edge weight, but no luck.
Where can I find the code of your solution? What kind of automated post-processing are you proposing?
Have a nice day.
Francesco

Hello Steve. Please post the temporary code you have written, as-is, including the tweaks: maybe I will be able to reproduce them in my software.
Thanks, bye