-
Notifications
You must be signed in to change notification settings - Fork 283
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
Updatable Displays #225
Updatable Displays #225
Changes from all commits
7caed53
7e5bb9c
bd2b0ea
2fd2d59
fab26d8
f5468c7
4776d31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -965,7 +965,12 @@ Message type: ``display_data``:: | |
'data' : dict, | ||
|
||
# Any metadata that describes the data | ||
'metadata' : dict | ||
'metadata' : dict, | ||
|
||
# Optional transient data introduced in 5.1. Information not to be | ||
# persisted to a notebook or other documents. Intended to live only | ||
# during a live kernel session. | ||
'transient': dict, | ||
} | ||
|
||
|
||
|
@@ -994,12 +999,58 @@ and expanded for JSON data:: | |
} | ||
} | ||
|
||
|
||
The ``transient`` dict contains runtime metadata that should not be persisted to | ||
document formats and is fully optional. The only transient key currently defined in Jupyter is | ||
``display_id``:: | ||
|
||
transient = { | ||
'display_id': 'abcd' | ||
} | ||
|
||
.. versionchanged:: 5.0 | ||
|
||
`application/json` data should be unpacked JSON data, | ||
not double-serialized as a JSON string. | ||
|
||
.. versionchanged:: 5.1 | ||
|
||
`transient` is a new field. | ||
|
||
Update Display Data | ||
------------------- | ||
|
||
.. versionadded:: 5.1 | ||
|
||
Displays can now be named with a ``display_id`` within the ``transient`` field of | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add |
||
``display_data`` or ``execute_result``. | ||
|
||
When a ``display_id`` is specified for a display, it can be updated later | ||
with an ``update_display_data`` message. This message has the same format as `display_data`_ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Double check the '`' and triple backticks in this line and the next. Looks like some typos. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, that's my complete markdown bias showing. I've completely forgotten how to write restructured text. |
||
messages and must contain a ``transient`` field with a ``display_id``. | ||
|
||
.. _update_display_data: | ||
|
||
Message type: ``update_display_data``:: | ||
|
||
content = { | ||
|
||
# The data dict contains key/value pairs, where the keys are MIME | ||
# types and the values are the raw data of the representation in that | ||
# format. | ||
'data' : dict, | ||
|
||
# Any metadata that describes the data | ||
'metadata' : dict, | ||
|
||
# Any information not to be persisted to a notebook or other environment | ||
# Intended to live only during a kernel session | ||
'transient': dict, | ||
} | ||
|
||
Frontends can choose how they update prior outputs (or if they regard this as a | ||
regular ``display_data`` message). Within the jupyter and nteract_ notebooks, | ||
all displays that match the ``display_id`` are updated (even if there are multiple). | ||
|
||
Code inputs | ||
----------- | ||
|
@@ -1297,3 +1348,4 @@ Missing things include: | |
* Important: finish thinking through the payload concept and API. | ||
|
||
.. _ZeroMQ: http://zeromq.org | ||
.. _nteract: https://nteract.io |
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.
add
.. versionchanged:: 5.1
note for whentransient
will arrive