summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/smartdiagram/smartdiagram.pdfbin214909 -> 230760 bytes
-rw-r--r--Master/texmf-dist/source/latex/smartdiagram/smartdiagram.dtx580
-rw-r--r--Master/texmf-dist/source/latex/smartdiagram/smartdiagram.ins4
-rw-r--r--Master/texmf-dist/tex/latex/smartdiagram/smartdiagram.sty355
4 files changed, 774 insertions, 165 deletions
diff --git a/Master/texmf-dist/doc/latex/smartdiagram/smartdiagram.pdf b/Master/texmf-dist/doc/latex/smartdiagram/smartdiagram.pdf
index 170faefbae5..386180f40fa 100644
--- a/Master/texmf-dist/doc/latex/smartdiagram/smartdiagram.pdf
+++ b/Master/texmf-dist/doc/latex/smartdiagram/smartdiagram.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/smartdiagram/smartdiagram.dtx b/Master/texmf-dist/source/latex/smartdiagram/smartdiagram.dtx
index 3d7ea5b44a5..052ab29dbf9 100644
--- a/Master/texmf-dist/source/latex/smartdiagram/smartdiagram.dtx
+++ b/Master/texmf-dist/source/latex/smartdiagram/smartdiagram.dtx
@@ -35,7 +35,7 @@ See http://www.latex-project.org/lppl.txt
\endpreamble
\postamble
-Copyright (C) 2012 by Claudio Fiandrino <claudio.fiandrino@gmail.com>
+Copyright (C) 2012-2013 by Claudio Fiandrino <claudio.fiandrino@gmail.com>
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License (LPPL), either
@@ -77,7 +77,7 @@ and the derived files smartdiagram.ins,
%</internal>
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{smartdiagram}[2012/10/28 v0.1 Automatic creation of smart diagrams from lists of items.]
+\ProvidesPackage{smartdiagram}[2013/03/09 v0.2 Automatic creation of smart diagrams from lists of items.]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -107,7 +107,7 @@ and the derived files smartdiagram.ins,
%</driver>
% \fi
%
-% \CheckSum{883}
+% \CheckSum{1102}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -126,6 +126,9 @@ and the derived files smartdiagram.ins,
% Right brace \} Tilde \~}
%
%
+% \changes{v0.1}{2012/10/28}{Initial version}
+% \changes{v0.2}{2013/03/09}{Clockwise order circular diagram/horizontal order flow diagram/Uniform colors/Sequence diagram}
+%
% \GetFileInfo{smartdiagram.sty}
% \title{The \textsf{smartdiagram} package\thanks{This document
% corresponds to \textsf{smartdiagram}~\fileversion,
@@ -146,7 +149,8 @@ and the derived files smartdiagram.ins,
% \begin{itemize}
% \item Ti\textit{k}Z;
% \item \textsf{etoolbox};
-% \item \textsf{xparse}.
+% \item \textsf{xparse};
+% \item \textsf{xstring} (from version 0.2).
% \end{itemize}
% Moreover, the package loads the following Ti\textit{k}Z libraries:
% \begin{itemize}
@@ -154,7 +158,8 @@ and the derived files smartdiagram.ins,
% \item \library{calc};
% \item \library{fadings};
% \item \library{shadows};
-% \item \library{shapes.arrows}.
+% \item \library{shapes.arrows};
+% \item \library{shapes.symbols} (from version 0.2).
% \end{itemize}
% and it sets a new layer called \verb|smart diagram arrow back|.
%
@@ -165,13 +170,16 @@ and the derived files smartdiagram.ins,
%
% The possible diagrams that could be created are:
% \begin{itemize}
-% \item \diagram{circular diagram}: the items in the list are diplayed around a circle;
+% \item \diagram{circular diagram}: the items in the list are diplayed around a circle typically in counterclockwise order;
+% \item \diagram{circular diagram:clockwise}: same as before, but now items are placed in clockwise order (no space between names and \diagram{:});
% \item \diagram{flow diagram}: the items in the list are diplayed as a flow chart;
+% \item \diagram{flow diagram:horizontal}: the items in the list are diplayed as an horizontal flow chart (no space between names and \diagram{:});
% \item \diagram{descriptive diagram}: a diagram in which are displayed concepts and their description;
% \item \diagram{priority descriptive diagram}: a diagram in which the items are deployted based on their relevance;
% \item \diagram{bubble diagram}: each item is a bubble deployted around a bubble center, which is the first element in the list;
% \item \diagram{constellation diagram}: each item is a circle connected to the center, the first element in the list again;
-% \item \diagram{connected constellation diagram}: each item is a circle and, a part from the first element in the list, the other ones are connected toghether.
+% \item \diagram{connected constellation diagram}: each item is a circle and, a part from the first element in the list, the other ones are connected toghether;
+% \item \diagram{sequence diagram}: the items in the list are diplayed in sequence and each item points to the subsequent.
% \end{itemize}
%
% For example:
@@ -189,11 +197,13 @@ and the derived files smartdiagram.ins,
%
% For what concern the \diagram{bubble diagram}, the \diagram{constellation diagram} and the \diagram{connected constellation diagram}, they are a bit different from the rest of the diagrams, in the sense that the first item in the \mbrarg{list of items} is particular: called \emph{bubble center} and \emph{planet}, respectively, its aspect is different and it could be customized with dedicated keys.
%
+% From version 0.2 there is availble also the \diagram{sequence diagram} which displays the \mbrarg{list of items} with a particular shape.
+%
% \DescribeMacro{\smartdiagramanimated} Inside presentations, the user could select if the diagram should be displayed in a \emph{persistent} way, or with an animation. The \emph{persistent} way is achieved by exploiting, again, \cs{smartdiagram}, while to have the diagram \emph{overlay-aware} the command is \cs{smartdiagramanimated}\mqbarg{type of diagram}\marg{list of items}.
% For diagrams like the \diagram{circular diagram} and the \diagram{flow diagram} the animation runs as follows: at the beginning the first item of the list is displayed, then each time appears an arrow connecting the previous element with the new one; at the end it is displayed the arrow connecting the last element with the first one. Considering instead the \diagram{descriptive diagram}, per couple description title-description, first it is shown the description title and subsequently the description. In the \diagram{priority descriptive diagram}, very simply, the list of items is deployted starting from the bottom, that is the less relevant item, to the top to progressively show much relevant items.
-% Finally, for the \diagram{bubble diagram}, the \diagram{constellation diagram} and the \diagram{connected constellation diagram}, at first it is always shown the \emph{bubble center} and \emph{planet}, respectively and later all the items subsequently.
-%
+% For what concern the \diagram{bubble diagram}, the \diagram{constellation diagram} and the \diagram{connected constellation diagram}, at first it is always shown the \emph{bubble center} and \emph{planet}, respectively and later all the items subsequently.
+% Finally, in the \diagram{sequence} diagram, the items are presented one at a time starting from the left one ending with the right one.
%
% \section{The options}
% \label{sec:options}
@@ -207,7 +217,9 @@ and the derived files smartdiagram.ins,
%
% \item \packoption{module minimum height}{1cm}: this option sets the minimum height of the module;
%
-% \item \packoption{module y sep}{1.65}: this option sets a vertical distance factor among the modules in a \verb|flow diagram|;
+% \item \packoption{module y sep}{1.65}: this option sets a vertical distance factor among the modules in a \diagram{flow diagram};
+%
+% \item \packoption{module x sep}{2.75}: this option sets an horizontal distance factor among the modules in a \diagram{flow diagram:horizontal};
%
% \item \packoption{module shape}{rectangle,rounded corners}: this option should be used to change the shape of the module, but the user should load manually the proper Ti\textit{k}Z library; for example, to user an \verb|ellipse|, load \library{shapes.geometric} in the preamble;
%
@@ -231,6 +243,17 @@ and the derived files smartdiagram.ins,
% \end{itemize}
% \subsubsection{Specific options}
% Here follows the list of specific available options per type of diagram.
+%
+% For what concern the \diagram{circular diagram} and the \diagram{flow diagram}:
+% \begin{itemize}
+% \item \packoption{uniform arrow color}{false}: the option, set to \texttt{true} overrides the color list definition;
+% \item \packoption{arrow color}{gray}: this option allows to specify the color valid for all arrows.
+% \end{itemize}
+%
+% Considering just the \diagram{flow diagram}, there is a specific option to disable the back arrow going from the final module to the first one:
+% \begin{itemize}
+% \item \packoption{back arrow disabled}{false}: the option, set to \texttt{true} disables the back arrow.
+% \end{itemize}
%
% For what concern the \diagram{descriptive diagram} and the \diagram{priority descriptive diagram}:
% \begin{itemize}
@@ -306,36 +329,81 @@ and the derived files smartdiagram.ins,
%
% \item \packoption{distance planet-satellite}{3.5cm}: this option determine the distance among any pair of planet-satellite.
% \end{itemize}
+%
+% Considering just the the \diagram{constellation diagram} and the \diagram{connected constellation diagram}:
+% \begin{itemize}
+% \item \packoption{uniform connection color}{false}: the option, set to \texttt{true} overrides the color list definition;
+% \item \packoption{connection color}{gray}: this option allows to specify the color valid for all the connections.
+% \end{itemize}
+% For what concern the \diagram{sequence diagram}:
+% \begin{itemize}
+%
+% \item \packoption{sequence item height}{1cm}: the option specifies the minimum height of the items;
+%
+% \item \packoption{sequence item width}{2cm}: the option specifies the minimum width of the items;
+%
+% \item \packoption{sequence item border color}{gray}: sets the border line color;
+%
+% \item \packoption{sequence item border size}{1.65\textbackslash pgflinewidth}: sets the border line width;
+%
+% \item \packoption{sequence item font size}{\textbackslash normalfont}: this option sets the font size of the items;
+%
+% \item \packoption{sequence item fill opacity}{1}: sets the opacity at which the item is shown;
+%
+% \item \packoption{sequence item text opacity}{1}: sets the opacity at which the item text is shown;
+%
+% \item \packoption{sequence item text width}{1.9cm}: the option allows to select the item text width;
+%
+% \item \packoption{sequence item text color}{black}: the option allows to select the item text color;
+%
+% \item \packoption{uniform sequence color}{false}: the option, set to \texttt{true} overrides the color list definition;
+%
+% \item \packoption{sequence item uniform color}{gray!60!black}: this option allows to specify the color valid for all the items in the sequence.
+%
+% \end{itemize}
%
% \section{Gallery of examples}
% \label{sec:gallery}
-% \DescribeMacro{Flow chart with custom color list}
-% Example with a flow chart:
+% \DescribeMacro{Horizontal flow chart: custom color list - no back arrow}
+% Example of an horizontal flow chart with custom color list and back arrow disabled:
% \begin{verbatim}
% \begin{center}
% \smartdiagramset{border color=none,
-% set color list={blue!50!cyan,green!60!lime,orange!50!red,red!80!black}}
-% \smartdiagram[flow diagram]{Set up,Run,Analyse,Modify~/ Add}
+% set color list={blue!50!cyan,green!60!lime,
+% orange!50!red,red!80!black},
+% back arrow disabled=true}
+% \smartdiagram[flow diagram:horizontal]{Set up,Run,
+% Analyse,Modify~/ Add}
% \end{center}
% \end{verbatim}
% \begin{center}
-% \smartdiagramset{border color=none,set color list={blue!50!cyan,green!60!lime,orange!50!red,red!80!black}}
-% \smartdiagram[flow diagram]{Set up,Run,Analyse,Modify~/ Add}
+% \scalebox{0.8}{
+% \smartdiagramset{border color=none,
+% set color list={blue!50!cyan,green!60!lime,orange!50!red,red!80!black},
+% back arrow disabled=true}
+% \smartdiagram[flow diagram:horizontal]{Set up,Run,Analyse,Modify~/ Add}
+% }
% \end{center}
% \smartdiagramset{use predefined color list}
% \DescribeMacro{Circular diagram with custom options}
% Another example:
% \begin{verbatim}
% \begin{center}
-% \smartdiagramset{circular distance=4cm, font=\large, text width=2.5cm,
-% module minimum width=2.5cm, module minimum height=1.5cm,arrow tip=to}
-% \smartdiagram[circular diagram]{Set up~/ Adapt,Run,Analyse,Modify~/ Add,Check,Check again}
+% \smartdiagramset{circular distance=4cm,
+% font=\large, text width=2.5cm,
+% module minimum width=2.5cm,
+% module minimum height=1.5cm,
+% arrow tip=to}
+% \smartdiagram[circular diagram]{Set up~/ Adapt,Run,
+% Analyse,Modify~/ Add,Check,Check again}
% \end{center}
% \end{verbatim}
% \begin{center}
+% \scalebox{0.7}{
% \smartdiagramset{circular distance=4cm, font=\large, text width=2.5cm,
% module minimum width=2.5cm, module minimum height=1.5cm,arrow tip=to}
% \smartdiagram[circular diagram]{Set up~/ Adapt,Run,Analyse,Modify~/ Add,Check,Check again}
+% }
% \end{center}
% \DescribeMacro{Circular diagram with custom shape}
% An example with a diamond shape:
@@ -343,31 +411,44 @@ and the derived files smartdiagram.ins,
% \begin{center}
% \usetikzlibrary{shapes.geometric} % required in the preamble
% \smartdiagramset{module shape=diamond,font=\scriptsize,
-% module minimum width=1cm,module minimum height=1cm,text width=1cm,
+% module minimum width=1cm,module minimum height=1cm,
+% text width=1cm,
% circular distance=2cm}
-% \smartdiagram[circular diagram]{Set up,Run,Analyse,Modify~/ Add}
+% \smartdiagram[circular diagram:clockwise]{Set up,Run,
+% Analyse,Modify~/ Add}
% \end{center}
% \end{verbatim}
% \begin{center}
% \smartdiagramset{module shape=diamond,font=\scriptsize,
% module minimum width=1cm,module minimum height=1cm,text width=1cm,
% circular distance=2cm}
-% \smartdiagram[circular diagram]{Set up,Run,Analyse,Modify~/ Add}
+% \smartdiagram[circular diagram:clockwise]{Set up,Run,Analyse,Modify~/ Add}
% \end{center}
-% \DescribeMacro{Flow diagram with decorated border}
-% An example with a decorated shape:
+% \DescribeMacro{Flow diagram with decorated border and uniform arrow color}
+% An example with a decorated shape and uniform arrow color:
% \begin{verbatim}
% \usetikzlibrary{decorations.pathmorphing} % required in the preamble
% \begin{center}
-% \tikzset{my decoration/.style={decorate,decoration=zigzag}}
-% \smartdiagramset{module shape=rectangle,insert decoration={my decoration}}
+% \tikzset{my decoration/.style={
+% decorate,
+% decoration=zigzag
+% }
+% }
+% \smartdiagramset{module shape=rectangle,
+% insert decoration={my decoration},
+% uniform arrow color=true, arrow color=gray!50!black,
+% }
% \smartdiagram[flow diagram]{Set up,Run,Analyse,Modify~/ Add}
% \end{center}
% \end{verbatim}
% \begin{center}
% \tikzset{my decoration/.style={decorate,decoration=zigzag}}
-% \smartdiagramset{module shape=rectangle,insert decoration={my decoration}}
+% \smartdiagramset{module shape=rectangle,insert decoration={my decoration},
+% uniform arrow color=true, arrow color=gray!50!black,
+% }
+% \scalebox{0.8}{
% \smartdiagram[flow diagram]{Set up,Run,Analyse,Modify~/ Add}
+% }
% \end{center}
% \DescribeMacro{Descriptive diagram}
% An example of descriptive diagram:
@@ -395,7 +476,8 @@ and the derived files smartdiagram.ins,
% An example of bubble diagram:
% \begin{verbatim}
% \begin{center}
-% \smartdiagram[bubble diagram]{Build a program,Set up,Run,Analyze,Modify~/\\ Add,Check}
+% \smartdiagram[bubble diagram]{Build a program,Set up,Run,
+% Analyze,Modify~/\\ Add,Check}
% \end{center}
% \end{verbatim}
% \begin{center}
@@ -407,11 +489,30 @@ and the derived files smartdiagram.ins,
% An example of constellation diagram:
% \begin{verbatim}
% \begin{center}
+% \smartdiagram[constellation diagram]{Build a program,
+% Set up,Run,Analyze,Modify~/\\ Add}
+% \end{center}
+% \end{verbatim}
+% \begin{center}
+% \scalebox{0.8}{
% \smartdiagram[constellation diagram]{Build a program,Set up,Run,Analyze,Modify~/\\ Add}
+% }
+% \end{center}
+% \DescribeMacro{Constellation diagram with custom colors}
+% An example of constellation diagram with custom colors:
+% \begin{verbatim}
+% \begin{center}
+% \smartdiagramset{set color list={orange!60, green!50!lime!60,
+% magenta!60,blue!50!cyan},
+% uniform connection color=true}
+% \smartdiagram[constellation diagram]{Build a program,
+% Set up,Run,Analyze,Modify~/\\ Add}
% \end{center}
% \end{verbatim}
% \begin{center}
% \scalebox{0.8}{
+% \smartdiagramset{set color list={orange!60, green!50!lime!60,magenta!60,blue!50!cyan},
+% uniform connection color=true}
% \smartdiagram[constellation diagram]{Build a program,Set up,Run,Analyze,Modify~/\\ Add}
% }
% \end{center}
@@ -426,7 +527,7 @@ and the derived files smartdiagram.ins,
% \end{verbatim}
% \begin{center}
% \scalebox{0.8}{
-% \smartdiagramset{planet color=orange!60, distance planet-satellite=2.75cm}
+% \smartdiagramset{planet color=orange!60, distance planet-satellite=2.75cm,use predefined color list}
% \smartdiagram[connected constellation diagram]{Build a program,Set up,Run,Analyze,Modify~/\\ Add}
% }
% \end{center}
@@ -434,9 +535,11 @@ and the derived files smartdiagram.ins,
% An example of priority descriptive diagram describing that Ti\textit{k}Z is built on top of PGF and Smartdiagram on top of Ti\textit{k}Z:
% \begin{verbatim}
% \begin{center}
-% \smartdiagramset{set color list={blue!50!cyan,green!60!lime,orange!50!red},
+% \smartdiagramset{set color list={blue!50!cyan,green!60!lime,
+% orange!50!red},
% priority arrow width=2cm,priority arrow height advance=2.25cm}
-% \smartdiagram[priority descriptive diagram]{PGF,Ti\textit{k}Z,Smartdiagram}
+% \smartdiagram[priority descriptive diagram]{PGF,
+% Ti\textit{k}Z,Smartdiagram}
% \end{center}
% \end{verbatim}
% \begin{center}
@@ -444,11 +547,39 @@ and the derived files smartdiagram.ins,
% priority arrow width=2cm,priority arrow height advance=2.25cm}
% \smartdiagram[priority descriptive diagram]{PGF,Ti\textit{k}Z,Smartdiagram}
% \end{center}
+% \DescribeMacro{Sequence diagram}
+% The same previous example with a sequence diagram:
+% \begin{verbatim}
+% \begin{center}
+% \smartdiagram[sequence diagram]{PGF,Ti\textit{k}Z,Smartdiagram}
+% \end{center}
+% \end{verbatim}
+% \begin{center}
+% \smartdiagramset{use predefined color list}
+% \smartdiagram[sequence diagram]{PGF,Ti\textit{k}Z,Smartdiagram}
+% \end{center}
+% and with \smkey{uniform sequence color} set to \verb|true|:
+% \begin{verbatim}
+% \begin{center}
+% \smartdiagramset{uniform sequence color=true,
+% sequence item border color=black,sequence item font size=\footnotesize,
+% sequence item text color=white
+% }
+% \smartdiagram[sequence diagram]{PGF,Ti\textit{k}Z,Smartdiagram}
+% \end{center}
+% \end{verbatim}
+% \begin{center}
+% \smartdiagramset{uniform sequence color=true,
+% sequence item border color=black,sequence item font size=\footnotesize,
+% sequence item text color=white
+% }
+% \smartdiagram[sequence diagram]{PGF,Ti\textit{k}Z,Smartdiagram}
+% \end{center}
%
% \section{Recommendations and known issues}
% \label{sec:recommendations}
% \subsection{Something about colors}
-% As seen in the section \ref{sec:options}, the colors could be customized by means of the key \smkey{set color list}. By default there are 10 predefined colors; in order: \colsmartbox{red!40}, \colsmartbox{cyan!40}, \colsmartbox{blue!40}, \colsmartbox{green!40}, \colsmartbox{orange!40}, \colsmartbox{yellow!40}, \colsmartbox{magenta!40}, \colsmartbox{brown!40}, \colsmartbox{violet!40} and \colsmartbox{teal!40}. This implies that, by default, it is not possible to have list longer than 10 items. This, of course, could be avoided by declaring its own proper list with, say, 20 colors and therefore develop diagrams with more than 10 items. In any case, it is always possible to reset custom color lists by means of:
+% As seen in the section \ref{sec:options}, the colors could be customized by means of the key \smkey{set color list}. By default there are 10 predefined colors; in order: \colsmartbox{red!40}, \colsmartbox{cyan!40}, \colsmartbox{blue!40}, \colsmartbox{green!40}, \colsmartbox{orange!40}, \colsmartbox{yellow!40}, \colsmartbox{magenta!40}, \colsmartbox{brown!40}, \colsmartbox{violet!40} and \colsmartbox{teal!40}. This implies that, by default, it is not possible to have lists longer than 10 items. This, of course, could be avoided by declaring proper lists with, say, 20 colors and therefore develop diagrams with more than 10 items. In any case, it is always possible to reset custom color lists by means of:
% \begin{verbatim}
% \smartdiagramset{use predefined color list}
% \end{verbatim}
@@ -506,10 +637,10 @@ and the derived files smartdiagram.ins,
% \end{verbatim}
% where the dots represent the other options.
%
-% The insertion of decorations inside a \diagram{descriptive diagram} are problematic: only \verb|random steps|, \verb|bent| and \verb|coil| do not raise errors. Other decorations, like \verb|coil|, raise as error:
+% The insertion of decorations inside a \diagram{descriptive diagram} are problematic: only \verb|random steps|, \verb|bent| and \verb|coil| do not raise errors. Other decorations, like \verb|snake|, raise as error:
% \begin{verbatim}
% ! Dimension too large.
-% \end{verbatim} but, after all, the decoration is deployted anyway.
+% \end{verbatim} but, after all, the decoration is deployed anyway.
%
% In case the user wants to decorate a border with a decoration that involves random numbers, such as \verb|random steps| or other custom-built decorations, it is preferable to set a seed for the animated diagram, to avoid that at each step the border of the same module changes. An example:
% \begin{verbatim}
@@ -534,7 +665,8 @@ and the derived files smartdiagram.ins,
% For what concern these diagrams there is a bug in displaying the tick line when the \smkey{priority arrow head extend} is set with a bigger size than the default; a minimal-non-working example:
% \begin{verbatim}
% \begin{center}
-% \smartdiagramset{priority arrow width=2cm,priority arrow height advance=2.25cm,
+% \smartdiagramset{priority arrow width=2cm,
+% priority arrow height advance=2.25cm,
% priority arrow head extend=0.3cm}
% \smartdiagram[priority descriptive diagram]{PGF,Ti\textit{k}Z,Smartdiagram}
% \end{center}
@@ -551,7 +683,9 @@ and the derived files smartdiagram.ins,
% \section{Aknowledgements}
% I would like to acknowledge first of all \href{http://tex.stackexchange.com/users/3144/alain-matthes}{Alain Matthes} and \href{http://tex.stackexchange.com/users/4956/mohsen}{Mohsen} because the \diagram{bubble diagram} and the \diagram{constellation diagram} are based on \href{http://tex.stackexchange.com/questions/52394/high-level-macros-and-environments-based-on-tikz?#52408}{Alain's answer} while the \diagram{circular diagram} is based on \href{http://tex.stackexchange.com/questions/52394/high-level-macros-and-environments-based-on-tikz?#52972}{Mohsen's answer}.
%
-% Last, but not least, I would like to thank \href{http://tex.stackexchange.com/users/4427/egreg}{Enrico Gregorio} and \href{http://tex.stackexchange.com/users/994/ahmed-musa}{Ahmed Musa} for the courtesy of explaining me why my poor attempt in creating the \smkey{set color list} failed and for providing me valid solutions.
+% I would also like to thank \href{http://tex.stackexchange.com/users/4427/egreg}{Enrico Gregorio} and \href{http://tex.stackexchange.com/users/994/ahmed-musa}{Ahmed Musa} for the courtesy of explaining me why my poor attempt in creating the \smkey{set color list} failed and for providing me valid solutions.
+%
+% Last, but not least, I would like to thank prof.~Ludger~Humbert for suggesting and providing the code for the \diagram{circular diagram:clockwise} and André Hilbig for suggesting the key \smkey{back arrow disabled}.
% \StopEventually{\PrintChanges}
% \iffalse
%<*package>
@@ -562,9 +696,18 @@ and the derived files smartdiagram.ins,
% This subsection highlights which are the package loaded and the \verb|tikzlibraries| needed.
% \begin{macrocode}
\RequirePackage{tikz}
-\RequirePackage{xparse,etoolbox}
-\usetikzlibrary{backgrounds,calc,fadings,shadows,shapes.arrows}
+\RequirePackage{etoolbox}
+\RequirePackage{xparse}
+\RequirePackage{xstring}
+
+\usetikzlibrary{backgrounds,
+ calc,
+ fadings,
+ shadows,
+ shapes.arrows,
+ shapes.symbols
+}
\pgfdeclarelayer{smart diagram arrow back}
\pgfsetlayers{background,smart diagram arrow back,main}
% \end{macrocode}
@@ -593,11 +736,12 @@ and the derived files smartdiagram.ins,
\global\expandafter\edef\csname #3\endcsname{\myheight}
}
% \end{macrocode}
-% The key definition and function to set them:
+% The key definition and the functions to set them:
% \begin{macrocode}
\pgfkeys{/smart diagram/.cd, module minimum width/.initial=2cm,
module minimum height/.initial={1cm},
module y sep/.initial={1.65},
+ module x sep/.initial={2.75},
descriptive items y sep/.initial={1.75},
text width/.initial={1.5cm},
description title width/.initial={1.5cm},
@@ -613,6 +757,7 @@ and the derived files smartdiagram.ins,
module shape/.initial={rnd rectangle},
insert decoration/.initial={},
arrow tip/.initial={stealth},
+ arrow color/.initial={gray},
bubble center node size/.initial={4cm},
bubble center node font/.initial={\large},
bubble center node color/.initial={lightgray!60},
@@ -635,16 +780,28 @@ and the derived files smartdiagram.ins,
satellite text width/.initial={1.5cm},
distance satellite-connection/.initial={0.075cm},
connection line width/.initial={0.1cm},
+ connection color/.initial={gray},
distance planet-satellite/.initial={3.5cm},
priority arrow width/.initial={1.5cm},
priority arrow head extend/.initial={0.15cm},
priority tick size/.initial={5pt},
priority arrow height advance/.initial={2cm},
+ sequence item height/.initial={1cm},
+ sequence item width/.initial={2cm},
+ sequence item border color/.initial={gray},
+ sequence item border size/.initial={1.75\pgflinewidth},
+ sequence item font size/.initial={\normalfont},
+ sequence item fill opacity/.initial={1},
+ sequence item text opacity/.initial={1},
+ sequence item text width/.initial={1.9cm},
+ sequence item text color/.initial={black},
+ sequence item uniform color/.initial={gray!60!black},
}%
\pgfkeys{/smart diagram/.cd, module minimum width/.get=\modulewidth,
module minimum height/.get=\moduleheight,
module y sep/.get=\moduleysep,
+ module x sep/.get=\modulexsep,
descriptive items y sep/.get=\descriptiveitemsysep,
text width/.get=\moduletextwidth,
description title width/.get=\descriptiontitlewidth,
@@ -660,6 +817,7 @@ and the derived files smartdiagram.ins,
module shape/.get=\moduleshape,
insert decoration/.get=\borderdecoration,
arrow tip/.get=\arrowtip,
+ arrow color/.get=\arrowcolor,
bubble center node size/.get=\bubblecenternodesize,
bubble center node font/.get=\bubblecenternodefont,
bubble center node color/.get=\bubblecenternodecolor,
@@ -682,13 +840,28 @@ and the derived files smartdiagram.ins,
satellite text width/.get=\satellitetextwidth,
distance satellite-connection/.get=\satelliteoutersep,
connection line width/.get=\connectionlinewidth,
+ connection color/.get=\connectioncolor,
distance planet-satellite/.get=\distanceplanetsatellite,
priority arrow width/.get=\priorityarrowwidth,
priority arrow head extend/.get=\priorityarrowheadextend,
priority tick size/.get=\prioritytick,
priority arrow height advance/.get=\priorityarrowheightadvance,
+ sequence item height/.get=\seqitemheight,
+ sequence item width/.get=\seqitemwidth,
+ sequence item border color/.get=\seqitembordercolor,
+ sequence item border size/.get=\seqlinewidth,
+ sequence item font size/.get=\seqitemfont,
+ sequence item fill opacity/.get=\seqitemfillopacity,
+ sequence item text opacity/.get=\seqitemtextopacity,
+ sequence item text width/.get=\seqitemtextwidth,
+ sequence item text color/.get=\seqitemtextcolor,
+ sequence item uniform color/.get=\seqitemuniformcol,
}%
+% \end{macrocode}
+% The specific key to set the list of colors:
+% \begin{macrocode}
+
\pgfkeys{/smart diagram/.cd, set color list/.code={
\foreach \listitem [count=\i] in {#1}{
\global\@namedef{color@\i\expandafter}\expandafter{\listitem}
@@ -710,11 +883,26 @@ and the derived files smartdiagram.ins,
}
}
+% \end{macrocode}
+% The specific key to disable the back arrow in the flow diagram:
+% \begin{macrocode}
+
+\newif\ifbackarrowdisabled
+\pgfkeys{/smart diagram/.cd,
+ back arrow disabled/.is if=backarrowdisabled,
+ back arrow disabled=false,
+}
+
+% \end{macrocode}
+% The specific command to use within the document to use the keys:
+% \begin{macrocode}
+
\NewDocumentCommand{\smartdiagramset}{m}{%
\pgfkeys{/smart diagram/.cd,#1}%
\pgfkeys{/smart diagram/.cd, module minimum width/.get=\modulewidth,
module minimum height/.get=\moduleheight,
module y sep/.get=\moduleysep,
+ module x sep/.get=\modulexsep,
descriptive items y sep/.get=\descriptiveitemsysep,
text width/.get=\moduletextwidth,
description title width/.get=\descriptiontitlewidth,
@@ -730,6 +918,7 @@ and the derived files smartdiagram.ins,
module shape/.get=\moduleshape,
insert decoration/.get=\borderdecoration,
arrow tip/.get=\arrowtip,
+ arrow color/.get=\arrowcolor,
bubble center node size/.get=\bubblecenternodesize,
bubble center node font/.get=\bubblecenternodefont,
bubble center node color/.get=\bubblecenternodecolor,
@@ -752,18 +941,36 @@ and the derived files smartdiagram.ins,
satellite text width/.get=\satellitetextwidth,
distance satellite-connection/.get=\satelliteoutersep,
connection line width/.get=\connectionlinewidth,
+ connection color/.get=\connectioncolor,
distance planet-satellite/.get=\distanceplanetsatellite,
priority arrow width/.get=\priorityarrowwidth,
priority arrow head extend/.get=\priorityarrowheadextend,
priority tick size/.get=\prioritytick,
priority arrow height advance/.get=\priorityarrowheightadvance,
+ sequence item height/.get=\seqitemheight,
+ sequence item width/.get=\seqitemwidth,
+ sequence item border color/.get=\seqitembordercolor,
+ sequence item border size/.get=\seqlinewidth,
+ sequence item font size/.get=\seqitemfont,
+ sequence item fill opacity/.get=\seqitemfillopacity,
+ sequence item text opacity/.get=\seqitemtextopacity,
+ sequence item text width/.get=\seqitemtextwidth,
+ sequence item text color/.get=\seqitemtextcolor,
+ sequence item uniform color/.get=\seqitemuniformcol,
}%
}%
% \end{macrocode}
% The fading style applied to the \diagram{priority descriptive diagram} and styles diagram definition:
% \begin{macrocode}
-\tikzfading[name=priorityarrowfading, bottom color=transparent!5, top color=transparent!80]
-\tikzset{priority arrow fill/.style={fill=gray,path fading=priorityarrowfading}}
+\tikzfading[name=priorityarrowfading,
+ bottom color=transparent!5,
+ top color=transparent!80
+]
+\tikzset{priority arrow fill/.style={
+ fill=gray,
+ path fading=priorityarrowfading
+ }
+}
\tikzset{module/.style={
\pgfkeysvalueof{/smart diagram/module shape},
@@ -778,9 +985,24 @@ and the derived files smartdiagram.ins,
\borderdecoration
},
diagram arrow type/.style={
- >=\arrowtip,line width=\arrowlinewidth,\col,
+ >=\arrowtip,line width=\arrowlinewidth,\col
},
}
+
+% let the arrow color be uniform
+\pgfkeys{/smart diagram/.cd,%
+ uniform arrow color/.is choice,%
+ uniform arrow color/true/.code={%
+ \tikzset{diagram arrow type/.append style={
+ \arrowcolor
+ },
+ }
+ },%
+ uniform arrow color/false/.style={diagram arrow type},%
+ uniform arrow color/.default=false,
+}%
+
+
\tikzset{description title/.style={
circle,
draw=\bordercolor,
@@ -847,12 +1069,12 @@ and the derived files smartdiagram.ins,
satellite/.style={
minimum size=\satelliteminimumsize,
circle,
- font=\satellitefont,
- fill opacity=\satellitefillopacity,
- fill=\col,
- text opacity=\satellitetextopacity,
- text width=\satellitetextwidth,
- outer sep=\satelliteoutersep,
+ font=\satellitefont,
+ fill opacity=\satellitefillopacity,
+ fill=\col,
+ text opacity=\satellitetextopacity,
+ text width=\satellitetextwidth,
+ outer sep=\satelliteoutersep,
},
connection planet satellite/.style={
line width=\connectionlinewidth,
@@ -860,44 +1082,112 @@ and the derived files smartdiagram.ins,
\col,
}
}
+
+\tikzset{sequence item/.style={
+ minimum height=\seqitemheight,
+ minimum width=\seqitemwidth,
+ signal,
+ signal from=west,
+ signal to=east,
+ draw=\seqitembordercolor,
+ line width=\seqlinewidth,
+ font=\seqitemfont,
+ fill opacity=\seqitemfillopacity,
+ fill=\col,
+ text opacity=\seqitemtextopacity,
+ text width=\seqitemtextwidth,
+ text=\seqitemtextcolor,
+ }
+}
+
+% let the sequence color be uniform
+\pgfkeys{/smart diagram/.cd,%
+ uniform sequence color/.is choice,%
+ uniform sequence color/true/.code={%
+ \tikzset{sequence item/.append style={
+ fill=\seqitemuniformcol,
+ },
+ }
+ },%
+ uniform sequence color/false/.style={sequence item},%
+ uniform sequence color/.default=false,
+}%
+
+% let the connection planet satellite color be uniform
+\pgfkeys{/smart diagram/.cd,%
+ uniform connection color/.is choice,%
+ uniform connection color/true/.code={%
+ \tikzset{connection planet satellite/.append style={
+ \connectioncolor
+ },
+ }
+ },%
+ uniform connection color/false/.style={connection planet satellite},%
+ uniform connection color/.default=false,
+}%
% \end{macrocode}
% \subsection{Commands}
-% Definition of the two basic commands. The diagrams:
+% Definition of the two commands. The diagrams:
% \begin{macrocode}
-\NewDocumentCommand{\smartdiagram}{r[] m}{%
+\NewDocumentCommand{\smartdiagram}{r[] m}{%
+ \StrCut{#1}{:}\diagramtype\option
\IfNoValueTF{#1}{% true-no value 1
- \PackageError{smartdiagram}{Type of the diagram not inserted. Please insert it}
+ \PackageError{smartdiagram}%
+ {Type of the diagram not inserted. Please insert it}%
{Example: \protect\smartdiagram[flow diagram]}}
{%false-no value 1
- \ifstrequal{#1}{circular diagram}{% true-circular diagram
+ \IfStrEq{\diagramtype}{}{%
+ \PackageError{smartdiagram}{Type of the diagram not inserted. Please insert it}
+ {Example: \protect\smartdiagram[flow diagram]}
+ }{}
+ \IfStrEq{\diagramtype}{circular diagram}{% true-circular diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2} {\global\let\maxsmitem\xi}
- \foreach \smitem [count=\xi] in {#2}{%
- \pgfmathtruncatemacro{\angle}{360/\maxsmitem*\xi}
+ \foreach \smitem [count=\xi] in {#2}{%
+ \IfStrEq{\option}{clockwise}{% true-clockwise-circular diagram
+ \pgfmathtruncatemacro{\angle}{180+360/\maxsmitem*\xi}
+ }{% false-clockwise-circular diagram
+ \pgfmathtruncatemacro{\angle}{360/\maxsmitem*\xi}
+ }
\edef\col{\@nameuse{color@\xi}}
- \node[module,drop shadow] (module\xi) at (\angle:\circulardistance) {\smitem };
+ \IfStrEq{\option}{clockwise}{% true-clockwise-circular diagram
+ \node[module,drop shadow] (module\xi)
+ at (-\angle:\circulardistance) {\smitem };
+ }{% false-clockwise-circular diagram
+ \node[module,drop shadow] (module\xi)
+ at (\angle:\circulardistance) {\smitem };
+ }
}%
\foreach \smitem [count=\xi] in {#2}{%
\pgfmathtruncatemacro{\xj}{mod(\xi, \maxsmitem) + 1)}
\edef\col{\@nameuse{color@\xj}}
- \draw[<-,diagram arrow type,shorten <=0.3cm,shorten >=0.3cm]
+ \IfStrEq{\option}{clockwise}{% true-clockwise-circular diagram
+ \draw[<-,diagram arrow type,shorten <=0.3cm,shorten >=0.3cm]
+ (module\xj) to[bend right] (module\xi);
+ }{% false-clockwise-circular diagram
+ \draw[<-,diagram arrow type,shorten <=0.3cm,shorten >=0.3cm]
(module\xj) to[bend left] (module\xi);
+ }
}%
\end{tikzpicture}
}{}% end-circular diagram
- \ifstrequal{#1}{flow diagram}{% true-flow diagram
+ \IfStrEq{\diagramtype}{flow diagram}{% true-flow diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2} {\global\let\maxsmitem\xi}
\foreach \smitem [count=\xi] in {#2}{%
\edef\col{\@nameuse{color@\xi}}
- \path let \n1 = {int(0-\xi)}, \n2={0-\xi*\moduleysep}
- in node[module,drop shadow] (module\xi) at +(0,\n2) {\smitem};
-
+ \IfStrEq{\option}{horizontal}{% true-horizontal-flow diagram
+ \path let \n1 = {int(0-\xi)}, \n2={0+\xi*\modulexsep} in
+ node[module,drop shadow] (module\xi) at +(\n2,0) {\smitem};
+ }{% false-horizontal-flow diagram
+ \path let \n1 = {int(0-\xi)}, \n2={0-\xi*\moduleysep} in
+ node[module,drop shadow] (module\xi) at +(0,\n2) {\smitem};
+ }
}%
\foreach \smitem [count=\xi] in {#2}{%
@@ -908,15 +1198,32 @@ and the derived files smartdiagram.ins,
\draw[<-,diagram arrow type] (module\xj) -- (module\xi);
\end{pgfonlayer}
\fi
- % last arrow - not display it in background
- \ifnum\xi=\maxsmitem
- \draw[<-,diagram arrow type] (module\xj.east)--
- ($(module\xj.east)+(1,0)$) |- (module\xi);
+ % last arrow - not display it in background - check if disabled
+ \ifbackarrowdisabled
+ \relax
+ \else
+ \ifnum\xi=\maxsmitem
+ \IfStrEq{\option}{horizontal}{% true-horizontal-flow diagram
+ \tikzset{square arrow/.style={
+ to path={-- ++(0,0.5) -| (\tikztotarget)}
+ }
+ }
+ \draw[<-,diagram arrow type, square arrow]
+ (module\xj.north) to (module\xi.north);
+ }{% false-horizontal-flow diagram
+ \tikzset{square arrow/.style={
+ to path={-- ++(0.5,0) |- (\tikztotarget)}
+ }
+ }
+ \draw[<-,diagram arrow type,square arrow]
+ (module\xj.east) to (module\xi);
+ }
+ \fi
\fi
}%
\end{tikzpicture}
}{}% end-flow diagram
- \ifstrequal{#1}{descriptive diagram}{% true-descriptive diagram
+ \IfStrEq{\diagramtype}{descriptive diagram}{% true-descr. diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{%
\edef\col{\@nameuse{color@\xi}}
@@ -932,8 +1239,8 @@ and the derived files smartdiagram.ins,
}%
}%
\end{tikzpicture}
- }{}% end-descriptive diagram
- \ifstrequal{#1}{bubble diagram}{% true-bubble diagram
+ }{}% end-descr. diagram
+ \IfStrEq{\diagramtype}{bubble diagram}{% true-bubble diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{\global\let\maxsmitem\xi}
\pgfmathtruncatemacro\actualnumitem{\maxsmitem-1}
@@ -944,12 +1251,13 @@ and the derived files smartdiagram.ins,
\pgfmathtruncatemacro{\xj}{\xi-1}
\pgfmathtruncatemacro{\angle}{360/\actualnumitem*\xj}
\edef\col{\@nameuse{color@\xj}}
- \node[bubble node] (module\xi) at (center bubble.\angle) {\smitem };
+ \node[bubble node] (module\xi)
+ at (center bubble.\angle) {\smitem };
}%
}%
\end{tikzpicture}
}{}%end-bubble diagram
- \ifstrequal{#1}{constellation diagram}{% true-constellation diagram
+ \IfStrEq{\diagramtype}{constellation diagram}{% true-const diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{\global\let\maxsmitem\xi}
\pgfmathtruncatemacro\actualnumitem{\maxsmitem-1}
@@ -960,13 +1268,14 @@ and the derived files smartdiagram.ins,
\pgfmathtruncatemacro{\xj}{\xi-1}
\pgfmathtruncatemacro{\angle}{360/\actualnumitem*\xj}
\edef\col{\@nameuse{color@\xj}}
- \node[satellite] (satellite\xi) at (\angle:\distanceplanetsatellite) {\smitem };
+ \node[satellite] (satellite\xi)
+ at (\angle:\distanceplanetsatellite) {\smitem };
\draw[->,connection planet satellite] (planet) -- (satellite\xi);
}%
}%
\end{tikzpicture}
- }{}%end-constellation diagram
- \ifstrequal{#1}{connected constellation diagram}{% true-connected constellation diagram
+ }{}%end-const diagram
+ \IfStrEq{\diagramtype}{connected constellation diagram}{% true-conn const diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{\global\let\maxsmitem\xi}
\pgfmathtruncatemacro\actualnumitem{\maxsmitem-1}
@@ -977,7 +1286,8 @@ and the derived files smartdiagram.ins,
\pgfmathtruncatemacro{\xj}{\xi-1}
\pgfmathtruncatemacro{\angle}{360/\actualnumitem*\xj}
\edef\col{\@nameuse{color@\xj}}
- \node[satellite] (satellite\xj) at (\angle:\distanceplanetsatellite) {\smitem };
+ \node[satellite] (satellite\xj)
+ at (\angle:\distanceplanetsatellite) {\smitem };
}%
}%
\foreach \smitem [count=\xi] in {#2}{%
@@ -985,12 +1295,13 @@ and the derived files smartdiagram.ins,
\pgfmathtruncatemacro{\xj}{\xi-1}
\edef\col{\@nameuse{color@\xj}}
\pgfmathtruncatemacro{\xk}{mod(\xj,\actualnumitem) +1}
- \path[connection planet satellite] (satellite\xj) edge[bend right] (satellite\xk);
+ \path[connection planet satellite]
+ (satellite\xj) edge[bend right] (satellite\xk);
}{}
}%
\end{tikzpicture}
}{}%end-connected constellation diagram
- \ifstrequal{#1}{priority descriptive diagram}{% true-priority descriptive diagram
+ \IfStrEq{\diagramtype}{priority descriptive diagram}{% true-priority descriptive diagram
\pgfmathparse{subtract(\priorityarrowwidth,\priorityarrowheadextend)}
\pgfmathsetmacro\priorityticksize{\pgfmathresult/2}
\pgfmathsetmacro\arrowtickxshift{(\priorityarrowwidth-\priorityticksize)/2}
@@ -1000,7 +1311,8 @@ and the derived files smartdiagram.ins,
\edef\col{\@nameuse{color@\xi}}
\node[description,drop shadow](module\xi)
at (0,0+\xi*\descriptiveitemsysep) {\smitem};
- \draw[line width=\prioritytick,\col] ([xshift=-\arrowtickxshift pt]module\xi.base west)--
+ \draw[line width=\prioritytick,\col]
+ ([xshift=-\arrowtickxshift pt]module\xi.base west)--
($([xshift=-\arrowtickxshift pt]module\xi.base west)-(\priorityticksize pt,0)$);
}%
\coordinate (A) at (module1);
@@ -1014,6 +1326,18 @@ and the derived files smartdiagram.ins,
\end{pgfonlayer}
\end{tikzpicture}
}{}% end-priority descriptive diagram
+ \IfStrEq{\diagramtype}{sequence diagram}{% true-sequence diagram
+ \begin{tikzpicture}[every node/.style={align=center}]
+ \foreach \x[count=\xi, count=\prevx from 0] in {#2}{%
+ \edef\col{\@nameuse{color@\xi}}
+ \ifnum\xi=1
+ \node[sequence item] (x-\xi) {\x};
+ \else
+ \node[sequence item,anchor=west] (x-\xi) at (x-\prevx.east) {\x};
+ \fi
+ }
+ \end{tikzpicture}
+ }{}% end-sequence diagram
}% end-no value 1
}% end-command
% \end{macrocode}
@@ -1029,45 +1353,68 @@ and the derived files smartdiagram.ins,
\NewDocumentCommand{\smartdiagramanimated}{r[] m}{%
+ \StrCut{#1}{:}\diagramtype\option
\IfNoValueTF{#1}{% true-no value 1
\PackageError{smartdiagram}{Type of the diagram not inserted. Please insert it}
{Example: \protect\smartdiagram[flow diagram]}}
{%false-no value 1
- \ifstrequal{#1}{circular diagram}{% true-circular diagram
- \begin{tikzpicture}[every node/.style={align=center}]
-
+ \IfStrEq{\diagramtype}{}{%
+ \PackageError{smartdiagram}{Type of the diagram not inserted. Please insert it}
+ {Example: \protect\smartdiagram[flow diagram]}
+ }{}
+ \IfStrEq{\diagramtype}{circular diagram}{% true-circular diagram
+ \begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2} {\global\let\maxsmitem\xi}
-
\foreach \smitem [count=\xi] in {#2}{%
- \pgfmathtruncatemacro{\angle}{360/\maxsmitem*\xi}
+ \IfStrEq{\option}{clockwise}{% true-clockwise-circular diagram
+ \pgfmathtruncatemacro{\angle}{180+360/\maxsmitem*\xi}
+ }{% false-clockwise-circular diagram
+ \pgfmathtruncatemacro{\angle}{360/\maxsmitem*\xi}
+ }
\edef\col{\@nameuse{color@\xi}}
- \node[module,
+ \IfStrEq{\option}{clockwise}{% true-clockwise-circular diagram
+ \node[module,
+ drop shadow={smvisible on=<\xi->},
+ smvisible on=<\xi->] (module\xi)
+ at (-\angle:\circulardistance) {\smitem};
+ }{% false-clockwise-circular diagram
+ \node[module,
drop shadow={smvisible on=<\xi->},
- smvisible on=<\xi->] (module\xi) at (\angle:\circulardistance) {\smitem };
+ smvisible on=<\xi->] (module\xi)
+ at (\angle:\circulardistance) {\smitem};
+ }
}%
-
\foreach \smitem [count=\xi] in {#2}
{%
\pgfmathtruncatemacro{\xj}{mod(\xi, \maxsmitem) + 1)}
\pgfmathtruncatemacro{\adv}{\xi + 1)}
\edef\col{\@nameuse{color@\xi}}
- \draw[<-,diagram arrow type,shorten <=0.3cm,shorten >=0.3cm,
+ \IfStrEq{\option}{clockwise}{% true-clockwise-circular diagram
+ \draw[<-,diagram arrow type,shorten <=0.3cm,shorten >=0.3cm,
+ smvisible on=<\adv->] (module\xj) to[bend right] (module\xi);
+ }{% false-clockwise-circular diagram
+ \draw[<-,diagram arrow type,shorten <=0.3cm,shorten >=0.3cm,
smvisible on=<\adv->] (module\xj) to[bend left] (module\xi);
+ }
}%
\end{tikzpicture}
}{}% end-circular diagram
- \ifstrequal{#1}{flow diagram}{% true-flow diagram
+ \IfStrEq{\diagramtype}{flow diagram}{% true-flow diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2} {\global\let\maxsmitem\xi}
\foreach \smitem [count=\xi] in {#2}{%
\edef\col{\@nameuse{color@\xi}}
- \path let \n1 = {int(0-\xi)}, \n2={0-\xi*\moduleysep}
- in node[module,
- drop shadow={smvisible on=<\xi->},
+ \IfStrEq{\option}{horizontal}{% true-horizontal-flow diagram
+ \path let \n1 = {int(0-\xi)}, \n2={0+\xi*\modulexsep}
+ in node[module,drop shadow={smvisible on=<\xi->},
+ smvisible on=<\xi->] (module\xi) at +(\n2,0) {\smitem};
+ }{% false-horizontal-flow diagram
+ \path let \n1 = {int(0-\xi)}, \n2={0-\xi*\moduleysep}
+ in node[module,drop shadow={smvisible on=<\xi->},
smvisible on=<\xi->] (module\xi) at +(0,\n2) {\smitem};
-
+ }
}%
\foreach \smitem [count=\xi] in {#2}{%
@@ -1076,18 +1423,35 @@ and the derived files smartdiagram.ins,
\ifnum\xi<\maxsmitem
\begin{pgfonlayer}{smart diagram arrow back}
\draw[<-,diagram arrow type,smvisible on=<\xi->]
- (module\xj) -- (module\xi);
+ (module\xj) -- (module\xi);
\end{pgfonlayer}
\fi
- % last arrow - not display it in background
- \ifnum\xi=\maxsmitem
- \draw[<-,diagram arrow type,smvisible on=<\xi->]
- (module\xj.east)--($(module\xj.east)+(1,0)$) |- (module\xi);
+ % last arrow - not display it in background - check if disabled
+ \ifbackarrowdisabled
+ \relax
+ \else
+ \ifnum\xi=\maxsmitem
+ \IfStrEq{\option}{horizontal}{% true-horizontal-flow diagram
+ \tikzset{square arrow/.style={
+ to path={-- ++(0,0.5) -| (\tikztotarget)}
+ }
+ }
+ \draw[<-,diagram arrow type, square arrow,smvisible on=<\xi->]
+ (module\xj.north) to (module\xi.north);
+ }{% false-horizontal-flow diagram
+ \tikzset{square arrow/.style={
+ to path={-- ++(0.5,0) |- (\tikztotarget)}
+ }
+ }
+ \draw[<-,diagram arrow type,square arrow,smvisible on=<\xi->]
+ (module\xj.east) to (module\xi);
+ }
+ \fi
\fi
}%
\end{tikzpicture}
}{}% end-flow diagram
- \ifstrequal{#1}{descriptive diagram}{% true-descriptive diagram
+ \IfStrEq{\diagramtype}{descriptive diagram}{% true-descriptive diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{%
\edef\col{\@nameuse{color@\xi}}
@@ -1106,7 +1470,7 @@ and the derived files smartdiagram.ins,
}%
\end{tikzpicture}
}{}% end-descriptive diagram
- \ifstrequal{#1}{bubble diagram}{% true-bubble diagram
+ \IfStrEq{\diagramtype}{bubble diagram}{% true-bubble diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{\global\let\maxsmitem\xi}
\pgfmathtruncatemacro\actualnumitem{\maxsmitem-1}
@@ -1117,12 +1481,13 @@ and the derived files smartdiagram.ins,
\pgfmathtruncatemacro{\xj}{\xi-1}
\pgfmathtruncatemacro{\angle}{360/\actualnumitem*\xj}
\edef\col{\@nameuse{color@\xj}}
- \node[bubble node, smvisible on=<\xi->](module\xi) at (center bubble.\angle) {\smitem };
+ \node[bubble node, smvisible on=<\xi->](module\xi)
+ at (center bubble.\angle) {\smitem };
}%
}%
\end{tikzpicture}
}{}%end-bubble diagram
- \ifstrequal{#1}{constellation diagram}{% true-constellation diagram
+ \IfStrEq{\diagramtype}{constellation diagram}{% true-const diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{\global\let\maxsmitem\xi}
\pgfmathtruncatemacro\actualnumitem{\maxsmitem-1}
@@ -1141,7 +1506,7 @@ and the derived files smartdiagram.ins,
}%
\end{tikzpicture}
}{}%end-constellation diagram
- \ifstrequal{#1}{connected constellation diagram}{% true-connected constellation diagram
+ \IfStrEq{\diagramtype}{connected constellation diagram}{% true-conn const diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{\global\let\maxsmitem\xi}
\pgfmathtruncatemacro\actualnumitem{\maxsmitem-1}
@@ -1168,7 +1533,7 @@ and the derived files smartdiagram.ins,
}%
\end{tikzpicture}
}{}%end-connected constellation diagram
- \ifstrequal{#1}{priority descriptive diagram}{% true-priority descriptive diagram
+ \IfStrEq{\diagramtype}{priority descriptive diagram}{% true-priority descriptive diagram
\pgfmathparse{subtract(\priorityarrowwidth,\priorityarrowheadextend)}
\pgfmathsetmacro\priorityticksize{\pgfmathresult/2}
\pgfmathsetmacro\arrowtickxshift{(\priorityarrowwidth-\priorityticksize)/2}
@@ -1194,6 +1559,19 @@ and the derived files smartdiagram.ins,
\end{pgfonlayer}
\end{tikzpicture}
}{}% end-priority descriptive diagram
+ \IfStrEq{\diagramtype}{sequence diagram}{% true-sequence diagram
+ \begin{tikzpicture}[every node/.style={align=center}]
+ \foreach \x[count=\xi, count=\prevx from 0] in {#2}{%
+ \edef\col{\@nameuse{color@\xi}}
+ \ifnum\xi=1
+ \node[sequence item,smvisible on=<\xi->] (x-\xi) {\x};
+ \else
+ \node[sequence item,anchor=west,smvisible on=<\xi->]
+ (x-\xi) at (x-\prevx.east) {\x};
+ \fi
+ }
+ \end{tikzpicture}
+ }{}% end-sequence diagram
}% end-no value 1
}% end-command
% \end{macrocode}
diff --git a/Master/texmf-dist/source/latex/smartdiagram/smartdiagram.ins b/Master/texmf-dist/source/latex/smartdiagram/smartdiagram.ins
index 24efc45630e..59fecee2ef7 100644
--- a/Master/texmf-dist/source/latex/smartdiagram/smartdiagram.ins
+++ b/Master/texmf-dist/source/latex/smartdiagram/smartdiagram.ins
@@ -26,7 +26,7 @@ See http://www.latex-project.org/lppl.txt
\endpreamble
\postamble
-Copyright (C) 2012 by Claudio Fiandrino <claudio.fiandrino@gmail.com>
+Copyright (C) 2012-2013 by Claudio Fiandrino <claudio.fiandrino@gmail.com>
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License (LPPL), either
@@ -52,7 +52,7 @@ and the derived files smartdiagram.ins,
%%
-%% Copyright (C) 2012 by Claudio Fiandrino <claudio.fiandrino@gmail.com>
+%% Copyright (C) 2012-2013 by Claudio Fiandrino <claudio.fiandrino@gmail.com>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either
diff --git a/Master/texmf-dist/tex/latex/smartdiagram/smartdiagram.sty b/Master/texmf-dist/tex/latex/smartdiagram/smartdiagram.sty
index 0efd91a95d9..de6878aedcd 100644
--- a/Master/texmf-dist/tex/latex/smartdiagram/smartdiagram.sty
+++ b/Master/texmf-dist/tex/latex/smartdiagram/smartdiagram.sty
@@ -13,12 +13,21 @@
%% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
%%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{smartdiagram}[2012/10/28 v0.1 Automatic creation of smart diagrams from lists of items.]
+\ProvidesPackage{smartdiagram}[2013/03/09 v0.2 Automatic creation of smart diagrams from lists of items.]
\RequirePackage{tikz}
-\RequirePackage{xparse,etoolbox}
-\usetikzlibrary{backgrounds,calc,fadings,shadows,shapes.arrows}
+\RequirePackage{etoolbox}
+\RequirePackage{xparse}
+\RequirePackage{xstring}
+
+\usetikzlibrary{backgrounds,
+ calc,
+ fadings,
+ shadows,
+ shapes.arrows,
+ shapes.symbols
+}
\pgfdeclarelayer{smart diagram arrow back}
\pgfsetlayers{background,smart diagram arrow back,main}
\@namedef{color@1}{red!40}
@@ -42,6 +51,7 @@
\pgfkeys{/smart diagram/.cd, module minimum width/.initial=2cm,
module minimum height/.initial={1cm},
module y sep/.initial={1.65},
+ module x sep/.initial={2.75},
descriptive items y sep/.initial={1.75},
text width/.initial={1.5cm},
description title width/.initial={1.5cm},
@@ -57,6 +67,7 @@
module shape/.initial={rnd rectangle},
insert decoration/.initial={},
arrow tip/.initial={stealth},
+ arrow color/.initial={gray},
bubble center node size/.initial={4cm},
bubble center node font/.initial={\large},
bubble center node color/.initial={lightgray!60},
@@ -79,16 +90,28 @@
satellite text width/.initial={1.5cm},
distance satellite-connection/.initial={0.075cm},
connection line width/.initial={0.1cm},
+ connection color/.initial={gray},
distance planet-satellite/.initial={3.5cm},
priority arrow width/.initial={1.5cm},
priority arrow head extend/.initial={0.15cm},
priority tick size/.initial={5pt},
priority arrow height advance/.initial={2cm},
+ sequence item height/.initial={1cm},
+ sequence item width/.initial={2cm},
+ sequence item border color/.initial={gray},
+ sequence item border size/.initial={1.75\pgflinewidth},
+ sequence item font size/.initial={\normalfont},
+ sequence item fill opacity/.initial={1},
+ sequence item text opacity/.initial={1},
+ sequence item text width/.initial={1.9cm},
+ sequence item text color/.initial={black},
+ sequence item uniform color/.initial={gray!60!black},
}%
\pgfkeys{/smart diagram/.cd, module minimum width/.get=\modulewidth,
module minimum height/.get=\moduleheight,
module y sep/.get=\moduleysep,
+ module x sep/.get=\modulexsep,
descriptive items y sep/.get=\descriptiveitemsysep,
text width/.get=\moduletextwidth,
description title width/.get=\descriptiontitlewidth,
@@ -104,6 +127,7 @@
module shape/.get=\moduleshape,
insert decoration/.get=\borderdecoration,
arrow tip/.get=\arrowtip,
+ arrow color/.get=\arrowcolor,
bubble center node size/.get=\bubblecenternodesize,
bubble center node font/.get=\bubblecenternodefont,
bubble center node color/.get=\bubblecenternodecolor,
@@ -126,13 +150,25 @@
satellite text width/.get=\satellitetextwidth,
distance satellite-connection/.get=\satelliteoutersep,
connection line width/.get=\connectionlinewidth,
+ connection color/.get=\connectioncolor,
distance planet-satellite/.get=\distanceplanetsatellite,
priority arrow width/.get=\priorityarrowwidth,
priority arrow head extend/.get=\priorityarrowheadextend,
priority tick size/.get=\prioritytick,
priority arrow height advance/.get=\priorityarrowheightadvance,
+ sequence item height/.get=\seqitemheight,
+ sequence item width/.get=\seqitemwidth,
+ sequence item border color/.get=\seqitembordercolor,
+ sequence item border size/.get=\seqlinewidth,
+ sequence item font size/.get=\seqitemfont,
+ sequence item fill opacity/.get=\seqitemfillopacity,
+ sequence item text opacity/.get=\seqitemtextopacity,
+ sequence item text width/.get=\seqitemtextwidth,
+ sequence item text color/.get=\seqitemtextcolor,
+ sequence item uniform color/.get=\seqitemuniformcol,
}%
+
\pgfkeys{/smart diagram/.cd, set color list/.code={
\foreach \listitem [count=\i] in {#1}{
\global\@namedef{color@\i\expandafter}\expandafter{\listitem}
@@ -154,11 +190,20 @@
}
}
+
+\newif\ifbackarrowdisabled
+\pgfkeys{/smart diagram/.cd,
+ back arrow disabled/.is if=backarrowdisabled,
+ back arrow disabled=false,
+}
+
+
\NewDocumentCommand{\smartdiagramset}{m}{%
\pgfkeys{/smart diagram/.cd,#1}%
\pgfkeys{/smart diagram/.cd, module minimum width/.get=\modulewidth,
module minimum height/.get=\moduleheight,
module y sep/.get=\moduleysep,
+ module x sep/.get=\modulexsep,
descriptive items y sep/.get=\descriptiveitemsysep,
text width/.get=\moduletextwidth,
description title width/.get=\descriptiontitlewidth,
@@ -174,6 +219,7 @@
module shape/.get=\moduleshape,
insert decoration/.get=\borderdecoration,
arrow tip/.get=\arrowtip,
+ arrow color/.get=\arrowcolor,
bubble center node size/.get=\bubblecenternodesize,
bubble center node font/.get=\bubblecenternodefont,
bubble center node color/.get=\bubblecenternodecolor,
@@ -196,15 +242,33 @@
satellite text width/.get=\satellitetextwidth,
distance satellite-connection/.get=\satelliteoutersep,
connection line width/.get=\connectionlinewidth,
+ connection color/.get=\connectioncolor,
distance planet-satellite/.get=\distanceplanetsatellite,
priority arrow width/.get=\priorityarrowwidth,
priority arrow head extend/.get=\priorityarrowheadextend,
priority tick size/.get=\prioritytick,
priority arrow height advance/.get=\priorityarrowheightadvance,
+ sequence item height/.get=\seqitemheight,
+ sequence item width/.get=\seqitemwidth,
+ sequence item border color/.get=\seqitembordercolor,
+ sequence item border size/.get=\seqlinewidth,
+ sequence item font size/.get=\seqitemfont,
+ sequence item fill opacity/.get=\seqitemfillopacity,
+ sequence item text opacity/.get=\seqitemtextopacity,
+ sequence item text width/.get=\seqitemtextwidth,
+ sequence item text color/.get=\seqitemtextcolor,
+ sequence item uniform color/.get=\seqitemuniformcol,
}%
}%
-\tikzfading[name=priorityarrowfading, bottom color=transparent!5, top color=transparent!80]
-\tikzset{priority arrow fill/.style={fill=gray,path fading=priorityarrowfading}}
+\tikzfading[name=priorityarrowfading,
+ bottom color=transparent!5,
+ top color=transparent!80
+]
+\tikzset{priority arrow fill/.style={
+ fill=gray,
+ path fading=priorityarrowfading
+ }
+}
\tikzset{module/.style={
\pgfkeysvalueof{/smart diagram/module shape},
@@ -219,9 +283,22 @@
\borderdecoration
},
diagram arrow type/.style={
- >=\arrowtip,line width=\arrowlinewidth,\col,
+ >=\arrowtip,line width=\arrowlinewidth,\col
},
}
+
+\pgfkeys{/smart diagram/.cd,%
+ uniform arrow color/.is choice,%
+ uniform arrow color/true/.code={%
+ \tikzset{diagram arrow type/.append style={
+ \arrowcolor
+ },
+ }
+ },%
+ uniform arrow color/false/.style={diagram arrow type},%
+ uniform arrow color/.default=false,
+}%
+
\tikzset{description title/.style={
circle,
draw=\bordercolor,
@@ -288,12 +365,12 @@
satellite/.style={
minimum size=\satelliteminimumsize,
circle,
- font=\satellitefont,
- fill opacity=\satellitefillopacity,
- fill=\col,
- text opacity=\satellitetextopacity,
- text width=\satellitetextwidth,
- outer sep=\satelliteoutersep,
+ font=\satellitefont,
+ fill opacity=\satellitefillopacity,
+ fill=\col,
+ text opacity=\satellitetextopacity,
+ text width=\satellitetextwidth,
+ outer sep=\satelliteoutersep,
},
connection planet satellite/.style={
line width=\connectionlinewidth,
@@ -301,40 +378,106 @@
\col,
}
}
+
+\tikzset{sequence item/.style={
+ minimum height=\seqitemheight,
+ minimum width=\seqitemwidth,
+ signal,
+ signal from=west,
+ signal to=east,
+ draw=\seqitembordercolor,
+ line width=\seqlinewidth,
+ font=\seqitemfont,
+ fill opacity=\seqitemfillopacity,
+ fill=\col,
+ text opacity=\seqitemtextopacity,
+ text width=\seqitemtextwidth,
+ text=\seqitemtextcolor,
+ }
+}
+
+\pgfkeys{/smart diagram/.cd,%
+ uniform sequence color/.is choice,%
+ uniform sequence color/true/.code={%
+ \tikzset{sequence item/.append style={
+ fill=\seqitemuniformcol,
+ },
+ }
+ },%
+ uniform sequence color/false/.style={sequence item},%
+ uniform sequence color/.default=false,
+}%
+
+\pgfkeys{/smart diagram/.cd,%
+ uniform connection color/.is choice,%
+ uniform connection color/true/.code={%
+ \tikzset{connection planet satellite/.append style={
+ \connectioncolor
+ },
+ }
+ },%
+ uniform connection color/false/.style={connection planet satellite},%
+ uniform connection color/.default=false,
+}%
\NewDocumentCommand{\smartdiagram}{r[] m}{%
+ \StrCut{#1}{:}\diagramtype\option
\IfNoValueTF{#1}{% true-no value 1
- \PackageError{smartdiagram}{Type of the diagram not inserted. Please insert it}
+ \PackageError{smartdiagram}%
+ {Type of the diagram not inserted. Please insert it}%
{Example: \protect\smartdiagram[flow diagram]}}
{%false-no value 1
- \ifstrequal{#1}{circular diagram}{% true-circular diagram
+ \IfStrEq{\diagramtype}{}{%
+ \PackageError{smartdiagram}{Type of the diagram not inserted. Please insert it}
+ {Example: \protect\smartdiagram[flow diagram]}
+ }{}
+ \IfStrEq{\diagramtype}{circular diagram}{% true-circular diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2} {\global\let\maxsmitem\xi}
\foreach \smitem [count=\xi] in {#2}{%
- \pgfmathtruncatemacro{\angle}{360/\maxsmitem*\xi}
+ \IfStrEq{\option}{clockwise}{% true-clockwise-circular diagram
+ \pgfmathtruncatemacro{\angle}{180+360/\maxsmitem*\xi}
+ }{% false-clockwise-circular diagram
+ \pgfmathtruncatemacro{\angle}{360/\maxsmitem*\xi}
+ }
\edef\col{\@nameuse{color@\xi}}
- \node[module,drop shadow] (module\xi) at (\angle:\circulardistance) {\smitem };
+ \IfStrEq{\option}{clockwise}{% true-clockwise-circular diagram
+ \node[module,drop shadow] (module\xi)
+ at (-\angle:\circulardistance) {\smitem };
+ }{% false-clockwise-circular diagram
+ \node[module,drop shadow] (module\xi)
+ at (\angle:\circulardistance) {\smitem };
+ }
}%
\foreach \smitem [count=\xi] in {#2}{%
\pgfmathtruncatemacro{\xj}{mod(\xi, \maxsmitem) + 1)}
\edef\col{\@nameuse{color@\xj}}
- \draw[<-,diagram arrow type,shorten <=0.3cm,shorten >=0.3cm]
+ \IfStrEq{\option}{clockwise}{% true-clockwise-circular diagram
+ \draw[<-,diagram arrow type,shorten <=0.3cm,shorten >=0.3cm]
+ (module\xj) to[bend right] (module\xi);
+ }{% false-clockwise-circular diagram
+ \draw[<-,diagram arrow type,shorten <=0.3cm,shorten >=0.3cm]
(module\xj) to[bend left] (module\xi);
+ }
}%
\end{tikzpicture}
}{}% end-circular diagram
- \ifstrequal{#1}{flow diagram}{% true-flow diagram
+ \IfStrEq{\diagramtype}{flow diagram}{% true-flow diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2} {\global\let\maxsmitem\xi}
\foreach \smitem [count=\xi] in {#2}{%
\edef\col{\@nameuse{color@\xi}}
- \path let \n1 = {int(0-\xi)}, \n2={0-\xi*\moduleysep}
- in node[module,drop shadow] (module\xi) at +(0,\n2) {\smitem};
-
+ \IfStrEq{\option}{horizontal}{% true-horizontal-flow diagram
+ \path let \n1 = {int(0-\xi)}, \n2={0+\xi*\modulexsep} in
+ node[module,drop shadow] (module\xi) at +(\n2,0) {\smitem};
+ }{% false-horizontal-flow diagram
+ \path let \n1 = {int(0-\xi)}, \n2={0-\xi*\moduleysep} in
+ node[module,drop shadow] (module\xi) at +(0,\n2) {\smitem};
+ }
}%
\foreach \smitem [count=\xi] in {#2}{%
@@ -345,15 +488,32 @@
\draw[<-,diagram arrow type] (module\xj) -- (module\xi);
\end{pgfonlayer}
\fi
- % last arrow - not display it in background
- \ifnum\xi=\maxsmitem
- \draw[<-,diagram arrow type] (module\xj.east)--
- ($(module\xj.east)+(1,0)$) |- (module\xi);
+ % last arrow - not display it in background - check if disabled
+ \ifbackarrowdisabled
+ \relax
+ \else
+ \ifnum\xi=\maxsmitem
+ \IfStrEq{\option}{horizontal}{% true-horizontal-flow diagram
+ \tikzset{square arrow/.style={
+ to path={-- ++(0,0.5) -| (\tikztotarget)}
+ }
+ }
+ \draw[<-,diagram arrow type, square arrow]
+ (module\xj.north) to (module\xi.north);
+ }{% false-horizontal-flow diagram
+ \tikzset{square arrow/.style={
+ to path={-- ++(0.5,0) |- (\tikztotarget)}
+ }
+ }
+ \draw[<-,diagram arrow type,square arrow]
+ (module\xj.east) to (module\xi);
+ }
+ \fi
\fi
}%
\end{tikzpicture}
}{}% end-flow diagram
- \ifstrequal{#1}{descriptive diagram}{% true-descriptive diagram
+ \IfStrEq{\diagramtype}{descriptive diagram}{% true-descr. diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{%
\edef\col{\@nameuse{color@\xi}}
@@ -369,8 +529,8 @@
}%
}%
\end{tikzpicture}
- }{}% end-descriptive diagram
- \ifstrequal{#1}{bubble diagram}{% true-bubble diagram
+ }{}% end-descr. diagram
+ \IfStrEq{\diagramtype}{bubble diagram}{% true-bubble diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{\global\let\maxsmitem\xi}
\pgfmathtruncatemacro\actualnumitem{\maxsmitem-1}
@@ -381,12 +541,13 @@
\pgfmathtruncatemacro{\xj}{\xi-1}
\pgfmathtruncatemacro{\angle}{360/\actualnumitem*\xj}
\edef\col{\@nameuse{color@\xj}}
- \node[bubble node] (module\xi) at (center bubble.\angle) {\smitem };
+ \node[bubble node] (module\xi)
+ at (center bubble.\angle) {\smitem };
}%
}%
\end{tikzpicture}
}{}%end-bubble diagram
- \ifstrequal{#1}{constellation diagram}{% true-constellation diagram
+ \IfStrEq{\diagramtype}{constellation diagram}{% true-const diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{\global\let\maxsmitem\xi}
\pgfmathtruncatemacro\actualnumitem{\maxsmitem-1}
@@ -397,13 +558,14 @@
\pgfmathtruncatemacro{\xj}{\xi-1}
\pgfmathtruncatemacro{\angle}{360/\actualnumitem*\xj}
\edef\col{\@nameuse{color@\xj}}
- \node[satellite] (satellite\xi) at (\angle:\distanceplanetsatellite) {\smitem };
+ \node[satellite] (satellite\xi)
+ at (\angle:\distanceplanetsatellite) {\smitem };
\draw[->,connection planet satellite] (planet) -- (satellite\xi);
}%
}%
\end{tikzpicture}
- }{}%end-constellation diagram
- \ifstrequal{#1}{connected constellation diagram}{% true-connected constellation diagram
+ }{}%end-const diagram
+ \IfStrEq{\diagramtype}{connected constellation diagram}{% true-conn const diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{\global\let\maxsmitem\xi}
\pgfmathtruncatemacro\actualnumitem{\maxsmitem-1}
@@ -414,7 +576,8 @@
\pgfmathtruncatemacro{\xj}{\xi-1}
\pgfmathtruncatemacro{\angle}{360/\actualnumitem*\xj}
\edef\col{\@nameuse{color@\xj}}
- \node[satellite] (satellite\xj) at (\angle:\distanceplanetsatellite) {\smitem };
+ \node[satellite] (satellite\xj)
+ at (\angle:\distanceplanetsatellite) {\smitem };
}%
}%
\foreach \smitem [count=\xi] in {#2}{%
@@ -422,12 +585,13 @@
\pgfmathtruncatemacro{\xj}{\xi-1}
\edef\col{\@nameuse{color@\xj}}
\pgfmathtruncatemacro{\xk}{mod(\xj,\actualnumitem) +1}
- \path[connection planet satellite] (satellite\xj) edge[bend right] (satellite\xk);
+ \path[connection planet satellite]
+ (satellite\xj) edge[bend right] (satellite\xk);
}{}
}%
\end{tikzpicture}
}{}%end-connected constellation diagram
- \ifstrequal{#1}{priority descriptive diagram}{% true-priority descriptive diagram
+ \IfStrEq{\diagramtype}{priority descriptive diagram}{% true-priority descriptive diagram
\pgfmathparse{subtract(\priorityarrowwidth,\priorityarrowheadextend)}
\pgfmathsetmacro\priorityticksize{\pgfmathresult/2}
\pgfmathsetmacro\arrowtickxshift{(\priorityarrowwidth-\priorityticksize)/2}
@@ -437,7 +601,8 @@
\edef\col{\@nameuse{color@\xi}}
\node[description,drop shadow](module\xi)
at (0,0+\xi*\descriptiveitemsysep) {\smitem};
-\draw[line width=\prioritytick,\col] ([xshift=-\arrowtickxshift pt]module\xi.base west)--
+\draw[line width=\prioritytick,\col]
+ ([xshift=-\arrowtickxshift pt]module\xi.base west)--
($([xshift=-\arrowtickxshift pt]module\xi.base west)-(\priorityticksize pt,0)$);
}%
\coordinate (A) at (module1);
@@ -451,6 +616,18 @@
\end{pgfonlayer}
\end{tikzpicture}
}{}% end-priority descriptive diagram
+ \IfStrEq{\diagramtype}{sequence diagram}{% true-sequence diagram
+ \begin{tikzpicture}[every node/.style={align=center}]
+ \foreach \x[count=\xi, count=\prevx from 0] in {#2}{%
+ \edef\col{\@nameuse{color@\xi}}
+\ifnum\xi=1
+ \node[sequence item] (x-\xi) {\x};
+\else
+ \node[sequence item,anchor=west] (x-\xi) at (x-\prevx.east) {\x};
+\fi
+ }
+ \end{tikzpicture}
+ }{}% end-sequence diagram
}% end-no value 1
}% end-command
\tikzset{
@@ -462,45 +639,68 @@
}
\NewDocumentCommand{\smartdiagramanimated}{r[] m}{%
+ \StrCut{#1}{:}\diagramtype\option
\IfNoValueTF{#1}{% true-no value 1
\PackageError{smartdiagram}{Type of the diagram not inserted. Please insert it}
{Example: \protect\smartdiagram[flow diagram]}}
{%false-no value 1
- \ifstrequal{#1}{circular diagram}{% true-circular diagram
+ \IfStrEq{\diagramtype}{}{%
+ \PackageError{smartdiagram}{Type of the diagram not inserted. Please insert it}
+ {Example: \protect\smartdiagram[flow diagram]}
+ }{}
+ \IfStrEq{\diagramtype}{circular diagram}{% true-circular diagram
\begin{tikzpicture}[every node/.style={align=center}]
-
\foreach \smitem [count=\xi] in {#2} {\global\let\maxsmitem\xi}
-
\foreach \smitem [count=\xi] in {#2}{%
- \pgfmathtruncatemacro{\angle}{360/\maxsmitem*\xi}
+ \IfStrEq{\option}{clockwise}{% true-clockwise-circular diagram
+ \pgfmathtruncatemacro{\angle}{180+360/\maxsmitem*\xi}
+ }{% false-clockwise-circular diagram
+ \pgfmathtruncatemacro{\angle}{360/\maxsmitem*\xi}
+ }
\edef\col{\@nameuse{color@\xi}}
- \node[module,
+ \IfStrEq{\option}{clockwise}{% true-clockwise-circular diagram
+ \node[module,
drop shadow={smvisible on=<\xi->},
- smvisible on=<\xi->] (module\xi) at (\angle:\circulardistance) {\smitem };
+ smvisible on=<\xi->] (module\xi)
+ at (-\angle:\circulardistance) {\smitem};
+ }{% false-clockwise-circular diagram
+ \node[module,
+ drop shadow={smvisible on=<\xi->},
+ smvisible on=<\xi->] (module\xi)
+ at (\angle:\circulardistance) {\smitem};
+ }
}%
-
\foreach \smitem [count=\xi] in {#2}
{%
\pgfmathtruncatemacro{\xj}{mod(\xi, \maxsmitem) + 1)}
\pgfmathtruncatemacro{\adv}{\xi + 1)}
\edef\col{\@nameuse{color@\xi}}
- \draw[<-,diagram arrow type,shorten <=0.3cm,shorten >=0.3cm,
+ \IfStrEq{\option}{clockwise}{% true-clockwise-circular diagram
+ \draw[<-,diagram arrow type,shorten <=0.3cm,shorten >=0.3cm,
+ smvisible on=<\adv->] (module\xj) to[bend right] (module\xi);
+ }{% false-clockwise-circular diagram
+ \draw[<-,diagram arrow type,shorten <=0.3cm,shorten >=0.3cm,
smvisible on=<\adv->] (module\xj) to[bend left] (module\xi);
+ }
}%
\end{tikzpicture}
}{}% end-circular diagram
- \ifstrequal{#1}{flow diagram}{% true-flow diagram
+ \IfStrEq{\diagramtype}{flow diagram}{% true-flow diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2} {\global\let\maxsmitem\xi}
\foreach \smitem [count=\xi] in {#2}{%
\edef\col{\@nameuse{color@\xi}}
- \path let \n1 = {int(0-\xi)}, \n2={0-\xi*\moduleysep}
- in node[module,
- drop shadow={smvisible on=<\xi->},
+ \IfStrEq{\option}{horizontal}{% true-horizontal-flow diagram
+ \path let \n1 = {int(0-\xi)}, \n2={0+\xi*\modulexsep}
+ in node[module,drop shadow={smvisible on=<\xi->},
+ smvisible on=<\xi->] (module\xi) at +(\n2,0) {\smitem};
+ }{% false-horizontal-flow diagram
+ \path let \n1 = {int(0-\xi)}, \n2={0-\xi*\moduleysep}
+ in node[module,drop shadow={smvisible on=<\xi->},
smvisible on=<\xi->] (module\xi) at +(0,\n2) {\smitem};
-
+ }
}%
\foreach \smitem [count=\xi] in {#2}{%
@@ -509,18 +709,35 @@
\ifnum\xi<\maxsmitem
\begin{pgfonlayer}{smart diagram arrow back}
\draw[<-,diagram arrow type,smvisible on=<\xi->]
- (module\xj) -- (module\xi);
+ (module\xj) -- (module\xi);
\end{pgfonlayer}
\fi
- % last arrow - not display it in background
- \ifnum\xi=\maxsmitem
- \draw[<-,diagram arrow type,smvisible on=<\xi->]
- (module\xj.east)--($(module\xj.east)+(1,0)$) |- (module\xi);
+ % last arrow - not display it in background - check if disabled
+ \ifbackarrowdisabled
+ \relax
+ \else
+ \ifnum\xi=\maxsmitem
+ \IfStrEq{\option}{horizontal}{% true-horizontal-flow diagram
+ \tikzset{square arrow/.style={
+ to path={-- ++(0,0.5) -| (\tikztotarget)}
+ }
+ }
+ \draw[<-,diagram arrow type, square arrow,smvisible on=<\xi->]
+ (module\xj.north) to (module\xi.north);
+ }{% false-horizontal-flow diagram
+ \tikzset{square arrow/.style={
+ to path={-- ++(0.5,0) |- (\tikztotarget)}
+ }
+ }
+ \draw[<-,diagram arrow type,square arrow,smvisible on=<\xi->]
+ (module\xj.east) to (module\xi);
+ }
+ \fi
\fi
}%
\end{tikzpicture}
}{}% end-flow diagram
- \ifstrequal{#1}{descriptive diagram}{% true-descriptive diagram
+ \IfStrEq{\diagramtype}{descriptive diagram}{% true-descriptive diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{%
\edef\col{\@nameuse{color@\xi}}
@@ -539,7 +756,7 @@
}%
\end{tikzpicture}
}{}% end-descriptive diagram
- \ifstrequal{#1}{bubble diagram}{% true-bubble diagram
+ \IfStrEq{\diagramtype}{bubble diagram}{% true-bubble diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{\global\let\maxsmitem\xi}
\pgfmathtruncatemacro\actualnumitem{\maxsmitem-1}
@@ -550,12 +767,13 @@
\pgfmathtruncatemacro{\xj}{\xi-1}
\pgfmathtruncatemacro{\angle}{360/\actualnumitem*\xj}
\edef\col{\@nameuse{color@\xj}}
- \node[bubble node, smvisible on=<\xi->](module\xi) at (center bubble.\angle) {\smitem };
+ \node[bubble node, smvisible on=<\xi->](module\xi)
+ at (center bubble.\angle) {\smitem };
}%
}%
\end{tikzpicture}
}{}%end-bubble diagram
- \ifstrequal{#1}{constellation diagram}{% true-constellation diagram
+ \IfStrEq{\diagramtype}{constellation diagram}{% true-const diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{\global\let\maxsmitem\xi}
\pgfmathtruncatemacro\actualnumitem{\maxsmitem-1}
@@ -574,7 +792,7 @@
}%
\end{tikzpicture}
}{}%end-constellation diagram
- \ifstrequal{#1}{connected constellation diagram}{% true-connected constellation diagram
+ \IfStrEq{\diagramtype}{connected constellation diagram}{% true-conn const diagram
\begin{tikzpicture}[every node/.style={align=center}]
\foreach \smitem [count=\xi] in {#2}{\global\let\maxsmitem\xi}
\pgfmathtruncatemacro\actualnumitem{\maxsmitem-1}
@@ -601,7 +819,7 @@
}%
\end{tikzpicture}
}{}%end-connected constellation diagram
- \ifstrequal{#1}{priority descriptive diagram}{% true-priority descriptive diagram
+ \IfStrEq{\diagramtype}{priority descriptive diagram}{% true-priority descriptive diagram
\pgfmathparse{subtract(\priorityarrowwidth,\priorityarrowheadextend)}
\pgfmathsetmacro\priorityticksize{\pgfmathresult/2}
\pgfmathsetmacro\arrowtickxshift{(\priorityarrowwidth-\priorityticksize)/2}
@@ -627,11 +845,24 @@
\end{pgfonlayer}
\end{tikzpicture}
}{}% end-priority descriptive diagram
+ \IfStrEq{\diagramtype}{sequence diagram}{% true-sequence diagram
+ \begin{tikzpicture}[every node/.style={align=center}]
+ \foreach \x[count=\xi, count=\prevx from 0] in {#2}{%
+ \edef\col{\@nameuse{color@\xi}}
+\ifnum\xi=1
+ \node[sequence item,smvisible on=<\xi->] (x-\xi) {\x};
+\else
+ \node[sequence item,anchor=west,smvisible on=<\xi->]
+ (x-\xi) at (x-\prevx.east) {\x};
+\fi
+ }
+ \end{tikzpicture}
+ }{}% end-sequence diagram
}% end-no value 1
}% end-command
%%
-%% Copyright (C) 2012 by Claudio Fiandrino <claudio.fiandrino@gmail.com>
+%% Copyright (C) 2012-2013 by Claudio Fiandrino <claudio.fiandrino@gmail.com>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either