Personalize a rectangle node tikz
One possibility might be to add a path picture
to the style, e.g.
path picture={
\fill [green!50!black] ([xshift=-4mm]path picture bounding box.north east) -| ([yshift=-4mm]path picture bounding box.north east) -- cycle;
}
So if you have
noeudA/.style={
rectangle,
inner sep=0pt,
text width=25mm,
align=center,
draw=black,
fill=green!30,
minimum height = 10mm,
path picture={
\fill [green!50!black] ([xshift=-4mm]path picture bounding box.north east) -| ([yshift=-4mm]path picture bounding box.north east) -- cycle;
}
}
Then the first node of your diagram will look like
Alternatively you could make a new upperlefttriangle
style where the color is an argument, i.e.
upperlefttriangle/.style={
path picture={
\fill [#1] ([xshift=-4mm]path picture bounding box.north east) -| ([yshift=-4mm]path picture bounding box.north east) -- cycle;
}
}
And then use
upperlefttriangle={<color>}
either in other styles, or in individual nodes.
MWE, much more concise as provided MWE (after a some, actually lot of effort :) ) combine trees
and positioning
library:
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{chains, positioning, trees}
\usepackage[utf8]{inputenc}
\newcommand\ppbb{path picture bounding box}
\begin{document}
\begin{tikzpicture}[
node distance = 2mm and 2mm,
start chain = going below,
base/.style = {rectangle, draw,
fill=#1,
inner sep=0mm,
minimum height = 9mm, text width=25mm, align=center,
font=\linespread{.9}\selectfont
},
T/.style = {path picture={\fill[cyan!75]
(\ppbb.east) -- (\ppbb.north east) -- ++ (-4.5mm,0) -- cycle;
}% end of path picture
},
boxB/.style = {base=#1, text width=20mm},
% on chain
box/.style = {boxB=#1, on chain},
% tree's parameters
level distance = 18mm,
sibling distance = 32mm,
level 2/.style = {sibling distance = 25mm},
level 3/.style = {sibling distance = 22mm}
]
% first part of image
% start of tree
\node[base=teal!30] {SCR}
[edge from parent fork down]
child { node[base=teal!30] {Ajustement}}
child { node[base=teal!30,T] {BSCR}
child { node[boxB=teal!15,T] (Rba) {Marché}}
child { node[boxB=teal!15,T] (Rbb) {Santé}
child { node[boxB=teal!10,T](Rca) {SLT}}
child { node[boxB=teal!10,T](Rcb) {Catastrophe}}
child { node[boxB=teal!10] (Rcc) {NSLT}}
}
child { node[boxB=teal!15,T] (Rbc) {Contre-partie}}
child { node[boxB=teal!15,T] (Rbd) {Vie}}
child { node[boxB=teal!15] (Rbe) {Non-vie}}
child { node[boxB=teal!15] (Rbf) {Actifs incorporels}}
}
child { node[base=teal!30] {Opérationnel}};
% Noeud Marché
{[start chain]
\coordinate[on chain,below=of Rba.west |- Rca.south] (a);
\node[box=blue!10,T] (Rbaa) {Taux d'intérêt};
\node[box=blue!10,T] (Rbab) {Action};
\node[box=blue!10,T] (Rbac) {Immobilier};
\node[box=blue!10,T] (Rbad) {Spread};
\node[box=blue!10,T] (Rbae) {Change};
\node[box=blue!10,T] (Rbaf) {Concen\-tration};
\node[box=blue!10,T] (Rbag) {Illiquidité};
}
% Noeud Santé
{[start chain]
\coordinate[on chain,below=of Rcb.south west] (b);
\node[box=blue!10,T] (Rbbaa) {Mortalité};
\node[box=blue!10,T] (Rbbab) {Longévité};
\node[box=blue!10,T] (Rbbac) {Incapacité Invalidité};
\node[box=blue!10,T] (Rbbad) {Rachat};
\node[box=blue!10,T] (Rbbae) {Dépenses };
\node[box=blue!10,T] (Rbbaf) {Révision};
}
% Noeud NSLT
{[start chain]
\coordinate[on chain,below=of Rcc.south east -| Rbc.east] (c);
\node[box=blue!10] (Rbbca) {Prime et réserve};
\node[box=blue!10] (Rbbcb) {Rachat};
}
% Noeud Vie
{[start chain]
\coordinate[on chain,below left=of Rcc.south -| Rbe.west] (d);
\node[box=blue!10,T] (Rbda) {Mortalité};
\node[box=blue!10,T] (Rbdb) {Longévité};
\node[box=blue!10,T] (Rbdc) {Incapacité Invalidité};
\node[box=blue!10,T] (Rbdd) {Rachat};
\node[box=blue!10,T] (Rbde) {Dépenses};
\node[box=blue!10,T] (Rbdf) {Révision};
\node[box=blue!10,T] (Rbdg) {Catas\-trophe};
}
% Noeud Non Vie
{[start chain]
\coordinate[on chain,below left=of Rcc.south -| Rbf.west] (e);
\node[box=blue!10,T] (Rbea) {Prime et réserve};
\node[box=blue!10,T] (Rbeb) {Rachat};
\node[box=blue!10,T] (Rbec) {Catas\-trophe};
}
% lines a
\coordinate[left=of Rbaa.west] (aa);
\draw (Rba) -- ++ (0,-0.9) -| (aa) -- (Rbaa);
\foreach \i [remember=\i as \ii (initially a)] in {b,c,...,g}
\draw (aa |- Rba\ii) |- (Rba\i);
% lines b
\draw (Rca) |- (Rbbaa);
\foreach \i [remember=\i as \ii (initially a)] in {b,c,...,f}
\draw (Rca |- Rbba\ii) |- (Rbba\i);
% lines d
\draw (Rcc) |- (Rbbca);
\draw (Rcc) |- (Rbbcb);
% lines e
\draw (Rbd) |- (Rbda);
\foreach \i [remember=\i as \ii (initially a)] in {b,c,...,g}
\draw (Rbd |- Rbd\ii) |- (Rbd\i);
% lines f
\draw (Rbe) |- (Rbea);
\foreach \i [remember=\i as \ii (initially a)] in {b,c}
\draw (Rbe |- Rbe\ii) |- (Rbe\i);
\end{tikzpicture}
\end{document}
Addendum: in the case, when all nodes in second part of block diagram have the same color, than the code of this part can be further reduced:
% second part of image
\begin{scope}[every node/.append style = {box=blue!10}] % define common style for all nodes in scope
% Noeud Marché
{[start chain]
\coordinate[on chain,below=of Rba.west |- Rca.south] (a);
\node[T] (Rbaa) {Taux d'intérêt};
\node[T] (Rbab) {Action};
\node[T] (Rbac) {Immobilier};
\node[T] (Rbad) {Spread};
\node[T] (Rbae) {Change};
\node[T] (Rbaf) {Concen\-tration};
\node[T] (Rbag) {Illiquidité};
}
% Noeud Santé
{[start chain]
\coordinate[on chain,below=of Rcb.south west] (b);
\node[T] (Rbbaa) {Mortalité};
\node[T] (Rbbab) {Longévité};
\node[T] (Rbbac) {Incapacité Invalidité};
\node[T] (Rbbad) {Rachat};
\node[T] (Rbbae) {Dépenses };
\node[T] (Rbbaf) {Révision};
}
% Noeud NSLT
{[start chain]
\coordinate[on chain,below=of Rcc.south east -| Rbc.east] (c);
\node (Rbbca) {Prime et réserve};
\node (Rbbcb) {Rachat};
}
% Noeud Vie
{[start chain]
\coordinate[on chain,below left=of Rcc.south -| Rbe.west] (d);
\node[T] (Rbda) {Mortalité};
\node[T] (Rbdb) {Longévité};
\node[T] (Rbdc) {Incapacité Invalidité};
\node[T] (Rbdd) {Rachat};
\node[T] (Rbde) {Dépenses};
\node[T] (Rbdf) {Révision};
\node[T] (Rbdg) {Catas\-trophe};
}
% Noeud Non Vie
{[start chain]
\coordinate[on chain,below left=of Rcc.south -| Rbf.west] (e);
\node[T] (Rbea) {Prime et réserve};
\node[T] (Rbeb) {Rachat};
\node[T] (Rbec) {Catas\-trophe};
}
\end{scope}
The result is the same as before.