Colorir todos os nós que seguem para um nó terminal específico

Colorir todos os nós que seguem para um nó terminal específico

Tenho tentado colorir alguns nós com pontos preenchidos. Mas estou preso, seguindo a diretriz do pacote florestal, só consegui preencher a primeira e as duas linhas.

O que estou tentando fazer:

O que eu quero fazer

Só consegui fazer o primeiro e o segundo. Aqui está meu código mínimo:

\documentclass[border=3mm]{standalone}
\usepackage[linguistics,edges]{forest} 
\forestset{
ned/.style={%
    for tree={calign=fixed edge angles},
    delay={%
      where content={}{%
        shape=coordinate,
        for nodewalk={%
          Nodewalk={%
            on invalid=fake,
          }{%
            parent,
          }{%
            for children={anchor=north},
          }
        }{},
      }{},
    },
},
}

\begin{document}

\begin{forest}
ned
[DP
  [
    [
      [pro]
      [
        [VP
          [NP\\ t\textsubscript{1}]
          [V\\Tuttukları]
        ]
        [T]
      ]
    ]
    [C]
  ]
  [
    [NP\\aşçı]
    [D]
  ]
]
\path[fill=red] (.parent anchor) circle[radius=2pt];
\path[fill=red] (!1.child anchor) circle[radius=2pt];
\end{forest}

\end{document}

Responder1

Para facilitar o entendimento escolhi uma cor por nó (você pode alterá-las para vermelho de acordo com sua necessidade).

De cima para baixo:

\path[fill=red] (.parent anchor) circle[radius=2pt];
\path[fill=black] (!1.child anchor) circle[radius=2pt];
\path[fill=green] (!11.child anchor) circle[radius=2pt];
\path[fill=blue] (!112.child anchor) circle[radius=2pt];
\path[fill=yellow] (!1121.south) circle[radius=2pt];
\path[fill=orange] (!11212.child anchor) circle[radius=2pt];

insira a descrição da imagem aqui

MWE:

\documentclass[border=3mm]{standalone}
\usepackage[linguistics,edges]{forest} 
\forestset{
ned/.style={%
    for tree={calign=fixed edge angles},
    delay={%
      where content={}{%
        shape=coordinate,
        for nodewalk={%
          Nodewalk={%
            on invalid=fake,
          }{%
            parent,
          }{%
            for children={anchor=north},
          }
        }{},
      }{},
    },
},
}

\begin{document}

\begin{forest}
ned
[DP
  [
    [
      [pro]
      [
        [VP
          [NP\\ t\textsubscript{1}]
          [V\\Tuttukları]
        ]
        [T]
      ]
    ]
    [C]
  ]
  [
    [NP\\aşçı]
    [D]
  ]
]
\path[fill=red] (.parent anchor) circle[radius=2pt];
\path[fill=black] (!1.child anchor) circle[radius=2pt];
\path[fill=green] (!11.child anchor) circle[radius=2pt];
\path[fill=blue] (!112.child anchor) circle[radius=2pt];
\path[fill=yellow] (!1121.south) circle[radius=2pt];
\path[fill=orange] (!11212.child anchor) circle[radius=2pt];
\end{forest}

\end{document}

Acho que é autoexplicativo, caso contrário, me avise.

informação relacionada