Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is there a way to force all the nodes in a mindmap to have the same size regardless of their hierarchy in the tree?

enter image description here

\begin{figure}\label{fig:HadoopVersion}
    \centering
    \begin{tikzpicture}[concept color=green!50!black,text=white,yscale=0.9,xscale=1.3]
    %level 1/.append style={level distance=4.5cm,sibling angle=90}]
    %level 2/.append style={level distance=3cm,sibling angle=45}]
    \node [concept]{0.24} % root
    child { node [concept] {0.23}
       child [concept color=black!50!white,grow=left] {node [concept] {3.0.0}}
       child [grow=down]{ node [concept] {0.22}
          child [concept color=black!50!white,grow=left] {node [concept,scale=0.9] {0.22.1}
         child {node [concept] {2.0.0}}
          }
          child [grow=down]{ node [concept] (021) {0.21}
         child { node [concept] {0.20}
            child [concept, grow=right, level distance=2cm] {node[concept] {0.20.2}
               child [concept color=black!50!white,grow=up] {node [concept,scale=0.7] (app){0.20.2 app}}
               child [concept color=red!50!black,grow=260,level distance=2cm] {node [concept] {MapR}}
               child [concept color=black!50!white,grow=right] {node [concept,scale=0.6] (yahoo) {0.20.200 Y!}
              child [concept color=green!50!black,grow=up, level distance=2cm] {node [concept,scale=0.8] {0.20.203}
                 child [concept color=red!50!black,grow=60, level distance=2cm]{node [concept,scale=0.6] {0.20.203 Azure}}
                 child [grow=120]{node [concept,scale=0.8] (205) {0.20.205}
                child [grow=up]{node [concept] {1.0.0}}
                 }
              }
               }
               child [concept color=red!50!black,grow=300, level distance=2cm] {node [concept, scale=0.8] (chd3) {CDH3}}
            }
            child [grow=240, level distance=3cm] { node [concept] {0.20.1}
               child [concept color=red!50!black,grow=left, level distance=2cm] {node [concept,scale=0.6] (ibm) {0.20.1 IBM}}
               child [concept color=red!50!black,grow=120] {node [concept,scale=0.6] {0.20.1 Green}
              child [concept color=black!50!white,grow=right, level distance=2cm] {node [concept] (eol) {EOL}}
               }
            }
            child [grow=down] { node [concept] {0.19}
               child { node [concept] {0.18}
              child { node [concept] {Old}}
               }
            }
         }
          }
       }
    };
    \begin{pgfonlayer}{background}
       \path (021) to [circle connection bar switch color=from (green!50!black) to (green!50!black)] (app);
       \path (205) to [circle connection bar switch color=from (green!50!black) to (black!50!white)] (app);
       \path (chd3) to [circle connection bar switch color=from (red!50!black) to (black!50!white)] (yahoo);
       \path (chd3) to [circle connection bar switch color=from (red!50!black) to (black!50!white)] (app);
       \path (ibm) to [circle connection bar switch color=from (red!50!black) to (black!50!white)] (eol);
       \path (eol) to [circle connection bar switch color=from (black!50!white) to (black!50!white)] (app);
    \end{pgfonlayer}
    \end{tikzpicture}
    \caption[Apache Hadoop Project versioning]{Apache Hadoop Project versioning in Spring 2013. Hadoop Apache releases are depicted in \fcolorbox{green!50!black}{green!50!black}{\textcolor{white}{green}} while teh commercial ones are \fcolorbox{red!50!black}{red!50!black}{\textcolor{white}{red}}. The \fcolorbox{white!50!black}{white!50!black}{\textcolor{white}{gray}} nodes stand for non official releases}
    \end{figure}
share|improve this question
    
Welcome to TeX.sx! –  Rico Jan 22 '13 at 16:12
add comment

1 Answer 1

up vote 6 down vote accepted

You could modify the style of every concept:

\tikzset{every concept/.style={minimum size=2cm, text width=2cm}}

Computer science mindmap example with several levels from the manual, with this change, resulting in the same size for all concept nodes, if the text doesn't blow it up:

mindmap example

% Author: Till Tantau
% Source: The PGF/TikZ manual
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{mindmap,trees}
% Here we change the style for all concepts: (Stefan K.)
\tikzset{every concept/.style={minimum size=2cm, text width=2cm}}
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}
  \path[mindmap,concept color=black,text=white]
    node[concept] {C. 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}
share|improve this answer
    
Dear Stefan, Do I have any elegant solution if the text does blow it up ? I "solved" solved it by individually scaling each of the problem nodes, but one can still note that this image was fixed. Thanks –  Cristi Jan 28 '13 at 21:34
    
@Cristi If you insert text which is bigger than the node, there's no magic which can fix it while keeping both node and text size ;-) so I would adjust text content or size or globally raise the node size. –  Stefan Kottwitz Jan 28 '13 at 21:37
    
I really appreciate your help! so i'm abusing your kindness. What about those bad coloring of the my vertices black/green and all the ones I didn't specify manually? (like 0.20 to 0.20.2) –  Cristi Jan 28 '13 at 21:41
1  
@Cristi No problem :-) however it's a question and answer site which works with one problem per question, unlike a forum with long threads. Just post a different problem as a new question, and if this answer has helped regarding this part, it would be great if you would mark it as accepted by clicking the check mark at the left. –  Stefan Kottwitz Jan 28 '13 at 21:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.