@@ -965,7 +965,12 @@ Message type: ``display_data``::
965
965
'data' : dict,
966
966
967
967
# Any metadata that describes the data
968
- 'metadata' : dict
968
+ 'metadata' : dict,
969
+
970
+ # Optional transient data introduced in 5.1. Information not to be
971
+ # persisted to a notebook or other documents. Intended to live only
972
+ # during a live kernel session.
973
+ 'transient': dict,
969
974
}
970
975
971
976
@@ -994,12 +999,58 @@ and expanded for JSON data::
994
999
}
995
1000
}
996
1001
1002
+
1003
+ The ``transient `` dict contains runtime metadata that should not be persisted to
1004
+ document formats and is fully optional. The only transient key currently defined in Jupyter is
1005
+ ``display_id ``::
1006
+
1007
+ transient = {
1008
+ 'display_id': 'abcd'
1009
+ }
1010
+
997
1011
.. versionchanged :: 5.0
998
1012
999
1013
`application/json ` data should be unpacked JSON data,
1000
1014
not double-serialized as a JSON string.
1001
1015
1016
+ .. versionchanged :: 5.1
1017
+
1018
+ `transient ` is a new field.
1019
+
1020
+ Update Display Data
1021
+ -------------------
1022
+
1023
+ .. versionadded :: 5.1
1024
+
1025
+ Displays can now be named with a ``display_id `` within the ``transient `` field of
1026
+ ``display_data `` or ``execute_result ``.
1027
+
1028
+ When a ``display_id `` is specified for a display, it can be updated later
1029
+ with an ``update_display_data `` message. This message has the same format as `display_data `_
1030
+ messages and must contain a ``transient `` field with a ``display_id ``.
1031
+
1032
+ .. _update_display_data :
1033
+
1034
+ Message type: ``update_display_data ``::
1035
+
1036
+ content = {
1037
+
1038
+ # The data dict contains key/value pairs, where the keys are MIME
1039
+ # types and the values are the raw data of the representation in that
1040
+ # format.
1041
+ 'data' : dict,
1042
+
1043
+ # Any metadata that describes the data
1044
+ 'metadata' : dict,
1045
+
1046
+ # Any information not to be persisted to a notebook or other environment
1047
+ # Intended to live only during a kernel session
1048
+ 'transient': dict,
1049
+ }
1002
1050
1051
+ Frontends can choose how they update prior outputs (or if they regard this as a
1052
+ regular ``display_data `` message). Within the jupyter and nteract _ notebooks,
1053
+ all displays that match the ``display_id `` are updated (even if there are multiple).
1003
1054
1004
1055
Code inputs
1005
1056
-----------
@@ -1297,3 +1348,4 @@ Missing things include:
1297
1348
* Important: finish thinking through the payload concept and API.
1298
1349
1299
1350
.. _ZeroMQ : http://zeromq.org
1351
+ .. _nteract : https://nteract.io
0 commit comments