How to draw a stack in drawstack/TiKz?

TiKZ could be an alternative to drawstack.

\documentclass[tikz, border=2mm]{standalone}
\usetikzlibrary{matrix,positioning}
\usepackage{lmodern}
\usepackage{fontawesome5}


\begin{document}
\begin{tikzpicture}[
    level/.style={draw, minimum width=3cm, minimum height=8mm},
    stack/.style={matrix of nodes, nodes={level}, row sep=-\pgflinewidth},
    ]

    \matrix[stack, label={[font=\small, align=center, name=aux1]below:{departure\\ airport}},
    label={[font=\Large, name=p1]above:\faPlaneDeparture}] (stackleft){
        ticket (purchase) \\
        baggage (check) \\
        gates (load) \\
        runway (takeoff) \\
        airplane routing \\};

    \node[level, right= of stackleft-5-1] (ar1) {airplane routing};
    \node[level, right=of ar1] (ar2) {airplane routing};

    \matrix[stack, label={[font=\small, align=center, name=aux2]below:{arrival\\ airport}}, 
    label={[font=\Large, name=p2]above:\faPlaneArrival},
        right=of ar2, anchor=stackright-5-1.west ] (stackright){
        ticket (complain) \\
        baggage (claim) \\
        gates (unload) \\
        runway (land) \\
        airplane routing \\};

    \node[font=\Large] at (p1-|ar1) {\faPlane};
    \node[font=\Large] at (p1-|ar2) {\faPlane};

    \path (aux1)--node[align=center, font=\small]{intermediate air-traffic\\ control centers} (aux2);

    \draw[blue, very thick, ->] (stackleft.north west)--(stackleft.west|-aux1)--(aux1.south)--(aux2.south)--(stackright.east|-aux2)--(stackright.north east);
\end{tikzpicture}
\end{document}

enter image description here


drawstack is poorly document package and consequently not very useful for your needs. better is to use pure tikz. with multi part node from the shapes.multipart library you can write:

\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows.meta,
                calc,
                positioning,
                shapes.multipart}

\begin{document}
    \begin{tikzpicture}[
node distance = 3mm and 4mm,
base/.style = {minimum width=32mm, node font=\sffamily, align=center},
VMPN/.style = {% Vertical Multi Part Node
    rectangle split, rectangle split parts=5,
    draw},
 box/.style = {base, draw}
                        ]
\node (n1)  [VMPN]
            {\nodepart{one}     purchase (complain)
             \nodepart{two}     baggage (claim)
             \nodepart{three}   gates (unload)
             \nodepart{four}    runway (land)
             \nodepart{five}    airplane routing
             };
\node (n2)  [box, right=of n1.five east]    {airplane routing};
\node (n3)  [box, right=of n2]              {airplane routing};
\node (n4)  [VMPN, above right=0mm and 4mm of n3.south east]
            {\nodepart{one}     purchase (complain)
             \nodepart{two}     baggage (claim)
             \nodepart{three}   gates (unload)
             \nodepart{four}    runway (land)
             \nodepart{five}    airplane routing
            };
\node [above=of $(n2.north)!0.5!(n3.north)$]
    {\includegraphics[width=32mm]{example-image-duck}};
%
\node (n11) [base, below=of n1] {departure airport};
\node (n12) [base, below=of $(n2.south)!0.5!(n3.south)$]
                                {intermediate air-trafic\\control centers};
\node (n131) [base, below=of n4] {arrival airport};
%
\draw[blue!50!black, ultra thick, rounded corners=4mm, -{Triangle[angle=60:3pt 3]}]
    ([xshift=-3mm] n1.north west) |- ([yshift=-3mm] n12.south) -|
    ([xshift= 3mm] n4.north east);
    \end{tikzpicture}
\end{document}

enter image description here

Tags:

Stack

Tikz Pgf