Skip to content

Commit bcf8553

Browse files
Add "transient" dict to "display_data" messages
(Necessary for any future `"update_display_data"` message implementation)
1 parent e3791f9 commit bcf8553

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/display.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ register_jsonmime(x::AbstractVector{<:MIME}) = push!(ijulia_jsonmime_types, Vect
4848
# return a String=>Any dictionary to attach as metadata
4949
# in Jupyter display_data and pyout messages
5050
metadata(x) = Dict()
51+
transient(x) = Dict()
5152

5253
"""
5354
Generate the preferred MIME representation of x.

src/inline.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ for mime in ipy_mime
6262
msg_pub(execute_msg, "display_data",
6363
Dict(
6464
"metadata" => metadata(x), # optional
65+
"transient" => transient(x), # optional
6566
"data" => Dict($mime => limitstringmime(MIME($mime), x)))))
6667
end
6768
displayable(d::InlineDisplay, ::MIME{Symbol($mime)}) = true
@@ -87,6 +88,7 @@ function display(d::InlineDisplay, M::MIME, x)
8788
send_ipython(publish[],
8889
msg_pub(execute_msg, "display_data",
8990
Dict("metadata" => metadata(x), # optional
91+
"transient" => transient(x), # optional
9092
"data" => d)))
9193
end
9294

@@ -98,6 +100,7 @@ function display(d::InlineDisplay, x)
98100
send_ipython(publish[],
99101
msg_pub(execute_msg, "display_data",
100102
Dict("metadata" => metadata(x), # optional
103+
"transient" => transient(x), # optional
101104
"data" => display_dict(x))))
102105
end
103106

0 commit comments

Comments
 (0)