2

I am using the smartdiagram package and have a flow diagram:horizontal diagram. I'd like to include an "addition", which is a full flow diagram:vertical.

Here is the code for my diagram:

\smartdiagramset{
  back arrow disabled = true,
  module minimum width=1.5cm,
  module x sep = 2.5,
  uniform arrow color=true,
  additions={
    additional item offset=0.85cm,
    additional item border color=red,
    additional arrow color=red,
    additional arrow tip=stealth,
    additional arrow line width=1pt,
    additional arrow style=]-latex’,
  }
}
\smartdiagramadd[flow diagram:horizontal]{ Experiment, Theory, Processing, V\&V, Codes, Users }{%
  below of module3/Name
}

enter image description here

What I'd like is for the Name module to be something like this:

smartdiagram[flow diagram:vertical]{Name, Step1, Step2, Step3}

and, of course, be able to customize this diagram as much as I'd like.

Is this even possible with the smartdiagram package or do I have to us the full TikZ package (with which I don't have a lot of experience)?

2
  • smartdiagram has some limitation which can be overcome with the chains tikzlibrary and is simpler in syntax -- have a look at the answer below -- the node color and shape can be redone as desired and the branching can not only be down but up also leading to enhanced flexibility
    – js bibra
    Commented Dec 13, 2020 at 2:22
  • I agree: the idea of the additions is meant for simple modifications, the one you're looking at really becomes simpler if designed directly with TikZ Commented Dec 13, 2020 at 8:14

2 Answers 2

3

enter image description here

\documentclass{article}
\usepackage{tikz}% http://ctan.org/pkg/pgf
\usetikzlibrary{chains, scopes, arrows.meta}
\begin{document}

\begin{tikzpicture}[
    every on chain/.style=join,
    every join/.style=->,
    mynode/.style={rectangle, draw, semithick, rounded corners,text width=20mm, minimum height=11mm, align=center,
                fill=white, fill=blue!20,inner sep=2mm,},
    node distance=10mm and 1cm
    ]
    { [start chain=trunk]
        \node [mynode,on chain] {A};
        \node [mynode,on chain] {B};
        { [start branch=numbers going below] } % just a declaration,
        { [start branch=greek going above] } % we will come back later
        \node [mynode,on chain] {C};
        \node [mynode,on chain] {D};
        % Now come the branches...
        { [continue branch=numbers]
            \node [mynode,on chain] {1};
            \node [mynode,on chain] {2};
        }
        { [continue branch=greek]
            \node [mynode,on chain] {$\alpha$};
            \node [mynode,on chain] {$\beta$};
        }
    }
\end{tikzpicture}
\end{document}

**edit another adaptation **

enter image description here

\documentclass{article}
\usepackage{tikz}% http://ctan.org/pkg/pgf
\usetikzlibrary{chains, scopes, arrows.meta}
\begin{document}

\begin{tikzpicture}[
    every on chain/.style=join,
    every join/.style=->,
    C/.style args = {#1/#2}{% Color
        top color = #1, bottom color=#2},
    C/.default = green!40!white/green!20!white,
    mynode/.style={rectangle, draw=blue!75, ultra thick, rounded corners,text width=20mm, minimum height=11mm, align=center,  inner sep=2mm,},
    node distance=10mm and 1cm
    ]
    { [start chain=trunk]
        \node [mynode,C=blue!40/blue,on chain] {A};
        \node [mynode,C=yellow!40/yellow,on chain] {B};
        { [start branch=numbers going below] } % just a declaration,
        { [start branch=greek going above] } % we will come back later
        \node [mynode,C=yellow!40/yellow,on chain] {C};
        \node [mynode,C=red!40/red,on chain] {D};
        % Now come the branches...
        { [continue branch=numbers]
            \node [mynode,C,on chain] {1};
            \node [mynode,C, on chain] {2};
        }
        { [continue branch=greek]
            \node [mynode,C=gray!40/gray,on chain] {$\alpha$};
            \node [mynode,C=gray!40/gray,on chain] {$\beta$};
        }
    }
\end{tikzpicture}
\end{document}
4

I recommend using plain TikZ, without smartdiagram or chains TikZ library.

enter image description here

\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[n/.style={minimum height=9mm, minimum width=1.5cm,draw=cyan,thick,fill=cyan!30,rounded corners,inner xsep=1mm}]
\def\a{2.5} % vertical distance between nodes
\def\b{1.5} % horizontal distance between nodes
\path[nodes={n}]
(0,0)    node (A) {Experiment}      
++(\a,0) node (B) [fill=yellow]{Theory}
++(\a,0) node (C) {Processing}
++(\a,0) node (D) {V\& V}
++(\a,0) node (E) {Codes}
++(\a,0) node (F) {Users}
(B)
++(0,-\b) node (N) [draw=red]{Name}
(B)
++(0,\b) node (s1) {Step 1}
++(0,\b) node (s2) {Step 2}
++(0,\b) node (s3) {Step 3}
;
\foreach \p/\q in {A/B,B/C,C/D,D/E,E/F,N/B,B/s1,s1/s2,s2/s3}
\draw[-stealth] (\p)--(\q);
\end{tikzpicture}   
\end{document}

You must log in to answer this question.

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