Add support for displaying image/png data. #406
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change maps image/png display data from execution results as tags with in-line data.
Side note - Hi! I'm Tyler, I work on Colab at Google. Huge fans of this project - we're using it to show folks how to deploy Colab notebooks on Cloud Run with the kernel gateway (https://x.com/GoogleColab/status/1864765949913739725).
I added this bit of functionality so users could display simple (and only png) objects in notebooks, for example this pair of cells:
And
Produces correct output for /plot
as an in-line
<img>
tag.It also has the capability of mixing between images/html/text.
Happy to re-arrange/format/etc. any of this code, thanks for reading!