I find a code that redefines the way one defines a chain (\chainin), and allows one to include labels in the chains. However, this code disables the style options (by and with keyword). However, I need to give individual styles to each chain.
How can I add individual styles to each chain, and at the same time being able to tag the connections by adding a node, like: node [left] {tag}. So I'm aiming for something like this: \chainin (node) [join=by myStyle, {node [left] {my Tag}}];
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,chains,scopes,matrix}
% This code makes it able to include the tag
\makeatletter
\tikzset{join/.code=\tikzset{after node path={%
\ifx\tikzchainprevious\pgfutil@empty\else(\tikzchainprevious)%
edge[every join]#1(\tikzchaincurrent)\fi}}}
\makeatother
\begin{document}
\begin{tikzpicture}[auto,
decision/.style = {draw,
diamond,
text badly centered,
fill = blue!5,
text width = 15mm,
node distance = 2.5cm,
inner sep = 0pt},
block/.style = {draw,
rectangle,
text centered,
rounded corners,
fill = blue!5,
text width = 20mm,
minimum height = 10mm},
tip/.style = {->,
very thick,
color = black!50}
]
\matrix[row sep=1cm]{
\node [block] (blk) {A block here}; \\
\node [decision] (dec) {Is something?};\\
};
{ [start chain]
\chainin (blk);
% By removing the 'by tip' style this compiles
\chainin (dec) [join=by tip, {node [left] {yes}}];
}
\end{tikzpicture}
\end{document}