summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/tikz-ext/doc/tikz-ext-manual-en-pgf-shapes-heatmark.tex
blob: fa13cb00004a2a91b923cfea65a0ad260b8939fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
% !TeX spellcheck = en_US
% !TeX root = tikz-ext-manual.tex
% Copyright 2022 by Qrrbrbirlbel
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Free Documentation License.
%
\section{Shape: Heatmark}
\begin{pgflibrary}{ext.shapes.heatmark}
  A circular shape that has customizable rings around it.
  \inspiration{ShapeHeat-Q}{ShapeHeat-A}
\end{pgflibrary}

\begin{shape}{heatmark}
  \begin{key}{/pgf/heatmark arcs=\meta{arcs num} (initially 3)}
  Sets the number of arc around the circle to \meta{arcs num}.
  \end{key}
  \begin{key}{/pgf/heatmark arc width=\meta{arc width} (initially 4pt)}
  Sets the width of the rings around the circle to \meta{arc width}.
  \end{key}
  \begin{key}{/pgf/heatmark arc sep=\meta{sep length} (initially 1pt)}
  Sets the whitespace between the rings to \meta{sep length}.
  \end{key}
  \begin{key}{/pgf/heatmark arc rings=\meta{rings num} (initially 3)}
  Sets the number of rings around the circle to \meta{rings num}
  \end{key}
  \begin{key}{/pgf/heatmark arc sep angle=\meta{sep angle} (initially 20)}
  Sets the whitespace angle between the arcs in one ring to \meta{sep angle}.
  \end{key}
  \begin{key}{/pgf/heatmark inner opacity=\meta{inner opacity} (initially 0.8)}
  Sets the opacity of the inner ring to \meta{inner opacity}.
  \end{key}
  \begin{key}{/pgf/heatmark outer opacity=\meta{low opacity} (initially 0.2)}
  Sets the opacity of the outer ring to \meta{outer opacity}.
  
  The opacity of the rings between the outer and the inner ring will be interpolated by these two opacities.
  \end{key}

This shape takes the value of |/pgf/shape border rotate|%
\indexKeyO[/pgf/]{shape border rotate} into consideration.

For every ring and for every arc the following styke keys are tried.
\begin{stylekey}{/pgf/heatmark ring \meta{ring number}}
\end{stylekey}
\begin{stylekey}{/pgf/heatmark arc \meta{arc number}}
\end{stylekey}
\begin{stylekey}{/pgf/heatmark ring \meta{ring number} arc \meta{arc number}}
\end{stylekey}

The \pgfname shape is setup in a way that even \tikzname\space
styles can be used with a little bit work:
\begin{codeexample}[preamble=\usetikzlibrary{ext.shapes.heatmark}]
\tikz[
  shape border rotate=90,
  /pgf/heatmark ring 1/.append style={/tikz/fill=green},
  /pgf/heatmark arc 1/.append style={/tikz/fill=blue},
  /pgf/heatmark ring 2 arc 2/.append style={/tikz/fill=yellow!70!black}
] \node[heatmark, fill=red] (n) {100};
\end{codeexample}

It is best to use this shape with no actual border (|draw = none|) and the |outer sep| set to zero.
\begin{codeexample}[preamble=\usetikzlibrary{ext.shapes.heatmark},width=16cm]
\begin{tikzpicture}\Huge
\node[name=s, shape=heatmark, shape example,
  fill=blue!25, draw=none, outer sep=0pt]
  {Heatmark\vrule width 1pt height 2cm};
\foreach \anchor/\placement in
  {north west/above left, north/above,
                          north east/above right,
         west/left, center/above,      east/right,
     mid west/right,   mid/above,  mid east/left,
    base west/left,   base/below, base east/right,
   south west/below left, south/below,
                          south east/below right,
   text/left, 10/right, 130/above}
   \draw[shift=(s.\anchor)] plot[mark=x] coordinates{(0,0)}
     node[\placement] {\scriptsize\texttt{(s.\anchor)}};
\end{tikzpicture}
\end{codeexample}
\end{shape}
\endinput