9

I'm trying to draw a diagram, as depicted in the picture below,

enter image description here

May I know, how can I draw multiple arrows branching out nicely from a node to many different nodes as shown above? The arrows I've drawn will directly point towards the box hence, cutting through some of the nodes. How can I make them bend 90 degrees before connecting to the left side of each node.

MWE:

\documentclass[11pt,a4paper]{article}
\usepackage{tikz}
\usepackage{varwidth}
\usetikzlibrary{shapes.geometric, arrows}
\begin{document}
    \begin{tikzpicture}[node distance=2cm]

    \tikzstyle{Goal} = [rectangle, rounded corners, minimum width=3cm, minimum height=3cm,text centered, draw=black, fill=white]

    \tikzstyle{Inventory Analysis} = [rectangle, rounded corners, minimum width=3cm, minimum height=3cm,text centered, draw=black, fill=white]

    \tikzstyle{Impact Assessment} = [rectangle, rounded corners, minimum width=3cm, minimum height=3cm,text centered, draw=black, fill=white]

    \tikzstyle{Interpretation} = [rectangle, rounded corners, minimum width=3cm, minimum height=3cm,text centered, draw=black, fill=white]

    \tikzstyle{inputs} = [rectangle, rounded corners, minimum width=8cm, minimum height=1cm,text centered, draw=black, fill=white]

    \tikzstyle{arrow} = [thick,->,>=stealth]

    \node (goal) [Goal,align=center] {\begin{varwidth}{5em}Goal \& Scope Definition\end{varwidth}};

    \node (Inventory) [Inventory Analysis, below of=goal, yshift=-4cm, align=center] {\begin{varwidth}{5em}Inventory Analysis\end{varwidth}};

    \node (Impact Assessment) [Impact Assessment, below of=Inventory, yshift=-4cm,align=center] {\begin{varwidth}{5em}Impact\\Assessment\end{varwidth}};

    \node (Interpretation) [Interpretation, below of=Impact Assessment,yshift=-2cm,align=center] {\begin{varwidth}{5em}Interpretation\end{varwidth}};

    \node (inputs) [inputs, right of=goal, xshift=5cm, yshift=2cm] {System Boundary - Cradle-to-grave};

    \node (inputs1) [inputs, below of=inputs, yshift=0.7cm] {Functional Unit - 1$m^2$ Gross Floor Area};

    \node (inputs2) [inputs,below of= inputs1, yshift=0.7cm] {Building Lifespan - 50 years};

    \node (inputs3) [inputs,below of= inputs2, yshift=0.7cm] {Building materials data};

    \node (inputs4) [inputs,below of= inputs3, yshift=0.7cm] {Transportation data};

    \node (inputs5) [inputs,below of= inputs4, yshift=0.7cm] {Construction data};

    \node (inputs6) [inputs,below of= inputs5, yshift=0.7cm] {Operational data};

    \node (inputs7) [inputs,below of= inputs6, yshift=0.7cm] {Maintenance data};

    \node (inputs8) [inputs,below of= inputs7, yshift=0.7cm] {End-of-life data};
    \node (inputs9) [inputs,below of= inputs8, yshift=-1.2cm] {CML2 Baseline 2000 for midpoint indicator};
    \node (inputs10) [inputs,below of= inputs9, yshift=-1.1cm] {\begin{varwidth}{20em}Sensitivity analysis for transportation distance and data quality\end{varwidth}};
    \node (inputs11) [inputs,below of= inputs10, yshift=0.7cm] {\begin{varwidth}{20em}Data validation by comparing results with literatures and local industry practice recommendations\end{varwidth}};
    \node (inputs11) [inputs,below of= inputs11, yshift=0.7cm] {\begin{varwidth}{20em}Recommendations and conclusions\end{varwidth}};

    \draw [arrow] (goal) -- (Inventory);
    \draw [arrow] (goal) -- (inputs);
    \draw [arrow] (goal) -- (inputs1);
    \draw [arrow] (goal) -- (inputs2);
    \draw [arrow] (Inventory) -- (inputs3);
    \draw [arrow] (Inventory) -- (inputs4);
    \draw [arrow] (Inventory) -- (Impact Assessment);
    \draw [arrow] (Impact Assessment) -- (Interpretation);
    \end{tikzpicture}
\end{document}
4
  • could you add a compilable MWE? The one you have here is incomplete IMO. Aug 8, 2018 at 7:40
  • 1
    Hi Raaja, thanks for the comment. Is it complete now ? Aug 8, 2018 at 7:43
  • I just edited your MWE to a compilable form. If you think it is not the one you have in mind, please feel free to roll-back. Aug 8, 2018 at 7:47
  • \draw [arrow] (goal.east) --++(0:5mm)|- (inputs2);
    – Ignasi
    Aug 8, 2018 at 8:00

2 Answers 2

8

Like this?

enter image description here

