Como posso usar \pause para que cada nível na apresentação do beamer apareça sequencialmente?

Como posso usar \pause para que cada nível na apresentação do beamer apareça sequencialmente?
\documentclass[tikz,border=10pt]{standalone}  
\usepackage{pgfplots}  
\usepackage{forest}  
\usetikzlibrary{shadows}  
\begin{document}  
\begin{forest}
  shade me/.style={%  
    bottom color=#1!25,  
    top color=#1!5,  
    draw=#1,  
    drop shadow,  
    font=\Huge,  
  },  
  my label/.style n args=2{%  
    edge label={node [midway, black, font=\sffamily\large, #1] {#2}}  
  },  
  where n children=0{%  
    shade me=green!95!gray,
  }{%  
    if level=0{%  
      shade me=green!95!gray,  
    }{%  
      shade me=green!95!gray, 
    }  
  },  
  for tree={%  
    delay={content/.wrap value={\strut #1}},  
    edge={red,->},  
    l sep+=45pt,  
    s sep+=60pt  
  }  
  [100000 individuals  
  [100 affected, my label={above, xshift=1cm}{}  
      [{95\% true positives}, my label={below, xshift=-1.7cm}{}  
    [,phantom] [{95 + 999 test positive, Total = 1094}, my label={above, sloped}{}, name=aux1]]]  
    [99900 unaffected, my label={above, sloped}{}  
      [{1\% false positives}, my label={below, xshift=1.5cm}{}, name=aux  
 % [{95 + 999 test positive Total = 1094}, my label={above, sloped}{}]
 ]]        ]  
    ]  
  ]  
  \draw[red, ->] (aux)--(aux1);
\end{forest}  
\end{document} 

Responder1

Observe que tive que modificar seu MWE de várias maneiras para deixá-lo pronto para perguntas antes de começar a trabalhar em uma solução.

  1. Quando uma pergunta é inerentemente sobre uma classe específica, um MWE adequado precisa usar essa classe. A primeira mudança obviamente necessária neste caso éusarbeamer. Não faz sentido tentar implementar a descoberta incremental de outra forma. (Talvez você pudesse jogar com a beameropção standalone, mas seu MWE não usou isso.)

  2. A segunda modificação obviamente necessária é que antes mesmo que você possapensarsobre especificações sofisticadas de sobreposição, você precisa revisar a especificação da árvore, pois ela é bastante inadequada para um slide Beamer como está. É simplesmenteenorme.

  3. Uma boa parte do código da árvore não é utilizada e pode simplesmente ser removida do exemplo. Nenhuma etiqueta de borda é tão boa para esse propósito – talvez melhor – do que as vazias.

Feito isso, aqui está uma solução baseada no método que utilizo e que deve muito aos diversos autores, principalmente Qrrbrbirlbel, anotado no código.

\begin{filecontents}{mytree.tex}
\documentclass[tikz,border=10pt,multi]{standalone}
\usepackage{forest}
\usetikzlibrary{shadows}
\begin{document}
\begin{forest}
    shade me/.style={%
      bottom color=#1!25,
      top color=#1!5,
      draw=#1,
    },
    where n children=0{%
      shade me=green!95!gray,
    }{%
      if level=0{%
        shade me=green!95!gray,
      }{%
        shade me=green!95!gray,
      }
    },
    for tree={%
      delay={content/.wrap value={\strut #1}},
      edge={red,->},
      l sep+=20pt,
      s sep+=20pt,
      from slide/.wrap pgfmath arg={#1}{int(level()+1)},
    },
    delay={%
      for tree={%
        visible on=<\forestoption{from slide}->,
        alt=<\forestoption{from slide}->{drop shadow}{},
      }
    }
    [100000 individuals
      [100 affected
        [{95\% true positives}
          [,phantom
          ]
          [{95 + 999 test positive, Total = 1094}, name=aux1
          ]
        ]
      ]
      [99900 unaffected
        [{1\% false positives}, tikz+={\scoped[visible on=<4>]{\draw [red, ->] () -- (aux1);}}
        ]
      ]
    ]
  \end{forest}
\end{document}
\end{filecontents}
\documentclass{beamer}
\usepackage{forest,standalone}
\usetikzlibrary{shadows}
\tikzset{% set up for transitions using tikz with beamer overlays - developed by Daniel (http://tex.stackexchange.com/a/55849/) and, in ear lier form, by Matthew Leingang (http://tex.stackexchange.com/a/6155/) and modified for this use, I think by Qrrbrbirlbel (http://tex.stacke xchange.com/a/112471/)
  invisible/.style={opacity=0,text opacity=0},
  visible on/.style={alt=#1{}{invisible}},
  alt/.code args={<#1>#2#3}{%
    \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}} % \pgfkeysalso doesn't change the path
  },
}
\forestset{%
  visible on/.style={% developed by Qrrbrbirlbel (http://tex.stackexchange.com/a/112471/)
    for tree={%
      /tikz/visible on={#1},
      edge={/tikz/visible on={#1}}}},
  % based on Qrrbrbirlbel's answer at http://tex.stackexchange.com/a/112895/
  declare toks={from slide}{1},
}
\begin{document}
\begin{frame}
  \centering
  \input{mytree}
\end{frame}
\end{document}

descoberta incremental nível por nível

informação relacionada