Skip to content

Commit

Permalink
plots: show-vega: adjust renderers before show vega
Browse files Browse the repository at this point in the history
Fixes: iterative/cml#1112
  • Loading branch information
pared authored and daavoo committed Aug 18, 2022
1 parent a79ea15 commit 25166f3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions dvc/commands/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,19 @@ 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)
return 0

_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:
Expand Down

0 comments on commit 25166f3

Please sign in to comment.