I'm trying to adapt this forest-based hierarchial diagram to construct my own taxonomy. This is a first try
\documentclass[border=1pt]{standalone}
\usepackage{forest}
\usetikzlibrary{arrows.meta, shapes.geometric, calc, shadows}
\colorlet{mygreen}{green!75!black}
\colorlet{col1in}{red!30}
\colorlet{col1out}{red!40}
\colorlet{col2in}{mygreen!40}
\colorlet{col2out}{mygreen!50}
\colorlet{col3in}{blue!30}
\colorlet{col3out}{blue!40}
\colorlet{col4in}{mygreen!20}
\colorlet{col4out}{mygreen!30}
\colorlet{col5in}{blue!10}
\colorlet{col5out}{blue!20}
\colorlet{col6in}{blue!20}
\colorlet{col6out}{blue!30}
\colorlet{col7out}{orange}
\colorlet{col7in}{orange!50}
\colorlet{col8out}{orange!40}
\colorlet{col8in}{orange!20}
\colorlet{linecol}{blue!60}
\begin{document}
\colorlet{mygreen}{green!75!black}
\colorlet{col1in}{red!30}
\colorlet{col1out}{red!40}
\colorlet{col2in}{mygreen!40}
\colorlet{col2out}{mygreen!50}
\colorlet{col3in}{blue!30}
\colorlet{col3out}{blue!40}
\colorlet{col4in}{mygreen!20}
\colorlet{col4out}{mygreen!30}
\colorlet{col5in}{blue!10}
\colorlet{col5out}{blue!20}
\colorlet{col6in}{blue!20}
\colorlet{col6out}{blue!30}
\colorlet{col7out}{orange}
\colorlet{col7in}{orange!50}
\colorlet{col8out}{orange!40}
\colorlet{col8in}{orange!20}
\colorlet{linecol}{blue!60}
\pgfkeys{/forest,
rect/.append style={rectangle, rounded corners=2pt, inner color=col6in, outer color=col6out},
ellip/.append style={ellipse, inner color=col5in, outer color=col5out},
orect/.append style={rect, font=\sffamily\bfseries\LARGE, text width=325pt, text centered, minimum height=10pt, outer color=col7out, inner color=col7in},
oellip/.append style={ellip, inner color=col8in, outer color=col8out, font=\sffamily\bfseries\large, text centered},
}
\begin{forest}
for tree={
font=\sffamily\bfseries,
line width=1pt,
draw=linecol,
ellip,
align=center,
child anchor=north,
parent anchor=south,
drop shadow,
l sep+=12.5pt,
edge path={
\noexpand\path[color=linecol, rounded corners=5pt, >={Stealth[length=10pt]}, line width=1pt, ->, \forestoption{edge}]
(!u.parent anchor) -- +(0,-5pt) -|
(.child anchor)\forestoption{edge label};
},
where level={3}{tier=tier3}{},
where level={0}{l sep-=15pt}{},
where level={1}{
if n={1}{
edge path={
\noexpand\path[color=linecol, rounded corners=5pt, >={Stealth[length=10pt]}, line width=1pt, ->, \forestoption{edge}]
(!u.west) -| (.child anchor)\forestoption{edge label};
},
}{
edge path={
\noexpand\path[color=linecol, rounded corners=5pt, >={Stealth[length=10pt]}, line width=1pt, ->, \forestoption{edge}]
(!u.east) -| (.child anchor)\forestoption{edge label};
},
}
}{},
}
[Break Causes, inner color=col1in, outer color=col1out
[Locators, inner color=col2in, outer color=col2out
[Structure-Based\\Locators, inner color=col4in, outer color=col4out
[Hierarchy-based locator\\Target Not Found]
[, phantom, calign with current]
[Hierarchy-based locator\\Target Not Found]
]
[Attribute-based\\Locators, inner color=col4in, outer color=col4out
[Element Text\\Not Found]
[, phantom, calign with current]
[Element\\Attribute\\Not Found
[Id attribute\\Not Found]
[Href attribute\\Not Found]
[Alt attribute\\Not Found]
[Name attribute\\Not Found]
[Type attribute\\Not Found]
[Value attribute\\Not Found]
[Class attribute\\Not Found]
[Click attribute\\Not Found]
]
]
]
[Values/Actions, inner color=col3in, outer color=col3out
[Invalid Text Field\\Value Input]
[Missing Value]
[Value Deleted\\from Dropdown List]
[, phantom, calign with current]
[Unexpected\\Assertion Value]
[Exceeding Action]
[Modified Statement]
]
[Page Reloading, inner color=col3in, outer color=col3out
[Page Reload\\Needed]
[, phantom, calign with current]
[Page Reload\\no longer\\Needed]
]
[JavaScript Popup\\Boxes, inner color=col3in, outer color=col3out
[User Session\\Made Longer]
[, phantom, calign with current]
[User Session\\Made Shorter]
]
]
% \begin{scope}[color = linecol, rounded corners = 5pt,
% >={Stealth[length=10pt]}, line width=1pt, ->]
% %\draw (sse2.south) -- (us.north -| sse2.south);
% %\draw (sse3.south) -- (us.north -| sse3.south);
% %\coordinate (c1) at ($(sse1.south)!2/5!(sse2.south)$);
% %\coordinate (c2) at ($(sse3.south)!2/5!(sse4.south)$);
% %\draw (sse1.south) -- +(0,-10pt) -| (us.north -| c1);
% %\draw (sse4.south) -- +(0,-10pt) -| (us.north -| c2);
% \end{scope}
\end{forest}
\end{document}
which produces the following output:
However, due to the presence of many leaves, the layout is very small and unreadable. Thus, I've tried to change the grow orientation with
grow' = east,
child anchor=west,
parent anchor=east,
which produces this better result:
I'd like to further enhance it with: 1) better and clean edges layout, and 2) for each edge, two labels: one above and another below
Any hints do to so on my MWE? Is perhaps forest too tricky to build this kind of diagrams?