-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
backlogissue has been triaged but has not been earmarked for any upcoming releaseissue has been triaged but has not been earmarked for any upcoming releasetype: bugSomething isn't workingSomething isn't working
Description
Checklist
- I added a descriptive title
- I searched for other issues and couldn't find a solution or duplication
- I already searched in Google and didn't find any good information or help
What happened?
Here you can see our current methods:
MIME_METHODS = {
"__repr__": "text/plain",
"_repr_html_": "text/html",
"_repr_markdown_": "text/markdown",
"_repr_svg_": "image/svg+xml",
"_repr_png_": "image/png",
"_repr_pdf_": "application/pdf",
"_repr_jpeg_": "image/jpeg",
"_repr_latex": "text/latex",
"_repr_json_": "application/json",
"_repr_javascript_": "application/javascript",
"savefig": "image/png",
}
And their implementation:
MIME_RENDERERS = {
"text/plain": identity,
"text/html": identity,
"image/png": lambda value, meta: render_image("image/png", value, meta),
"image/jpeg": lambda value, meta: render_image("image/jpeg", value, meta),
"image/svg+xml": identity,
"application/json": identity,
"application/javascript": lambda value, meta: f"<script>{value}</script>",
}
As you can see not all of them map to an implementation which makes them not possible to use (? maybe I'm missing something here)
We either have to fix it or... Completely change the way we implement these.
Antonio's input was that we should have an API that allows users to expand on these and I agree. For example, it seems like numpy has a specific way of displaying arrays that we don't cover. This advice came from one of Jupyter Lab's main contributor "wishing they had made it different".
Antonio can probably unpack this better as he's the one leading the refactoring.
What browsers are you seeing the problem on? (if applicable)
No response
Console info
No response
Additional Context
No response
Metadata
Metadata
Assignees
Labels
backlogissue has been triaged but has not been earmarked for any upcoming releaseissue has been triaged but has not been earmarked for any upcoming releasetype: bugSomething isn't workingSomething isn't working
Type
Projects
Status
Next