% !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