[Tex/LaTex] TikZ graphs: Specify edge target anchor

tikz-graphstikz-pgf

I have the following code:

\documentclass[tikz]{standalone}
\usetikzlibrary{graphs}
\begin{document}
\tikz \graph[grow right sep=20,nodes={draw,rectangle}] { a -> {b, long node name} };
\end{document}

Which produces this output: MWE output: a -> {b, long node name}

I'd like to have the edge "a" -> "long node name" to not go from east to north but from south to west. Is this possible while still using just one \graph call? Or do I need to specify that edge manually in an extra command?

(That is, I have basically the same problem as in the question Edge anchor in tikz, but I want to use TikZ' graph drawing capabilities instead of manually creating edges.)

Best Answer

To obtain west anchor for node long node name you can use right anchor=west.

Code

\documentclass[tikz]{standalone}
\usetikzlibrary{graphs}
\begin{document}
\tikz \graph[grow right sep=20,nodes={draw,rectangle},right anchor=west] { a -> {b, long node name} };
\end{document}

Result

enter image description here