I have a graph on a frame in beamer
, drawn with tikz
and I would like to dismantle it after time.
The original graph looks like this:
\begin{frame}{Eksempel}
\begin{tikzpicture}[node distance=1.45cm, thick,
main node/.style={circle, draw, font=\sffamily\bfseries}]
\node[main node] (1) {1};
\node[main node] (3) [below left of=1] {3};
\node[main node] (4) [below right of=1] {4};
\node[main node] (2) [above right of=4] {2};
\node[main node] (6) [below right of=4] {6};
%\draw[->, visible on=<2->] (1) -- (2);
\path[->]
(1) edge (2)
(4) edge (2)
(6) edge (2)
(1) edge (3)
(4) edge (1)
(3) edge (4);
\end{tikzpicture}
\end{frame}
I want to make edges disappear and after the edges disappear, the nodes not having more edges get green. For example, on the next slide, all edges to node 2 should disappear, and on the next one, the node 2 itself should disappear.
I have tried stuff like visible on
or onslide
, but all of them give me error messages. Also, one could maybe use \pause
, but this is quite weird if I dismantle a graph instead of putting stuff into it.