How can I modify the orientation of text in the nodes of a mindmap, such that the text is oriented radially from the center in the case of the outermost nodes.
For example, in the below diagram, I seek for the text INSIDE the orange circled nodes to be rotated so that it is in alignment with the direction of the orange lines respectively.
Code for the above mindmap is as follows:
\begin{tikzpicture}
\path[small mindmap,concept,text=white]
node[concept] {Bla} [clockwise from=-15]
child[concept color=red,text=black]{
node[concept]at(1,0){Bla Bla}[clockwise from=90]
child[concept color=red!95!black,text=black]{
node[concept]{A}[clockwise from = 120]
child {node[concept,scale=0.5] {A.A}}
child {node[concept,scale=0.5] {A.B}}
child {node[concept,scale=0.5] {A.C}}
}
child[concept color=red!75!black,text=white,grow=50]{
node[concept]{B}[clockwise from = 80]
child {node[concept,scale=0.5] {B.A}}
child {node[concept,scale=0.5] {B.B}}
child {node[concept,scale=0.5] {B.C}}
}
child[concept color=red!50!black,text=white ,grow=10]{
node[concept]{C}[clockwise from = 40]
child {node[concept,scale=0.5] {C.A}}
child {node[concept,scale=0.5] {C.B}}
child {node[concept,scale=0.5] {C.C}}
}
child[concept color=red!25!black,text=white,grow=-30]{
node[concept]{D}[clockwise from = 0]
child {node[concept,scale=0.5] {D.A}}
child {node[concept,scale=0.5] {D.B}}
child {node[concept,scale=0.5] {D.C}}
}
child[concept color=red!10!black,text=white,grow=-70]{
node[concept]{D}[clockwise from = -40]
child {node[concept,scale=0.5] {D.A}}
child {node[concept,scale=0.5] {D.B}}
child {node[concept,scale=0.5] {D.C}}
}
}
child[concept color=green,text=black, grow=195]{
node[concept]{Bla Bla}[clockwise from=80]
child[concept color=green!10!black,text=white]{
node[concept]{Bla}[counterclockwise from = 50]
child {node[concept,scale=0.5] {A.A}}
child {node[concept,scale=0.5] {A.B}}
child {node[concept,scale=0.5] {A.C}}
}
child[concept color=green!25!black,text=white,grow=120]{
node[concept]{Bla}[counterclockwise from = 90]
child {node[concept,scale=0.5] {A.A}}
child {node[concept,scale=0.5] {A.B}}
child {node[concept,scale=0.5] {A.C}}
}
child[concept color=green!50!black,text=white,grow=160]{
node[concept]{Bla}[counterclockwise from = 130]
child {node[concept,scale=0.5] {B.A}}
child {node[concept,scale=0.5] {B.B}}
child {node[concept,scale=0.5] {B.C}}
}
child[concept color=green!75!black,text=white ,grow=200]{
node[concept]{Bla}[counterclockwise from = 170]
child {node[concept,scale=0.5] {C.A}}
child {node[concept,scale=0.5] {C.B}}
child {node[concept,scale=0.5] {C.C}}
}
child[concept color=green!95!black,text=black,grow=240]{
node[concept]{Bla}[counterclockwise from = 210]
child {node[concept,scale=0.5] {D.A}}
child {node[concept,scale=0.5] {D.B}}
child {node[concept,scale=0.5] {D.C}}
}
}
child[concept color=orange,text=black, grow = -90] {
node[concept]at(-1.5,-2.5){Bla Bla}[clockwise from=10]
child[concept color=orange!95!black]{
node[concept]{Bla}[clockwise from = 40]
child {node[concept,scale=0.5] {A.A}}
child {node[concept,scale=0.5] {A.B}}
child {node[concept,scale=0.5] {A.C}}
}
child[concept color=orange!75!black, grow = -30]{
node[concept]{Bla}[clockwise from =0]
child {node[concept,scale=0.5] {B.A}}
child {node[concept,scale=0.5] {B.B}}
child {node[concept,scale=0.5] {B.C}}
}
child[concept color=orange!50!black, text=white, grow=-70]{
node[concept]{Bla}[clockwise from =-40]
child {node[concept,scale=0.5] {C.A}}
child {node[concept,scale=0.5] {C.B}}
child {node[concept,scale=0.5] {C.C}}
}
child[concept color=orange!25!black, text=white, grow=-110]{
node[concept]{Bla}[clockwise from =-80]
child {node[concept,scale=0.5] {D.A}}
child {node[concept,scale=0.5] {D.B}}
child {node[concept,scale=0.5] {D.C}}
}
child[concept color=orange!10!black, text=white, grow=-150]{
node[concept]{Bla}[clockwise from =-120]
child {node[concept,scale=0.5] {E.A}}
child {node[concept,scale=0.5] {E.B}}
child {node[concept,scale=0.5] {E.C}}
}
}
;
\end{tikzpicture}
UPDATE: Continue this topic in Part II, seeking elliptical or rectangular radially rotating nodes.
Best Answer
There are two and a half problems to solve here.
1. The Mathematical Problem
We have to calculate the amount of rotation.
The
counterclockwise from
argument is saved internally in\tikz@grow@circle@from@start
.For every child the amount of
/tikz/sibling angle
get added (counterclockwise
) or subtracted (clockwise
). The number of the child is saved in\tikznumberofcurrentchild
.For the orange children which are all placed in a clockwise matter the angle the text must be rotated is:
¿zʞıʇ
If a node’s content shouldn’t be upside down the formula has to be adjusted:
2. The Rotation Problem
Great, so an easy
should do, right?
Nope:
The whole node gets transformed (in this case: rotated) which means that all anchor nodes are rotated, too. And this confuses the calculation of the
circle connection bar
decoration. The more we rotate a child the more the connection bar gets twisted.We surely could adjust the code for the
circle connection bar
decoration, but that’s a lot of code!It would be much easier to just rotate the text itself.
With the help of
graphicx
’s\rotatebox
macro this can be easily done:2½. The Node Text Problem
Do you want to edit every node that should get rotated and add the
\rotateme
macro?I didn’t think so!
My solution collects all the node’s text with the help of
execute at begin node
,execute at and node
, andlrbox
environment which saves the node’s text in a box called\rotatenodebox
.This box is then given to the already-mentioned
\rotateme
macro.Code
Output