diff --git a/dvc/repo/index.py b/dvc/repo/index.py index 809bc969d..83e36da9b 100644 --- a/dvc/repo/index.py +++ b/dvc/repo/index.py @@ -89,6 +89,21 @@ class Index: self._collect() return self._plots + @cached_property + def _plot_sources(self): + from dvc.repo.plots import _collect_pipeline_files + + sources = [] + for data in _collect_pipeline_files(self.repo, [], {}).values(): + for plot_id, props in data.get("data", {}).items(): + if isinstance(props.get("y"), dict): + sources.extend(props["y"]) + if isinstance(props.get("x"), dict): + sources.extend(props["x"]) + else: + sources.append(plot_id) + return sources + @cached_property def _top_params(self): self._collect()