2

I'd like to rotate of clockwise 45 degrees the mindmap but i'd like to keep the alignment of final nodes as a quarter circle.

I tried different options like rotate=45 or yshift=xxpt change-orientation-of-a-tikz-mindmap-node but no impact. Where am I wrong ? I adapted the code from how-to-put-level-2-concept-mindmap-nodes-alongside-a-rectangle enter image description here

Here is MWE

\documentclass[tikz,border=9]{standalone}
\usetikzlibrary{mindmap,decorations}
\usepackage{xspace}
\definecolor{joli}{RGB}{225,95,0}
\definecolor{JOLI}{RGB}{225,95,0}
\newcommand\etoc{\textcolor{joli}{\ttfamily\bfseries etoc}\xspace}
\DeclareRobustCommand\csa[1]{{\ttfamily\hyphenchar\font45 \char`\\ #1}}

\makeatletter
\newcount\tikzcountgrandchild
\def\tikz@grow@concentric{%
  \pgftransformreset%
  \pgftransformrotate{(\pgfkeysvalueof{/tikz/sibling angle})*(\tikzcountgrandchild)}%
  \ifnum\tikztreelevel=1
    \pgftransformrotate{(\pgfkeysvalueof{/tikz/sibling angle})*(\pgfkeysvalueof{/tikz/noc}-1)/2}%
  \fi
  \pgftransformxshift{\the\tikzleveldistance}%
  \ifnum\tikztreelevel=2
    \global\advance\tikzcountgrandchild by1
 \fi
}

\begin{document}
\tikzset{
    noc/.initial=0,
    branch color/.style={
        concept color=#1!white,
        every child/.append style={concept color=#1!white!30!white},
    }
}

\begin{tikzpicture}[text width=1.5cm,align=flush center,
        mindmap,growth function=\tikz@grow@concentric,
        sibling angle=360/30,
        nodes={concept},
        concept color=gray!60,
        root concept/.append style={concept color=green!50, ball color=green!50, line width=1.5ex,text=green!40!black,font=\huge\bfseries\scshape,minimum size=4.5cm,text width=4.5cm,},                   
       level 1/.style={,level distance=8cm,font=\Large,minimum size=3.0cm,text width=2.5cm,},
        level 2/.style={level distance=12cm,font=\large,minimum size=2.0cm,text width=2.0cm}
                   ]
\node [root concept]{Clients} 
  child[noc=3,branch color=green!70]{node {Retail} 
        child[] {node {CGPI}} 
        child[] {node {Banques privées}} 
        child[] {node {Retail banking}} 
    }
    child[noc=3,branch color=green!70]{node {ALM} 
        child[] {node {Mutuelles}} 
        child[] {node {Assurances}} 
        child[] {node {Caisse de retraite}}         
        } 
    child[noc=1,branch color=green!80]{node {Directions financières} 
        child[] {node {Corporate}} 
        } 
    child[noc=3,branch color=green!70]{node {Instrument specialists} 
        child {node {Asset Managers traditionnels}} 
        child {node {Hedge funds}} 
        child {node {Trading desks form other banks}} 
        } 
;
\end{tikzpicture}
\end{document}

1 Answer 1

3

I added a key overall rotation to accomplish this. (My editor is ancient and does not like non-ASCII characters, I hope I did not screw up the accents.)

\documentclass[tikz,border=9]{standalone}
\usetikzlibrary{mindmap,decorations}
\usepackage{xspace}
\definecolor{joli}{RGB}{225,95,0}
\definecolor{JOLI}{RGB}{225,95,0}
\newcommand\etoc{\textcolor{joli}{\ttfamily\bfseries etoc}\xspace}
\DeclareRobustCommand\csa[1]{{\ttfamily\hyphenchar\font45 \char`\\ #1}}

\makeatletter
\newcount\tikzcountgrandchild
\def\tikz@grow@concentric{%
  \pgftransformreset% 
  \pgftransformrotate{\pgfkeysvalueof{/tikz/overall rotation}+(\pgfkeysvalueof{/tikz/sibling angle})*(\tikzcountgrandchild)}%
  \ifnum\tikztreelevel=1
    \pgftransformrotate{(\pgfkeysvalueof{/tikz/sibling angle})*(\pgfkeysvalueof{/tikz/noc}-1)/2}%
  \fi
  \pgftransformxshift{\the\tikzleveldistance}%
  \ifnum\tikztreelevel=2
    \global\advance\tikzcountgrandchild by1
 \fi
}

\begin{document}
\tikzset{overall rotation/.initial=0,
    noc/.initial=0,
    branch color/.style={
        concept color=#1!white,
        every child/.append style={concept color=#1!white!30!white},
    }
}

\begin{tikzpicture}[text width=1.5cm,align=flush center,
        mindmap,growth function=\tikz@grow@concentric,
        overall rotation=-45,
        sibling angle=360/30,
        nodes={concept},
        concept color=gray!60,
        root concept/.append style={concept color=green!50, ball color=green!50, line width=1.5ex,text=green!40!black,font=\huge\bfseries\scshape,minimum size=4.5cm,text width=4.5cm,},                   
       level 1/.style={,level distance=8cm,font=\Large,minimum size=3.0cm,text width=2.5cm,},
        level 2/.style={level distance=12cm,font=\large,minimum size=2.0cm,text width=2.0cm}
                   ]
\node [root concept]{Clients} 
  child[noc=3,branch color=green!70]{node {Retail} 
        child[] {node {CGPI}} 
        child[] {node {Banques priv\'ees}} 
        child[] {node {Retail banking}} 
    }
    child[noc=3,branch color=green!70]{node {ALM} 
        child[] {node {Mutuelles}} 
        child[] {node {Assurances}} 
        child[] {node {Caisse de retraite}}         
        } 
    child[noc=1,branch color=green!80]{node {Directions financi\'eres} 
        child[] {node {Corporate}} 
        } 
    child[noc=3,branch color=green!70]{node {Instrument specialists} 
        child {node {Asset Managers traditionnels}} 
        child {node {Hedge funds}} 
        child {node {Trading desks form other banks}} 
        } 
;
\end{tikzpicture}
\end{document}

enter image description here

Maybe you want to change the colors a bit.

\documentclass[tikz,border=9]{standalone}
\usetikzlibrary{mindmap,decorations}
\usepackage{xspace}
\definecolor{joli}{RGB}{225,95,0}
\definecolor{JOLI}{RGB}{225,95,0}
\newcommand\etoc{\textcolor{joli}{\ttfamily\bfseries etoc}\xspace}
\DeclareRobustCommand\csa[1]{{\ttfamily\hyphenchar\font45 \char`\\ #1}}

\makeatletter
\newcount\tikzcountgrandchild
\def\tikz@grow@concentric{%
  \pgftransformreset% 
  \pgftransformrotate{\pgfkeysvalueof{/tikz/overall rotation}+(\pgfkeysvalueof{/tikz/sibling angle})*(\tikzcountgrandchild)}%
  \ifnum\tikztreelevel=1
    \pgftransformrotate{(\pgfkeysvalueof{/tikz/sibling angle})*(\pgfkeysvalueof{/tikz/noc}-1)/2}%
  \fi
  \pgftransformxshift{\the\tikzleveldistance}%
  \ifnum\tikztreelevel=2
    \global\advance\tikzcountgrandchild by1
 \fi
}

\begin{document}
\tikzset{overall rotation/.initial=0,
    noc/.initial=0,
    branch color/.style={
        concept color=#1!white,
        every child/.append style={concept color=#1!white!30!white},
    }
}

\begin{tikzpicture}[text width=1.5cm,align=flush center,
        mindmap,growth function=\tikz@grow@concentric,
        overall rotation=-45,
        sibling angle=360/30,
        nodes={concept},
        concept color=green!70!black,
        root concept/.append style={ ball color=green!50, line width=1.5ex,text=green!40!black,font=\huge\bfseries\scshape,minimum size=4.5cm,text width=4.5cm,},                   
       level 1/.style={,level distance=8cm,font=\Large,minimum size=3.0cm,text width=2.5cm,},
        level 2/.style={level distance=12cm,font=\large,minimum size=2.0cm,text width=2.0cm}
                   ]
\node [root concept]{Clients} 
  child[noc=3,branch color=green!70]{node {Retail} 
        child[] {node {CGPI}} 
        child[] {node {Banques priv\'ees}} 
        child[] {node {Retail banking}} 
    }
    child[noc=3,branch color=green!70]{node {ALM} 
        child[] {node {Mutuelles}} 
        child[] {node {Assurances}} 
        child[] {node {Caisse de retraite}}         
        } 
    child[noc=1,branch color=green!80]{node {Directions financi\'eres} 
        child[] {node {Corporate}} 
        } 
    child[noc=3,branch color=green!70]{node {Instrument specialists} 
        child {node {Asset Managers traditionnels}} 
        child {node {Hedge funds}} 
        child {node {Trading desks form other banks}} 
        } 
;
\end{tikzpicture}
\end{document}

enter image description here

3
  • You rock ! would never have found that key by myself. Merci !
    – JeT
    Mar 14, 2020 at 0:28
  • 1
    @Julien-ElieTaieb You're welcome! (But please note that this key did not exist, I really added it to the code of \tikz@grow@concentric.)
    – user194703
    Mar 14, 2020 at 0:31
  • I deleted my silly question since your code is very clear (but it's late in France) :)
    – JeT
    Mar 14, 2020 at 0:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .