How to horizontally align child nodes with the graphdrawing library of TikZ 3.0?
Instead every node={align=left}
in tikzpicture
parameters you should say:
every node/.style={anchor=west}
Result:
Upgrade: To my taste, regarding to edited questions, the following solution looks nicer:
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{graphdrawing, graphs}
\usegdlibrary{trees}
\begin{document}
\begin{tikzpicture}[>=stealth,
every node/.style={anchor=west}] % <---
\graph [tree layout, grow'=right,
fresh nodes, level distance=0.5in,
sibling distance=0.1in
]
{
4 -> {
3 -> { 1 -> { 5, " " }, 2,2 },
3 -> { 1, 2, 2 },
3 -> [head anchor=west]{ 1, 2, 2222} % head anchor=west can be
% mowed to graph preamble
}
};
\end{tikzpicture}
\end{document}
It gives:
Note: MWE should be compiled by LuaLaTeX.
Thanks to Zarko I was able to get a working solution:
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{graphdrawing}
\usetikzlibrary{graphs}
\usegdlibrary{trees}
\begin{document}
\begin{tikzpicture}[>=stealth,every node/.style={anchor=west}]
\graph [tree layout, grow'=right, fresh nodes, level distance=3cm,
sibling distance=2ex, head anchor=west]
{
4 -> {
3 -> { 1 -> { 5, " " }, 2,2 },
3 -> { 1, 2, 2 },
3 -> { 1, 2, 2222 }
}
};
\end{tikzpicture}
\end{document}
gives