Skip to content

Commit

Permalink
Move plot_ prefix to vega.
Browse files Browse the repository at this point in the history
  • Loading branch information
daavoo committed Jun 15, 2022
1 parent d00b696 commit 2cdb53c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/dvc_render/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def generate_html(self, html_path=None) -> str:
if partial:

div_id = self.remove_special_chars(self.name)
div_id = f"plot_{div_id}"

return self.DIV.format(id=div_id, partial=partial)
return ""
Expand Down
2 changes: 2 additions & 0 deletions src/dvc_render/vega.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class VegaRenderer(Renderer):
EXTENSIONS = {".yml", ".yaml", ".json", ".csv", ".tsv"}

def __init__(self, datapoints: List, name: str, **properties):
if name and not name.startswith("plot_"):
name = f"plot_{name}"
super().__init__(datapoints, name, **properties)
self.template = get_template(
self.properties.get("template", None),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_parallel_coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_write_parallel_coordinates(tmp_dir):
assert ParallelCoordinatesRenderer.SCRIPTS in html_text

div = ParallelCoordinatesRenderer.DIV.format(
id="plot_pcp", partial=renderer.partial_html()
id="pcp", partial=renderer.partial_html()
)
assert div in html_text

Expand Down

0 comments on commit 2cdb53c

Please sign in to comment.