From 342f2e1be699f5ec70b5b1c35d9cd59798d37304 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 4 May 2021 03:01:16 +0000 Subject: CTAN sync 202105040301 --- graphics/pgf/contrib/pgf-pie/COPYING | 4 +- graphics/pgf/contrib/pgf-pie/README | 3 - graphics/pgf/contrib/pgf-pie/README.md | 15 + graphics/pgf/contrib/pgf-pie/RELEASE_NOTES.md | 4 + .../pgf/contrib/pgf-pie/before-after-number.tex | 3 - graphics/pgf/contrib/pgf-pie/cloud.svg | 93 ----- graphics/pgf/contrib/pgf-pie/cloud.tex | 3 - graphics/pgf/contrib/pgf-pie/color.tex | 6 - graphics/pgf/contrib/pgf-pie/colorwheel.tex | 3 - .../contrib/pgf-pie/demo/before-after-number.tex | 3 + graphics/pgf/contrib/pgf-pie/demo/cloud.svg | 93 +++++ graphics/pgf/contrib/pgf-pie/demo/cloud.tex | 3 + graphics/pgf/contrib/pgf-pie/demo/color.tex | 6 + graphics/pgf/contrib/pgf-pie/demo/colorwheel.tex | 3 + graphics/pgf/contrib/pgf-pie/demo/explode.tex | 7 + graphics/pgf/contrib/pgf-pie/demo/first-pie.svg | 75 ++++ graphics/pgf/contrib/pgf-pie/demo/first-pie.tex | 3 + graphics/pgf/contrib/pgf-pie/demo/hide-number.tex | 3 + graphics/pgf/contrib/pgf-pie/demo/legend.tex | 3 + graphics/pgf/contrib/pgf-pie/demo/polar.svg | 75 ++++ graphics/pgf/contrib/pgf-pie/demo/polar.tex | 3 + graphics/pgf/contrib/pgf-pie/demo/population.tex | 27 ++ graphics/pgf/contrib/pgf-pie/demo/radius.tex | 7 + graphics/pgf/contrib/pgf-pie/demo/scalefont.tex | 3 + graphics/pgf/contrib/pgf-pie/demo/shadow.tex | 4 + graphics/pgf/contrib/pgf-pie/demo/square.svg | 75 ++++ graphics/pgf/contrib/pgf-pie/demo/square.tex | 3 + graphics/pgf/contrib/pgf-pie/demo/sum.tex | 5 + graphics/pgf/contrib/pgf-pie/demo/text-inside.tex | 3 + graphics/pgf/contrib/pgf-pie/demo/text.tex | 3 + graphics/pgf/contrib/pgf-pie/description.html | 1 + graphics/pgf/contrib/pgf-pie/explode.tex | 7 - graphics/pgf/contrib/pgf-pie/first-pie.svg | 75 ---- graphics/pgf/contrib/pgf-pie/first-pie.tex | 3 - graphics/pgf/contrib/pgf-pie/hide-number.tex | 3 - graphics/pgf/contrib/pgf-pie/legend.tex | 3 - graphics/pgf/contrib/pgf-pie/pgf-pie-manual.pdf | Bin 84480 -> 181416 bytes graphics/pgf/contrib/pgf-pie/pgf-pie-manual.tex | 156 +++---- graphics/pgf/contrib/pgf-pie/pgf-pie.sty | 450 +------------------- graphics/pgf/contrib/pgf-pie/polar.svg | 75 ---- graphics/pgf/contrib/pgf-pie/polar.tex | 3 - graphics/pgf/contrib/pgf-pie/population.tex | 27 -- graphics/pgf/contrib/pgf-pie/radius.tex | 7 - graphics/pgf/contrib/pgf-pie/scalefont.tex | 3 - graphics/pgf/contrib/pgf-pie/shadow.tex | 4 - graphics/pgf/contrib/pgf-pie/square.svg | 75 ---- graphics/pgf/contrib/pgf-pie/square.tex | 3 - graphics/pgf/contrib/pgf-pie/sum.tex | 5 - graphics/pgf/contrib/pgf-pie/text-inside.tex | 3 - graphics/pgf/contrib/pgf-pie/text.tex | 3 - .../pgf/contrib/pgf-pie/tikzlibrarypie.code.tex | 465 +++++++++++++++++++++ 51 files changed, 961 insertions(+), 951 deletions(-) delete mode 100644 graphics/pgf/contrib/pgf-pie/README create mode 100644 graphics/pgf/contrib/pgf-pie/README.md create mode 100644 graphics/pgf/contrib/pgf-pie/RELEASE_NOTES.md delete mode 100644 graphics/pgf/contrib/pgf-pie/before-after-number.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/cloud.svg delete mode 100644 graphics/pgf/contrib/pgf-pie/cloud.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/color.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/colorwheel.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/before-after-number.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/cloud.svg create mode 100644 graphics/pgf/contrib/pgf-pie/demo/cloud.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/color.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/colorwheel.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/explode.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/first-pie.svg create mode 100644 graphics/pgf/contrib/pgf-pie/demo/first-pie.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/hide-number.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/legend.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/polar.svg create mode 100644 graphics/pgf/contrib/pgf-pie/demo/polar.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/population.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/radius.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/scalefont.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/shadow.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/square.svg create mode 100644 graphics/pgf/contrib/pgf-pie/demo/square.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/sum.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/text-inside.tex create mode 100644 graphics/pgf/contrib/pgf-pie/demo/text.tex create mode 100644 graphics/pgf/contrib/pgf-pie/description.html delete mode 100644 graphics/pgf/contrib/pgf-pie/explode.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/first-pie.svg delete mode 100644 graphics/pgf/contrib/pgf-pie/first-pie.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/hide-number.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/legend.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/polar.svg delete mode 100644 graphics/pgf/contrib/pgf-pie/polar.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/population.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/radius.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/scalefont.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/shadow.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/square.svg delete mode 100644 graphics/pgf/contrib/pgf-pie/square.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/sum.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/text-inside.tex delete mode 100644 graphics/pgf/contrib/pgf-pie/text.tex create mode 100644 graphics/pgf/contrib/pgf-pie/tikzlibrarypie.code.tex (limited to 'graphics') diff --git a/graphics/pgf/contrib/pgf-pie/COPYING b/graphics/pgf/contrib/pgf-pie/COPYING index 63e7458132..8cdb966794 100644 --- a/graphics/pgf/contrib/pgf-pie/COPYING +++ b/graphics/pgf/contrib/pgf-pie/COPYING @@ -7,5 +7,5 @@ alternatively under the terms of the General Public License (GPL) Version 2. The terms of each license can be found in the source repository: -Apache License: ./LICENSE-LPPL1.3c.txt -GPL2 License: ./LICENSE-GPL2.txt +LaTeX Project Public License: doc/latex/pgf-pie/LICENSE-LPPL1.3c.txt +General Public License 2: doc/latex/pgf-pie/LICENSE-GPL2.txt diff --git a/graphics/pgf/contrib/pgf-pie/README b/graphics/pgf/contrib/pgf-pie/README deleted file mode 100644 index 6849209916..0000000000 --- a/graphics/pgf/contrib/pgf-pie/README +++ /dev/null @@ -1,3 +0,0 @@ -Some LaTeX macros for pie chart by using PGF/Tikz package. -Home page of project: http://pgf-pie.googlecode.com/ -Please read pgf-pie-manual.pdf for more information. diff --git a/graphics/pgf/contrib/pgf-pie/README.md b/graphics/pgf/contrib/pgf-pie/README.md new file mode 100644 index 0000000000..a35f1b23c7 --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/README.md @@ -0,0 +1,15 @@ +# pgf-pie + +![CI](https://github.com/pgf-tikz/pgf-pie/workflows/CI/badge.svg) + +Some LaTeX macros for pie charts using the PGF/TikZ package. + +Please go to the official repository at https://github.com/pgf-tikz/pgf-pie or +the official mailing list at https://tug.org/mailman/listinfo/pgf-tikz to +submit bug reports, request new features, etc. + +Please read pgf-pie-manual.pdf for more information. + +## License + +pgf-pie is released under the terms of both the LPPL v1.3c and the GPL v2. diff --git a/graphics/pgf/contrib/pgf-pie/RELEASE_NOTES.md b/graphics/pgf/contrib/pgf-pie/RELEASE_NOTES.md new file mode 100644 index 0000000000..a70048c12f --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/RELEASE_NOTES.md @@ -0,0 +1,4 @@ +# Bug fixes + +Loop counter variables have been renamed with the \pgfpie@ prefix to avoid +clashes with user macros. diff --git a/graphics/pgf/contrib/pgf-pie/before-after-number.tex b/graphics/pgf/contrib/pgf-pie/before-after-number.tex deleted file mode 100644 index 0a50ebf9d9..0000000000 --- a/graphics/pgf/contrib/pgf-pie/before-after-number.tex +++ /dev/null @@ -1,3 +0,0 @@ -\begin{tikzpicture} - \pie[before number={\$}, after number=,]{10/A, 20/B, 30/C, 40/D} -\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/cloud.svg b/graphics/pgf/contrib/pgf-pie/cloud.svg deleted file mode 100644 index 3fb608e5fb..0000000000 --- a/graphics/pgf/contrib/pgf-pie/cloud.svg +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/graphics/pgf/contrib/pgf-pie/cloud.tex b/graphics/pgf/contrib/pgf-pie/cloud.tex deleted file mode 100644 index fba25f896c..0000000000 --- a/graphics/pgf/contrib/pgf-pie/cloud.tex +++ /dev/null @@ -1,3 +0,0 @@ -\begin{tikzpicture} - \pie[cloud, text=inside, scale font]{10/A, 20/B, 30/C, 40/D} -\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/color.tex b/graphics/pgf/contrib/pgf-pie/color.tex deleted file mode 100644 index cb79b8c0ef..0000000000 --- a/graphics/pgf/contrib/pgf-pie/color.tex +++ /dev/null @@ -1,6 +0,0 @@ -\begin{tikzpicture} - \pie[color={black!10, black!20, black!30, black!40}] - {10/A, 20/B, 30/C, 40/D} - - \pie[pos={8,0}, color=blue!20] {10/A, 20/B, 30/C, 40/D} -\end{tikzpicture} diff --git a/graphics/pgf/contrib/pgf-pie/colorwheel.tex b/graphics/pgf/contrib/pgf-pie/colorwheel.tex deleted file mode 100644 index 1543fbe7c8..0000000000 --- a/graphics/pgf/contrib/pgf-pie/colorwheel.tex +++ /dev/null @@ -1,3 +0,0 @@ -\begin{tikzpicture} - \pie{10/, 10/, 10/, 10/, 10/, 10/, 10/, 10/, 10/, 10/} -\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/demo/before-after-number.tex b/graphics/pgf/contrib/pgf-pie/demo/before-after-number.tex new file mode 100644 index 0000000000..0a50ebf9d9 --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/before-after-number.tex @@ -0,0 +1,3 @@ +\begin{tikzpicture} + \pie[before number={\$}, after number=,]{10/A, 20/B, 30/C, 40/D} +\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/demo/cloud.svg b/graphics/pgf/contrib/pgf-pie/demo/cloud.svg new file mode 100644 index 0000000000..3fb608e5fb --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/cloud.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/graphics/pgf/contrib/pgf-pie/demo/cloud.tex b/graphics/pgf/contrib/pgf-pie/demo/cloud.tex new file mode 100644 index 0000000000..fba25f896c --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/cloud.tex @@ -0,0 +1,3 @@ +\begin{tikzpicture} + \pie[cloud, text=inside, scale font]{10/A, 20/B, 30/C, 40/D} +\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/demo/color.tex b/graphics/pgf/contrib/pgf-pie/demo/color.tex new file mode 100644 index 0000000000..cb79b8c0ef --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/color.tex @@ -0,0 +1,6 @@ +\begin{tikzpicture} + \pie[color={black!10, black!20, black!30, black!40}] + {10/A, 20/B, 30/C, 40/D} + + \pie[pos={8,0}, color=blue!20] {10/A, 20/B, 30/C, 40/D} +\end{tikzpicture} diff --git a/graphics/pgf/contrib/pgf-pie/demo/colorwheel.tex b/graphics/pgf/contrib/pgf-pie/demo/colorwheel.tex new file mode 100644 index 0000000000..1543fbe7c8 --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/colorwheel.tex @@ -0,0 +1,3 @@ +\begin{tikzpicture} + \pie{10/, 10/, 10/, 10/, 10/, 10/, 10/, 10/, 10/, 10/} +\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/demo/explode.tex b/graphics/pgf/contrib/pgf-pie/demo/explode.tex new file mode 100644 index 0000000000..94c83fc70a --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/explode.tex @@ -0,0 +1,7 @@ +\begin{tikzpicture} + % explode list + \pie[explode={0, 0, 0, 0.1}] {10/A, 20/B, 30/C, 40/D} + + % explode all + \pie[pos={8,0}, explode=0.1] {10/A, 20/B, 30/C, 40/D} +\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/demo/first-pie.svg b/graphics/pgf/contrib/pgf-pie/demo/first-pie.svg new file mode 100644 index 0000000000..9feb8fe15c --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/first-pie.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/graphics/pgf/contrib/pgf-pie/demo/first-pie.tex b/graphics/pgf/contrib/pgf-pie/demo/first-pie.tex new file mode 100644 index 0000000000..e8c63761b4 --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/first-pie.tex @@ -0,0 +1,3 @@ +\begin{tikzpicture} + \pie{10/A, 20/B, 30/C, 40/D} +\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/demo/hide-number.tex b/graphics/pgf/contrib/pgf-pie/demo/hide-number.tex new file mode 100644 index 0000000000..53252173e0 --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/hide-number.tex @@ -0,0 +1,3 @@ +\begin{tikzpicture} + \pie[hide number]{10/A, 20/B, 30/C, 40/D} +\end{tikzpicture} diff --git a/graphics/pgf/contrib/pgf-pie/demo/legend.tex b/graphics/pgf/contrib/pgf-pie/demo/legend.tex new file mode 100644 index 0000000000..f6665f6c8e --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/legend.tex @@ -0,0 +1,3 @@ +\begin{tikzpicture} + \pie[text=legend]{10/First, 20/Second, 30/Third, 40/Fourth} +\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/demo/polar.svg b/graphics/pgf/contrib/pgf-pie/demo/polar.svg new file mode 100644 index 0000000000..a4442a04df --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/polar.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/graphics/pgf/contrib/pgf-pie/demo/polar.tex b/graphics/pgf/contrib/pgf-pie/demo/polar.tex new file mode 100644 index 0000000000..4d86872493 --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/polar.tex @@ -0,0 +1,3 @@ +\begin{tikzpicture} + \pie[polar]{10/A, 20/B, 30/C, 40/D} +\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/demo/population.tex b/graphics/pgf/contrib/pgf-pie/demo/population.tex new file mode 100644 index 0000000000..9267acb3fc --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/population.tex @@ -0,0 +1,27 @@ +% data from http://en.wikipedia.org/wiki/List_of_countries_by_population +\begin{tikzpicture} + \pie[cloud, rotate=45, sum=auto, radius=35, after number=, text=pin] {1339/China, + 1210/India, 312/USA, 237/Indonesia, 190/Brazil, 177/Pakistan, + 158/Nigeria, 151/Bangladesh, 142/Russia, 127/Japan, 112/Mexico, + 94/Philippines, 87/Vietnam, 82/Ethiopia, 81/Germany, 80/Egypt, + 75/Iran, 73/Turkey, 67/Thailand, 65/Congo, 65/France, 62/UK, + 60/Italy, 50/South Africa, 48/South Korea, 47/Myanmar, 46/Spain, + 46/Colombia, 45/Ukraine, 43/Tanzania, 40/Argentina, 38/Kenya, + 38/Poland, 36/Algeria, 34/Canada, 32/Morocco, 31/Uganda, 31/Iraq, + 31/Afghanistan, 30/Sudan, 29/Peru, 29/Venezuela, 28/Nepal, + 28/Malaysia, 27/Uzbekistan, 27/Saudi Arabia, 24/Ghana, 24/North + Korea, 23/Syria, 23/Taiwan, 22/Australia, 22/Yemen, 21/Romania, + 20/Madagascar, 20/Sri Lanka, 20/Mozambique, 19/Cote d'Ivoire, + 19/Cameroon, 19/Angola, 17/Chile, 16/Netherlands, 16/Kazakhstan, + 15/Burkina Faso, 15/Niger, 14/Malawi, 14/Mali, 14/Guatemala, + 14/Ecuador, 13/Cambodia, 13/Zambia, 12/Zimbabwe, 12/Senegal, + 11/Cuba, 11/Chad, 10/Belgium, 10/Greece, 10/Portugal, 10/Tunisia, + 10/Czech Republic, 10/Bolivia, 10/Rwanda, 10/Haiti, 10/Hungary, + 10/Guinea, 10/Belarus, 9/Sweden, 9/Dominican Republic, 9/Somalia, + 9/Azerbaijan, 9/Benin, 8/Austria, 8/Burundi, 8/United Arab + Emirates, 8/South Sudan, 8/Honduras, 8/Switzerland, 8/Israel, + 7/Bulgaria, 7/Serbia, 7/Hong Kong } + + % \node[circle,draw=black,thick, fill=white, font=\bf] + % {Population of the world}; +\end{tikzpicture} diff --git a/graphics/pgf/contrib/pgf-pie/demo/radius.tex b/graphics/pgf/contrib/pgf-pie/demo/radius.tex new file mode 100644 index 0000000000..944e218219 --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/radius.tex @@ -0,0 +1,7 @@ +\begin{tikzpicture} + \pie{10/, 20/, 30/, 40/} + + \pie[pos={8,0}, rotate=180]{10/, 20/, 30/, 40/} + + \pie[pos={17,0}, radius=4]{10/, 20/, 30/, 40/} +\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/demo/scalefont.tex b/graphics/pgf/contrib/pgf-pie/demo/scalefont.tex new file mode 100644 index 0000000000..df61709c40 --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/scalefont.tex @@ -0,0 +1,3 @@ +\begin{tikzpicture} + \pie[scale font]{10/A, 20/B, 30/C, 40/D} +\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/demo/shadow.tex b/graphics/pgf/contrib/pgf-pie/demo/shadow.tex new file mode 100644 index 0000000000..9ccfd9ffb5 --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/shadow.tex @@ -0,0 +1,4 @@ +% \usetikzlibrary{shadows} +\begin{tikzpicture} + \pie[style=drop shadow]{10/A, 20/B, 30/C, 40/D} +\end{tikzpicture} diff --git a/graphics/pgf/contrib/pgf-pie/demo/square.svg b/graphics/pgf/contrib/pgf-pie/demo/square.svg new file mode 100644 index 0000000000..8e0a48f86a --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/square.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/graphics/pgf/contrib/pgf-pie/demo/square.tex b/graphics/pgf/contrib/pgf-pie/demo/square.tex new file mode 100644 index 0000000000..dd37da64cf --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/square.tex @@ -0,0 +1,3 @@ +\begin{tikzpicture} + \pie[square]{40/A, 30/B, 20/C, 10/D} +\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/demo/sum.tex b/graphics/pgf/contrib/pgf-pie/demo/sum.tex new file mode 100644 index 0000000000..13e2b7365c --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/sum.tex @@ -0,0 +1,5 @@ +\begin{tikzpicture} + \pie[sum=auto, after number=, radius=2]{33/Boys, 7/Girls} + + \pie[pos={6,0}, sum=40, after number=, radius=2]{33/Boys} +\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/demo/text-inside.tex b/graphics/pgf/contrib/pgf-pie/demo/text-inside.tex new file mode 100644 index 0000000000..07cf42eafd --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/text-inside.tex @@ -0,0 +1,3 @@ +\begin{tikzpicture} + \pie[text=inside]{10/A, 20/B, 30/C, 40/D} +\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/demo/text.tex b/graphics/pgf/contrib/pgf-pie/demo/text.tex new file mode 100644 index 0000000000..95ef108578 --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/demo/text.tex @@ -0,0 +1,3 @@ +\begin{tikzpicture} + \pie[text=pin]{10/A, 20/B, 30/C, 40/D} +\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/description.html b/graphics/pgf/contrib/pgf-pie/description.html new file mode 100644 index 0000000000..820aa9bb3d --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/description.html @@ -0,0 +1 @@ +

