diff --git a/dvc/commands/plots.py b/dvc/commands/plots.py index d957d3be43..1f0f88209e 100644 --- a/dvc/commands/plots.py +++ b/dvc/commands/plots.py @@ -155,11 +155,6 @@ def run(self): out=renderers_out, templates_dir=self.repo.plots.templates_dir, ) - if self.args.show_vega: - renderer = first(filter(lambda r: r.TYPE == "vega", renderers)) - if renderer: - ui.write_json(json.loads(renderer.get_filled_template())) - return 0 if self.args.json: renderers = _filter_unhandled_renderers(renderers) _show_json(renderers, self.args.split) @@ -167,6 +162,12 @@ def run(self): _adjust_vega_renderers(renderers) + if self.args.show_vega: + renderer = first(filter(lambda r: r.TYPE == "vega", renderers)) + if renderer: + ui.write_json(json.loads(renderer.get_filled_template())) + return 0 + output_file: Path = (Path.cwd() / out).resolve() / "index.html" if renderers: