-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dvc render: Add RENDERERS registry. #6931
Conversation
I wouldn't do that until there is demand for that. As far as the discussions go with @rogermparent, more desirable would be to get URL to the images.
Lets remember that from HTML point of view, Image and Vega behave very similar - they just provide the
Good point, there is no need for that, I moved it as is to |
I don't really have the context from that discussions. I was just thinking that Regardless, the bigger point was that all renderers should implement a method (
For vega, we have a Lines 102 to 109 in 4175f9f
And users can customize the vega spec ( For images, we also have a Lines 13 to 18 in 4175f9f
But in this case users can't customize the Lines 35 to 41 in 4175f9f
My perspective here would be that users could use templates to customize this children However, I'm not sure if this makes sense or it is just trying too hard to mimic abstractions between renderers for plots and images. |
The renaming will probably take place, though I would leave
Makes sense, the current state of image rendering is very ugly. |
assert len(files) == 1 | ||
self.filename = files.pop() | ||
|
||
def _convert(self, path: "StrPath"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every time I see this name I am cringing, if you have some comments on this name feel free to share :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe in #6943 names (and logic) could be revisited
@Mergifyio rebase |
✅ Branch has been successfully rebased |
5dfc8c1
to
ee74299
Compare
@daavoo can you include the information that is related to iterative/dvc-render#7, #4455, and #6943 in the commit comment? Let's merge it, I am working on #6943 and it will be helpful there. |
ee74299
to
f0706ff
Compare
f0706ff
to
390973a
Compare
Pre-requisite for iterative/dvc-render#7 -> #4455
These changes should not break any existing behavior.
Refactored existing
render
/plots.template
logic in order to make it more "plugin" friendly so it's easier to add new renderers (i.e. plotly / parallel coordinates plot).Open questions:
Should
ImageRenderer
implementas_json
(meaning a machine-shareable representation of the "plot"). Maybe we should use base64 for that (potentially even internally assrc
).Should
ImageRenderer
be, somehow, template-based?. It looks that it could be generalized to follow a similar logic asVegaRenderer
where DVC provides "anchor" data (thesrc
in<img>
) and the template can customize how to insert that data in the HTML.Is there a reason to have
templates
indvc.repo.plots
? It looks like there is the only remaining connection to other dvc subsystems that preventsrender
to be extracted as a separate library.