The package provides the means to draw pie (and variant) charts, using PGF/TikZ.

diff --git a/graphics/pgf/contrib/pgf-pie/explode.tex b/graphics/pgf/contrib/pgf-pie/explode.tex deleted file mode 100644 index 94c83fc70a..0000000000 --- a/graphics/pgf/contrib/pgf-pie/explode.tex +++ /dev/null @@ -1,7 +0,0 @@ -\begin{tikzpicture} - % explode list - \pie[explode={0, 0, 0, 0.1}] {10/A, 20/B, 30/C, 40/D} - - % explode all - \pie[pos={8,0}, explode=0.1] {10/A, 20/B, 30/C, 40/D} -\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/first-pie.svg b/graphics/pgf/contrib/pgf-pie/first-pie.svg deleted file mode 100644 index 9feb8fe15c..0000000000 --- a/graphics/pgf/contrib/pgf-pie/first-pie.svg +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/graphics/pgf/contrib/pgf-pie/first-pie.tex b/graphics/pgf/contrib/pgf-pie/first-pie.tex deleted file mode 100644 index e8c63761b4..0000000000 --- a/graphics/pgf/contrib/pgf-pie/first-pie.tex +++ /dev/null @@ -1,3 +0,0 @@ -\begin{tikzpicture} - \pie{10/A, 20/B, 30/C, 40/D} -\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/hide-number.tex b/graphics/pgf/contrib/pgf-pie/hide-number.tex deleted file mode 100644 index 53252173e0..0000000000 --- a/graphics/pgf/contrib/pgf-pie/hide-number.tex +++ /dev/null @@ -1,3 +0,0 @@ -\begin{tikzpicture} - \pie[hide number]{10/A, 20/B, 30/C, 40/D} -\end{tikzpicture} diff --git a/graphics/pgf/contrib/pgf-pie/legend.tex b/graphics/pgf/contrib/pgf-pie/legend.tex deleted file mode 100644 index f6665f6c8e..0000000000 --- a/graphics/pgf/contrib/pgf-pie/legend.tex +++ /dev/null @@ -1,3 +0,0 @@ -\begin{tikzpicture} - \pie[text=legend]{10/First, 20/Second, 30/Third, 40/Fourth} -\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.pdf b/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.pdf index 961445766e..f8485f2bf0 100644 Binary files a/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.pdf and b/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.pdf differ diff --git a/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.tex b/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.tex index f9235a2eb7..c1e16c4e06 100644 --- a/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.tex +++ b/graphics/pgf/contrib/pgf-pie/pgf-pie-manual.tex @@ -2,30 +2,32 @@ % chart. Written by Xu Yuan This file is part of % pgf-pie you may get it at https://github.com/pgf-tikz/pgf-pie -\documentclass{article} -\usepackage[margin=12mm]{geometry} -\usepackage{hyperref} +\documentclass{ltxdoc} \usepackage{pgf-pie} \usetikzlibrary{shadows} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\usepackage{listings} -\usepackage{color} -\definecolor{listinggray}{gray}{0.92} -\lstset{ % -language=[LaTeX]TeX, -breaklines=true, -frame=single, -% frameround=tttt, -basicstyle=\footnotesize\ttfamily, -backgroundcolor=\color{listinggray}, -keywordstyle=\color{blue} +\usepackage[a4paper,left=2.25cm,right=2.25cm,top=2.5cm,bottom=2.5cm,nohead]{geometry} +\usepackage{calc} +\usepackage{graphicx} +\input{pgfmanual-en-macros.tex} + +\pgfqkeys{/codeexample}{% + scale/.store in=\pgfpieexamplescale, + scale=1, + every codeexample/.style={% + width=.4\textwidth+7pt, + pre={ + \setbox\codeexamplebox=\hbox\bgroup + }, + post={ + \egroup + \resizebox{\pgfpieexamplescale\textwidth}{!}{\box\codeexamplebox}% + }, + }, } -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\hypersetup{ +\usepackage[ colorlinks=true, linkcolor=blue, anchorcolor=black, @@ -33,53 +35,23 @@ keywordstyle=\color{blue} filecolor=magenta, menucolor=red, urlcolor=blue -} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand{\demo}[2][1]{ - \begin{center} - \begin{tabular}{cc} - \begin{minipage}{.49\linewidth} - \centering - \resizebox{#1\linewidth}{!}{ - \input{demo/#2} - } - \end{minipage} - & - \begin{minipage}{.45\linewidth} - \lstinputlisting{demo/#2} - \end{minipage} - \end{tabular} - \end{center} -} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand{\example}[2][1]{ - \begin{center} - \resizebox{#1\linewidth}{!}{ - \input{demo/#2} - } - \end{center} - \lstinputlisting{demo/#2} -} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +]{hyperref} + +\newcommand\pgfpiename{\texttt{pgf-pie}} \begin{document} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\title{Drawing Pie Chart by using \texttt{pgf-pie}} + +\title{Drawing Pie Chart by using \pgfpiename} \author{\href{mailto:xuyuan.cn@gmail.com}{Yuan Xu}} -\date{\today{}~(v0.3)} +\date{\today{}~(v0.5)} \maketitle -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{abstract} - \texttt{pgf-pie} is a LaTeX package for drawing pie chart (and + \pgfpiename\ is a LaTeX package for drawing pie chart (and variant charts). As stated by its name, it is based on a very - popular graphic package \texttt{PGF/TikZ}. This document presents - the usage of \texttt{pgf-pie} and collects some pie charts as - examples. \texttt{pgf-pie} can be downloaded from + popular graphic package \pgfname/\tikzname. This document presents + the usage of \pgfpiename\ and collects some pie charts as + examples. \pgfpiename\ can be downloaded from \href{https://github.com/pgf-tikz/pgf-pie}{https://github.com/pgf-tikz/pgf-pie}. \end{abstract} @@ -88,28 +60,28 @@ keywordstyle=\color{blue} \section{Usage} \subsection{First Pie} -\lstinline|\pie| is the only coomand that provided by -\texttt{pgf-pie}. The argument is a list of number and text -combination in the formate of \texttt{number/text}, i.e. \texttt{10/A, - 20/B, 30/C, 40/D}. The result is shown in figure \ref{fig:first-pie}. +|\pie| is the only coomand that provided by +\pgfpiename. The argument is a list of number and text +combination in the formate of |number/text|, i.e. |10/A, 20/B, 30/C, 40/D|. +The result is shown in figure \ref{fig:first-pie}. \begin{figure} \centering - \demo[0.6]{first-pie} + \codeexample[scale=0.25,from file={demo/first-pie.tex}] \caption{The first pie.} \label{fig:first-pie} \end{figure} \subsection{Position, Rotation, Size} -The center of chart can be set by \texttt{pos}, default is -\texttt{\{0,0\}}. The chart can be rotated by setting \texttt{rotate} -(in degrees). The size of chart can be set by \texttt{radius}, default +The center of chart can be set by |pos|, default is +|{0,0}|. The chart can be rotated by setting |rotate| +(in degrees). The size of chart can be set by |radius|, default is 3. -\demo{radius} +\codeexample[scale=0.4,from file={demo/radius.tex}] \subsection{Color} -The color can be specified by \texttt{color}, the default color wheel +The color can be specified by |color|, the default color wheel is shown in figure \ref{fig:color-wheel}. \begin{figure} \centering @@ -118,52 +90,52 @@ is shown in figure \ref{fig:color-wheel}. \label{fig:color-wheel} \end{figure} -\demo{color} +\codeexample[scale=0.4,from file={demo/color.tex}] \subsection{Explode} -\demo{explode} +\codeexample[scale=0.4,from file={demo/explode.tex}] \subsection{Angle of slices} -The value of \texttt{sum} indicats the sum of all data in the chart, +The value of |sum| indicats the sum of all data in the chart, it is 100 by default. It can be calculated automatically when -\texttt{auto} is set. Then the angle of slices are determined by -number value and \texttt{sum}. +|auto| is set. Then the angle of slices are determined by +number value and |sum|. -\demo{sum} +\codeexample[scale=0.4,from file={demo/sum.tex}] \subsection{Text} \subsubsection{Number} -Two parameters can be used to decorate number: \texttt{before number} -and \texttt{after number}. Both are empty by default, but if -\texttt{sum=100}, \texttt{after number} will be set to \% +Two parameters can be used to decorate number: |before number| +and |after number|. Both are empty by default, but if +|sum=100|, |after number| will be set to \% automatically if user doesn't set it. -\demo[0.6]{before-after-number} +\codeexample[scale=0.25,from file={demo/before-after-number.tex}] -The number also can be hide by \texttt{hide number}: +The number also can be hide by |hide number|: -\demo[0.6]{hide-number} +\codeexample[scale=0.25,from file={demo/hide-number.tex}] \paragraph{Scale font} The size of font in size pie can be scaled according to how big the part is automatically. -\demo[0.6]{scalefont} +\codeexample[scale=0.25,from file={demo/scalefont.tex}] \subsubsection{Label text} -The value of \texttt{text} can be \texttt{label}(default), -\texttt{pin}, \texttt{inside} or \texttt{legend}. +The value of |text| can be |label| (default), +|pin|, |inside| or |legend|. -\demo[0.6]{text} +\codeexample[scale=0.25,from file={demo/text.tex}] -\demo[0.5]{text-inside} +\codeexample[scale=0.25,from file={demo/text-inside.tex}] -\demo[0.6]{legend} +\codeexample[scale=0.25,from file={demo/legend.tex}] \subsection{More about style} \subsubsection{shadow} -\demo[0.6]{shadow} +\codeexample[scale=0.25,from file={demo/shadow.tex}] \section{Variant Charts} \subsection{Polar area diagram} @@ -171,17 +143,17 @@ The polar area diagram is similar to a usual pie chart, except sectors are equal angles and differ rather in how far each sector extends from the center of the circle. -\demo[0.6]{polar} +\codeexample[scale=0.25,from file={demo/polar.tex}] \subsection{Square} -\demo[0.6]{square} +\codeexample[scale=0.25,from file={demo/square.tex}] -Note: \texttt{explode} has no affects in sqaure chart. +Note: |explode| has no affects in sqaure chart. \subsection{Clouds} -\demo[0.6]{cloud} +\codeexample[scale=0.25,from file={demo/cloud.tex}] \section{Examples} @@ -189,7 +161,7 @@ Note: \texttt{explode} has no affects in sqaure chart. % \example{population} \section{Acknowledgements} -Many people contributed to \texttt{pgf-pie} by reporting problems, +Many people contributed to \pgfpiename\ by reporting problems, suggesting various improvements or submitting code. Here is a list of these people: \href{mailto:mohammed.alfaki@ii.uib.no}{Mohammed Alfaki}, diff --git a/graphics/pgf/contrib/pgf-pie/pgf-pie.sty b/graphics/pgf/contrib/pgf-pie/pgf-pie.sty index 0aaa3a0b54..b717b076a1 100644 --- a/graphics/pgf/contrib/pgf-pie/pgf-pie.sty +++ b/graphics/pgf/contrib/pgf-pie/pgf-pie.sty @@ -1,450 +1,6 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Start of pgf-pie.sty -% -% Some LaTeX macros for pie chart by using PGF/Tikz package. -% Home page of project: http://pgf-pie.googlecode.com/ -% Author: Xu Yuan -% - +% SPDX-License-Identifier: GPL-2.0-only OR LPPL-1.3c \NeedsTeXFormat{LaTeX2e}[1999/12/01] -\ProvidesPackage{pgf-pie}[2020/05/27 v0.3 Some LaTeX macros for pie +\ProvidesPackage{pgf-pie}[2021/05/03 v0.5 Some LaTeX macros for pie chart by using PGF/Tikz package.] - \RequirePackage{tikz} -\RequirePackage{ifthen} -\RequirePackage{scalefnt} - - -% args: -% #1: begin angle -% #2: end angle -% #3: number -% #4: label -% #5: explode -% #6: fill color -% #7: radius -% #8: center -\newcommand{\pgfpie@slice}[8]{ - \pgfmathparse{0.5*(#1)+0.5*(#2)} - \let\midangle\pgfmathresult - - \path (#8) -- ++(\midangle:#5) coordinate(O); - - \pgfmathparse{#7+#5} - \let\pgfpie@radius\pgfmathresult - - % slice - \draw[line join=round, fill=#6, \pgfpie@style] (O) -- ++(#1:#7) arc (#1:#2:#7) -- cycle; - - \pgfmathparse{min(((#2)-(#1)-10)/110*(-0.3),0)} - \let\temp\pgfmathresult - \pgfmathparse{(max(\temp,-0.5) + 0.8)*#7} - \let\innerpos\pgfmathresult - - \ifthenelse{\equal{\pgfpie@text}{inside}} - { - % label and number together - \path (O) -- ++(\midangle:\innerpos) node - {\scalefont{#3}\shortstack{#4\\\pgfpie@numbertext{#3}}}; - } - { - % label - \iflegend - \else - \path (O) -- ++ (\midangle:\pgfpie@radius) - node[inner sep=0, \pgfpie@text=\midangle:#4]{}; - \fi - - % number - \path (O) -- ++(\midangle:\innerpos) node - {\scalefont{#3}\pgfpie@numbertext{#3}}; - } -} - -\newcommand{\pgfpie@findColor}[1] -{ - \pgfmathparse{int(mod(#1,\value{pgfpie@colorLength}))} - \let\ci\pgfmathresult - \foreach \c [count=\j from 0] in \pgfpie@color { - \ifnum \j=\ci - \xdef\thecolor{\c} - \thecolor - \breakforeach - \fi - } -} - -\newcommand{\pgfpie@findExplode}[1] -{ - \pgfmathparse{int(mod(#1,\value{pgfpie@explodeLength}))} - \let\ei\pgfmathresult - \foreach \e [count=\j from 0] in \pgfpie@explode { - \ifnum \j=\ei - \xdef\theexplode{\e} - \breakforeach - \fi - } -} - -% #1: bottom left point -% #2: size -% #3: number -% #4: color -% #5: text -\newcommand{\pgfpie@square}[5] -{ - \ifthenelse{\equal{\pgfpie@text}{inside}} - { - \draw[fill=#4, \pgfpie@style] (#1) rectangle node - {\scalefont{#3}\shortstack{#5\\\pgfpie@numbertext{#3}}} ++(#2); - } - { - \draw[fill=#4, \pgfpie@style] (#1) rectangle node - {\scalefont{#3}\pgfpie@numbertext{#3}} ++(#2); - } -} - -% #1: pos -% #2: radius -% #3: number -% #4: color -% $5: style -% $6: label -\newcommand{\pgfpie@cloud}[6] -{ - \draw[fill=#4, #5] (#1) circle[radius=#2]; - \ifthenelse{\equal{\pgfpie@text}{inside}} - { - \node at (#1) {\scalefont{#3}\shortstack{#6\\\pgfpie@numbertext{#3}}}; - } - { - \node at (#1) {\scalefont{#3}\pgfpie@numbertext{#3}}; - } -} - -\newlength{\pgfpie@angleEnd} -\newcounter{pgfpie@explodeLength} -\newcounter{pgfpie@colorLength} -\newcounter{pgfpie@sliceLength} - -\def\setexplode#1\pgfeov{\def\pgfpie@explode{#1}} -\pgfkeyslet{/explode/.@cmd}{\setexplode} - -\def\setcolor#1\pgfeov{\def\pgfpie@color{#1}} -\pgfkeyslet{/color/.@cmd}{\setcolor} - -\def\setradius#1\pgfeov{\def\pgfpie@radius{#1}} -\pgfkeyslet{/radius/.@cmd}{\setradius} - -\def\setpos#1\pgfeov{\def\pgfpie@pos{#1}} -\pgfkeyslet{/pos/.@cmd}{\setpos} - -\def\setstyle#1\pgfeov{\def\pgfpie@style{#1}} -\pgfkeyslet{/style/.@cmd}{\setstyle} - -\def\setbeforenumber#1\pgfeov{\def\pgfpie@beforenumber{#1}} -\pgfkeyslet{/before number/.@cmd}{\setbeforenumber} - -\def\setafternumber#1\pgfeov{\def\pgfpie@afternumber{#1}} -\pgfkeyslet{/after number/.@cmd}{\setafternumber} - -\def\settext#1\pgfeov{\xdef\pgfpie@text{#1}} -\pgfkeyslet{/text/.@cmd}{\settext} - -\def\setsum#1\pgfeov{\xdef\pgfpie@sum{#1}} -\pgfkeyslet{/sum/.@cmd}{\setsum} - -\def\setrotate#1\pgfeov{\xdef\pgfpie@rotate{#1}} -\pgfkeyslet{/rotate/.@cmd}{\setrotate} - -\newif\ifpolar -\pgfkeys{/polar/.is if=polar} - -\newif\iflegend - -\newif\ifsquare -\pgfkeys{/square/.is if=square} - -\newif\ifcloud -\pgfkeys{/cloud/.is if=cloud} - -\newif\ifscalefont -\pgfkeys{/scale font/.is if=scalefont} -\let\scalefontorg\scalefont -\renewcommand{\scalefont}[1] -{ - \ifscalefont - \pgfmathparse{#1 / \pgfpie@sum * 3 + 0.9} - \scalefontorg{\pgfmathresult} - \fi -} - -\newif\ifhidenumber -\pgfkeys{/hide number/.is if=hidenumber} -\newcommand{\pgfpie@numbertext}[1] -{ - \ifhidenumber - \else - \pgfpie@beforenumber#1\pgfpie@afternumber - \fi -} - -\newcommand{\pie}[2][] -{ - % load default parameters - \pgfkeys{ - explode=0, - color={blue!60, cyan!60, yellow!60, orange!60, red!60, - blue!60!cyan!60, cyan!60!yellow!60, red!60!cyan!60, - red!60!blue!60, orange!60!cyan!60}, - radius=3, - pos={0,0}, - style={thick}, - before number=, - after number=, - text=label, - sum=100, - rotate=0, - polar=false, - square=false, - cloud=false, - scale font=false, - hide number=false - } - % load user's parameters - \pgfkeys{#1} - % add percentage automatically - \ifthenelse{\equal{\pgfpie@sum}{100}} - { - \pgfkeys{after number=\%} - \pgfkeys{#1} - }{} - - % legend or not - \ifthenelse{\equal{\pgfpie@text}{legend}} - {\legendtrue} - {\legendfalse} - - % handle sum - \ifthenelse{\equal{\pgfpie@sum}{auto}} - { - % sum all input - \xdef\pgfpie@sum{0} - \foreach \p/\t in {#2} - { - \pgfmathparse{\pgfpie@sum + \p} - \xdef\pgfpie@sum{\pgfmathresult} - } - } - {} - - % init counters - \setcounter{pgfpie@explodeLength}{0} - \foreach \e in \pgfpie@explode { \addtocounter{pgfpie@explodeLength}{1} } - - \setcounter{pgfpie@colorLength}{0} - \foreach \c in \pgfpie@color { \addtocounter{pgfpie@colorLength}{1} } - - \pgfmathsetlength{\pgfpie@angleEnd}{0} - - \setcounter{pgfpie@sliceLength}{0} - \foreach \p/\e in {#2} { \addtocounter{pgfpie@sliceLength}{1} } - - \ifsquare - %%%%%%%%%% SQUARE PIE BEGIN %%%%%%%%%%% - \pgfmathparse{\pgfpie@radius*2} - \xdef\verticalLength{\pgfmathresult} - \xdef\horizontalLength{\pgfmathresult} - \path (\pgfpie@pos) -- ++(-\pgfpie@radius, -\pgfpie@radius) coordinate (start); - \pgfmathparse{\verticalLength * \horizontalLength / \pgfpie@sum} - \let\squareUnit\pgfmathresult - - % drawing loop - \foreach \p/\t [count=\i from 0] in {#2} - { - \pgfpie@findColor{\i} - - \ifthenelse{\lengthtest{\verticalLength cm > \horizontalLength cm}} - { - \pgfmathparse{\p * \squareUnit / \horizontalLength} - \let\height\pgfmathresult - - \pgfpie@square{start}{\horizontalLength,\height} - {\p} - {\thecolor} - {\t} - %label - \iflegend - \else - \ifthenelse{\equal{\pgfpie@text}{inside}} - {} - { - \path (start) -- ++(\horizontalLength,\height*0.5) node[inner - sep=0, \pgfpie@text=0:\t]{}; - } - \fi - - \pgfmathparse{\verticalLength - \height} - \xdef\verticalLength{\pgfmathresult} - \path (start) -- ++(0, \height) coordinate (start); - } - { - \pgfmathparse{\p * \squareUnit / \verticalLength } - \let\width\pgfmathresult - - \pgfpie@square{start}{\width,\verticalLength} - {\p} - {\thecolor} - {\t} - %label - \iflegend - \else - \ifthenelse{\equal{\pgfpie@text}{inside}} - {} - { - \path (start) -- ++(\width*0.5,\verticalLength) node[inner - sep=0, \pgfpie@text=90:\t]{}; - } - \fi - - \pgfmathparse{\horizontalLength - \width} - \xdef\horizontalLength{\pgfmathresult} - \path (start) -- ++(\width, 0) coordinate (start); - } - } - - %%%%%%%%%% SQUARE PIE END %%%%%%%%%%% - \else - \ifcloud - %%%%%%%%%% CLOUD PIE BGEIN %%%%%%%%%%% - % drawing loop - \foreach \p/\t [count=\i from 0] in {#2} - { - % find explode - \pgfpie@findExplode{\i} - \def\cloudGap{\theexplode + 0.1} - \pgfmathparse{sqrt(\p / \pgfpie@sum) * \pgfpie@radius} - \let\cloudR\pgfmathresult - \ifnum \i = 0 - % first cloud - \coordinate (O) at (\pgfpie@pos); - \xdef\cloudRone{\cloudR} - \xdef\cloudExtendDir{180+\pgfpie@rotate} - \else - \ifnum \i = 1 - % second cloud - \xdef\cloudRtwo{\cloudR} - \xdef\cloudExtendDir{45+\pgfpie@rotate} - \path (O) -- ++(\cloudExtendDir:\cloudRone+\cloudGap+\cloudRtwo) coordinate (O); - \else - % next cloud - \pgfmathparse{\cloudRone+\cloudGap+\cloudRtwo} - \let\la\pgfmathresult - \pgfmathparse{\cloudRone+\cloudGap+\cloudR} - \let\lb\pgfmathresult - \pgfmathparse{\cloudRtwo+\cloudGap+\cloudR} - \let\lc\pgfmathresult - \pgfmathparse{\la^2+\lc^2-\lb^2} - \let\tmp\pgfmathresult - \pgfmathparse{180 - acos(\tmp / 2 / \la / \lc)} - \let\cloudRot\pgfmathresult - \ifodd \i - \pgfmathparse{-\cloudRot} - \let\cloudRot\pgfmathresult - \fi - \pgfmathparse{\cloudExtendDir - \cloudRot} - \xdef\cloudExtendDir{\pgfmathresult} - \path (O) -- ++(\cloudExtendDir:\lc) coordinate (O); - \xdef\cloudRone{\cloudRtwo} - \xdef\cloudRtwo{\cloudR} - \fi - \fi - - % find color - \pgfpie@findColor{\i} - - \pgfpie@cloud{O}{\cloudR}{\p} - {\thecolor}{\pgfpie@style}{\t} - - % label - \iflegend - \else - \ifthenelse{\equal{\pgfpie@text}{inside}} - {} - { - \path (O) -- ++(\cloudExtendDir:\cloudR) - node[inner sep=0, \pgfpie@text=\cloudExtendDir:\t] {}; - } - \fi - } - %%%%%%%%%% CLOUD PIE BGEIN %%%%%%%%%%% - \else - %%%%%%%%%% CIRCLE PIE BGEIN %%%%%%%%%%% - \ifpolar - \xdef\maxValue{0} - \foreach \p/\e in {#2} { - \ifnum \maxValue < \p - \xdef\maxValue{\p} - \fi - } - \pgfmathparse{\pgfpie@sum / \value{pgfpie@sliceLength}} - \xdef\polarangle{\pgfmathresult} - \pgfmathparse{\pgfpie@radius / sqrt(\maxValue)} - \xdef\polarRadiusUnit{\pgfmathresult} - \else - \xdef\theradius{\pgfpie@radius} - \fi - - \xdef\pgfpie@angleBegin{\the\pgfpie@angleEnd} - % drawing loop - \foreach \p/\t [count=\i from 0] in {#2} - { - \pgfmathsetlength{\pgfpie@angleEnd}{\pgfpie@angleBegin} - \ifpolar - % Polar area diagram - \pgfmathaddtolength{\pgfpie@angleEnd}{\polarangle} - \pgfmathparse{sqrt(\p) * \polarRadiusUnit} - \xdef\theradius{\pgfmathresult} - \else - % normal pie - \pgfmathaddtolength{\pgfpie@angleEnd}{\p} - \fi - - % find explode - \pgfpie@findExplode{\i} - - % find color - \pgfpie@findColor{\i} - \pgfpie@slice{\pgfpie@angleBegin/\pgfpie@sum*360+\pgfpie@rotate} - {\the\pgfpie@angleEnd/\pgfpie@sum*360+\pgfpie@rotate} - {\p} - {\t} - {\theexplode} - {\thecolor} - {\theradius} - {\pgfpie@pos} - \xdef\pgfpie@angleBegin{\the\pgfpie@angleEnd} - } - %%%%%%%%%% CIRCLE PIE END %%%%%%%%%%% - \fi - \fi - - % legend - \iflegend - \coordinate[xshift=0.8cm, - yshift=(\value{pgfpie@sliceLength}*0.5+1)*0.5cm] (legendpos) at - (current bounding box.east); - - \begin{scope}[node distance=0.5cm] - \foreach \p/\t [count=\i from 0] in {#2} - { - \pgfpie@findColor{\i} - \node[draw, fill=\thecolor, \pgfpie@style, below of=legendpos, label=0:\t] (legendpos) {}; - } - \end{scope} - \fi -} - -%%% End of pgf-pie.sty -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - +\usetikzlibrary{pie} diff --git a/graphics/pgf/contrib/pgf-pie/polar.svg b/graphics/pgf/contrib/pgf-pie/polar.svg deleted file mode 100644 index a4442a04df..0000000000 --- a/graphics/pgf/contrib/pgf-pie/polar.svg +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/graphics/pgf/contrib/pgf-pie/polar.tex b/graphics/pgf/contrib/pgf-pie/polar.tex deleted file mode 100644 index 4d86872493..0000000000 --- a/graphics/pgf/contrib/pgf-pie/polar.tex +++ /dev/null @@ -1,3 +0,0 @@ -\begin{tikzpicture} - \pie[polar]{10/A, 20/B, 30/C, 40/D} -\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/population.tex b/graphics/pgf/contrib/pgf-pie/population.tex deleted file mode 100644 index 9267acb3fc..0000000000 --- a/graphics/pgf/contrib/pgf-pie/population.tex +++ /dev/null @@ -1,27 +0,0 @@ -% data from http://en.wikipedia.org/wiki/List_of_countries_by_population -\begin{tikzpicture} - \pie[cloud, rotate=45, sum=auto, radius=35, after number=, text=pin] {1339/China, - 1210/India, 312/USA, 237/Indonesia, 190/Brazil, 177/Pakistan, - 158/Nigeria, 151/Bangladesh, 142/Russia, 127/Japan, 112/Mexico, - 94/Philippines, 87/Vietnam, 82/Ethiopia, 81/Germany, 80/Egypt, - 75/Iran, 73/Turkey, 67/Thailand, 65/Congo, 65/France, 62/UK, - 60/Italy, 50/South Africa, 48/South Korea, 47/Myanmar, 46/Spain, - 46/Colombia, 45/Ukraine, 43/Tanzania, 40/Argentina, 38/Kenya, - 38/Poland, 36/Algeria, 34/Canada, 32/Morocco, 31/Uganda, 31/Iraq, - 31/Afghanistan, 30/Sudan, 29/Peru, 29/Venezuela, 28/Nepal, - 28/Malaysia, 27/Uzbekistan, 27/Saudi Arabia, 24/Ghana, 24/North - Korea, 23/Syria, 23/Taiwan, 22/Australia, 22/Yemen, 21/Romania, - 20/Madagascar, 20/Sri Lanka, 20/Mozambique, 19/Cote d'Ivoire, - 19/Cameroon, 19/Angola, 17/Chile, 16/Netherlands, 16/Kazakhstan, - 15/Burkina Faso, 15/Niger, 14/Malawi, 14/Mali, 14/Guatemala, - 14/Ecuador, 13/Cambodia, 13/Zambia, 12/Zimbabwe, 12/Senegal, - 11/Cuba, 11/Chad, 10/Belgium, 10/Greece, 10/Portugal, 10/Tunisia, - 10/Czech Republic, 10/Bolivia, 10/Rwanda, 10/Haiti, 10/Hungary, - 10/Guinea, 10/Belarus, 9/Sweden, 9/Dominican Republic, 9/Somalia, - 9/Azerbaijan, 9/Benin, 8/Austria, 8/Burundi, 8/United Arab - Emirates, 8/South Sudan, 8/Honduras, 8/Switzerland, 8/Israel, - 7/Bulgaria, 7/Serbia, 7/Hong Kong } - - % \node[circle,draw=black,thick, fill=white, font=\bf] - % {Population of the world}; -\end{tikzpicture} diff --git a/graphics/pgf/contrib/pgf-pie/radius.tex b/graphics/pgf/contrib/pgf-pie/radius.tex deleted file mode 100644 index 944e218219..0000000000 --- a/graphics/pgf/contrib/pgf-pie/radius.tex +++ /dev/null @@ -1,7 +0,0 @@ -\begin{tikzpicture} - \pie{10/, 20/, 30/, 40/} - - \pie[pos={8,0}, rotate=180]{10/, 20/, 30/, 40/} - - \pie[pos={17,0}, radius=4]{10/, 20/, 30/, 40/} -\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/scalefont.tex b/graphics/pgf/contrib/pgf-pie/scalefont.tex deleted file mode 100644 index df61709c40..0000000000 --- a/graphics/pgf/contrib/pgf-pie/scalefont.tex +++ /dev/null @@ -1,3 +0,0 @@ -\begin{tikzpicture} - \pie[scale font]{10/A, 20/B, 30/C, 40/D} -\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/shadow.tex b/graphics/pgf/contrib/pgf-pie/shadow.tex deleted file mode 100644 index 9ccfd9ffb5..0000000000 --- a/graphics/pgf/contrib/pgf-pie/shadow.tex +++ /dev/null @@ -1,4 +0,0 @@ -% \usetikzlibrary{shadows} -\begin{tikzpicture} - \pie[style=drop shadow]{10/A, 20/B, 30/C, 40/D} -\end{tikzpicture} diff --git a/graphics/pgf/contrib/pgf-pie/square.svg b/graphics/pgf/contrib/pgf-pie/square.svg deleted file mode 100644 index 8e0a48f86a..0000000000 --- a/graphics/pgf/contrib/pgf-pie/square.svg +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/graphics/pgf/contrib/pgf-pie/square.tex b/graphics/pgf/contrib/pgf-pie/square.tex deleted file mode 100644 index dd37da64cf..0000000000 --- a/graphics/pgf/contrib/pgf-pie/square.tex +++ /dev/null @@ -1,3 +0,0 @@ -\begin{tikzpicture} - \pie[square]{40/A, 30/B, 20/C, 10/D} -\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/sum.tex b/graphics/pgf/contrib/pgf-pie/sum.tex deleted file mode 100644 index 13e2b7365c..0000000000 --- a/graphics/pgf/contrib/pgf-pie/sum.tex +++ /dev/null @@ -1,5 +0,0 @@ -\begin{tikzpicture} - \pie[sum=auto, after number=, radius=2]{33/Boys, 7/Girls} - - \pie[pos={6,0}, sum=40, after number=, radius=2]{33/Boys} -\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/text-inside.tex b/graphics/pgf/contrib/pgf-pie/text-inside.tex deleted file mode 100644 index 07cf42eafd..0000000000 --- a/graphics/pgf/contrib/pgf-pie/text-inside.tex +++ /dev/null @@ -1,3 +0,0 @@ -\begin{tikzpicture} - \pie[text=inside]{10/A, 20/B, 30/C, 40/D} -\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/text.tex b/graphics/pgf/contrib/pgf-pie/text.tex deleted file mode 100644 index 95ef108578..0000000000 --- a/graphics/pgf/contrib/pgf-pie/text.tex +++ /dev/null @@ -1,3 +0,0 @@ -\begin{tikzpicture} - \pie[text=pin]{10/A, 20/B, 30/C, 40/D} -\end{tikzpicture} \ No newline at end of file diff --git a/graphics/pgf/contrib/pgf-pie/tikzlibrarypie.code.tex b/graphics/pgf/contrib/pgf-pie/tikzlibrarypie.code.tex new file mode 100644 index 0000000000..dd949d9644 --- /dev/null +++ b/graphics/pgf/contrib/pgf-pie/tikzlibrarypie.code.tex @@ -0,0 +1,465 @@ +% SPDX-License-Identifier: GPL-2.0-only OR LPPL-1.3c +\RequirePackage{scalefnt} + +% +% Utilities +% + +\def\pgfpie@ifx#1#2{% + \ifx#1#2% + \expandafter\pgfutil@firstoftwo + \else + \expandafter\pgfutil@secondoftwo + \fi} + +\def\pgfpie@ifdim#1#2#3{% + \ifdim\dimexpr#1\relax#2\dimexpr#3\relax + \expandafter\pgfutil@firstoftwo + \else + \expandafter\pgfutil@secondoftwo + \fi} + +\def\pgfpie@ifnum#1#2#3{% + \ifnum\numexpr#1\relax#2\numexpr#3\relax + \expandafter\pgfutil@firstoftwo + \else + \expandafter\pgfutil@secondoftwo + \fi} + +\def\pgfpie@ifodd#1{% + \ifodd\numexpr#1\relax + \expandafter\pgfutil@firstoftwo + \else + \expandafter\pgfutil@secondoftwo + \fi} + +\def\pgfpie@newif#1{% + \csname newif\expandafter\endcsname\csname ifpgfpie@#1\endcsname + \expandafter\def\csname pgfpie@if#1\expandafter\endcsname\expandafter{% + \csname ifpgfpie@#1\endcsname + \expandafter\pgfutil@firstoftwo + \else + \expandafter\pgfutil@secondoftwo + \fi}% +} + +% +% Constants for text comparison +% + +\def\pgfpie@text@inside{inside} +\def\pgfpie@text@legend{legend} +\def\pgfpie@sum@c{100} +\def\pgfpie@sum@auto{auto} + +% args: +% #1: begin angle +% #2: end angle +% #3: number +% #4: label +% #5: explode +% #6: fill color +% #7: radius +% #8: center +\def\pgfpie@slice#1#2#3#4#5#6#7#8{% + \pgfmathparse{0.5*(#1)+0.5*(#2)} + \let\pgfpie@midangle\pgfmathresult + + \path (#8) -- ++({\pgfpie@midangle}:{#5}) coordinate (pgfpie@O); + + \pgfmathparse{(#7)+(#5)} + \let\pgfpie@radius\pgfmathresult + + % slice + \draw[line join=round,fill={#6},\pgfpie@style] (pgfpie@O) -- ++({#1}:{#7}) arc ({#1}:{#2}:{#7}) -- cycle; + + \pgfmathparse{min(((#2)-(#1)-10)/110*(-0.3),0)} + \pgfmathparse{(max(\pgfmathresult,-0.5) + 0.8)*(#7)} + \let\pgfpie@innerpos\pgfmathresult + + \pgfpie@ifx\pgfpie@text\pgfpie@text@inside{% + % label and number together + \path (pgfpie@O) -- ++({\pgfpie@midangle}:{\pgfpie@innerpos}) node[align=center] + {\pgfpie@scalefont{#3}\pgfpie@labeltext{#4}\\\pgfpie@numbertext{#3}}; + }{% + % label + \pgfpie@ifhidelabel{}{% + \pgfpie@iflegend{}{% + \path (pgfpie@O) -- ++ ({\pgfpie@midangle}:{\pgfpie@radius}) + node[inner sep=0, \pgfpie@text={\pgfpie@midangle:#4}]{}; + }% + }% + + % number + \path (pgfpie@O) -- ++({\pgfpie@midangle}:{\pgfpie@innerpos}) node + {\pgfpie@scalefont{#3}\pgfpie@numbertext{#3}}; + }% +} + +\def\pgfpie@findColor#1{% + \pgfmathparse{int(mod(#1,\the\pgfpie@colorLength))}% + \let\pgfpie@ci\pgfmathresult + \foreach \pgfpie@c [count=\pgfpie@j from 0] in \pgfpie@color {% + \pgfpie@ifnum{\pgfpie@j}{=}{\pgfpie@ci}{% + \xdef\pgfpie@thecolor{\pgfpie@c}% + \breakforeach + }{}% + } +} + +\def\pgfpie@findExplode#1{% + \pgfmathparse{int(mod(#1,\the\pgfpie@explodeLength))}% + \let\pgfpie@ei\pgfmathresult + \foreach \pgfpie@e [count=\pgfpie@j from 0] in \pgfpie@explode {% + \pgfpie@ifnum{\pgfpie@j}{=}{\pgfpie@ei}{% + \xdef\pgfpie@theexplode{\pgfpie@e}% + \breakforeach + }{}% + }% +} + +% #1: bottom left point +% #2: size +% #3: number +% #4: color +% #5: text +\def\pgfpie@square#1#2#3#4#5{% + \pgfpie@ifx\pgfpie@text\pgfpie@text@inside{% + \draw[fill={#4},\pgfpie@style] (#1) rectangle node[align=center] + {\pgfpie@scalefont{#3}\pgfpie@labeltext{#5}\\\pgfpie@numbertext{#3}} ++(#2); + }{% + \draw[fill={#4},\pgfpie@style] (#1) rectangle node + {\pgfpie@scalefont{#3}\pgfpie@numbertext{#3}} ++(#2); + }% +} + +% #1: pos +% #2: radius +% #3: number +% #4: color +% $5: style +% $6: label +\def\pgfpie@cloud#1#2#3#4#5#6{% + \draw[fill=#4, #5] (#1) circle[radius=#2]; + \pgfpie@ifx\pgfpie@text\pgfpie@text@inside{% + \node[align=center] at (#1) {\pgfpie@scalefont{#3}\pgfpie@labeltext{#6}\\\pgfpie@numbertext{#3}}; + }{% + \node at (#1) {\pgfpie@scalefont{#3}\pgfpie@numbertext{#3}}; + }% +} + +\newdimen\pgfpie@angleEnd +\newcount\pgfpie@explodeLength +\newcount\pgfpie@colorLength +\newcount\pgfpie@sliceLength + +\pgfqkeys{/pgfpie}{% + explode/.store in=\pgfpie@explode, + color/.store in=\pgfpie@color, + radius/.store in=\pgfpie@radius, + pos/.store in=\pgfpie@pos, + style/.store in=\pgfpie@style, + before number/.store in=\pgfpie@beforenumber, + after number/.store in=\pgfpie@afternumber, + text/.store in=\pgfpie@text, + sum/.store in=\pgfpie@sum, + rotate/.store in=\pgfpie@rotate, +} + +\pgfpie@newif{polar} +\pgfqkeys{/pgfpie}{polar/.is if=pgfpie@polar} + +\pgfpie@newif{legend} + +\pgfpie@newif{square} +\pgfqkeys{/pgfpie}{square/.is if=pgfpie@square} + +\pgfpie@newif{cloud} +\pgfqkeys{/pgfpie}{cloud/.is if=pgfpie@cloud} + +\pgfpie@newif{scalefont} +\pgfqkeys{/pgfpie}{scale font/.is if=pgfpie@scalefont} +\def\pgfpie@scalefont#1{% + \pgfpie@ifscalefont{% + \pgfmathparse{(#1) / (\pgfpie@sum) * 3 + 0.9}% + \scalefont{\pgfmathresult}% + }{}% +} + +\pgfpie@newif{hidenumber} +\pgfqkeys{/pgfpie}{hide number/.is if=pgfpie@hidenumber} +\def\pgfpie@numbertext#1{% + \pgfpie@ifhidenumber{}{% + \pgfpie@beforenumber#1\pgfpie@afternumber + }% +} + +\pgfpie@newif{hidelabel} +\pgfqkeys{/pgfpie}{hide label/.is if=pgfpie@hidelabel} +\def\pgfpie@labeltext#1{\pgfpie@ifhidelabel{}{#1}} + +\tikzaddtikzonlycommandshortcutlet{\pie}{\pgfpie@pie}% + +\def\pgfpie@pie{% + \pgfutil@ifnextchar[{\pgfpie@@pie}{\pgfpie@@pie[]}% +} + +\def\pgfpie@@pie[#1]#2{% + % load default parameters + \pgfqkeys{/pgfpie}{ + explode=0, + color={blue!60, cyan!60, yellow!60, orange!60, red!60, + blue!60!cyan!60, cyan!60!yellow!60, red!60!cyan!60, + red!60!blue!60, orange!60!cyan!60}, + radius=3, + pos={0,0}, + style={thick}, + before number=, + after number=, + text=label, + sum=100, + rotate=0, + polar=false, + square=false, + cloud=false, + scale font=false, + hide number=false, + hide label=false, + every pie/.try, + }% + % load user's parameters + \pgfqkeys{/pgfpie}{#1}% + % add percentage automatically + \pgfpie@ifx\pgfpie@sum\pgfpie@sum@c{% + \pgfqkeys{/pgfpie}{after number=\%}% + \pgfqkeys{/pgfpie}{#1}% + }{}% + + % legend or not + \pgfpie@ifx\pgfpie@text\pgfpie@text@legend{% + \pgfpie@legendtrue + }{% + \pgfpie@legendfalse + }% + + % handle sum + \pgfpie@ifx\pgfpie@sum\pgfpie@sum@auto{% + % sum all input + \xdef\pgfpie@sum{0}% + \foreach \pgfpie@p/\pgfpie@t in {#2} {% + \pgfmathparse{(\pgfpie@sum) + (\pgfpie@p)}% + \xdef\pgfpie@sum{\pgfmathresult}% + }% + }{}% + + % init counters + \global\pgfpie@explodeLength=0 + \foreach \pgfpie@e in \pgfpie@explode {% + \global\advance\pgfpie@explodeLength by 1 + }% + + \global\pgfpie@colorLength=0 + \foreach \pgfpie@c in \pgfpie@color {% + \global\advance\pgfpie@colorLength by 1 + }% + + \pgfmathsetlength{\pgfpie@angleEnd}{0}% + + \global\pgfpie@sliceLength=0 + \foreach \pgfpie@p/\pgfpie@e in {#2} {% + \global\advance\pgfpie@sliceLength by 1 + }% + + \pgfpie@ifsquare{% + \pgfpie@pie@square{#2}% + }{\pgfpie@ifcloud{\pgfpie@pie@cloud{#2}% + }{\pgfpie@pie@circle{#2}}} + + % legend + \pgfpie@ifhidelabel{}{% + \pgfpie@iflegend{% + \pgfpie@legend{#2}% + }{}}% +} + +\def\pgfpie@pie@square#1{% + \pgfmathparse{(\pgfpie@radius)*2} + \xdef\pgfpie@verticalLength{\pgfmathresult} + \xdef\pgfpie@horizontalLength{\pgfmathresult} + \path (\pgfpie@pos) -- ++({-\pgfpie@radius},{-\pgfpie@radius}) coordinate (pgfpie@start); + \pgfmathparse{(\pgfpie@verticalLength) * (\pgfpie@horizontalLength) / (\pgfpie@sum)} + \let\pgfpie@squareUnit\pgfmathresult + + % drawing loop + \foreach \pgfpie@p/\pgfpie@t [count=\pgfpie@i from 0] in {#1} + { + \pgfpie@findColor{\pgfpie@i} + + \pgfpie@ifdim{\pgfpie@verticalLength cm}{>}{\pgfpie@horizontalLength cm}{% + \pgfmathparse{(\pgfpie@p) * (\pgfpie@squareUnit) / (\pgfpie@horizontalLength)} + \let\pgfpie@height\pgfmathresult + + \pgfpie@square{pgfpie@start}{\pgfpie@horizontalLength,\pgfpie@height} + {\pgfpie@p} + {\pgfpie@thecolor} + {\pgfpie@t} + %label + \pgfpie@iflegend{}{% + \pgfpie@ifx\pgfpie@text\pgfpie@text@inside{}{% + \pgfpie@ifhidelabel{}{% + \path (pgfpie@start) -- ++({\pgfpie@horizontalLength},{\pgfpie@height*0.5}) + node[inner sep=0, \pgfpie@text={0:{\pgfpie@t}}]{}; + }% + }% + }% + + \pgfmathparse{\pgfpie@verticalLength - \pgfpie@height} + \xdef\pgfpie@verticalLength{\pgfmathresult} + \path (pgfpie@start) -- ++(0, \pgfpie@height) coordinate (pgfpie@start); + }{% + \pgfmathparse{(\pgfpie@p) * (\pgfpie@squareUnit) / (\pgfpie@verticalLength)}% + \let\pgfpie@width\pgfmathresult + + \pgfpie@square{pgfpie@start}{\pgfpie@width,\pgfpie@verticalLength} + {\pgfpie@p} + {\pgfpie@thecolor} + {\pgfpie@t} + %label + \pgfpie@iflegend{}{% + \pgfpie@ifx\pgfpie@text\pgfpie@text@inside{}{% + \pgfpie@ifhidelabel{}{% + \path (pgfpie@start) -- ++({\pgfpie@width*0.5},{\pgfpie@verticalLength}) + node[inner sep=0, \pgfpie@text={90:{\pgfpie@t}}]{}; + }% + }% + }% + + \pgfmathparse{(\pgfpie@horizontalLength) - (\pgfpie@width)}% + \xdef\pgfpie@horizontalLength{\pgfmathresult}% + \path (pgfpie@start) -- ++({\pgfpie@width},0) coordinate (pgfpie@start); + }% + }% +} + +\def\pgfpie@pie@cloud#1{% + % drawing loop + \foreach \pgfpie@p/\pgfpie@t [count=\pgfpie@i from 0] in {#1} + { + % find explode + \pgfpie@findExplode{\pgfpie@i} + \def\pgfpie@cloudGap{(\pgfpie@theexplode) + 0.1} + \pgfmathparse{sqrt((\pgfpie@p) / (\pgfpie@sum)) * (\pgfpie@radius)} + \let\pgfpie@cloudR\pgfmathresult + \pgfpie@ifnum{\pgfpie@i}{=}{0}{% + % first cloud + \coordinate (pgfpie@O) at (\pgfpie@pos); + \xdef\pgfpie@cloudRone{\pgfpie@cloudR} + \xdef\pgfpie@cloudExtendDir{180+(\pgfpie@rotate)} + }{\pgfpie@ifnum{\pgfpie@i}{=}{1}{% + % second cloud + \xdef\pgfpie@cloudRtwo{\pgfpie@cloudR} + \xdef\pgfpie@cloudExtendDir{45+(\pgfpie@rotate)} + \path (pgfpie@O) -- ++({\pgfpie@cloudExtendDir}:{(\pgfpie@cloudRone)+(\pgfpie@cloudGap)+(\pgfpie@cloudRtwo)}) coordinate (pgfpie@O); + }{% + % next cloud + \pgfmathparse{(\pgfpie@cloudRone)+(\pgfpie@cloudGap)+(\pgfpie@cloudRtwo)} + \let\pgfpie@la\pgfmathresult + \pgfmathparse{(\pgfpie@cloudRone)+(\pgfpie@cloudGap)+(\pgfpie@cloudR)} + \let\pgfpie@lb\pgfmathresult + \pgfmathparse{(\pgfpie@cloudRtwo)+(\pgfpie@cloudGap)+(\pgfpie@cloudR)} + \let\pgfpie@lc\pgfmathresult + \pgfmathparse{(\pgfpie@la)^2+(\pgfpie@lc)^2-(\pgfpie@lb)^2} + \let\pgfpie@tmp\pgfmathresult + \pgfmathparse{180 - acos((\pgfpie@tmp) / 2 / (\pgfpie@la) / (\pgfpie@lc))} + \let\pgfpie@cloudRot\pgfmathresult + \pgfpie@ifodd{\pgfpie@i}{% + \pgfmathparse{-(\pgfpie@cloudRot)} + \let\pgfpie@cloudRot\pgfmathresult + }{}% + \pgfmathparse{(\pgfpie@cloudExtendDir) - (\pgfpie@cloudRot)} + \xdef\pgfpie@cloudExtendDir{\pgfmathresult} + \path (pgfpie@O) -- ++({\pgfpie@cloudExtendDir}:{\pgfpie@lc}) coordinate (pgfpie@O); + \xdef\pgfpie@cloudRone{\pgfpie@cloudRtwo} + \xdef\pgfpie@cloudRtwo{\pgfpie@cloudR} + }}% + + % find color + \pgfpie@findColor{\pgfpie@i} + + \pgfpie@cloud{pgfpie@O}{\pgfpie@cloudR}{\pgfpie@p} + {\pgfpie@thecolor}{\pgfpie@style}{\pgfpie@t} + + % label + \pgfpie@iflegend{}{% + \pgfpie@ifx\pgfpie@text\pgfpie@text@inside{}{% + \pgfpie@ifhidelabel{}{% + \path (pgfpie@O) -- ++({\pgfpie@cloudExtendDir}:{\pgfpie@cloudR}) + node[inner sep=0, \pgfpie@text={\pgfpie@cloudExtendDir:{\pgfpie@t}}] {}; + }% + }% + }% + }% +} + +\def\pgfpie@pie@circle#1{% + \pgfpie@ifpolar{% + \xdef\pgfpie@maxValue{0} + \foreach \pgfpie@p/\pgfpie@e in {#1} { + \pgfmathparse{\pgfpie@p}% + \pgfpie@ifdim{\pgfpie@maxValue pt}{<}{\pgfmathresult pt}{% + \xdef\pgfpie@maxValue{\pgfpie@p} + }{}% + } + \pgfmathparse{(\pgfpie@sum) / \the\pgfpie@sliceLength} + \xdef\pgfpie@polarangle{\pgfmathresult} + \pgfmathparse{(\pgfpie@radius) / sqrt(\pgfpie@maxValue)} + \xdef\pgfpie@polarRadiusUnit{\pgfmathresult} + }{% + \xdef\pgfpie@theradius{\pgfpie@radius}% + } + + \xdef\pgfpie@angleBegin{\the\pgfpie@angleEnd} + % drawing loop + \foreach \pgfpie@p/\pgfpie@t [count=\pgfpie@i from 0] in {#1} + { + \pgfmathsetlength{\pgfpie@angleEnd}{\pgfpie@angleBegin} + \pgfpie@ifpolar{% + % Polar area diagram + \pgfmathaddtolength{\pgfpie@angleEnd}{\pgfpie@polarangle} + \pgfmathparse{sqrt(\pgfpie@p) * (\pgfpie@polarRadiusUnit)} + \xdef\pgfpie@theradius{\pgfmathresult} + }{% + % normal pie + \pgfmathaddtolength{\pgfpie@angleEnd}{\pgfpie@p} + } + + % find explode + \pgfpie@findExplode{\pgfpie@i} + + % find color + \pgfpie@findColor{\pgfpie@i} + \pgfpie@slice{(\pgfpie@angleBegin)/(\pgfpie@sum)*360+(\pgfpie@rotate)} + {\the\pgfpie@angleEnd/(\pgfpie@sum)*360+(\pgfpie@rotate)} + {\pgfpie@p} + {\pgfpie@t} + {\pgfpie@theexplode} + {\pgfpie@thecolor} + {\pgfpie@theradius} + {\pgfpie@pos} + \xdef\pgfpie@angleBegin{\the\pgfpie@angleEnd} + } +} + +\def\pgfpie@legend#1{% + \coordinate[xshift=0.8cm, + yshift={(\the\pgfpie@sliceLength*0.5+1)*0.5cm}] (pgfpie@legendpos) at + (current bounding box.east); + + \scope[node distance=0.5cm] + \foreach \pgfpie@p/\pgfpie@t [count=\pgfpie@i from 0] in {#1} + { + \pgfpie@findColor{\pgfpie@i} + \node[draw, fill={\pgfpie@thecolor}, \pgfpie@style, below of={pgfpie@legendpos}, label={0:{\pgfpie@t}}] (pgfpie@legendpos) {}; + } + \endscope +} -- cgit v1.2.3