Is it possible to use beamer and tikz tree syntax to draw animated trees?
I start e.g. with a linear tree of steps where there are objects (steps)
at levels 0, 2 and 4 and the children at levels 1 and 3 are just empty :
\node at(0,0) {pre-imaging observation @ UT3}
child {
child {node[fill=green, text width=2.5cm] {position slits @ home}
child {
child {node[fill=blue, text width=2cm] {cut mask @ MMU}
} } } }
In further slides in the same frame each of the empty "child {" lines
should be replaced by one or more children (e.g. "child { node {FITS
img}". I tried a syntax like
child { node<2>{FITS img}
child<2> { node{FITS img}
child { \onslide<2>{node{FITS img}}
child { node{\onslide<2>{FITS img}}
but they all give tikz errors.
What is the correct syntax, if any, to generate animated trees ?
--
----------------------------------------------------------------------
nos...@mi.iasf.cnr.it is a newsreading account used by more persons to
avoid unwanted spam. Any mail returning to this address will be rejected.
Users can disclose their e-mail address in the article if they wish so.
This is AFAIK not possible as things stand currently, although one of
the PGF developers posted a quick solution on the PGF mailing list,
which can be viewed here:
http://www.nabble.com/Re%3A-successive-creation-of-tikz-mindmap-in-beamer-p22525001.html
-brian
On Oct 29, 5:29 pm, LC's No-Spam Newsreading account
> This is AFAIK not possible as things stand currently, although one of
> the PGF developers posted a quick solution on the PGF mailing list,
Thanks. Such "solution" goes beyond my comprehension, and I also believe
it applies to a newer version of tikz than I have (for instance it
appears not only that I do not have a "mindmap" library, whatever they
are, but also the \usetikzlibrary is not recognised.
My tikz/pgf is labelled 1.01 and dated 16 nov 2005 in the manual, though
I got it in 2008.
I'll try and see if I can achieve something simpler using styles, or in
the worst case redrawing the entire tree with some additional nodes
unvelied at each overlay ...
... I guess that will make the CODE redundant but not necessarily the
resulting PDF heavier.
> I'll try and see if I can achieve something simpler using styles
Apparently I can manage to do something like this
\node (preima) at(0,0) {pre-imagingobservation@UT3}
child { node[style=slide2] {FITS img}
child {node[fill=green, text width=2.5cm] (mps) {positionslits@home}
child {
child {node[fill=blue, text width=2cm] {cutmask@MMU}
} } } }
If I redefine the styles as follow
\only<1>{
\tikzstyle{slide2}=[transparent,parent anchor=north, child anchor=south]
}
\only<2>{
\tikzstyle{slide2}=[opaque,parent anchor=south, child anchor=north]
}
... the "opaque" and "transparent" are enough to make the node appear
only in slide 2. The stuff with parent and child anchor is an aborted
attempt ... even if the node is invisible, the arrows (which are defined
by a global \tikzstyle{edge from parent}=[draw,->,thick,yellow])
go to the top of the invisible box, and resume from its bottom. I tried
dynamic redefinition of edge from parent but did not succeed.
I ended with a workaround adding a conditional path (which accepts
Beamer's overlay indicators)
\path<1|invisible@2>[draw,thick,yellow] (preima.south) -- (mps.north) ;
This connects effectively the two nodes above and below the hidden one
on the first slide.
I guess I will use the tree syntax with node names to define my tree,
some styles slide2, slide3 etc. to toggle opaque to transparent, and
additional conditional path commands to change the connecting lines for
each overlay.