[Tex/LaTex] Hierarchy diagram

foresttikz-pgf

I’m trying to resemble what’s on the picture by using a template.

enter image description here

  \documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{trees}
\begin{document}
\begin{tikzpicture}[level 1/.style={sibling distance=7cm},
level 2/.style={sibling distance=2cm}, 
level 3/.style={sibling distance=2.5cm}, align = flush center]
\tikzset{every node/.append style={draw,rectangle}}

    \node {Recommendation Systems}
        [style=edge from parent fork down]
        child { 
            node {1}    
            child {node {1.1} 
                child {node {1.1.1} }
                child {node {1.1.2} }
                child {node {1.1.3} }
                }
            child {node {1.2}}
            child {node {1.3}}
        edge from parent node[pos=0.25,above,draw=none]{left}%<-added
        } 
        child { 
            node {2} 
            child {node {2.1}}
            child {node {2.2} 
                child {node {2.2.1} }
                child {node {2.2.2} }
                child {node {2.2.3} }
                }
            child {node {2.3}}
        edge from parent node[pos=0.25,above,draw=none]{right}%<-added
        }
    ;
\end{tikzpicture} 
\end{document}

I don’t know how to get the boxes. Could you give me a hand/orientation?

Best Answer

I recommend forest for that.

\documentclass{article}
\usepackage[edges]{forest}
\begin{document}
\begin{forest}
forked edges,
for tree={draw,align=center,edge={-latex}}
[Recommendation\\ Systems
 [1.1]
 [1.2
  [1.2.1
   [1.2.1.1]
   [1.2.1.2]
  ]
  [1.2.2
   [1.2.2.1]
   [1.2.2.2]
   [1.2.2.3]
  ]
 ]
 [1.3]
]
\end{forest}
\end{document}

enter image description here

With shadows:

\documentclass{article}
\usepackage[edges]{forest}
\usetikzlibrary{shadows.blur}
\begin{document}
\begin{forest}
forked edges,
for tree={draw,align=center,edge={-latex},fill=white,blur shadow}
[Recommendation\\ Systems
 [1.1]
 [1.2
  [1.2.1
   [1.2.1.1]
   [1.2.1.2]
  ]
  [1.2.2
   [1.2.2.1]
   [1.2.2.2]
   [1.2.2.3]
  ]
 ]
 [1.3]
]
\end{forest}
\end{document}

enter image description here