forked from mdolab/pyXDSM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiagram_styles.tex
executable file
·124 lines (105 loc) · 4.07 KB
/
diagram_styles.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
% Define all the styles used to produce XDSMs for MDO
% Tableau 20 color palette, taken from
% https://jrnold.github.io/ggthemes/reference/tableau_color_pal.html
% we use the lighter variants here with 80% opacity
% Blue
\definecolor{red}{HTML}{A0CBE8}
% Orange
\definecolor{orange}{HTML}{FFBE7D}
% Cyan
\definecolor{cyan}{HTML}{86BCB6}
% Green
\definecolor{green}{HTML}{8CD17D}
% Yellow
\definecolor{yellow}{HTML}{F1CE63}
% Salmon
\definecolor{salmon}{HTML}{FF9D9A}
\tikzstyle{every node}=[font=\sffamily,align=center]
\newcommand{\fillOpacity}{80}
% Component shapes
\newcommand{\compShape}{rectangle}
\newcommand{\groupShape}{chamfered rectangle}
\newcommand{\procShape}{rounded rectangle}
% Colors
\newcommand{\explicitColor}{green}
\newcommand{\implicitColor}{salmon}
\newcommand{\optimizationColor}{red} % also used by DOE
% Component types
\tikzstyle{Optimization} = [\procShape,draw,fill=\optimizationColor!\fillOpacity,inner sep=6pt,minimum height=1cm,text badly centered]
\tikzstyle{MDA} = [\procShape,draw,fill=orange!\fillOpacity,inner sep=6pt,minimum height=1cm,text badly centered]
\tikzstyle{DOE} = [\procShape,draw,fill=\optimizationColor!\fillOpacity,inner sep=6pt,minimum height=1cm,text badly centered]
\tikzstyle{SubOptimization} = [\groupShape,draw,fill=\optimizationColor!\fillOpacity,inner sep=6pt,minimum height=1cm,text badly centered]
\tikzstyle{Group} = [\groupShape,draw,fill=\explicitColor!\fillOpacity,inner sep=6pt,minimum height=1cm,text badly centered]
\tikzstyle{ImplicitGroup} = [\groupShape,draw,fill=\implicitColor!\fillOpacity,inner sep=6pt,minimum height=1cm,text badly centered]
\tikzstyle{Function} = [\compShape,draw,fill=\explicitColor!\fillOpacity,inner sep=6pt,minimum height=1cm,text badly centered]
\tikzstyle{ImplicitFunction} = [\compShape,draw,fill=\implicitColor!\fillOpacity,inner sep=6pt,minimum height=1cm,text badly centered]
\tikzstyle{Metamodel} = [\compShape,draw,fill=yellow!\fillOpacity,inner sep=6pt,minimum height=1cm,text badly centered]
%% A simple command to give the repeated structure look for components and data
\tikzstyle{stack} = [double copy shadow={shadow xshift=.75ex, shadow yshift=-.75ex}]
%% A simple command to fade components and data, e.g. demonstrating a sequence of steps in an animation
\tikzstyle{faded} = [draw=black!50,fill=white,text opacity=0.5]
%% Simple fading commands for the lines
\tikzstyle{fadeddata} = [color=black!20]
\tikzstyle{fadedprocess} = [color=black!50]
% Data types
\newcommand{\dataRightAngle}{105}
\newcommand{\dataLeftAngle}{75}
\tikzstyle{DataInter} = [trapezium,trapezium left angle=\dataLeftAngle,trapezium right angle=\dataRightAngle,draw,fill=black!10]
\tikzstyle{DataIO} = [trapezium,trapezium left angle=\dataLeftAngle,trapezium right angle=\dataRightAngle,draw,fill=white]
% Edges
\tikzstyle{DataLine} = [color=black!40,line width=5pt,line cap=rect]
\tikzstyle{ProcessHV} = [-,line width=1pt,to path={-| (\tikztotarget)}]
\tikzstyle{ProcessHVA} = [->,line width=1pt,to path={-| (\tikztotarget)}]
\tikzstyle{ProcessTip} = [-,line width=1pt]
\tikzstyle{ProcessTipA} = [->, line width=1pt]
% Matrix options
\tikzstyle{MatrixSetup} = [row sep=3mm, column sep=2mm]
% Declare a background layer for showing node connections
\pgfdeclarelayer{data}
\pgfdeclarelayer{process}
\pgfsetlayers{data,process,main}
% A new command to split the component text over multiple lines
\newcommand{\MultilineComponent}[2]
{
\begin{minipage}{#1}
\begin{center}
#2
\end{center}
\end{minipage}
}
\newcommand{\TwolineComponent}[3]
{
\begin{minipage}{#1}
\begin{center}
#2 \linebreak #3
\end{center}
\end{minipage}
}
\newcommand{\ThreelineComponent}[4]
{
\begin{minipage}{#1}
\begin{center}
#2 \linebreak #3 \linebreak #4
\end{center}
\end{minipage}
}
% A new command to split the component text over multiple columns
\newcommand{\MultiColumnComponent}[5]
{
\begin{minipage}{#1}
\begin{center}
#2 \linebreak #3
\end{center}
\begin{minipage}{0.49\textwidth}
\begin{center}
#4
\end{center}
\end{minipage}
\begin{minipage}{0.49\textwidth}
\begin{center}
#5
\end{center}
\end{minipage}
\end{minipage}
}
\def\arraystretch{1.3}