-
-
Notifications
You must be signed in to change notification settings - Fork 416
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
Function to publish raw/encoded display data #946
base: master
Are you sure you want to change the base?
Conversation
Closes #934, can use |
@stevengj does this seem useful? |
I'd rather have this as a method of |
@stevengj what exactly would the method be? I feel like this is a somewhat different concept than Another way of looking at it - |
@stevengj any thoughts on the above? |
src/display.jl
Outdated
display_data(mime::Union{MIME, String}, data; metadata::Dict=Dict()) | ||
display_data(mimebundle::Dict; metadata::Dict=Dict()) | ||
|
||
Publish raw data to be displayed on all Jupyter front ends. |
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.
raw data is never a good term to use,
but here it seems particularly misleading.
that data
argument is the output of limitstringmime
which means it has already going though a call to rerepresent it.
Which will have for example converted DataFrames to HTML tables, etc etc or anything else that has show(io, mimetype, data)
defined on it for any of the registered mime types.
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.
How about something like "Publish rich display data to all Jupyter front ends"? I think the rest of the docstring is hopefully pretty clear on the expected format.
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.
bump?
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.
Could be.
I don't know enough about what this does to say for sure.
And I don't have merge rights here.
|
@stevengj Any way you can take another look at this? |
bump? |
Latest merge conflicts have been resolved, both |
Added a
display_data
function which takes raw/encoded data to display in the front end. The first form accepts a single MIME type and a data string or JSON-able value, the second takes a MIME bundle.display(::InlineDisplay, ...)
methods are updated to use this function instead of explicitly constructing the message and callingsend_ipython
.I added a detailed docstring and listed it under the public API in the documentation.
This works when I tested it manually, I don't know how to write a unit test for it though.