The main question was how to make multiple joins to other nodes from a single point. The syntax used was:

    \draw [arrow] (goal.east) --++(0:5mm)|- (inputs);

This means, draw a 5mm long horizontal line from goal.east to the right and from this point start a vertical+horizontal path to inputs center stopping at inputs border.

Some other changes applied to the original code:

  • replaced use of varwidth package by text width option.
  • replaced tikzstyle by tikzset: see Should \tikzset or \tikzstyle be used to define TikZ styles?
  • replaced old right of syntax by new right = of from positioning library
  • build the figure from right to left. Right nodes have been placed before left ones to simplify alignment.

The complete code is:

\documentclass[11pt,a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{positioning, arrows}

\begin{document}
    \begin{tikzpicture}[node distance=3mm,
    Goal/.style={
        rectangle, rounded corners, minimum width=3cm, 
        minimum height=3cm, text width=2.5cm, 
        align=center, draw=black,   fill=white
    },
    inputs/.style={
        rectangle, rounded corners, minimum width=8cm, 
        minimum height=1cm, text width=7.5cm,
        align=center, draw=black, fill=white
    },
    arrow/.style={thick,->,>=stealth}
]

    \node (inputs) [inputs] {System Boundary - Cradle-to-grave};

    \node (inputs1) [inputs, below = of inputs] {Functional Unit - 1$m^2$ Gross Floor Area};

    \node (inputs2) [inputs, below = of inputs1] {Building Lifespan - 50 years};

    \node (inputs3) [inputs, below = 1cm of inputs2] {Building materials data};

    \node (inputs4) [inputs, below = of inputs3] {Transportation data};

    \node (inputs5) [inputs, below = of inputs4] {Construction data};

    \node (inputs6) [inputs, below = of inputs5] {Operational data};

    \node (inputs7) [inputs, below = of inputs6] {Maintenance data};

    \node (inputs8) [inputs, below = of inputs7] {End-of-life data};

    \node (inputs9) [inputs, below = 1cm of inputs8] {CML2 Baseline 2000 for midpoint indicator};

    \node (inputs10) [inputs, below = 1cm of inputs9] {Sensitivity analysis for transportation distance and data quality};

    \node (inputs11) [inputs, below = of inputs10] {Data validation by comparing results with literatures and local industry practice recommendations};

    \node (inputs12) [inputs, below = of inputs11] {Recommendations and conclusions};

    \node (goal) [Goal, left=1cm of inputs1] {Goal \& Scope Definition};
%
    \path (inputs5.west)-- coordinate (aux) (inputs6.west);
   \node (Inventory) [Goal, left = 1cm of aux] {Inventory Analysis};

    \node (Impact Assessment) [Goal, left=1cm of inputs9] {Impact\\Assessment};

    \node (Interpretation) [Goal, left=1cm of inputs11] {Interpretation};

    \draw [arrow] (goal) -- (Inventory);
    \draw [arrow] (Inventory) -- (Impact Assessment);
    \draw [arrow] (Impact Assessment) -- (Interpretation);

    \draw [arrow] (goal.east) --++(0:5mm)|- (inputs);
    \draw [arrow] (goal.east) --++(0:5mm)|- (inputs1);
    \draw [arrow] (goal.east) --++(0:5mm)|- (inputs2);

    \foreach \i in {3,...,8}
        \draw [arrow] (Inventory.east) --++(0:5mm)|- (inputs\i);

    \draw [arrow] (Impact Assessment.east) --++(0:5mm)|- (inputs9);

    \foreach \i in {10,11,12}
        \draw [arrow] (Interpretation.east) --++(0:5mm)|- (inputs\i);

    \end{tikzpicture}
\end{document}
1
  • Thanks so much for the explanation man, helps me to learn. :) Aug 8, 2018 at 9:21
4

I hope this helps:

You can plan with the length of the box placements to get the image you want:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fit,arrows,calc,positioning}

\begin{document}
\tikzstyle{b} = [rectangle, rounded corners, minimum width=3cm, minimum height=3cm,text centered, draw=black, fill=white]
\tikzstyle{l} = [draw, -latex',thick]

\begin{tikzpicture}[auto]
    \node [b] (A) {A};
    \node [b, below=of A] (B) {B};
    \node [b, right=3cm of A] (F) {F};
    \node [b, right=3cm of A, below=of F] (G) {G};
    \node [b, right=3cm of A, below=of G] (H) {H};
    \node [b, below=of B] (C) {C};


    \path [l] (A) -- (B);
    \path [l] (A) -- (F);
    \path [l] (B) -- (C);
    \path [l] (A.east) --++(0:5mm)|- (H);
    \path [l] (A.east) --++(0:5mm)|- (G);
\end{tikzpicture}
\end{document}

this gives:

enter image description here

1
  • @thesilencer you are welcome! but sorry that it was not the exact solution :) Aug 8, 2018 at 9:22

You must log in to answer this question.

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