3

Question: I am struggling to split the arrows in the flow chart. I have tried looking at similar code but cannot seem to reproduce it. How can I get the ideal output?

Relevant Research:

MWE:

\begin{document}


\begin{center}

    % Define block styles
    \tikzstyle{decision} = [diamond, draw, fill=blue!20, 
        text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
    \tikzstyle{block} = [rectangle, draw, fill=blue!20, 
        text width=4.5cm, text badly centered, rounded corners, minimum height=4em, minimum width=5cm]
    \tikzstyle{line} = [draw, -latex']
    % \tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm, minimum height=2em]



    \begin{tikzpicture}[node distance = 2.5cm, auto]
    % Place nodes
    \node [block, below of=dav] (install)           {Install fan, heat sink, thermal dough and 4 jumpers on the board};
    \node [block, below of=install] (voltage)       {Complete Voltage Testing};
    \node [block, below of=voltage] (recordvalue)   {Record serial number Voltage Testing is a pass or fail to spreadsheet};
    \node [block, below left  of=recordvalue, node distance=6.5cm] (flashTX) {Flash as Tx};
    \node [block, below right of=recordvalue, node distance=6.5cm] (flashRX) {Flash as Rx};
    \node [block, below of=flashTX] (testflashTX)   {Test Tx with \textit{Golden Rx}};
    \node [block, below of=flashRX] (testflashRX)   {Test Rx with \textit{Golden Tx}};     
    
    \node [decision, below of=recordvalue, node distance=10cm] (passfail)   {Pass/Fail}; 
    

    % Draw edges
    \path [line] (dav) -- (install);
    \path [line] (install) -- (voltage);
    \path [line] (voltage) -- (recordvalue);
    \path [line] (recordvalue) |- (flashTX);
    \path [line] (recordvalue) |- (flashRX);


    \path [line] (flashTX) -- (testflashTX);
    \path [line] (flashRX) -- (testflashRX);
      

\end{document}

Current Output:

enter image description here

Ideal Output:

enter image description here

3
  • Please, make your code fragment complete and compilabe! Undefined shape dav , missed libraries, etc.
    – Zarko
    Commented Nov 24, 2020 at 6:41
  • Also shoved image are not produced with your code ... missed are some blocks ...
    – Zarko
    Commented Nov 24, 2020 at 6:55
  • 1
    Thank you for showing your research in the question, also well-formatted. +1
    – Alenanno
    Commented Nov 24, 2020 at 15:58

1 Answer 1

2

Edit: In diagram are added new nodes as you require in edited question.

In MWE (Minimal Working Example) below are in comparison to your code fragment done the changes:

  • nodes are organised in three chains (using TikZ library chains) where is for positioning of nodes used positioning library and its syntax (by this distances between nodes are equal in determined by node distance = <below> and <right>)
  • nodes in chains are linked by arrows drawn by instruction join defined in the chains package
  • connections between nodes are discontinued in four places by use of code suspend join
  • connections between nodes, which are not considered in join, are drawn separately
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta,
                chains,
                positioning,
                shapes.geometric}

\begin{document}
    \begin{tikzpicture}
\makeatletter
\tikzset{
  node distance = 4mm and 2mm,
    start chain = A going below,
     arr/.style = {-Stealth},
    base/.style = {draw, fill=blue!30, font=\small,
                   text width=42mm, minimum height=8mm,
                   align=center},
   block/.style = {base, rounded corners},
decision/.style = {base, diamond,  aspect=1.6, 
                   text width=21mm, inner xsep=0pt},
suspend join/.code={\def\tikz@after@path{}}
        }
\makeatother
% Place nodes
% main branch
    \begin{scope}[nodes={block, on chain=A, join=by arr}]
\node   {Get Dante AV board from batch};            % name: A-1
\node   {Install fan, heat sink, 
         thermal dough and 4 jumpers on the board};  
\node   {Complete Voltage Testing};
\node   {Record serial number Voltage Testing 
         is a pass or fail to spreadsheet};         % name: A-4
    \end{scope}
\coordinate[below=of A-4] (aux1);
    \begin{scope}[nodes={block, on chain=A, join=by arr}]
% first left branch
% here had to be discontinued "join" instruction from main branch
\node [suspend join,                         % name: A-5
       below  left=of aux1 -| A-4.west] {Flash as Tx};
\node                                   {Test Tx with \textit{Golden Rx}};
% first right branch
% here had to be discontinued "join" instruction from main branch again
\node [suspend join,                         % name; A-7
       below right=of aux1 -| A-4.east] {Flash as Rx};
\node                                   {Test Rx with \textit{Golden Tx}};
    \end{scope}
% decision
\coordinate[below=of A-6.south -| aux1] (aux2);   
\node [decision, below=of aux2] (decision)      {Pass/Fail};
% end branches
    \begin{scope}[nodes={block, on chain=A, join=by arr}]
% left end branch
% here had to be discontinued "join" instruction from main branch again
\node [suspend join,                          
       below=of decision -| A-6]    {Flash P};  % name A-9
\node                               {Test T};
\node                               {Record};
% right end branch
% here had to be discontinued "join" instruction from left end branch
\node [suspend join,                          
       below=of decision -| A-8]    {Flash F};  % name A-12
\node                               {Test T};
    \end{scope}
% Draw edges which are not considered in join
% left
\draw[arr]  (A-4) -- (aux1) -| (A-5);
\draw[arr]  (A-6) |- (aux2) -- (decision);
\draw[arr]  (decision) -| (A-9)     node[pos=0.25,above] {Pass};
% right
\draw[arr]  (aux1) -| (A-7);
\draw       (A-8) |- (aux2);
\draw[arr]  (decision) -| (A-12)    node[pos=0.25,above] {Fail};
    \end{tikzpicture}
\end{document}

produce:

enter image description here

Is this what you after?

2
  • thank you so much, I was pretty naïve to guess I could continue on by myself after this point, but I really struggled to complete what I had in mind. I've put the final flow chart in the question -...
    – 3kstc
    Commented Nov 25, 2020 at 5:51
  • 1
    @3kstc, all what you need is to form new end branches in scope to which you add new nodes. See edited answer.
    – Zarko
    Commented Nov 25, 2020 at 7:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .