I am trying to use a tree built by the forest package in a beamer animation. To uncover part of the tree (I want it to be revealed from bottom to top) I use the method described in Using beamer overlays with forest generated trees while modifying it slightly such that it only hides the current node and not the whole subtree.
The problem now is that I can manually hide the nodes by simply adding the visible on=<#> option, but for some reason this does not work when adding the option through a where statement.
The second part of the question was an oddity I discovered while trying to clean up my code - when combining the two forestset options, it no longer hides the edges as well as the nodes, but only the nodes. (Now even when adding the visibility statement manually.
The code I am trying this with is the following: (in the tree I added one position
\documentclass[]{beamer}
\usepackage[linguistics,external]{forest}
\usepackage{tikz}
\tikzset{highlight/.style={darkred,very thick},}
\tikzset{positive/.style={fill=examplegreen}}
\tikzset{negative/.style={fill=examplered}}
\colorlet{parameterblue}{rgb:cyan,2;white,4;blue,3}
\colorlet{examplegreen}{rgb:green,4;white,4;black,1}
\colorlet{examplered}{rgb:orange,2;red,3;white,4}
\colorlet{darkred}{red!80!black}
\colorlet{darkgreen}{green!80!black}
\newcommand{\plus}{\color{darkgreen}{$+$}}
\newcommand{\minus}{\color{darkred}{$-$}}
\tikzset{
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
},
beschr/.style={remember picture,overlay,font=\small},
highlight on/.style={{alt=#1{highlight}{}}},
}
\forestset{
highlight on/.style={/tikz/highlight on={#1},}
}
\forestset{
visible on/.style={
% for tree={
/tikz/visible on={#1},
for children={
edge={/tikz/visible on={#1}}}
}
}
\begin{document}
\begin{frame}
\begin{forest}
%aligns the bottom lines
where n children=0{tier=terminal,!u.tier=second,!uu.tier=third}{math content},
where n children=0{!u.visible on=<2->,!uu.visible on=<3->,!uuu.visible on=<4->}{},
for tree={l sep+=1em,}
[ {\{m_7,m_{11}\}}
[{\{m_8,m_9\}}
[{\{m_1,m_2,m_4\}}
[{\{m_1,m_3\}}
[1][2],
]
[{\{\dots\}}
[3][4\\\plus]
]
]
[{\{m_7\}}
[ {\{m_7\}}
[{5\onslide<5->{\\\minus}},for ancestors={edge={highlight on=<5->}},edge={highlight on=<5->}][6]
]
[ {\{\dots\}}
[7\\\plus][8\\\plus]
]
]
]
[{\{\dots\}},visible on=<2->
[{\{\dots\}}[9\\\minus][10]]
[{\{\dots\}}[11][12\\\minus]]
]
]
\end{forest}
\end{frame}
\end{document}
for the second part of the question, I exchanged the block containing the two forestset statements
\forestset{
highlight on/.style={/tikz/highlight on={#1},}
}
\forestset{
visible on/.style={
% for tree={
/tikz/visible on={#1},
for children={
edge={/tikz/visible on={#1}}}
}
}
by a single forestset statement
\forestset{
highlight on/.style={/tikz/highlight on={#1},}
visible on/.style={
% for tree={
/tikz/visible on={#1},
for children={
edge={/tikz/visible on={#1}}}
}
}
and then it did not hide any of the edges. Any suggestions about what I am missing here?

highlight online in the combo settings.highlight on/.style={/tikz/highlight on={#1},}->highlight on/.style={/tikz/highlight on={#1},},. – cfr Sep 21 '17 at 22:15