summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-02-23 00:49:54 +0000
committerKarl Berry <karl@freefriends.org>2008-02-23 00:49:54 +0000
commit4fc1af1461e934c39f8f5e10d5d8788681d82223 (patch)
tree7716e8a3e8787a3d11c5ce728d21b808f786ce7d /Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex
parent6f5a4edf390b6e05291d7a4b816782b14122a205 (diff)
tikz/pgf 2.0 first attempt (22feb08)
git-svn-id: svn://tug.org/texlive/trunk@6741 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex')
-rw-r--r--Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex262
1 files changed, 128 insertions, 134 deletions
diff --git a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex
index 102fd8b41e5..f9396ccf335 100644
--- a/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex
+++ b/Master/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-mindmaps.tex
@@ -15,13 +15,14 @@
\subsection{Overview}
-This library is intended to make the creation of mindmaps easier. A
-\emph{mindmap} is a graphical representation of a concept together
+This library is intended to make the creation of mindmaps or concept
+maps easier. A \emph{mindmap} is a graphical representation of a
+concept together
with related concepts and annotations. Mindmaps are, essentially,
trees, possibly with a few extra edges added, but they are usually
drawn in a special way: The root concept is placed in the middle of
the page and is drawn as a huge circle, ellipse, or cloud. The related
-concepts then ``leave'' this root concept in branch-like tendrils.
+concepts then ``leave'' this root concept via branch-like tendrils.
The mindmap library of \tikzname\ produces mindmaps that look a bit
different from the standard mindmaps: While the big root concept is
@@ -43,8 +44,7 @@ a graph with arbitrary edges and this is also possible.
Every mindmap should be put in a scope or a picture where the
|mindmap| style is used. This style installs some internal settings.
-\begin{itemize}
- \itemstyle{mindmap}
+\begin{stylekey}{/tikz/mindmap}
Use this style with all pictures or at least scopes that contain a
mindmap. It installs a whole bunch of settings that are useful for
drawing mindmaps.
@@ -55,23 +55,28 @@ Every mindmap should be put in a scope or a picture where the
\end{codeexample}
The sizes of concepts are predefined in such a way that a
medium-size mindmap will fit on an A4 page (more or less).
- \itemstyle{every mindmap}
- This style is included by the |mindmap| style. Change this style to
- add special settings to your mindmaps.
+ \begin{stylekey}{/tikz/every mindmap}
+ This style is included by the |mindmap| style. Change this style to
+ add special settings to your mindmaps.
\begin{codeexample}[]
\tikz[large mindmap,concept color=red!50]
\node [concept] {Root concept}
child[grow=right] {node[concept] {Child concept}};
\end{codeexample}
- \itemstyle{large mindmap}
+ \end{stylekey}
+\end{stylekey}
+
+\begin{stylekey}{/tikz/large mindmap}
This style includes the |mindmap| style, but additionally changes
the default size of concepts and of distances so that a medium-sized
mindmap will fit on an A3 page (A3 pages are twice as large as A4
pages).
- \itemstyle{huge mindmap}
+\end{stylekey}
+\begin{stylekey}{/tikz/huge mindmap}
This style causes conepts to be even bigger and it is best used with
A2 paper and above.
-\end{itemize}
+\end{stylekey}
+
\subsection{Concepts Nodes}
@@ -84,8 +89,7 @@ circular for some of the connection macros to work.
The following styles influence how isolated concepts are rendered:
-\begin{itemize}
- \itemstyle{concept}
+\begin{stylekey}{/tikz/concept}
This style should be used with all nodes that are concepts, although
some styles like |extra concept| install this style automatically.
@@ -95,24 +99,30 @@ The following styles influence how isolated concepts are rendered:
\begin{codeexample}[]
\tikz[mindmap,concept color=red!50] \node [concept] {Some concept};
\end{codeexample}
- \itemstyle{every concept}
- In order to change the appearance of concept nodes, you should
- change this style. Note, however, that the color of a concept should
- be uniform for some of the connection bar stuff to work, so you
- should not change the color or the draw/fill state of concepts using
- this option. It is mostly useful for changing the text color and
- font.
- \itemoption{concept color}|=|\meta{color}
- This option tells \tikzname\ which color should be used for filling
- and stroking concepts. The difference between this option and just
- setting |every concept| to the desired color is that this option
- allows \tikzname\ to keep track of the colors used for
- concepts. This is important when you \emph{change} the color between
- two connected concepts. In this case, \tikzname\ can automatically
- create a shading that provides a smooth transition between the old
- and the new concept color; we will come back to this in the next
- section.
- \itemstyle{extra concept}
+
+ \begin{stylekey}{/tikz/every concept}
+ In order to change the appearance of concept nodes, you should
+ change this style. Note, however, that the color of a concept should
+ be uniform for some of the connection bar stuff to work, so you
+ should not change the color or the draw/fill state of concepts using
+ this option. It is mostly useful for changing the text color and
+ font.
+ \end{stylekey}
+
+ \begin{key}{/tikz/concept color=\meta{color}}
+ This option tells \tikzname\ which color should be used for filling
+ and stroking concepts. The difference between this option and just
+ setting |every concept| to the desired color is that this option
+ allows \tikzname\ to keep track of the colors used for
+ concepts. This is important when you \emph{change} the color between
+ two connected concepts. In this case, \tikzname\ can automatically
+ create a shading that provides a smooth transition between the old
+ and the new concept color; we will come back to this in the next
+ section.
+ \end{key}
+\end{stylekey}
+
+\begin{stylekey}{/tikz/extra concept}
This style is intended for concepts that are not part of the
``mindmap tree,'' but stand beside it. Typically, they will have a
subdued color are be smaller. In order to have these concepts appear
@@ -124,9 +134,10 @@ The following styles influence how isolated concepts are rendered:
\node [extra concept] at (10,0) {extra concept};
\end{tikzpicture}
\end{codeexample}
- \itemstyle{every extra concept}
- Change this style to change the appearance of extra concepts.
-\end{itemize}
+ \begin{stylekey}{/tikz/every extra concept}
+ Change this style to change the appearance of extra concepts.
+ \end{stylekey}
+\end{stylekey}
\subsubsection{Concepts in Trees}
@@ -136,41 +147,48 @@ using the |child| facilities of \tikzname. There are numerous options
that influence how concepts are rendered at the different levels of a
tree.
-\begin{itemize}
- \itemstyle{root concept}
- This style is used for the roots of mindmap trees. More precisely,
- this style is included by the |mindmap| style. Thus, by adding
+\begin{stylekey}{/tikz/root concept}
+ This style is used for the roots of mindmap trees. By adding
something to this, you can change how the root of a mindmap will be
rendered.
\begin{codeexample}[]
-\tikzstyle{root concept}+=[concept color=blue!80,minimum size=3.5cm]
-\tikz[mindmap] \node [concept] {Root concept};
+\tikz
+ [root concept/.append style={concept color=blue!80,minimum size=3.5cm},
+ mindmap]
+ \node [concept] {Root concept};
\end{codeexample}
Note that styles like |large mindmap| redefine these styles, so you
should add something to this style only inside the picture.
- \itemstyle{level 1 concept}
+\end{stylekey}
+
+\begin{stylekey}{/tikz/level 1 concept}
The |mindmap| style adds this style to the |level 1| style. This
means that the first level children of a mindmap tree will use this
style.
\begin{codeexample}[]
-\tikzstyle{root concept}+=[concept color=blue!80]
-\tikzstyle{level 1 concept}+=[concept color=red!50]
-\tikz[mindmap]
+\tikz
+ [root concept/.append style={concept color=blue!80},
+ level 1 concept/.append style={concept color=red!50},
+ mindmap]
\node [concept] {Root concept}
child[grow=30] {node[concept] {child}}
child[grow=0 ] {node[concept] {child}};
\end{codeexample}
- \itemstyle{level 2 concept}
- works like |level 1 concept|, only for second level children.
- \itemstyle{level 3 concept}
- works like |level 1 concept|.
- \itemstyle{level 4 concept}
- works like |level 1 concept|. Note that there are not fifth and
+\end{stylekey}
+\begin{stylekey}{/tikz/level 2 concept}
+ Works like |level 1 concept|, only for second level children.
+\end{stylekey}
+\begin{stylekey}{/tikz/level 3 concept}
+ Works like |level 1 concept|.
+\end{stylekey}
+\begin{stylekey}{/tikz/level 4 concept}
+ Works like |level 1 concept|. Note that there are not fifth and
higher level styles, you need to modify |level 5| directly in such
cases.
-
- \itemoption{concept color}|=|\meta{color}
+\end{stylekey}
+
+\begin{key}{/tikz/concept color=\meta{color}}
We saw already that this option is used to change the color of
concepts. We now have a look at its effect when used on child nodes
of a concept. Normally, this option simply changes the color of the
@@ -191,14 +209,15 @@ tree.
In order to have all children of a certain level have a different
concept color, a tiny bit of magic is needed:
\begin{codeexample}[]
-\tikzstyle{root concept}+=[concept color=blue]
-\tikzstyle{level 1 concept}+=[set style={{every child}=[concept color=blue!50]}]
-\tikz[mindmap,text=white]
+\tikz[mindmap,text=white,
+ root concept/.style={concept color=blue},
+ level 1 concept/.append style=
+ {every child/.style={concept color=blue!50}}]
\node [concept] {Root concept}
child[grow=30] {node[concept] {child}}
child[grow=0 ] {node[concept] {child}};
\end{codeexample}
-\end{itemize}
+\end{key}
\subsection{Connecting Concepts}
@@ -208,11 +227,10 @@ The easiest way to connect two concepts is to draw a line between
them. In order to give such lines a consistent appearance, it is
recommendable to use the following style when drawing such lines:
-\begin{itemize}
- \itemstyle{concept connection}
+\begin{stylekey}{/tikz/concept connection}
This style can be used for lines between two concepts. Feel free to
redefine this style.
-\end{itemize}
+\end{stylekey}
A problem arises when you need to connect concepts after the main
mindmap has been drawn. In this case you will want the connection
@@ -222,9 +240,10 @@ determined. In this case you should place the connecting lines on a
background layer as in the following example:
\begin{codeexample}[]
-\tikzstyle{root concept}+=[concept color=blue!20,minimum size=2cm]
-\tikzstyle{level 1 concept}+=[sibling angle=45]
-\begin{tikzpicture}[mindmap]
+\begin{tikzpicture}
+ [root concept/.append style={concept color=blue!20,minimum size=2cm},
+ level 1 concept/.append style={sibling angle=45},
+ mindmap]
\node [concept] {Root concept}
[clockwise from=45]
child { node[concept] (c1) {child}}
@@ -239,30 +258,30 @@ background layer as in the following example:
\end{codeexample}
-\subsubsection{The Circle Connection Bar Snake}
+\subsubsection{The Circle Connection Bar Decoration}
Instead of a simple line between two concepts, you can also add a bar
between the two nodes that has slightly organic ends. These bars are
also used by default as the edges from parents in the mindmap tree.
-For the drawing of the bars a special snake is used, which is defined
+For the drawing of the bars a special decoration is used, which is defined
in the mindmap library:
-\begin{snake}{circle connection bar}
- This snake can be used to connect two circles. The start of the
- snake should lie on the border of the first circle, the end should
- lie on the border of the second circle. The following two macros should be
- initialized with the sizes of the circles:
+\begin{decoration}{circle connection bar}
+ This decoration can be used to connect two circles. The start of the
+ to-be-decorated path should lie on the border of the first circle,
+ the end should lie on the border of the second circle. The following
+ two decoration keys should be initialized with the sizes of the circles:
\begin{itemize}
- \item |\pgfsnakecirclestartradius|
- \item |\pgfsnakecircleendradius|
+ \item |start radius|
+ \item |end radius|
\end{itemize}
- Furthermore, the following two macros influence the snake:
+ Furthermore, the following two decoration keys influence the decoration:
\begin{itemize}
- \item |\pgfsnakesegmentamplitude|
- \item |\pgfsnakesegmentangle|
+ \item |amplitude|
+ \item |angle|
\end{itemize}
- The snake itself will be a path that starts on the border of the
+ The decoration turns a straight line into a path that starts on the border of the
first circle at the specified angle relative to the line connecting
the centers of the circles. The path then changes into a rectangle
whose thickness is given by the amplitude. Finally, the path ends
@@ -271,37 +290,31 @@ in the mindmap library:
Here is an example that should make this clearer:
\begin{codeexample}[]
\begin{tikzpicture}
+ [decoration={start radius=1cm,end radius=.5cm,amplitude=2mm,angle=30}]
\fill[blue!20] (0,0) circle (1cm);
\fill[red!20] (2.5,0) circle (.5cm);
- \def\pgfsnakecirclestartradius{1cm}
- \def\pgfsnakecircleendradius{.5cm}
- \def\pgfsnakesegmentamplitude{2mm}
- \def\pgfsnakesegmentangle{30}
-
- \filldraw [draw=red,fill=black,snake=circle connection bar] (1,0) -- (2,0);
+ \filldraw [draw=red,fill=black,
+ decorate,decoration=circle connection bar] (1,0) -- (2,0);
\end{tikzpicture}
\end{codeexample}
- As can be seen, the snake consists of three parts and is not really
- useful for drawing. However, if you fill the snake only and if you
+ As can be seen, the decorated path consists of three parts and is not really
+ useful for drawing. However, if you fill the decorated path only, and if you
use the same color as for the circles, the result is better.
\begin{codeexample}[]
-\begin{tikzpicture}[blue!50]
+\begin{tikzpicture}
+ [blue!50,decoration={start radius=1cm,
+ end radius=.5cm,amplitude=2mm,angle=30}]
\fill (0,0) circle (1cm);
\fill (2.5,0) circle (.5cm);
- \def\pgfsnakecirclestartradius{1cm}
- \def\pgfsnakecircleendradius{.5cm}
- \def\pgfsnakesegmentamplitude{2mm}
- \def\pgfsnakesegmentangle{30}
-
- \fill [snake=circle connection bar] (1,0) -- (2,0);
+ \fill [decorate,decoration=circle connection bar] (1,0) -- (2,0);
\end{tikzpicture}
\end{codeexample}
In the above example you may notice the small white line between the
- circles and the snake. This is due to rounding
+ circles and the decorated path. This is due to rounding
errors. Unfortunately, for larger distances, there errors can
accumulate quite strongly, especially since \tikzname\ and \TeX\ are
not very good at computing square roots. For this reason, it is a
@@ -310,38 +323,34 @@ in the mindmap library:
|draw| option with a |line width| or one or two points (for very
large distances you may need line width up to 4pt).
\begin{codeexample}[]
-\begin{tikzpicture}[blue!50]
+\begin{tikzpicture}
+ [blue!50,decoration={start radius=1cm,
+ end radius=.5cm,amplitude=2mm,angle=30}]
\fill (0,0) circle (1cm+1pt);
\fill (2.4,0) circle (.5cm+1pt);
- \def\pgfsnakecirclestartradius{1cm}
- \def\pgfsnakecircleendradius{.5cm}
- \def\pgfsnakesegmentamplitude{2mm}
- \def\pgfsnakesegmentangle{30}
-
- \fill [snake=circle connection bar] (1,0) -- (1.9,0);
+ \fill [decorate,decoration=circle connection bar] (1,0) -- (1.9,0);
\end{tikzpicture}
\end{codeexample}
Note the slightly strange |outer sep=0pt|. This is needed so that
- the snakes being on the border of the filled circle, not on the
+ the decorated path lies on the border of the filled circle, not on the
border of the stroked circle (which is slightly larger and this
slightly larger size is exactly what we wish to use to cover up the
rounding errors).
-\end{snake}
+\end{decoration}
\subsubsection{The Circle Connection Bar To-Path}
-The circle connection bar snake is a bit complicated to
+The |circle connection bar| decoration is a bit complicated to
use. Especially specifying the radii is quite bothersome (the
amplitude and the angle can be set once and for all). For this reason,
the mindmap library defines a special to-path, that performs the
necessary computations for you.
-\begin{itemize}
- \itemstyle{circle connection bar}
+\begin{stylekey}{/tikz/circle connection bar}
This style installs a rather involved to-path. Unlike normal
to-paths, this path requires that the start and the target of the
to-path are named nodes of shape |circle| -- if this is not the case,
@@ -350,15 +359,14 @@ necessary computations for you.
Assuming that the start and the target are circles, the to-path will
first compute the radii of these circles (by measuring the distance
from the |center| anchor to some anchor on the border) and will set
- the |\pgfsnakecirlce...| macros accordingly. Next, the |fill| option
- is set to the |concept color| while |draw=none| is set. The snake is
+ the |start circle| keys accordingly. Next, the |fill| option
+ is set to the |concept color| while |draw=none| is set. The decoration is
set to |circle conncetion bar|. Finally, the following style is
included:
- \begin{itemize}
- \itemstyle{every circle connection bar}
+ \begin{stylekey}{/tikz/every circle connection bar}
Redefine this sytle to change the appearance of circle connection
bar to-paths.
- \end{itemize}
+ \end{stylekey}
\begin{codeexample}[]
\begin{tikzpicture}[concept color=blue!50,blue!50,outer sep=0pt]
\node (n1) at (0,0) [circle,minimum size=2cm,fill,draw,thick] {};
@@ -371,7 +379,7 @@ necessary computations for you.
together this the option |circle connection bar| in a single
|\path|. Use the |edge| operation, instead, for creating multiple
connections and this operation creates a new scope for each edge.
-\end{itemize}
+\end{stylekey}
In a mindmap we sometimes want colors to change from one concept color
to another. Then, the connection bar should, ideally, consist of a
@@ -379,9 +387,8 @@ smooth transition between these two colors. Getting this right using
shadings is a bit tricky if you try this ``by hand,'' so the mindmap
library provides a special option for facilitating this procedure.
-\begin{itemize}
- \itemoption{circle connection bar switch color}|=from (|\meta{first
- color}|) to (|\meta{second color}|)|
+\begin{key}{/tikz/circle connection bar switch color=|from (|\meta{first
+ color}|) to (|\meta{second color}|)|}
This style works similarly to the |circle connection bar|. The only
difference is that instead of filling the path with a single color a
shading is used.
@@ -393,7 +400,7 @@ library provides a special option for facilitating this procedure.
\path (n1) to[circle connection bar switch color=from (red) to (blue)] (n2);
\end{tikzpicture}
\end{codeexample}
-\end{itemize}
+\end{key}
\subsubsection{Tree Edges}
@@ -448,38 +455,25 @@ extra concept, simply explains something in the mindmap. The following
style is mainly intended to help readers of the code see that a node
in an annotation node.
-\begin{itemize}
- \itemstyle{annotation}
+\begin{stylekey}{/tikz/annotation}
This style indicates that a node is an annotation node. It includes
the style |every annotation|, which allows you to change this style
in a convenient fashion.
\begin{codeexample}[]
-\tikzstyle{every annotation}=[fill=red!20]
-\begin{tikzpicture}[mindmap,concept color=blue!80]
+
+\begin{tikzpicture}
+ [mindmap,concept color=blue!80,
+ every annotation/.style={fill=red!20}]
\node [concept] (root) {Root concept};
\node [annotation,right] at (root.east)
{The root concept is, in general, the most important concept.};
\end{tikzpicture}
\end{codeexample}
- \itemstyle{every annotation}
+ \begin{stylekey}{/tikz/every annotation}
This style is included by |annotation|.
-\end{itemize}
-
-
-\subsection{Examples}
-
-The following pictures show examples of more complicated mindmaps that
-have been created using the mindmap library. Note that these mindmaps
-should be printed on A1 paper.
-
-\medskip
-\noindent
-\pgfimage[width=\textwidth]{pgfmanual-mindmap-1}
-
-\medskip
-\noindent
-\pgfimage[width=\textwidth]{pgfmanual-mindmap-2}
+ \end{stylekey}
+\end{stylekey}