[Tex/LaTex] Mindmap sibling angle in Tikz

mindmapstikz-pgftikz-trees

I am using the following tikz example (original source)

MWE:

% Author: Till Tantau
% Source: The PGF/TikZ manual
\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{mindmap,trees}
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}
  \path[mindmap,concept color=black,text=white]
    node[concept] {Computer Science}
    [clockwise from=0]
    child[concept color=green!50!black] {%
      node[concept] {practical}
      [clockwise from=90]
      child {node[concept] {algorithms} }
      child {node[concept] {data structures} }
      child {node[concept] {pro\-gramming languages} }
      child {node[concept] {software engineer\-ing} }
    }  
    child[concept color=blue] {%
      node[concept] {applied}
      [clockwise from=-30]
      child {node[concept] {databases} }
      child {node[concept] {WWW} }
    }
    child[concept color=red] {node[concept] {technical} }
    child[concept color=orange] {node[concept] {theoretical} };
\end{tikzpicture}\end{document}

Output:

enter image description here

Where each child is spread 60 degrees apart. I presume you control this spacing with sibling angle=60 (got the idea from here), but I can't use it to change the spacing. Could someone modify the MWE to illustrate how to use it. I would very much appreciate it if you could use a different angle for each branch (including the main branch). Thank you.

EDIT:
There seems to be some confusion as people think I want to space things out randomly. What I want is this instead, if a node has two children, I want to define the spacing to be 180 degrees, if it has 3 children, I want the spacing to be 120 degrees, 4 children, 90 degrees, 5 children 72 degrees and so on. As is, I must have 6 children for it to not look weird.

Best Answer

The style set angles for level is used to append the correct sibling distance for level #1.

It can either used inside the level style or possibly in a .listed option.

Usage should vary depending on the use-case in a real document. It may preferable to append set angles for level to grow cyclic or create a custom special grow cyclic that used this solution.

Code

\documentclass[tikz,convert=false]{standalone}
\usetikzlibrary{mindmap,trees,graphs}
\tikzset{
  set angles for level/.style={level #1/.append style={sibling angle=360/\the\tikznumberofchildren}},
  level/.append style={set angles for level=#1}% solution 1
}
\begin{document}
\begin{tikzpicture}
  \path[
    mindmap,
    concept color=black,
    text=white,
    grow cyclic,
    nodes=concept,
%    set angles for level/.list={1,...,4}% solution 2
  ]
  node {Computer Science} 
    child[concept color=green!50!black] {%
      node {practical}
      child {node {algorithms} }
      child {node {data structures} }
      child {node {pro\-gramming languages} }
      child {node {software engineer\-ing} }
      child {node {and a fifth}}
    }  
    child[concept color=blue] { node[concept] {applied}
      child {node {databases} }
      child {node {WWW} }
    }
    child[concept color=red] {node {technical} }
    child[concept color=orange] {node {theoretical} };
\end{tikzpicture}
\end{document}

Output

enter image description here

Related Question