MWE:
\documentclass[12pt]{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, graphs, matrix, quotes}
\usepackage{fancyhdr}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
\matrix[matrix of nodes, column sep= 2em] {
|(n1)| node 1 & |(n2)| node 2 \\
|(n3)| node 3 \\
};
\graph[use existing nodes]{
n1 -> ["label"] n2;
% n2.east -> ["label"] n3.east;
n2.east -> [to path={-- ++(1em, 0) |- (\tikztotarget)}]
n3.east;
};
\end{tikzpicture}
\begin{tikzpicture}
\matrix[matrix of nodes, column sep= 2em] {
|(n1)| node 1 & |(n2)| node 2 \\
|(n3)| node 3 \\
};
\graph[use existing nodes]{
n1 -> ["label"] n2;
n2.east -> ["label"] n3.east;
% n2.east -> [to path={-- ++(1em, 0) |- (\tikztotarget)}]
% n3.east;
};
\end{tikzpicture}
\end{document}
In the first example, I have shaped the edge. In the second one, I have labeled, but not shaped, that edge. I tried using to path and the quotes syntax together, but:
- If I do it in that order, it has no effect (only shaped edge)
- If I reverse the order of the options, the label appears, but the edge is straight
How can I do both things at the same time?

to pathneeds in its declaration a\tikztonodesso that TikZ knows on which part of theto paththe collected nodes (“labels”) shall be placed. Tryn2.east -> ["label", to path={-- ++(1em, 0) |- (\tikztotarget) \tikztonodes}] n3.east;– Qrrbrbirlbel Jun 12 '16 at 22:34