mia-rapport-2024/tikz/moving-window.tex
2024-06-28 16:24:24 +02:00

127 lines
No EOL
5 KiB
TeX

\definecolor{mypurple}{RGB}{128,0,128}
\begin{tikzpicture}
\tikzstyle{model}=[circle,draw=none,fill=gray, thick]
\tikzstyle{split}=[>=stealth,->, thick, draw=blueind]
\tikzstyle{merge}=[>=stealth,->,thick, draw=red]
\draw[step=1cm, help lines] (-2,-2) grid (2,2);
\onslide<1-7>{
\node[model] (mode) at (0,0) {{\color{red}X}};
}
% Axes
\draw[>=to,->,thick] (-2,-2) -- +(1,0);
\node[font=\small, fill=none] (Q_1) at (-0.75,-2) {$Q_1$};
\draw[>=to,->,thick] (-2,-2) -- +(0,1);
\node[font=\small, fill=none] (Q_2) at (-2,-0.75) {$Q_2$};
\onslide<2-8>{
\draw[color=red, line width=1pt] (-1.5,-1.5) rectangle ++(3,3);
}
\onslide<3>{
\node[model] (bottom_left) at (-1,-1) {};
\node[model, opacity=0.6] (row_1) at (0,-1) {};
\node[model, opacity=0.6] (col_1) at (-1,0) {};
\draw[split] (bottom_left) -- (col_1);
\draw[split] (-1.75,0) -- (col_1);
\draw[split] (bottom_left) -- (row_1);
\draw[split] (0,-1.75) -- (row_1);
}
\onslide<4-7>{
\node[model] (bottom_left) at (-1,-1) {};
\node[model, draw=blueind] (row_1) at (0,-1) {};
\node[model, draw=blueind] (col_1) at (-1,0) {};
}
\onslide<4>{
\node[model, opacity=0.6] (row_2) at (1,-1) {};
\node[model, opacity=0.6] (col_2) at (-1,1) {};
\draw[split] (col_1) -- (col_2);
\draw[split] (-1.75,1) -- (col_2);
\draw[split] (row_1) -- (row_2);
\draw[split] (1,-1.75) -- (row_2);
\draw[split] (row_1) -- (mode);
\draw[split] (col_1) -- (mode);
}
\onslide<5-7>{
\node[model, draw=blueind] (row_2) at (1,-1) {};
\node[model, draw=blueind] (col_2) at (-1,1) {};
\node[model, draw=blueind] (mode) at (0,0) {{\color{red}X}};
}
\onslide<5>{
\node[model, opacity=0.6] (row_3) at (1,0) {};
\node[model, opacity=0.6] (col_3) at (0,1) {};
\draw[split] (col_2) -- (col_3);
\draw[split] (row_2) -- (row_3);
\draw[split] (mode) -- (row_3);
\draw[split] (mode) -- (col_3);
}
\onslide<6-7>{
\node[model, draw=blueind] (row_3) at (1,0) {};
\node[model, draw=blueind] (col_3) at (0,1) {};
}
\onslide<6>{
\node[model, opacity=0.6] (top_right) at (1,1) {};
\draw[split] (col_3) -- (top_right);
\draw[split] (row_3) -- (top_right);
}
\onslide<7>{
\node[model, draw=blueind] (top_right) at (1,1) {};
}
\onslide<8>{
\node[model, draw=mypurple] (top_right) at (1,1) {};
\node[model, draw=mypurple] (row_3) at (1,0) {};
\node[model, draw=mypurple] (col_3) at (0,1) {};
\node[model, draw=mypurple] (row_2) at (1,-1) {};
\node[model, draw=mypurple] (col_2) at (-1,1) {};
\node[model, draw=mypurple] (mode) at (0,0) {{\color{red}X}};
\node[model, draw=red] (bottom_left) at (-1,-1) {};
\node[model, draw=mypurple] (row_1) at (0,-1) {};
\node[model, draw=mypurple] (col_1) at (-1,0) {};
\draw[merge] (1,1.75) -- (top_right);
\draw[merge] (1.75,1) -- (top_right);
\draw[merge] (0,1.75) -- (col_3);
\draw[merge] (1.75,0) -- (row_3);
\draw[merge] (1.75,-1) -- (row_2);
\draw[merge] (-1,1.75) -- (col_2);
\draw[merge] (top_right) -- (col_3);
\draw[merge] (top_right) -- (row_3);
\draw[merge] (col_3) -- (col_2);
\draw[merge] (row_3) -- (row_2) ;
\draw[merge] (row_3) -- (mode);
\draw[merge] (col_3) -- (mode);
\draw[merge] (col_2) --(col_1);
\draw[merge] (row_2) -- (row_1);
\draw[merge] (mode) -- (row_1);
\draw[merge] (mode) -- (col_1);
\draw[merge] (col_1) -- (bottom_left);
\draw[merge] (row_1) -- (bottom_left);
}
\onslide<9>{
\node[model, draw=mypurple] (top_right) at (1,1) {};
\node[model, draw=mypurple] (new_mode) at (1,0) {{\color{red}X}};
\node[model, draw=mypurple] (col_3) at (0,1) {};
\node[model, draw=mypurple] (row_2) at (1,-1) {};
\node[model, draw=mypurple] (col_2) at (-1,1) {};
\node[model, draw=mypurple] (old_mode) at (0,0) {};
\node[model, draw=red] (bottom_left) at (-1,-1) {};
\node[model, draw=mypurple] (row_1) at (0,-1) {};
\node[model, draw=mypurple] (col_1) at (-1,0) {};
}
\onslide<10>{
\draw[color=red, line width=1pt] (-0.5,-1.5) rectangle ++(3,3);
\node[model, draw=mypurple] (top_right) at (1,1) {};
\node[model, draw=mypurple] (new_mode) at (1,0) {{\color{red}X}};
\node[model, draw=mypurple] (col_3) at (0,1) {};
\node[model, draw=mypurple] (row_2) at (1,-1) {};
\node[model, draw=mypurple] (col_2) at (-1,1) {};
\node[model, draw=mypurple] (old_mode) at (0,0) {};
\node[model, draw=red] (bottom_left) at (-1,-1) {};
\node[model, draw=mypurple] (row_1) at (0,-1) {};
\node[model, draw=mypurple] (col_1) at (-1,0) {};
}
\end{tikzpicture}